:root {
  --bg: oklch(0.985 0.003 95);
  --surface: #fff;
  --elev: oklch(0.975 0.003 95);
  --sunken: oklch(0.96 0.004 95);
  --text: oklch(0.18 0.008 270);
  --text-2: oklch(0.42 0.008 270);
  --muted: oklch(0.58 0.006 270);
  --faint: oklch(0.78 0.005 270);
  --line: oklch(0.92 0.004 270);
  --line-2: oklch(0.96 0.003 270);
  --accent: oklch(0.78 0.14 165);
  --accent-ink: oklch(0.42 0.10 165);
  --accent-soft: oklch(0.95 0.04 165);
  --danger: oklch(0.62 0.18 25);
  --shadow-md: 0 4px 14px oklch(0.2 0.01 270 / 0.06), 0 1px 2px oklch(0.2 0.01 270 / 0.04);
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

button, input { font: inherit; }
button { cursor: pointer; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "zero"; }
.tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  width: 232px;
  height: 100vh;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 14px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0 6px 20px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 120px;
  height: auto;
  display: block;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; font-weight: 600; }
.brand small { color: var(--muted); font-size: 11px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: var(--text-2);
  padding: 0 10px;
  text-decoration: none;
  font-size: 13.5px;
}

.nav-item:hover, .nav-item.active { background: var(--elev); color: var(--text); }
.nav-item.active { font-weight: 500; }

.nav-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
}

.side-balance {
  margin-top: auto;
  border: 1px solid var(--text);
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  padding: 12px;
}

.side-balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-balance-add {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.side-balance-add:hover { background: rgb(255 255 255 / 14%); }

.side-balance-amount {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 500;
}

.side-balance-hint {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  color: color-mix(in oklch, var(--bg), transparent 16%);
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
}

.avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.7 0.13 165), oklch(0.55 0.15 220));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.avatar-lg { width: 64px; height: 64px; font-size: 20px; }

.profile-menu { position: relative; margin-top: 6px; }

.profile-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 8px;
  text-align: left;
}

.profile-trigger:hover { background: var(--elev); }

.profile-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.25;
}

.profile-info strong { font-size: 13px; font-weight: 500; }
.profile-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.profile-caret {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.profile-menu.open .profile-caret { transform: rotate(180deg); }

.profile-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: 5px;
}

.profile-pop button {
  display: flex;
  height: 32px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  padding: 0 9px;
  text-align: left;
  font-size: 13px;
}

.profile-pop button:hover { background: var(--elev); color: var(--text); }

.side-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  border-radius: 10px;
  color: var(--text-2);
  padding: 8px 10px;
  font-size: 12.5px;
}

.workspace { min-width: 0; flex: 1; }

.top-actions { display: flex; gap: 8px; }
.breadcrumb { color: var(--muted); font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; }
h1, h2, p { margin: 0; }
h1 { margin-top: 2px; font-size: 20px; font-weight: 600; letter-spacing: 0; }

.view-header { min-width: 0; margin-bottom: 20px; }
.view-header p { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.panel-head .view-header { margin-bottom: 0; }

.hero-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  padding: 28px;
}

.flow-main { min-width: 0; }

.stepper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.step span {
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.step.active { border-color: var(--text); background: var(--text); color: var(--bg); }
.step.active span { color: color-mix(in oklch, var(--bg), transparent 20%); }
.step:disabled { cursor: not-allowed; }

.panel, .summary-card, .activity-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.panel {
  min-height: 520px;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h2 { margin-top: 4px; font-size: 24px; font-weight: 600; letter-spacing: 0; }

.chip {
  display: inline-flex;
  height: 24px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--elev);
  color: var(--text-2);
  padding: 0 8px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}

.chip.accent { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 1.8s ease-out infinite;
  background: var(--accent);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.78 0.14 165 / 0.6); }
  70% { box-shadow: 0 0 0 10px oklch(0.78 0.14 165 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.78 0.14 165 / 0); }
}

.search { position: relative; display: block; max-width: 360px; margin-bottom: 18px; }
.search span { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px 0 34px;
  font-size: 13px;
}
.search input:focus { border-color: var(--text); }

.duration-picker {
  margin: 0 0 18px;
}

.duration-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.duration-option {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  padding: 0 11px;
  font-size: 12.5px;
}

.duration-option:hover, .duration-option.active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.service-empty { grid-column: 1 / -1; }
.service-card, .country-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-align: left;
}
.service-card {
  display: flex;
  min-height: 108px;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
}
.service-card:hover, .country-card:hover, .service-card.selected, .country-card.selected {
  border-color: var(--text);
  background: var(--elev);
}
.service-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
}
.service-card strong, .country-card strong { font-size: 13.5px; font-weight: 600; }
.service-card small, .country-card small { color: var(--muted); font-size: 12px; }

