/* BuzzVoice brand (from buzzvoice.com, 2026-10-10): Work Sans, green #0EB77E (gradient #0A9E6A → #0EB77E → #2EC896),
   black hero, ink #0F172B, navy #1D293D / #314158, slate #62748E / #90A1B9, light #F1F5F9 / #CAD5E2.
   Light mode only (owner, 2026-10-10); the top bar stays black for the white logo. */
:root {
  --bg: #f1f5f9; --surface: #ffffff; --surface-2: #f1f5f9; --border: #dbe3ec; --text: #0f172b; --muted: #62748e;
  --primary: #0eb77e; --primary-hover: #0a9e6a; --primary-ink: #0f172b; --focus: rgba(14, 183, 126, .30);
  --brand-grad: linear-gradient(90deg, #0a9e6a, #0eb77e, #2ec896);
  --ok: #0a8a5d; --ok-bg: #e3f6ee; --warn: #9a5b00; --warn-bg: #fdf1dc; --bad: #c22f3e; --bad-bg: #fdecee;
  --shadow: 0 1px 2px rgba(15, 23, 43, .05), 0 6px 22px rgba(15, 23, 43, .07);
  --radius: 18px; --radius-sm: 12px;
  --top-bg: #000000; --top-text: #ffffff; --top-muted: #90a1b9;
  --ig: #d62976; --fb: #1877f2; --tt: #0f172b; --x: #0f172b; --yt: #e00000; --sc: #ff5500;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* top bar: black like buzzvoice.com, white logo */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px max(16px, calc((100vw - 1040px) / 2)); background: var(--top-bg); color: var(--top-text);
  border-bottom: 1px solid #1d293d;
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--top-text); text-decoration: none; }
.brand .logo { width: 62px; height: auto; display: block; }
.brand .divider { width: 1px; height: 26px; background: #314158; }
.brand .title { font-size: 16px; }
.grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who { display: flex; align-items: center; gap: 10px; color: var(--top-muted); font-size: 14px; }
.top .btn.ghost { color: var(--top-muted); }
.top .btn.ghost:hover { background: #1d293d; color: #ffffff; }

main { max-width: 1040px; margin: 0 auto; padding: 22px 16px 40px; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 560; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* cards + inputs */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.field-label { display: block; font-weight: 600; margin-bottom: 8px; }
textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 112px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 560; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .tab:focus-visible, .kind button:focus-visible, .recent button:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; }
/* primary = BuzzVoice green button: white text on the brand green, soft green shadow */
.btn.primary {
  background: linear-gradient(180deg, #10c085 0%, #0a9e6a 100%); border: 0; color: #ffffff;
  padding: 10px 18px; font-size: 15px; font-weight: 600; letter-spacing: .01em; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(10, 158, 106, .25), 0 4px 12px rgba(14, 183, 126, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn.primary:hover { background: linear-gradient(180deg, #0eb77e 0%, #088a5c 100%); box-shadow: 0 1px 2px rgba(10, 158, 106, .3), 0 6px 16px rgba(14, 183, 126, .3); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary:focus-visible { outline: 2px solid #088a5c; outline-offset: 2px; }
.btn.primary:disabled { opacity: .6; cursor: progress; box-shadow: none; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }

/* detected links */
.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.chip .short { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.chip.bad .short { color: var(--bad); }
.kind { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex: none; }
.kind button { border: 0; background: var(--surface); padding: 3px 9px; font-size: 12px; cursor: pointer; color: var(--muted); }
.kind button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* platform badge */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.badge i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; }
.badge.INSTAGRAM i { background: var(--ig); } .badge.FACEBOOK i { background: var(--fb); }
.badge.TIKTOK i { background: var(--tt); color: var(--bg); } .badge.X i { background: var(--x); color: var(--bg); }
.badge.YOUTUBE i { background: var(--yt); } .badge.SOUNDCLOUD i { background: var(--sc); }
.badge.none i { background: var(--muted); }

/* results */
.results { display: grid; gap: 12px; margin-top: 16px; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.result.error { border-left: 4px solid var(--bad); }
.result-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.result-head .link { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; text-decoration: none; }
.result-head .link:hover { text-decoration: underline; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 12px; }
.metric { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; }
.metric .label { font-size: 12px; color: var(--muted); font-weight: 560; text-transform: uppercase; letter-spacing: .03em; }
.metric .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.metric .value.long { font-size: 18px; }
.metric .value.xlong { font-size: 15px; }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.reactions span { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.err-msg { margin: 10px 0 0; color: var(--bad); }
.actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

.calc { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.calc summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 560; }
.calc-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.calc-grid label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.calc-out { margin-top: 10px; font-weight: 600; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); }

.skeleton { position: relative; overflow: hidden; }
.skeleton .bar { height: 12px; border-radius: 6px; background: var(--surface-2); margin-top: 10px; }
.skeleton .bar.w60 { width: 60%; } .skeleton .bar.big { height: 44px; width: 100%; margin-top: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* order */
.order-head { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; margin-top: 16px; }
.order-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.table-wrap { margin-top: 12px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .link { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.stack { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.state { font-size: 12.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.state.ok { background: var(--ok-bg); color: var(--ok); } .state.warn { background: var(--warn-bg); color: var(--warn); }
.state.grey { background: var(--surface-2); color: var(--muted); }

/* recent + usage */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.side { display: grid; gap: 14px; position: sticky; top: 76px; }
.side h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.recent button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; display: grid; gap: 1px; }
.recent button:hover { background: var(--surface-2); }
.recent .l { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage { display: grid; gap: 9px; }
.usage .u-row { font-size: 13px; }
.usage .u-top { display: flex; justify-content: space-between; gap: 8px; }
.usage .track { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 4px; overflow: hidden; }
.usage .fill { height: 100%; background: var(--primary); border-radius: 99px; }
.usage .fill.warn { background: var(--warn); } .usage .fill.bad { background: var(--bad); }
.empty { color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); z-index: 20; }

/* login: light page; black band with the white logo on top of the card */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 390px; padding: 0; overflow: hidden; }
.login .band { background: #000000; padding: 18px 22px; }
.login .logo { width: 80px; display: block; }
.login .inner { padding: 20px 22px 22px; }
.login h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
.login p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login .field { margin-bottom: 12px; }
.login .btn.primary { width: 100%; margin-top: 8px; }
.login .err { background: var(--bad-bg); color: var(--bad); padding: 9px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }

@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 560px) {
  main { padding: 16px 16px 32px; }
  textarea, input, select { font-size: 16px; }   /* iPhone doesn't zoom in on 16px fields */
  .chip { flex-wrap: wrap; }
  .chip .short { order: 3; flex-basis: 100%; }
  td[data-label="Link"] { flex-direction: column; align-items: flex-start; }
  .brand .logo { width: 52px; }
  .calc-grid { grid-template-columns: 1fr 1fr; }
  .calc-grid > :first-child { grid-column: 1 / -1; }
  .metric .value { font-size: 21px; }
  .who .name { display: none; }
  /* order table → cards */
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--border); padding: 8px 4px; }
  td { border: 0; padding: 4px 10px; display: flex; justify-content: space-between; gap: 12px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; }
  td.r { text-align: right; }
  td .link { max-width: 200px; }
}

.progress { margin: 10px 0 0; }
.paused { color: var(--warn); font-size: 12px; margin-top: 3px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-head h3 { margin: 0; }
.balances { display: grid; gap: 6px; }
.bal-row { display: flex; justify-content: space-between; font-size: 14px; }
.bal-row.low { color: var(--warn); font-weight: 600; }
.result-head .state { margin-left: auto; }
.ov-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ov-tiles { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ov-tiles .metric { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ov-card { margin-top: 14px; }
.ov-card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wait-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.wait-list li:last-child { border-bottom: 0; }
.wait-link { display: flex; gap: 10px; text-decoration: none; color: var(--text); font-weight: 560; min-width: 0; }
.wait-link:hover .wait-subj { text-decoration: underline; }
.wait-no { color: var(--primary-hover); flex: none; }
.wait-subj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.ok-pill { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.kop-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* top-bar pages: Overview | Live counter */
.views { display: flex; gap: 4px; margin-right: auto; margin-left: 28px; }
.view-link { color: var(--top-muted); text-decoration: none; font-weight: 560; font-size: 14.5px; padding: 8px 14px; border-radius: 10px; }
.view-link:hover { color: #ffffff; background: #1d293d; }
.view-link[aria-current="page"] { color: #ffffff; background: #1d293d; box-shadow: inset 0 -2px 0 #0eb77e; }
.view-link:focus-visible { outline: 2px solid #0eb77e; outline-offset: 2px; }
.page-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.ov-head { gap: 12px; }
@media (max-width: 700px) {
  .top { flex-wrap: wrap; row-gap: 8px; }
  .views { order: 3; width: 100%; margin: 0; }
  .view-link { flex: 1; text-align: center; }
  .brand .title { display: none; }
}
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 99px; background: #0eb77e; color: #ffffff; font-size: 12px; font-weight: 700; }
.tile-link { text-decoration: none; color: inherit; }
.tile-link .metric:hover { border-color: var(--primary); }
#view-waiting .card { max-width: 820px; }
/* two-step login */
.login .qr { background: #ffffff; border: 1px solid var(--border); border-radius: 12px; padding: 10px; width: 200px; margin: 6px auto 12px; }
.login .qr svg { width: 100%; height: auto; display: block; }
.login code.key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.login input#code { font-size: 22px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
