:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3e8ef;
  --line-2: #eef2f7;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eff6ff;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --c1: #2563eb;
  --c2: #0d9488;
  --caption-size: 22px;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; font-size: 15px; line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { margin: 0 0 14px; }
code { background: var(--line-2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.right { display: flex; justify-content: flex-end; }
.pos { color: var(--success); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-size: 13px; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Announcement ---------- */
.announce {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 48px; font-size: 14px; font-weight: 500; position: relative; text-align: center;
  background: var(--primary-50); color: #1e3a8a; border-bottom: 1px solid #dbeafe;
}
.announce-promo { background: linear-gradient(90deg, #fdf2f8, #f5f3ff); color: #6b21a8; border-color: #ede9fe; }
.announce-update { background: #ecfdf5; color: #065f46; border-color: #d1fae5; }
.announce-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.announce-outage { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.announce-text { white-space: pre-wrap; }
.announce-close { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 20px; cursor: pointer; color: inherit; opacity: .6; }
.announce-close:hover { opacity: 1; }
.announce.inline { border-radius: 10px; border: 1px solid; padding: 10px 16px; justify-content: flex-start; text-align: left; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 62px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; letter-spacing: -.02em; }
.brand b { color: var(--primary); }
.logo { width: 30px; height: 30px; color: var(--primary); display: inline-flex; }
.logo svg { width: 100%; height: 100%; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.balance-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary-600); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.balance-pill svg { width: 16px; height: 16px; }
.balance-pill.low { background: #fef2f2; color: var(--danger); }
.user-menu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #1e293b; color: #fff; font-weight: 700; cursor: pointer; }
.menu {
  position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 190px; padding: 6px; display: flex; flex-direction: column;
}
.menu a, .menu button { text-align: left; padding: 8px 12px; border-radius: 8px; color: var(--text-2); background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu-user { padding: 8px 12px; font-weight: 600; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }

/* ---------- Layout ---------- */
.view { flex: 1; min-height: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.narrow { max-width: 520px; margin: 60px auto; }
.view-page { overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px) 60px; display: flex; flex-direction: column; gap: 20px; }
.view-page > * { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 14px; }
.field input, .field select, .field textarea, .search, .edit-table input:not([type=checkbox]) {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface);
  font-size: 15px; font-weight: 400; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .search:focus, .edit-table input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field textarea { resize: vertical; }
.form-error { color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; padding: 9px 12px; border-radius: 8px; font-size: 14px; margin: 0 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check.big { font-weight: 600; margin-bottom: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow { flex: 1; min-width: 260px; margin-bottom: 0; }
.search { width: 240px; padding: 8px 12px; font-size: 14px; }

/* ---------- Auth ---------- */
.view-auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; max-width: 1080px; width: 100%; margin: 0 auto; padding: 48px 24px; }
.auth-hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -.03em; }
.lead { font-size: 18px; color: var(--text-2); margin: 18px 0 24px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; color: var(--text-2); }
.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary); font-size: 12px; font-weight: 800; display: grid; place-items: center;
}
.auth-card { padding: 28px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tab { border: 0; background: none; padding: 9px; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

/* ---------- Interpreter ---------- */
.view-interpret { display: flex; flex-direction: column; padding: 18px 24px 18px; gap: 14px; overflow: hidden; }
.setup { padding: 18px 20px 12px; }
.setup-grid { display: grid; grid-template-columns: auto minmax(120px, 1fr) minmax(130px, 1.1fr) minmax(110px, 1fr) auto minmax(110px, 1fr) auto; gap: 12px; align-items: end; }
.setup-grid .field { margin-bottom: 0; }
.setup-grid .start { min-height: 44px; height: auto; max-width: 230px; white-space: normal; line-height: 1.15; text-align: left; }
.setup-hint { margin: 10px 0 0; }
.swap { margin-bottom: 1px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; height: 44px; }
.segmented button { border: 0; background: none; padding: 0 14px; white-space: nowrap; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }

.livebar {
  display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.live-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--warn); }
.live-status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.live-status[data-state="live"] { color: var(--success); }
.live-status[data-state="live"] .dot { animation: pulse 1.6s infinite; box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
.live-summary { font-weight: 700; font-size: 16px; }
.live-status[data-state="paused"] { color: var(--muted); }
.livebar.is-paused { background: #f8fafc; border-style: dashed; }
#pauseBtn { min-width: 112px; }
.live-meta { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tool-group { display: flex; gap: 6px; }
.tool {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px;
  font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.tool:hover { background: var(--surface-2); }
.tool.on { color: var(--primary); border-color: #bfdbfe; background: var(--primary-50); }
.dot-pair { display: inline-flex; }
.dot-pair i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }
.dot-pair i + i { margin-left: -5px; }
.pop-wrap { position: relative; }
.popover {
  position: absolute; top: 38px; left: 0; z-index: 10; width: 320px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 16px;
}
.pop-title { font-weight: 700; margin-bottom: 12px; }
.color-row { margin-bottom: 14px; }
.color-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.sel { box-shadow: 0 0 0 2px var(--text); }
.swatch.custom { background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff; position: relative; overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Caption stage */
.stage { flex: 1; min-height: 0; display: grid; gap: 16px; }
.stage.one { grid-template-columns: 1fr; }
.stage.two { grid-template-columns: 1fr 1fr; }
.pane {
  display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.pane-head {
  padding: 12px 20px; font-weight: 700; font-size: 15px; display: flex; align-items: baseline; gap: 10px;
  border-bottom: 1px solid var(--line-2);
}
.pane-sub { font-weight: 500; font-size: 13px; color: var(--muted); }
.pane-head .arrow { opacity: .55; }
.pane-left { border-top: 4px solid var(--c1); }
.pane-left .pane-head { background: color-mix(in srgb, var(--c1) 8%, #fff); color: color-mix(in srgb, var(--c1) 80%, #000); }
.pane-left .pane-body { background: color-mix(in srgb, var(--c1) 2.5%, #fff); }
.pane-right { border-top: 4px solid var(--c2); }
.pane-right .pane-head { background: color-mix(in srgb, var(--c2) 8%, #fff); color: color-mix(in srgb, var(--c2) 80%, #000); }
.pane-right .pane-body { background: color-mix(in srgb, var(--c2) 2.5%, #fff); }
.pane-head.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.pane-head.cols .col-o { color: color-mix(in srgb, var(--c1) 80%, #000); }
.pane-head.cols .col-t { color: color-mix(in srgb, var(--c2) 80%, #000); }
.pane-single { border-top: 4px solid; border-image: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%) 1; }

.pane-body { flex: 1; overflow-y: auto; padding: 8px 20px 40px; font-size: var(--caption-size); line-height: 1.45; }
.pane-empty { color: var(--muted); font-size: 15px; text-align: center; margin-top: 12vh; }
.row { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.row.pending { border-bottom-style: dashed; }
.cell { white-space: pre-wrap; overflow-wrap: anywhere; }
.nf { color: #94a3b8; }
.pane-body .cell { cursor: pointer; }
.pane-body .cell:hover .f { text-decoration: underline dotted color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 5px; }

/* Word lookup popup */
.lookup-pop {
  position: fixed; z-index: 40; width: min(340px, calc(100vw - 24px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 23, 42, .18); padding: 14px 16px 12px;
  font-size: 14px; line-height: 1.45;
}
.lk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.lk-word { font-size: 18px; font-weight: 700; }
.lk-langs { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.lk-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.lk-main { font-size: 20px; font-weight: 700; color: var(--primary-600); margin-bottom: 8px; }
.lk-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 8px 0 4px; }
.lk-alts { display: flex; flex-wrap: wrap; gap: 6px; }
.lk-alts span { background: var(--primary-50); color: var(--primary-600); padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.lk-defs { margin: 0; padding-left: 18px; color: var(--text-2); }
.lk-defs li { margin-bottom: 4px; }
.lk-defs em { color: var(--muted); font-size: 12px; }
.lk-loading { color: var(--muted); padding: 6px 0; }
.lk-credit { font-size: 11px; color: #94a3b8; margin-top: 10px; text-align: right; }
/* one-way: side by side */
.stage.one .row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.stage.one .cell.o { color: color-mix(in srgb, var(--c1) 25%, var(--text)); }
.stage.one .cell.t { color: color-mix(in srgb, var(--c2) 75%, #000); font-weight: 600; }
/* captions only: one big column */
.stage.one.captions .row { display: block; }
.stage.captions .cell.t { display: none; }
.stage.captions .cell.o { color: var(--text); font-size: 1.1em; }
.stage.one.captions .pane-head { color: color-mix(in srgb, var(--c1) 80%, #000); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
/* two-way: stacked inside each half */
.stage.two .cell.o { color: var(--text-2); }
.stage.two .cell.t { font-weight: 600; margin-top: 4px; }
.stage.two .cell.t.blank { display: none; }
.pane-left .cell.t { color: color-mix(in srgb, var(--c1) 80%, #000); }
.pane-right .cell.t { color: color-mix(in srgb, var(--c2) 80%, #000); }

/* Full screen */
body.is-fullscreen .topbar, body.is-fullscreen .announce, body.is-fullscreen .setup, body.is-fullscreen .livebar { display: none !important; }
body.is-fullscreen .view-interpret { padding: 12px; }

/* ---------- Account & admin ---------- */
.stat-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat-card.accent { background: linear-gradient(135deg, var(--primary), #4f46e5); color: #fff; border: 0; }
.stat-card.accent .stat-label { color: rgba(255, 255, 255, .8); }
.stat-card.accent .btn { background: #fff; color: var(--primary); }
.stat-card.warn { border-color: #fde68a; background: #fffbeb; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.step-title { font-weight: 700; margin-bottom: 10px; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.plan input, .method input { position: absolute; opacity: 0; pointer-events: none; }
.plan-body {
  border: 2px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; height: 100%;
  display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, background .15s;
}
.plan input:checked + .plan-body { border-color: var(--primary); background: var(--primary-50); }
.plan-name { font-weight: 700; }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.plan-min { font-weight: 600; color: var(--primary-600); margin-bottom: 4px; }
.methods { display: flex; flex-wrap: wrap; gap: 10px; }
.method {
  position: relative; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line);
  border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600;
}
.method:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.method.soon { opacity: .6; cursor: not-allowed; }
.badge { font-style: normal; font-size: 11px; font-weight: 700; background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 999px; }
.pay-box { background: var(--surface-2); border: 1px dashed #cbd5e1; border-radius: 12px; padding: 16px; display: grid; gap: 8px; }
.pay-amount { font-size: 17px; }
.pay-instructions { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr.hl td { background: #fffbeb; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.count { background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-tab { border: 1px solid var(--line); background: var(--surface); padding: 8px 16px; border-radius: 999px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.admin-tab.active { background: var(--text); color: #fff; border-color: var(--text); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.edit-table input:not([type=checkbox]) { width: 100%; min-width: 120px; padding: 7px 10px; font-size: 14px; }
.edit-table input.num { min-width: 80px; width: 100px; }
.edit-table input.num.sm { width: 64px; min-width: 64px; }
.edit-table td { vertical-align: middle; }
.method-list { display: grid; gap: 14px; margin-top: 12px; }
.method-edit { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.toggles { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.settings-form { max-width: 760px; }
.settings-form .panel-head { margin-top: 18px; }
.announce-preview { min-height: 44px; display: flex; align-items: center; }

/* ---------- Contact ---------- */
.visitor-nav { margin-left: auto; display: flex; gap: 22px; }
.visitor-nav a { font-weight: 600; }
/* Public pricing */
.pricing-block { grid-column: 1 / -1; margin-top: 36px; }
.pricing-head { text-align: center; max-width: 680px; margin: 0 auto 22px; }
.pricing-head h2 { font-size: 28px; margin-bottom: 8px; }
.trial-pill { display: inline-block; margin-top: 6px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.price-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 20px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px;
}
.price-card.featured { border: 2px solid var(--primary); box-shadow: 0 10px 30px rgba(37, 99, 235, .15); }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.price-name { font-weight: 700; color: var(--text-2); }
.price-amount { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.price-hours { font-size: 18px; font-weight: 700; color: var(--primary-600); }
.price-rate { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.price-desc { flex: 1; margin-bottom: 12px; }
.price-card .btn { margin-top: auto; }
.price-foot { margin-top: 18px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.pay-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.pay-chip { border: 1px solid var(--line); background: var(--surface); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pay-chip.soon { color: var(--muted); border-style: dashed; }
.contact-block { grid-column: 1 / -1; margin-top: 24px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; }
.contact-info h2 { font-size: 24px; margin-bottom: 6px; }
.contact-links { display: grid; gap: 10px; margin-top: 16px; }
.contact-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--text);
}
a.contact-link:hover { border-color: #bfdbfe; background: var(--primary-50); }
.cl-icon { font-size: 20px; width: 28px; text-align: center; }
.cl-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.cl-value { display: block; font-weight: 600; }
.contact-hours { margin-top: 12px; }
.contact-form h3 { margin-bottom: 14px; }
.form-ok { color: var(--success); font-weight: 600; margin: 12px 0 0; }
#authOk { margin: 0 0 14px; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.field-hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.captcha-box { margin: 2px 0 14px; min-height: 65px; }
.center { text-align: center; }
#forgotWrap { margin: 12px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msg-list { display: grid; gap: 12px; margin-top: 12px; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.msg.unread { border-color: #bfdbfe; background: var(--primary-50); }
.msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.msg-body { white-space: pre-wrap; margin-bottom: 8px; }
.msg .actions { display: flex; gap: 6px; }
#view-contact .contact-grid { max-width: 1000px; }

/* ---------- Tickets ---------- */
.ticket-list { display: grid; gap: 8px; margin-top: 8px; }
.ticket-row {
  display: grid; grid-template-columns: 56px 1fr auto 150px; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text);
}
.ticket-row:hover { background: var(--surface-2); border-color: #cbd5e1; }
.ticket-id { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.status-t-open { background: #fef3c7; color: #92400e; }
.status-t-answered { background: #dbeafe; color: #1e40af; }
.status-t-closed { background: #f1f5f9; color: #475569; }
.back-link { font-weight: 600; }
.thread { display: grid; gap: 12px; margin: 16px 0 18px; }
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.bubble.from-user { background: var(--surface-2); justify-self: start; border-bottom-left-radius: 4px; }
.bubble.from-admin { background: var(--primary-50); border-color: #bfdbfe; justify-self: end; border-bottom-right-radius: 4px; }
.bubble-meta { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.bubble-body { white-space: pre-wrap; }
.reply-actions { display: flex; justify-content: flex-end; gap: 10px; }
.small-seg { height: 36px; }
.small-seg button { padding: 0 12px; font-size: 13px; }

/* ---------- Legal & footer ---------- */
.legal { max-width: 820px !important; padding: 32px 40px; }
.legal h1 { margin-bottom: 18px; }
.legal h2 { font-size: 17px; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 22px; }
.legal-nav { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.legal-edit { margin-bottom: 18px; }
.legal-edit textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.legal-edit h3 { margin: 0; }
.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted);
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
body[data-view="interpret"] .site-footer { display: none; }
body:not([data-view="interpret"]) { height: auto; min-height: 100vh; }
body:not([data-view="interpret"]) .view-page { overflow: visible; }
.status[class*="status-t-"] { text-transform: none; }
.contact-grid.no-form { grid-template-columns: 1fr; }
.contact-grid.no-form .contact-links { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Proof of payment ---------- */
.buy-form { display: grid; gap: 4px; max-width: 720px; }
.buy-form .btn { justify-self: start; }
.upload-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; border: 2px dashed #cbd5e1; border-radius: 12px; padding: 16px; cursor: pointer; background: var(--surface-2); font-weight: 500; }
.upload-box:hover { border-color: var(--primary); background: var(--primary-50); }
.upload-box input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-text { color: var(--text-2); }
#proofPreview { max-height: 180px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.proof-view img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 10px; border-radius: 8px; border: 1px solid var(--line); }
.modal:has(.proof-view) { width: min(760px, 100%); }

/* ---------- Site language ---------- */
.site-lang-wrap { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; background: var(--surface); font-size: 13px; }
.site-lang { border: 0; background: transparent; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 2px; font-size: 13px; }
.topbar .site-lang-wrap { margin-left: 8px; }
#topRight:not([hidden]) ~ .site-lang-wrap { order: 0; }
@media (max-width: 560px) { .site-lang-wrap { padding: 2px 5px; } .site-lang { max-width: 52px; font-size: 12px; } }

/* ---------- Installable app & phones ---------- */
.install-btn { border: 1px solid #bfdbfe; background: var(--primary-50); color: var(--primary-600); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.install-btn:hover { background: #dbeafe; }
.visitor-nav + .install-btn, .install-btn + .top-right { margin-left: 0; }
.mobile-tip { margin: 10px 0 0; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
@media (display-mode: standalone) { .install-btn { display: none !important; } }
@media (max-width: 560px) {
  .install-btn { padding: 5px 9px; font-size: 12px; }
  .view-interpret { padding: 8px; gap: 8px; }
  .setup { padding: 14px; }
  .setup-grid .start { height: 52px; font-size: 17px; max-width: none; justify-content: center; text-align: center; }
  .livebar { gap: 8px 12px; padding: 10px 12px; }
  .livebar .live-meta { margin-left: 0; }
  .livebar .btn { flex: 1; padding: 12px; font-size: 16px; }
  .toolbar { gap: 6px; }
  .tool { padding: 8px 10px; }
  .pane-head { padding: 8px 12px; }
  .pane-body { padding: 4px 12px 24px; }
  .stage.two { gap: 8px; }
}

/* ---------- Admin controls ---------- */
.danger-text { color: var(--danger) !important; }
.deleted-list { margin-top: 18px; }
.deleted-list summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.pause-box { border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.pause-box.paused { border-color: #fecaca; background: #fef2f2; }
.pause-status { margin-bottom: 10px; }
.pause-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pause-controls select, .pause-amount { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; font-size: 14px; }
.pause-amount { width: 72px; }
.paused-note { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.panel-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(460px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
  max-width: min(560px, 92vw); font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1250px) {
  .setup-grid { grid-template-columns: 1fr 1fr; }
  .setup-grid .swap { display: none; }
  .setup-grid .start { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; gap: 20px; }
  .ticket-row { grid-template-columns: 44px 1fr; }
  .ticket-row .status, .ticket-row > .small { grid-column: 2; }
  .legal { padding: 22px 18px; }
  .bubble { max-width: 95%; }
  .view-auth { grid-template-columns: 1fr; gap: 24px; padding: 28px 16px; }
  .nav a { padding: 0 8px; font-size: 14px; }
  .topbar { gap: 12px; padding: 0 12px; }
  .top-right .btn { display: none; }
  .grid-2, .grid-3, .row-2 { grid-template-columns: 1fr; }
  .stage.two { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .stage.one .row { grid-template-columns: 1fr; gap: 4px; }
  .pane-head.cols { grid-template-columns: 1fr; gap: 2px; }
  .view-interpret { padding: 12px; overflow-y: auto; }
  .livebar { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .visitor-nav { gap: 12px; font-size: 14px; }
  .nav { overflow-x: auto; }
  .nav a { white-space: nowrap; padding: 0 6px; font-size: 13px; }
  .balance-pill { white-space: nowrap; font-size: 12px; padding: 5px 9px; }
  .balance-pill svg { display: none; }
  .announce { padding: 8px 40px 8px 14px; font-size: 13px; }
  .setup-grid { grid-template-columns: 1fr; }
  .swap { justify-self: center; }
  .grid-4 { grid-template-columns: 1fr; }
}
.stage.captions .pane-single { border-image: none; border-top: 4px solid var(--c1); }
.segmented { width: max-content; }
.topbar .site-lang-wrap { margin-left: auto; }
.topbar .visitor-nav:not([hidden]) ~ .site-lang-wrap { margin-left: 8px; }
.topbar .top-right { margin-left: 8px; }