.country-list { display: grid; gap: 10px; }
.country-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; }
.flag {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--elev);
  font-size: 15px;
}

.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.btn, .icon-btn, .mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn { height: 40px; gap: 8px; padding: 0 16px; font-size: 14px; font-weight: 500; }
.btn:hover, .mini-btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--elev); }
.btn-danger { border-color: var(--line); background: transparent; color: var(--danger); }
.mini-btn {
  height: 26px;
  border-color: var(--line);
  background: transparent;
  color: var(--text-2);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 500;
}

.otp-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.otp-phone {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  background: var(--surface);
  padding: 22px;
}

.otp-phone > div {
  flex: 1;
  min-width: 0;
}

.otp-phone strong {
  display: block;
  min-width: 0;
  margin-top: 8px;
  font-size: 34px; /* base size; fitAssignedNumber() in app.js shrinks to fit one line */
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-2);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12.5px;
}

.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

.otp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-2);
  background: var(--elev);
  color: var(--muted);
  padding: 10px 22px;
  font-size: 12.5px;
}

/* Rental countdown ("19:43") in the otp-card meta row; shown only while waiting for SMS. */
.otp-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sms-box {
  position: relative;
  display: flex;
  min-height: 144px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  margin-top: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: repeating-linear-gradient(135deg, var(--elev) 0 8px, var(--bg) 8px 16px);
  color: var(--muted);
  padding: 20px 22px;
  text-align: left;
  font-size: 13px;
}

.sms-box.delivered { border-style: solid; background: var(--accent-soft); color: var(--accent-ink); }
.otp-code-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.otp-code {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  color: var(--text);
  font-size: clamp(30px, 6vw, 48px);
  font-weight: 600;
  letter-spacing: 0;
}
.sms-box #smsStatus { position: relative; z-index: 1; margin-top: 4px; }
.sms-box .otp-card-status { position: relative; z-index: 1; margin-top: 4px; }

.copy-code-btn { gap: 6px; }
.copy-code-btn svg { flex: none; }

@media (max-width: 760px) {
  .copy-code-btn .copy-code-label { display: none; }
  .copy-code-btn { width: 26px; padding: 0; }
}

.scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 180px;
  animation: scanline 2.8s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 70%), transparent);
}
.sms-box.delivered .scan { display: none; }
@keyframes scanline {
  0%, 100% { left: -220px; }
  50% { left: 100%; }
}

/* Compact otp-card variant — miniature of the #rent otp-card above, rendered
   by renderOtpCard() in app.js for the #numbers grid. Keep in sync with the
   full-size card styles. */
/* Short, on-hover-detailed allocation date in the card header (mini grid). */
.otp-card-date {
  flex: none;
  align-self: flex-start;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  cursor: help;
}
/* Copyable order id on each Numbers card, for locating the order in the DB. */
.otp-orderid {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line-2);
  background: var(--elev);
  padding: 8px 22px;
  font-size: 11.5px;
}
.otp-orderid .copy-chip { font-size: 11.5px; }
.otp-card--compact .otp-orderid { padding: 8px 14px; }
.otp-card--compact { border-radius: 16px; }

/* Status pill left, date right */
.otp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.otp-card-top .otp-card-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  cursor: help;
}

/* Number row: compact sizing, icon-btn flush right */
.otp-card--compact .otp-phone {
  padding: 6px 14px 10px;
}
.otp-card--compact .otp-phone strong {
  font-size: 20px;
  margin-top: 0;
}
.otp-card--compact .otp-meta {
  padding: 7px 14px;
  font-size: 11.5px;
}

/* SMS box: tighter, same hatch as rent */
.otp-card--compact .sms-box {
  min-height: 72px;
  padding: 10px 14px;
  font-size: 12px;
}
.otp-card--compact .otp-code {
  margin-top: 4px;
  font-size: 22px;
}
.otp-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.otp-card--compact .sms-box .copy-chip { align-self: flex-start; margin-top: 4px; }

/* Order ID mono strip at the bottom */
.otp-card-id {
  display: block;
  width: 100%;
  padding: 7px 14px;
  border: none;
  border-top: 1px solid var(--line-2);
  background: none;
  color: var(--muted);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.otp-card-id:hover { color: var(--text); background: var(--elev); }
.otp-card-id.copied { color: var(--accent); }

.summary {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}

.summary-card, .activity-card { padding: 20px; }
dl { margin: 14px 0; }
dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; color: var(--text); text-align: right; font-size: 13px; font-weight: 500; }
.total-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.total-row strong { font-size: 28px; font-weight: 500; }

