:root {
  --navy: #0b2a7a;
  --navy-deep: #071c55;
  --accent: #f29f05;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #121a2e;
  --muted: #5d6680;
  --border: #dfe4ef;
  --ok: #138a4a;
  --ok-bg: #e3f6eb;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --info-bg: #e8eefc;
  --radius-sm: 8px;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 64 / 6%), 0 6px 18px rgb(16 24 64 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Roboto Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --surface: #161d31;
    --text: #e8ecf6;
    --muted: #99a3bd;
    --border: #283252;
    --ok-bg: #133325;
    --warn-bg: #3a2b0e;
    --bad-bg: #3d1716;
    --info-bg: #1b2645;
    --ok: #5fd394;
    --warn: #f5c062;
    --bad: #ff8a80;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; /* page never scrolls sideways while a tab slides */ }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }

.topbar {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}
.topbar h1 { font-size: 1.2rem; letter-spacing: .2px; }
.topbar .sub { color: #c5d0f0; font-size: .85rem; }

.tabs {
  display: flex;
  background: var(--navy);
  padding: 0 8px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.tab {
  flex: 1;
  background: none;
  border: 0;
  color: #c5d0f0;
  font: 600 .95rem var(--font);
  padding: 12px 8px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.tab.active { color: #fff; border-bottom-color: var(--accent); }

.container { max-width: 760px; margin: 0 auto; padding: 12px 16px 32px; }

.sticky-filters {
  position: sticky;
  top: 46px;
  z-index: 4;
  background: var(--bg);
  padding: 4px 0 8px;
}
.search {
  width: 100%;
  font: 1rem var(--font);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.chips { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font: 600 .85rem var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.group { margin-top: 16px; }
.group-title {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin: 0 4px 8px;
}

.service-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.service-card:hover, .service-card:focus-visible { box-shadow: var(--shadow); transform: translateY(-1px); }
.service-card:active { transform: scale(.99); }
.service-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.service-name { font-size: .95rem; }

.price { font-weight: 800; color: var(--navy); white-space: nowrap; }
.price.big { font-size: 1.35rem; }
@media (prefers-color-scheme: dark) { .price { color: #9db6ff; } }

.type-chip {
  align-self: flex-start;
  font: 700 .65rem var(--font);
  letter-spacing: .6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--info-bg);
  color: var(--navy);
}
.type-SERVER { background: var(--warn-bg); color: var(--warn); }
.type-REMOTE { background: var(--ok-bg); color: var(--ok); }
@media (prefers-color-scheme: dark) { .type-IMEI { color: #9db6ff; } }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.service-head { display: flex; flex-direction: column; gap: 8px; }
.service-head h2 { font-size: 1.15rem; }
.service-meta { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.info {
  background: var(--info-bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  white-space: pre-line;
  font-size: .9rem;
  margin: 8px 0 0;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.field small { font-weight: 400; }
.field input, .field select, .field textarea {
  font: 1rem var(--font);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
}
.field input:focus, .field select:focus, .search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  font: 700 1rem var(--font);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); color: #1d1300; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-small { padding: 6px 10px; font-size: .85rem; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.wide { width: 100%; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.back { display: inline-block; margin: 4px 0 12px; color: var(--muted); text-decoration: none; font-weight: 600; }

.pay h3 { margin-bottom: 8px; }
.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.pay .form { margin-top: 14px; }
.copy {
  font: 700 1.05rem var(--mono);
  background: var(--info-bg);
  color: var(--text);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
}

.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.result { margin-top: 12px; }
.result pre {
  font: 1rem var(--mono);
  background: var(--ok-bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.result.rejected pre { background: var(--bad-bg); }

.badge {
  font: 700 .72rem var(--font);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--info-bg);
  color: var(--navy);
}
.badge-awaiting_payment, .badge-payment_submitted, .badge-supplier_error { background: var(--warn-bg); color: var(--warn); }
.badge-completed { background: var(--ok-bg); color: var(--ok); }
.badge-rejected, .badge-cancelled { background: var(--bad-bg); color: var(--bad); }
@media (prefers-color-scheme: dark) { .badge-processing, .badge-placing, .badge-refunded { color: #9db6ff; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: calc(100% - 32px);
  animation: toast-in .2s ease;
}
.toast-error { background: var(--bad); color: #fff; }
.toast-ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.footer { text-align: center; padding: 16px; font-size: .8rem; }
.footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.btn-m10 {
  display: block;
  text-align: center;
  text-decoration: none;
  background: #00e5b5;
  color: #062b24;
  margin-top: 12px;
}
.btn-m10:hover { filter: brightness(1.05); }
.qr { margin-top: 10px; font-size: .88rem; }
.qr summary { cursor: pointer; color: var(--muted); }
.qr img { display: block; margin: 10px auto 0; max-width: 100%; height: auto; border-radius: var(--radius-sm); background: #fff; }

.topbar { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { flex: none; border-radius: 9px; box-shadow: 0 2px 8px rgb(0 0 0 / 25%); }

.order-tools { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.contact-bar { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.contact { text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: 999px; color: #fff; }
.contact.wa { background: #1fa855; }
.contact.tg { background: #2a9fd8; }
.update-banner {
  display: block; text-align: center; text-decoration: none; font-weight: 700;
  background: var(--accent); color: #1d1300; padding: 12px 16px; margin: 0 16px 12px; border-radius: var(--radius-sm);
}

.download { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.download-icon { border-radius: 22px; box-shadow: var(--shadow); }
.warning { border-left: 4px solid var(--accent); }
.warning code { word-break: break-all; font-size: .75rem; }

.promo-row { display: flex; gap: 8px; }
.promo-row input { flex: 1; min-width: 0; font: 1rem var(--font); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.promo-row input[name=promoInput] { text-transform: uppercase; }
.discount-note { color: var(--ok); font-weight: 700; }

.wallet-balance { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0; }
.wallet-balance strong { font-size: 1.8rem; color: var(--navy); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .wallet-balance strong { color: #9db6ff; } }
.wallet h3 { margin-top: 10px; }

.link-button { align-self: flex-start; background: none; border: 0; padding: 2px 0; color: var(--muted); text-decoration: underline; font: 600 .82rem var(--font); cursor: pointer; }
.field textarea { font: 1rem var(--mono); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); resize: vertical; }

.stars { display: flex; gap: 6px; }
.star { background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--border); cursor: pointer; padding: 0; }
.star.on { color: var(--accent); }
.rating-summary { margin: 4px 0 0; font-weight: 700; color: var(--accent); }
.review-line { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }

.btn-tg { display: block; text-align: center; text-decoration: none; background: #2a9fd8; color: #fff; margin-bottom: 12px; }

/* terms / privacy, footer links and language switch */
.legal h3 { font-size: 1rem; margin: 16px 0 4px; }
.legal p { line-height: 1.55; }
.legal-note { text-align: center; margin: 8px 0 0; }
.legal-note a, .footer-links a { color: var(--muted); text-decoration: underline; }
.footer-links { margin-top: 10px; color: var(--muted); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; }
.lang-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 3px 8px; font: 600 .75rem var(--font); cursor: pointer; }
.lang-btn.active { color: var(--text); border-color: var(--accent); }

/* invite a friend */
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.invite-code { font: 700 1.4rem/1 ui-monospace, monospace; letter-spacing: 3px; padding: 8px 12px; border: 1px dashed var(--accent); border-radius: var(--radius-sm); }

.legal h2 { margin: 6px 0 2px; }
.legal ul { margin: 4px 0 8px 18px; padding: 0; }
.legal li { line-height: 1.5; margin: 2px 0; }

/* rent box, chat, availability */
.rent-box.warn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rent-box.over { opacity: .85; }
.extend-form { margin-top: 10px; }
.avail { display: inline-block; margin-top: 4px; }
.avail.free { color: var(--ok); }
.avail.busy { color: var(--accent); }
.receipt-field input[type=file] { font-size: .9rem; max-width: 100%; }
.receipt-img { display: block; max-width: 100%; max-height: 70vh; margin-top: 8px; border-radius: 8px; }
.booking-modes { display: flex; gap: 16px; flex-wrap: wrap; }
.booking-input { font-size: 1rem; }
.auto-renew { margin: 8px 0; }
.loyalty { margin: 6px 0; }
.night-badge { display: inline-block; margin: 4px 0 0 6px; color: #b9a6ff; }
.chat summary { cursor: pointer; }
.chat-thread { display: grid; gap: 8px; margin: 10px 0; max-height: 320px; overflow-y: auto; }
.chat-line { display: grid; gap: 2px; max-width: 85%; }
.chat-line.mine { justify-self: end; text-align: right; }
.chat-bubble { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; }
.chat-line.mine .chat-bubble { border-color: var(--accent); }
.chat-form { display: grid; gap: 6px; }
.chat-form textarea { width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font: inherit; }

/* globe language button (top right) */
.lang-slot { margin-left: auto; }
.lang-menu { position: relative; }
.lang-toggle {
  display: flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  background: rgb(255 255 255 / 12%); border: 1px solid rgb(255 255 255 / 25%); color: #fff; font: 700 .78rem var(--font);
}
.lang-toggle:hover, .lang-toggle[aria-expanded="true"] { background: rgb(255 255 255 / 22%); }
.globe-icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.lang-menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.lang-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); font: 500 .9rem var(--font); cursor: pointer;
}
.lang-option:hover, .lang-option:focus-visible { background: var(--info-bg); outline: none; }
.lang-option.active { font-weight: 700; }
.lang-code { min-width: 26px; font: 700 .72rem var(--font); color: var(--muted); }

/* "download the app" card on the main page (browser only) */
.app-download { display: flex; align-items: center; gap: 12px; padding: 12px; }
.app-download-icon { flex: none; border-radius: 12px; }
.app-download-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.app-download-text a { color: var(--muted); }
.app-download .btn { flex: none; text-decoration: none; }

/* public price list (/qiymetler): fits a phone screen */
.price-page .back { display: inline-block; margin-bottom: 10px; }
.price-page .card { padding: 12px 14px; }
.price-page h2 { font-size: 1rem; margin-bottom: 6px; }
.price-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .88rem; }
.price-table td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table td.price { width: 6.5em; text-align: right; padding-left: 8px; font-variant-numeric: tabular-nums; }
.price-table td.price a { text-decoration: none; }
.price-table .type-chip { margin-right: 4px; }