.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-list { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.activity-list li { margin-top: 8px; }
.activity-list .done { color: var(--text); }

.number-list {
  display: flex;
  max-height: 380px;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  margin-top: 14px;
}

.allocated-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--elev);
  padding: 10px;
}

.allocated-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.allocated-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
}

.allocated-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.status-pill {
  display: inline-flex;
  height: 20px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  padding: 0 7px;
  font-size: 11px;
}

.code-pill {
  color: var(--accent-ink);
  font-weight: 600;
}

.empty-row {
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
}

.numbers-section {
  padding: 28px;
}

.numbers-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

/* Responsive grid of compact otp-cards on the #numbers view (overrides the
   .numbers-table flex column; must come after it in the cascade). */
.otp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--sunken);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: capitalize;
  white-space: nowrap;
}

/* live = port up, listening for SMS — the "good/active" state */
.tag-status.tag-live {
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 40%, var(--line));
  color: var(--accent-ink);
}
/* ready = paid, waiting to go live on the gateway */
.tag-status.tag-ready {
  background: color-mix(in oklch, var(--accent) 8%, var(--surface));
  border-color: color-mix(in oklch, var(--accent) 24%, var(--line));
  color: var(--accent-ink);
}
/* reserved = claimed from pool, pre-payment */
.tag-status.tag-reserved { background: var(--sunken); color: var(--muted); }
.tag-status.tag-expired { background: var(--sunken); color: var(--muted); }

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elev);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.copy-chip:hover { background: var(--sunken); border-color: var(--faint); }
.copy-chip:active { transform: translateY(1px); }
.copy-chip svg { flex: none; color: var(--muted); }
.copy-chip:hover svg { color: var(--text-2); }
.copy-chip .copy-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copy-chip.code {
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 40%, var(--line));
  color: var(--accent-ink);
  font-weight: 600;
}
.copy-chip.code svg { color: var(--accent-ink); }

.copy-chip.phone { font-size: 15px; font-weight: 600; padding: 7px 11px; }
.copy-chip.code { font-size: 15px; padding: 7px 11px; }

.copy-chip.copied {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.copy-chip.copied svg { color: var(--accent-ink); }

#balance .wallet-card,
#balance #transactionsTable {
  max-width: 50rem;
}

.wallet-card {
  overflow: hidden;
  margin-top: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--text);
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
}

.balance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}
.balance-hero .eyebrow { color: color-mix(in oklch, var(--bg), transparent 30%); }
.balance-amount { display: block; margin-top: 4px; font-size: 52px; font-weight: 500; letter-spacing: -0.03em; color: var(--bg); }
.balance-hint {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
  color: color-mix(in oklch, var(--bg), transparent 15%);
  padding: 5px 9px;
  font-size: 11.5px;
}
.topup-panel {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0 22px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.topup-panel .eyebrow,
.topup-panel .muted { color: color-mix(in oklch, var(--bg), transparent 28%); }

.wallet-card .chip,
.topup-panel .topup-option {
  border-color: rgb(255 255 255 / 18%);
  background: rgb(255 255 255 / 9%);
  color: var(--bg);
}

.topup-panel .topup-option:hover {
  border-color: var(--bg);
  background: rgb(255 255 255 / 16%);
}

.topup-panel .topup-option.selected {
  border-color: var(--bg);
  background: var(--bg);
  color: var(--text);
}

.topup-panel .btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 2px;
  border-color: transparent;
  background: var(--accent);
  color: var(--text);
}

.topup-panel .btn-primary:disabled { opacity: 0.55; cursor: default; }

.topup-status { font-size: 12px; text-align: center; }

.paypal-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topup-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.topup-option {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.topup-option:hover, .topup-option.selected {
  border-color: var(--text);
  background: var(--elev);
}

.paypal-box {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

#paypal-button-container { min-height: 44px; }

.txn-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}
.txn-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.txn-reason { text-transform: capitalize; font-weight: 500; }
.txn-detail { font-size: 11.5px; color: var(--muted); }
.txn-date { font-size: 12px; }
.txn-amount { font-weight: 600; font-size: 14px; }
.txn-amount.tx-pos { color: var(--accent-ink); }
.txn-amount.tx-neg { color: oklch(0.58 0.14 55); }

.service-confirm {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.service-confirm #confirmService { font-weight: 600; }

.settings-stack {
  display: flex;
  max-width: 860px;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
}

.settings-card-head { margin-bottom: 14px; }
.settings-card-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.settings-card-head p {
  margin-top: 3px;
  max-width: 560px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.identity-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }

.field-box {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elev);
  padding: 6px 12px;
  font-size: 13px;
}

.field-box > span:first-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-row, .action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line-2);
  padding: 12px 0;
}

.toggle-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.toggle-info strong { font-size: 13.5px; font-weight: 500; }
.toggle-info small { color: var(--muted); font-size: 12px; }

.switch {
  position: relative;
  width: 36px;
  height: 22px;
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  padding: 0;
  transition: background 0.15s ease;
}

.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  transition: left 0.15s ease;
}

.switch.on { background: var(--accent); }
.switch.on .knob { left: 16px; }

.action-row .btn { height: 34px; padding: 0 13px; font-size: 13px; }

#supportInbox, #supportThreadView { max-width: 680px; }

.support-new {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.support-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}

.support-input:focus { outline: none; border-color: var(--text); }

.support-new .actions { margin-top: 0; }

.support-inbox {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.support-inbox .empty-row { border: 0; }

.support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.support-row:last-child { border-bottom: 0; }
.support-row:hover { background: var(--elev); }

.support-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.support-row-main strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-row-main span { color: var(--muted); font-size: 12.5px; }

.support-row-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.support-row-side small { font-size: 11.5px; }

.support-empty {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 44px 24px;
  text-align: center;
}

.support-empty h3 { margin: 0; font-size: 16px; font-weight: 600; }
.support-empty p { margin: 0; max-width: 320px; color: var(--muted); font-size: 13px; }
.support-empty .btn { margin-top: 12px; }

.support-thread-bar { margin-bottom: 14px; }

.support-back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.support-back:hover { color: var(--text); }

.support-thread-title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.support-attach { display: grid; gap: 6px; }
.support-attach select.support-input { resize: none; }

.support-thread-ref:not(:empty) { margin: -10px 0 18px; }

.support-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--elev);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.support-ref-chip:hover { border-color: var(--text); color: var(--text); }

.support-ref-chip span {
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.support-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 56vh;
  overflow-y: auto;
}

.support-msg {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.support-msg:last-child { border-bottom: 0; }

.support-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.support-msg-meta strong { font-size: 13px; font-weight: 600; }
.support-msg.staff .support-msg-meta strong { color: var(--accent-ink); }
.support-msg-meta small { color: var(--muted); font-size: 11.5px; }

.support-msg p {
  margin: 0;
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-reply {
  display: grid;
  gap: 10px;
  justify-items: end;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.support-reply .support-input { justify-self: stretch; }

.mobile-tabs { display: none; }

@media (max-width: 1100px) {
  .hero-flow { grid-template-columns: 1fr; }
  .summary { position: static; }
  .service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .view-header p, .breadcrumb { display: none; }
  .view-header { margin-bottom: 16px; }
  .top-actions { gap: 6px; }
  .top-actions .btn { height: 36px; padding: 0 10px; font-size: 13px; }
  .hero-flow { gap: 18px; padding: 16px 16px 88px; }
  .numbers-section { padding: 16px 16px 88px; }
  .panel { min-height: auto; padding: 18px; }
  .panel-head { flex-direction: column; margin-bottom: 18px; }
  .stepper { gap: 6px; }
  .step { justify-content: center; padding: 9px 6px; font-size: 12px; }
  .step span { display: none; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .country-card { grid-template-columns: auto 1fr; }
  .country-card .mono { grid-column: 2; }
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .topup-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .balance-hero { align-items: flex-start; flex-direction: column; }
  .support-reply .btn { width: 100%; }
  .settings-card { padding: 16px; }
  .identity-row { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .mobile-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: flex;
    justify-content: space-around;
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 9px 12px max(10px, env(safe-area-inset-bottom));
  }
  .mobile-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
  }
  .mobile-tabs .nav-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--elev);
    font-size: 13px;
    line-height: 1;
  }
  .mobile-tabs a.active { color: var(--text); }
  .mobile-tabs a.active .nav-icon { background: var(--accent-soft); color: var(--accent-ink); }
}

/* Language picker (profile settings) */
.lang-picker {
  display: inline-flex;
  flex-shrink: 0;
}
.lang-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.12));
  background: var(--surface, #fff);
  color: var(--text, #111);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ── Universal modal / alert ─────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: oklch(0.2 0.01 270 / 0.34);
  backdrop-filter: blur(4px);
  animation: modalFade 0.16s ease-out;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md), 0 24px 60px oklch(0.2 0.01 270 / 0.18);
  padding: 28px 26px 22px;
  text-align: center;
  animation: modalRise 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.modal-card.is-warn .modal-icon { background: oklch(0.95 0.06 85); color: oklch(0.52 0.12 75); }
.modal-card.is-error .modal-icon { background: oklch(0.95 0.04 25); color: var(--danger); }
.modal-icon:empty { display: none; }

.modal-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.modal-message {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.modal-actions .btn { min-width: 110px; justify-content: center; }

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalRise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
