/* ASOTool — design tokens from ASO Tool.dc.html (option 1a) */
:root {
  --page: #f1f2f3;
  --card: #ffffff;
  --ink: #1a1d20;
  --ink-2: #33383d;
  --ink-3: #4a4f54;
  --mut: #6b7076;
  --mut-2: #8b9096;
  --mut-3: #9aa0a5;
  --mut-4: #a0a5aa;
  --line: #e2e4e6;
  --line-soft: #eceef0;
  --line-faint: #f3f4f5;
  --wash: #fbfbfc;
  --chipbg: #edeff0;
  --link: #2f5fd0;
  --pos: #3d7a5c;
  --neg: #9b4a3a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--page); -webkit-text-size-adjust: 100%; }
body {
  color: var(--ink);
  font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
button:disabled { opacity: 0.5; cursor: default; }
/* Every control here is a bare button or input, and the browser's own focus ring was
   suppressed along with their borders — so tabbing through the tool showed nothing at
   all. :focus-visible keeps it to keyboard use, where it's the only way to tell where
   you are. */
:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px;
}
/* Except the search boxes, whose own border already darkens on focus. */
.searchbox input:focus-visible { outline: none; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }

.shell {
  max-width: 1160px; margin: 18px auto 40px; padding: 0 16px;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 50px; padding: 0 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px 6px 0 0; border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
/* Scoped to the link: an unscoped .brand also matched brand-keyword rows, which
   is how those keywords ended up wearing the wordmark's weight. */
a.brand {
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  color: inherit; text-decoration: none; user-select: none; cursor: pointer;
}
a.brand:hover { color: var(--mut); }
.tabs { display: flex; gap: 2px; font-size: 12.5px; }
.tab {
  display: inline-block; padding: 5px 10px; border-radius: 4px;
  color: var(--mut); white-space: nowrap; text-decoration: none;
}
.tab:visited { color: var(--mut); }
.tab:hover { color: var(--ink); }
.tab.active, .tab.active:visited { background: #f1f2f3; color: var(--ink); font-weight: 500; }
.tab-count { font-family: var(--mono); font-size: 10.5px; color: var(--mut-3); margin-left: 2px; }

/* app switcher — the one place "which app am I working on" is answered */
/* Fixed width, not max-width: app names differ in length, and a switcher that
   sized to its contents would shift every tab beside it on each switch. */
.appsw {
  display: flex; align-items: center; gap: 7px; width: 190px; flex: none;
  padding: 4px 8px; border-radius: 5px; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); background: var(--card); text-align: left;
}
.appsw:hover { border-color: var(--mut-3); }
.appsw.scoped { background: #f7f8f8; }
.appsw img { width: 17px; height: 17px; border-radius: 4px; background: #e3e5e7; flex: none; }
.appsw #appsw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appsw-caret { font-size: 9px; color: var(--mut-3); flex: none; }

/* ---------- which store ---------- */
/* The same product is two apps here, and they are otherwise identical on screen:
   same name, same icon, different everything that matters. So the glyph rides along
   wherever an app is named. A shape, not a colour — colour alone doesn't survive a
   greyscale screenshot or a colourblind reader. */
.sglyph { display: inline-flex; align-items: center; flex: none; }
.sglyph svg { width: 12px; height: 12px; display: block; }
.sg-ios svg { fill: #5b6166; }
.sg-play svg { fill: #6d8a52; }
.appsw-store { display: inline-flex; flex: none; opacity: 0.75; }
.pop-name .sglyph { margin-right: 6px; vertical-align: -1px; }
.pf-app .nm .sglyph { margin-right: 6px; }

/* A pair in the switcher: one product heading, one row per store under it. */
.pop-group {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px 3px;
  font-size: 11.5px; color: var(--mut-3);
}
.pop-group img { width: 16px; height: 16px; border-radius: 4px; flex: none; }
/* The whole row moves in, not just its text: an indent that only shifts the label
   leaves the icons in a straight line down the list, and an unpaired app after a
   pair then reads as a third member of it. */
.pop-row.pop-sub { padding-left: 26px; }
.pop-row.pop-sub .pop-name { color: var(--ink-3); }

/* Store pickers. Two of them: the header's, which only exists before an app is
   selected, and the one on the Apps screen, which chooses where to search. */
.storepick, .storeseg, .rangepick {
  display: flex; flex: none; border: 1px solid var(--line); border-radius: 5px;
  overflow: hidden; background: var(--card);
}
.storepick button, .storeseg button, .rangepick button {
  display: flex; align-items: center; gap: 6px; padding: 4px 9px;
  font-size: 12px; color: var(--mut); background: none; white-space: nowrap;
}
/* No app in the header yet: the switcher would be an empty 190px hole, and the
   store pair with its labels is a second control the width of Discover. Icons
   carry the same choice until an app is picked and answers the store itself. */
.storepick button {
  padding: 4px 8px; min-width: 34px; justify-content: center;
}
.storepick .sglyph svg { width: 14px; height: 14px; }
.storepick button + button, .storeseg button + button, .rangepick button + button { border-left: 1px solid var(--line); }
.storepick button:hover, .storeseg button:hover, .rangepick button:hover { background: var(--wash); }
.storepick button.on, .storeseg button.on, .rangepick button.on { background: #f1f2f3; color: var(--ink); }
.storeseg button { height: 34px; }
.rangepick button { padding: 3px 8px; font-family: var(--mono); font-size: 11px; }
.t-moved { font-size: 11.5px; color: var(--mut); display: flex; gap: 10px; align-items: center; }
.t-moved .up { color: var(--pos); }
.t-moved .down { color: var(--neg); }
.t-moved .nw { color: #2f6b4f; }
.t-moved .out { color: var(--mut-3); }

.twin-link, .link-btn { color: var(--mut); text-decoration: underline; text-decoration-color: var(--line); }
.twin-link:hover, .link-btn:hover { color: var(--ink); }
/* The account name can be any length, and the bar is a fixed 50px: it gives up
   characters rather than a second line. */
.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); min-width: 0; }
.conn .dot { width: 6px; height: 6px; border-radius: 50%; background: #b0b5ba; flex: none; }
.conn.on .dot { background: #3d9970; }
.conn.checking { color: var(--mut-3); }
.conn.checking .dot { background: #d3d7da; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.account {
  display: flex; align-items: center; gap: 10px; flex: none; min-width: 0;
}
.ws-switch {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  padding: 3px 6px; margin: 0 -6px; border-radius: 4px;
  font-size: 12px; color: var(--ink-2);
}
.ws-switch:hover { background: var(--line-faint); }
#ws-switch-name {
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sign-out {
  font-size: 11px; color: var(--mut-3); white-space: nowrap; flex: none;
  text-decoration: none;
}
.sign-out:hover { color: var(--ink); }
.pop-invite { color: var(--ink-2); }

body.gated .shell { visibility: hidden; pointer-events: none; }
#auth-gate {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  background: var(--page);
}
#auth-gate[hidden] { display: none !important; }
.land {
  max-width: 1080px; margin: 18px auto 48px; padding: 0 16px;
}
.land-view { min-height: auto; padding-bottom: 28px; }
.auth-loading {
  color: var(--mut); font-size: 13px; padding: 48px 22px;
}
.land-hero { padding: 40px 28px 4px; }
.land-kicker {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mut-2); margin-bottom: 10px;
}
.land-hero h1 {
  font-size: 34px; font-weight: 500; letter-spacing: -0.035em;
  max-width: 14em; line-height: 1.12;
}
.land-lead {
  font-size: 15px; color: var(--ink-3); line-height: 1.5;
  max-width: 34em; padding-top: 12px; text-wrap: pretty;
}
.land-cta { display: flex; align-items: center; gap: 14px; padding: 20px 0 10px; }
.land-cta .btn-dark { height: 36px; padding: 0 16px; font-size: 13.5px; }
.land-trust { font-size: 12px; color: var(--mut-2); padding-bottom: 28px; }
.land .topbar .btn-dark { height: 28px; padding: 0 11px; font-size: 12px; }

.land-preview {
  margin: 0 18px; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; pointer-events: none; user-select: none;
  background: var(--card);
}
.land-preview-bar {
  display: flex; align-items: center; gap: 4px;
  height: 44px; padding: 0 12px; overflow-x: auto;
  border-bottom: 1px solid var(--line-soft); background: var(--wash);
}
.land-tab {
  display: inline-block; padding: 5px 10px; border-radius: 4px;
  font-size: 12.5px; color: var(--mut); white-space: nowrap;
}
.land-tab.on { background: #f1f2f3; color: var(--ink); font-weight: 500; }
.land-preview-app {
  display: flex; align-items: center; gap: 6px;
  width: 140px; flex: none; margin-right: 8px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px;
  font-size: 12.5px; color: var(--ink-2); background: var(--card);
}
.land-preview-search {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.land-preview-q { font-size: 13px; color: var(--ink); flex: 1; min-width: 0; }
.land-preview .thead { padding-left: 14px; padding-right: 14px; }
.land-preview .row { padding-left: 14px; padding-right: 14px; }
.land-preview .row:hover { background: none; }
.land-preview-foot {
  padding: 9px 14px 11px; font-size: 10.5px; color: var(--mut-3);
  border-top: 1px solid var(--line-soft); background: var(--wash);
}

.land-points {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0;
  margin: 18px 18px 0; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden;
}
.land-point {
  padding: 18px 18px 20px;
  border-right: 1px solid var(--line-soft);
}
.land-point:last-child { border-right: none; }
.land-point .lbl {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-2);
  padding-bottom: 8px;
}
.land-point p { font-size: 13px; color: var(--ink-3); line-height: 1.5; text-wrap: pretty; }

.land-stores {
  margin: 18px 18px 0; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
}
.land-stores p { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; text-wrap: pretty; max-width: 46em; }
.land-stores b { color: var(--ink); font-weight: 600; }

.land-price {
  margin: 28px 18px 0; padding: 28px 8px 8px;
  text-align: center;
}
.land-price-kicker {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mut-2); margin-bottom: 8px;
}
.land-price h2 {
  font-size: 22px; font-weight: 500; letter-spacing: -0.03em; margin-bottom: 8px;
}
.land-price-lead {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.5;
  max-width: 36em; margin: 0 auto 18px; text-wrap: pretty;
}
.land-price-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 5px;
  overflow: hidden; background: var(--card); margin-bottom: 16px;
}
.land-price-toggle button {
  padding: 6px 12px; font-size: 12.5px; color: var(--mut);
}
.land-price-toggle button + button { border-left: 1px solid var(--line); }
.land-price-toggle button.on { background: #f1f2f3; color: var(--ink); font-weight: 500; }
.land-price-card {
  max-width: 420px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 28px 28px 40px; text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.land-price-amt { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.land-price-amt .n { font-size: 36px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.land-price-amt .per { font-size: 13px; color: var(--mut); }
.land-price-note { font-size: 12.5px; color: var(--mut); margin-bottom: 16px; }
.land-price-card ul {
  margin: 0 0 22px; padding: 0; list-style: none;
}
.land-price-card li {
  position: relative; padding: 6px 0 6px 16px;
  font-size: 13px; color: var(--ink-3); line-height: 1.45;
  border-top: 1px solid var(--line-faint);
}
.land-price-card li:first-child { border-top: none; }
.land-price-card li::before {
  content: ""; position: absolute; left: 0; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink);
}
.land-price-card .btn-dark { width: 100%; justify-content: center; }

.pay-wall {
  width: 100%; max-width: 520px; margin: 0 auto; padding: 28px 16px 24px;
  text-align: center;
}
.pay-wall h1 {
  font-size: 24px; font-weight: 500; letter-spacing: -0.035em; margin-bottom: 8px;
}
.pay-lead {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.5;
  margin: 0 auto 20px; text-wrap: pretty; max-width: 36em;
}
.pay-plans {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 0 0 12px; text-align: left;
}
.pay-plan {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.pay-plan:hover { border-color: var(--ink-3); }
.pay-plan.on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.pay-plan-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--pos); background: #eef6f1; padding: 2px 6px; border-radius: 3px;
}
.pay-plan-name { font-size: 12px; font-weight: 500; color: var(--mut); }
.pay-plan-amt { display: flex; align-items: baseline; gap: 4px; }
.pay-plan-amt .n { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.pay-plan-amt .per { font-size: 12px; color: var(--mut); }
.pay-plan-note { font-size: 12px; color: var(--mut-2); }
.pay-wall .land-price-card { text-align: left; margin-top: 0; max-width: none; }
.pay-wall .land-price-card ul { margin-bottom: 18px; }
.pay-wall .land-price-card li:first-child { border-top: none; }
.pay-wall .linkish { display: inline-block; margin: 14px 10px 0; }
.pay-wall .auth-err { text-align: left; max-width: none; margin: 0 auto 14px; }
.pay-head-who {
  margin-left: auto;
  font-size: 12px; color: var(--mut-2); max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.land.paying {
  min-height: calc(100dvh - 36px);
  display: flex; flex-direction: column;
}
.land.paying .land-view {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.land.paying .land-foot { margin-top: auto; }

.land.onboard {
  max-width: 440px;
}
.land.onboard.paying {
  min-height: 0;
}
.land.onboard.paying .land-view {
  flex: none; display: block; min-height: 0;
}
.land.onboard.paying .land-foot { margin-top: 0; padding: 4px 22px 16px; }

.pay-wall .crumb { display: inline-block; margin-bottom: 14px; }

.free-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0; padding: 6px 18px;
  background: var(--wash);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-3);
}
.free-bar[hidden] { display: none !important; }
.free-bar .linkish { font-size: 12px; color: var(--ink-2); flex: none; }
.free-bar .linkish:hover { color: var(--ink); }

.onboard-wall {
  width: 100%; max-width: none; margin: 0; padding: 28px 22px 24px;
  text-align: left;
}
.onboard-wall h1 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px;
}
.onboard-lead {
  font-size: 12.5px; color: var(--mut); line-height: 1.4;
  margin: 0 0 18px;
}
.onboard-q { margin: 0 0 12px; }
.onboard-q:last-of-type { margin-bottom: 16px; }
.onboard-qlabel {
  font-size: 11px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--mut-2); margin-bottom: 6px;
}
.onboard-opts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.onboard-opts.three { grid-template-columns: 1fr 1fr 1fr; }
.onboard-opt {
  width: 100%; min-width: 0; min-height: 40px; padding: 8px 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--ink-2); text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 5px;
  box-shadow: 0 0 0 1px transparent;
  touch-action: manipulation;
}
.onboard-opt:hover { border-color: var(--ink-3); color: var(--ink); }
.onboard-opt.on {
  background: #f1f2f3; border-color: var(--ink); color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.onboard-wall .btn-dark { width: 100%; justify-content: center; }
.onboard-wall .linkish { display: block; width: 100%; margin: 12px 0 0; text-align: center; }
.onboard-wall .auth-err { margin: 0 0 10px; }
@media (max-width: 700px) {
  .onboard-wall { padding: 20px 16px 18px; }
  .onboard-opt { min-height: 42px; }
}
@media (max-width: 700px) {
  .pay-wall { padding: 18px 4px 16px; }
  .pay-wall h1 { font-size: 20px; }
  .pay-plans { grid-template-columns: 1fr; }
  .land.paying { min-height: 0; }
  .land.paying .land-view { display: block; }
  .land.onboard .land-view { display: block; }
  .land .topbar { flex-wrap: nowrap; }
  .land .topbar .spacer { display: block; }
  .pay-head-who { max-width: min(200px, 52vw); }
}

.land-foot {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 28px 16px; font-size: 12px; color: var(--mut-3);
}
.land-foot a { color: var(--mut-2); text-decoration: none; }
.land-foot a:hover { color: var(--ink); }

#land-legacy { margin: 16px 18px 0; }
#land-legacy .linkish { margin-top: 8px; }
.auth-panel {
  max-width: 400px; padding: 36px 32px 40px;
}
.auth-panel .crumb { display: inline-block; margin-bottom: 16px; }
.auth-panel h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { color: var(--mut); font-size: 12.5px; margin-bottom: 18px; }
.auth-field { display: block; margin: 0 0 12px; }
.auth-field span {
  display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mut-3); margin-bottom: 5px;
}
.auth-field input {
  width: 100%; border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 10px; font: inherit; background: var(--card); color: var(--ink);
}
.auth-field input:focus { outline: none; border-color: var(--ink-3); }
.auth-field input.is-invalid { border-color: var(--neg); }
.auth-hint { font-size: 12px; color: var(--mut-2); margin: -6px 0 12px; }
.auth-err { color: var(--neg); font-size: 12.5px; margin: 0 0 12px; }
.auth-legal {
  font-size: 12px; color: var(--mut-2); line-height: 1.45;
  margin: 10px 0 0; text-wrap: pretty;
}
.auth-legal a { color: var(--ink-2); }
.auth-legal a:hover { color: var(--ink); }
#auth-form .btn-dark { width: 100%; margin-top: 4px; justify-content: center; }
#auth-switch { display: block; width: 100%; margin-top: 12px; text-align: center; }
@media (max-width: 860px) {
  .land-points { grid-template-columns: 1fr; }
  .land-point { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .land-point:last-child { border-bottom: none; }
  .land-hero h1 { font-size: 28px; }
  .land-preview { overflow-x: auto; }
  .land-preview .thead, .land-preview .row { min-width: 520px; }
}
@media (max-width: 700px) {
  .land { margin: 8px auto 28px; padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right)); }
  .land .topbar { height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .land-hero { padding: 22px 14px 4px; }
  .land-hero h1 { font-size: 24px; }
  .land-lead { font-size: 14px; }
  .land-cta { padding: 16px 0 8px; }
  .land-trust { padding-bottom: 20px; }
  .land-preview { margin: 0 0; overflow-x: auto; }
  .land-preview .thead, .land-preview .row { min-width: 0; }
  .land-preview .c-opp, .land-preview .c-rank { display: none; }
  .land-preview-bar { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 6px; }
  .land-preview-app { width: 100%; margin: 0; }
  .land-preview .land-tab:nth-child(n+5) { display: none; }
  .land-preview-search .search-hint { display: none; }
  .land-preview-foot { text-wrap: pretty; }
  .land-points, .land-stores { margin-left: 0; margin-right: 0; }
  .land-price { margin: 22px 0 0; padding: 22px 0 0; }
  .land-price h2 { font-size: 20px; }
  .land-price-card { padding: 22px 16px 28px; }
  .land-cta .btn-dark { height: 36px; padding: 0 16px; }
  .land-foot { padding: 18px 14px 4px; flex-wrap: wrap; gap: 10px 14px; }
  .auth-panel { padding: 28px 16px 36px; }
  .land .topbar .linkish,
  .land .topbar .btn-dark {
    height: 32px; display: inline-flex; align-items: center;
  }
}

#country {
  appearance: none; border: 1px solid var(--line); background: var(--card);
  border-radius: 4px; padding: 4px 22px 4px 9px; font-size: 12px; color: var(--ink-3);
  font-family: var(--mono); text-transform: uppercase; cursor: pointer; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0l3.5 4L7 0z' fill='%239aa0a5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center;
}

/* ---------- views ---------- */
.work {
  background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 6px 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  min-height: 480px;
}
.view {
  /* flow-root keeps a state-card's top margin inside the card. Without it the
     margin collapses through border-top: none and the page grey shows as a gap
     under the header — Keywords / Optimize empty states start with that card. */
  display: flow-root;
  min-height: 0; position: relative; padding-bottom: 8px;
}

/* ---------- search row ---------- */
.searchrow {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.searchbox {
  position: relative;
  flex: 1; display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 5px;
}
.searchbox:focus-within { border-color: var(--ink-2); }
.search-ico { width: 11px; height: 11px; border: 1.5px solid var(--mut); border-radius: 50%; flex: none; }
.searchbox input { flex: 1; border: none; outline: none; font-size: 13px; color: var(--ink); background: none; min-width: 0; }
.searchbox input::placeholder { color: var(--mut-3); }
.search-hint { font-size: 10.5px; color: var(--mut-4); flex: none; }
.btn-dark {
  display: flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 5px; background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 500;
}
.btn-dark:hover { background: #2c3136; }
.btn-light {
  display: flex; align-items: center; height: 28px; padding: 0 12px;
  border: 1px solid #d6d9dc; border-radius: 4px; color: var(--ink-2); font-size: 12.5px;
}
.btn-light:hover { border-color: var(--ink-2); }

/* Anchored to .searchbox so it lines up with the input in every view, with or
   without a trailing button in the row. */
.typeahead {
  position: absolute; z-index: 30; top: calc(100% + 3px); left: -1px; right: -1px;
  background: var(--card); border: 1px solid var(--line); border-radius: 5px;
  list-style: none; padding: 4px; box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  max-height: 300px; overflow-y: auto;
}
.typeahead li { padding: 7px 10px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
.typeahead li:hover, .typeahead li.sel { background: var(--line-faint); }
/* A state, not a suggestion: nothing to click, nothing to hover. */
.typeahead li.ta-note { color: var(--mut-3); cursor: default; font-size: 12px; }
.typeahead li.ta-note:hover { background: none; }
.typeahead li.ta-create { color: var(--ink-2); }
.typeahead li.ta-create span { color: var(--mut-3); font-size: 11.5px; margin-left: 8px; }

/* ---------- meta row ---------- */
.metarow {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; border-bottom: 1px solid var(--line-soft); background: var(--wash);
  font-size: 12px; color: var(--mut);
}
.meta-count .mono { color: var(--ink); }
.seedchip { display: flex; gap: 6px; }
.seedchip span {
  font-size: 11.5px; padding: 3px 8px; border-radius: 3px;
  background: var(--chipbg); color: var(--ink-2);
}
.linkish { font-size: 12px; color: var(--mut); }
.linkish:hover { color: var(--ink); }
.linkish b { color: var(--ink); font-weight: 400; }
/* An offer, not an alarm: something has changed and it's yours to apply. Boxed so it
   reads as a button among the plain links it sits with. */
.resort {
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--card); color: var(--ink-3);
}
.resort:hover { border-color: var(--mut-3); color: var(--ink); }
.resort b { font-family: var(--mono); font-size: 11px; }

/* ---------- table ---------- */
.thead {
  display: flex; align-items: center; padding: 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-2);
}
.thead > div { font-family: var(--mono); font-size: 10.5px; font-weight: 500; }
.row {
  display: flex; align-items: center; padding: 0 18px; height: 40px;
  border-bottom: 1px solid var(--line-faint);
}
.row:hover { background: var(--wash); }
.row.sel { background: #fafbfb; }
.c-check { width: 26px; flex: none; display: flex; align-items: center; cursor: pointer; }
.checkbox {
  width: 13px; height: 13px; border: 1px solid #d0d4d8; border-radius: 3px;
  background: #fff; display: block; cursor: pointer; padding: 0; position: relative;
}
.c-check:hover .checkbox { border-color: var(--mut-2); }
.row.sel .checkbox, .checkbox.on { background: var(--ink); border-color: var(--ink); }
/* Some but not all — a dash, so the header box never claims more than it holds. */
.checkbox.part { border-color: var(--ink); }
.checkbox.part::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 4px; bottom: 4px;
  background: var(--ink); border-radius: 1px;
}
.c-term { flex: 1; min-width: 0; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.c-term .term-btn {
  font-size: 13.5px; text-align: left; min-width: 0; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.c-term .term-btn:hover { color: var(--link); }
.badge-new, .badge-brand, .badge-ai {
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  padding: 2px 5px; border-radius: 2px; flex: none; cursor: help;
}
.badge-new { background: #eaf1ec; color: #2f6b4f; }
/* The badge is the whole marking: a brand keyword reads like any other keyword,
   because styling the term too says the same thing twice. */
.badge-brand { background: #eceef0; color: #6a7278; }
.badge-ai { background: #eeebf5; color: #5b4a86; }
.ai-note {
  font-size: 10.5px; letter-spacing: 0.04em; color: var(--mut-3);
  padding: 2px 6px; border-radius: 3px; background: var(--line-faint); cursor: help;
}
.c-pop { width: 84px; text-align: right; font-family: var(--mono); font-size: 12.5px; font-weight: 500; flex: none; display: flex; align-items: center; justify-content: flex-end; }
/* Marks an estimated popularity. Reserved on every row, empty on the measured
   ones, so the digits still line up down the column. */
.pop-est { display: inline-block; width: 9px; text-align: right; color: var(--ink-3); font-weight: 400; cursor: help; }
.c-diff { width: 118px; display: flex; align-items: center; justify-content: flex-end; flex: none; }
.c-opp { width: 64px; text-align: right; font-family: var(--mono); font-size: 12.5px; flex: none; display: flex; align-items: center; justify-content: flex-end; }
.c-opp.good { color: var(--pos); font-weight: 500; }
.c-top { width: 190px; padding-left: 14px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); overflow: hidden; flex: none; }
.c-top img, .c-top .mark { width: 16px; height: 16px; border-radius: 4px; background: #e3e5e7; flex: none; }
.c-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.serp-btn {
  flex: none; width: 22px; height: 22px; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--mut-3); border-radius: 4px;
}
.serp-btn svg { width: 13px; height: 13px; display: block; }
.serp-btn:hover { color: var(--ink); background: var(--line-faint); }
.c-rate { width: 92px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-3); flex: none; }
.c-rate small { color: var(--mut-2); font-size: 10.5px; }
.c-act { width: 40px; text-align: right; flex: none; }
.act-add { font-size: 12.5px; color: var(--link); padding: 4px 6px; }
/* saved is a state worth having, so it reads that way rather than like something
   greyed out */
.act-add.done { color: var(--pos); font-size: 11.5px; }
/* the toast lands at the bottom of the window, nowhere near the row you clicked,
   so the row confirms the change itself */
.row.flash-add { animation: rowflash 900ms ease-out; }
.row.flash-remove { animation: rowflash-out 900ms ease-out; }
@keyframes rowflash { from { background: #e4efe7; } to { background: transparent; } }
@keyframes rowflash-out { from { background: #f6ebe7; } to { background: transparent; } }
.act-x { font-size: 13px; color: var(--mut-2); padding: 4px 6px; }
.act-x:hover { color: var(--neg); }
.dim { color: #b0b5ba; }

/* difficulty: five-segment bar (design default) */
.diffbar { display: flex; align-items: center; gap: 7px; }
.diffbar .segs { display: flex; gap: 2px; }
.diffbar .segs i { width: 8px; height: 12px; border-radius: 1px; background: #e8eaec; display: block; }
.diffbar .n { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-3); width: 20px; text-align: right; }
/* tonal chip (detail views) */
.diffchip {
  min-width: 36px; text-align: center; font-family: var(--mono); font-size: 11.5px;
  padding: 2px 6px; border-radius: 3px; display: inline-block;
}

.rowload { height: 12px; width: 46px; border-radius: 3px; background: linear-gradient(90deg, #eff0f1, #f7f8f8, #eff0f1); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; display: inline-block; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: 0 0; } }
/* A row waiting to try again, saying so. Quieter than an error, since it isn't one. */
.retrying { font-size: 11.5px; opacity: 0.85; }

/* What's happening, above the table it's happening to. The bar is determinate once
   there's something to count and sweeps while there isn't — a phase whose length nobody
   can predict shouldn't be drawn as a percentage of anything. */
.discprog {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; font-size: 12.5px; color: var(--ink-2);
  background: #f8f9fa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.discprog .mono { font-size: 11px; }
.spin {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid #d9dcdf; border-top-color: var(--ink-2);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progline {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--ink-2); transition: width 0.25s ease;
}
.progline.sweep { width: 22%; animation: sweep 1.5s ease-in-out infinite; }
@keyframes sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(555%); } }

/* Rows the table doesn't have yet, in the shape of the rows it's about to */
.row.ghost { pointer-events: none; }
.row.ghost .rowload { opacity: 0.7; }

/* Rows that gave up, summed up above the table they're in */
.loadwarn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; font-size: 12.5px; color: var(--ink-2);
  background: #fdf7f5; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.loadwarn .state-dot { margin-top: 0; }
.t-score-note { color: var(--mut-2); margin-left: 8px; }
.t-score-note::before { content: " · "; color: var(--mut-3); }

.tfoot {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; font-size: 12px; color: var(--mut-2);
}
.foot-note { font-size: 11px; }

/* ---------- selection bar ---------- */
.selbar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 46px; padding: 0 18px; margin-top: -1px;
  background: var(--ink); color: #fff; border-radius: 0 0 6px 6px;
  font-size: 12.5px;
}
.selbar > * { white-space: nowrap; }
.selbar .vline { width: 1px; height: 18px; background: #3a3f44; }
.sel-dim { color: #cfd3d7; }
.sel-dim .mono { color: #fff; }
.sel-link { font-size: 12.5px; color: #cfd3d7; }
.sel-link:hover { color: #fff; }
.btn-white {
  display: flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 4px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 500;
}

/* ---------- state cards ---------- */
.state-card {
  margin: 16px 18px; padding: 15px 17px;
  border: 1px solid var(--line); border-radius: 6px;
  display: flex; gap: 14px; align-items: flex-start;
}
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: #c4c8cc; margin-top: 5px; flex: none; }
.state-dot.warn { background: #b8763c; }
.state-dot.err { background: #9b4a3a; }
.state-title { font-size: 13px; font-weight: 500; display: flex; align-items: baseline; gap: 9px; }
.state-tag { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-3); font-weight: 500; }
.state-body { font-size: 12.5px; color: var(--mut); line-height: 1.5; padding-top: 4px; text-wrap: pretty; max-width: 560px; }

/* ---------- detail ---------- */
.crumbrow {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px;
  border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--mut-2);
}
.crumb { color: var(--mut-2); font-size: 12.5px; }
.crumb:hover { color: var(--ink); }
.crumb-here { color: var(--ink); }
.d-head { display: flex; align-items: flex-end; gap: 40px; padding: 24px 22px 22px; }
.d-head h1 { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.d-sub { font-size: 12.5px; color: var(--mut); padding-top: 8px; }
.statrow { display: flex; gap: 34px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .lbl { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mut-2); }
.stat .val { font-family: var(--mono); font-size: 24px; }
.stat .note { font-size: 11.5px; color: var(--mut); }
.stat .note.pos { color: var(--pos); }

.d-cols { display: flex; border-top: 1px solid var(--line-soft); }
.d-main { flex: 1; min-width: 0; border-right: 1px solid var(--line-soft); padding-bottom: 20px; }
.d-side { width: 400px; flex: none; padding-bottom: 20px; }
.blockhead {
  padding: 16px 22px 10px; font-size: 13px; font-weight: 500;
  display: flex; align-items: baseline; gap: 12px;
}
.bh-gap { padding-top: 20px; }
.blocknote { font-size: 11.5px; color: var(--mut-2); font-weight: 400; }
.factor {
  display: flex; align-items: center; gap: 14px; padding: 9px 0;
  border-bottom: 1px solid var(--line-faint); margin: 0 22px;
}
.factor .fname { width: 178px; font-size: 12.5px; color: var(--ink-2); flex: none; }
.factor .fbar { flex: 1; height: 5px; background: #eff0f1; border-radius: 3px; overflow: hidden; }
.factor .fbar i { height: 5px; display: block; }
.factor .fval { width: 168px; text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; color: var(--mut); flex: none; }
.insight {
  margin: 14px 22px 0; padding: 11px 13px;
  background: #fbfaf7; border: 1px solid #eae6dd; border-radius: 5px;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.5;
}
.ranked-row {
  display: flex; align-items: center; gap: 11px; padding: 8px 0;
  border-bottom: 1px solid var(--line-faint); margin: 0 20px;
}
.ranked-row .pos { width: 22px; font-family: var(--mono); font-size: 12px; color: var(--mut-3); flex: none; }
.ranked-row img { width: 26px; height: 26px; border-radius: 6px; background: #e3e5e7; flex: none; }
.ranked-row .rmeta { flex: 1; min-width: 0; }
.ranked-row .rname { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-row .rname a { color: inherit; text-decoration: none; }
.ranked-row .rname a:hover { color: var(--link); }
.ranked-row .rnote { font-size: 11px; color: var(--mut-3); }
.ranked-row .rrating { font-family: var(--mono); font-size: 11.5px; color: var(--mut); flex: none; }
.variant-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--line-faint); margin: 0 20px;
}
.variant-row .vterm { flex: 1; font-size: 12.5px; min-width: 0; text-align: left; }
.variant-row .vterm:hover { color: var(--link); }
.variant-row .vpop { font-family: var(--mono); font-size: 12px; width: 26px; text-align: right; flex: none; }

/* ---------- tracked ---------- */
.metacard { margin: 14px 18px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--wash); }
.metacard-head {
  display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--mut-3); padding-bottom: 8px;
}
.metacard-head #meta-len { color: var(--ink-2); }
.metacard-str { font-size: 12px; line-height: 1.6; color: var(--ink-2); word-break: break-all; min-height: 19px; }
.metacard-bar { height: 3px; background: #e6e8ea; border-radius: 2px; margin-top: 10px; overflow: hidden; }
.metacard-bar i { height: 3px; background: var(--ink-2); display: block; width: 0; border-radius: 2px; transition: width 0.3s; }
.metacard-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 9px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12.5px;
  padding: 8px 14px; border-radius: 5px; z-index: 90;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.fb-scrim {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(26, 29, 32, 0.28);
}
.fb-card {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.16);
  padding: 22px 22px 18px;
}
.fb-card h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 4px; }
.fb-sub { color: var(--mut); font-size: 12.5px; margin-bottom: 14px; }
.fb-card textarea {
  width: 100%; min-height: 120px; resize: vertical;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 10px; font: inherit; background: var(--card); color: var(--ink);
}
.fb-card textarea:focus { outline: none; border-color: var(--ink-3); }
.fb-acts {
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  margin-top: 12px;
}
.fb-acts .btn-dark { height: 32px; padding: 0 14px; }

@media (max-width: 860px) {
  .c-top, .c-rate { display: none; }
  .sel-dim { display: none; }
  .d-cols { flex-direction: column; }
  .d-side { width: auto; }
  .d-main { border-right: none; }
  .d-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .statrow { flex-wrap: wrap; gap: 20px; }
  .search-hint { display: none; }
}

/* Where the data actually is, and what can be done about it. */
.backuprow {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px;
  margin-top: 14px; padding: 12px 18px;
  background: var(--wash); border: 1px solid var(--line-soft); border-radius: 6px;
}
.backuprow .foot-note { flex: 1; min-width: 260px; }

.team-panel {
  margin: 14px 0 0; padding: 14px 18px 16px;
  background: var(--wash); border: 1px solid var(--line-soft); border-radius: 6px;
}
.team-panel h2 {
  font-size: 13px; font-weight: 500; margin: 0 0 4px;
}
.team-panel .team-lead {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.45; margin: 0 0 12px; max-width: 42em;
}
.team-person, .team-pending {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px;
}
.team-person .em, .team-pending .em {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 11.5px;
}
.team-role {
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-3); flex: none;
}
.team-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px;
}
.team-form input {
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px;
  font: inherit; background: var(--card); color: var(--ink); min-width: 200px;
}
.team-form input:focus { outline: none; border-color: var(--ink-3); }
.team-form .btn-dark { height: 30px; padding: 0 12px; font-size: 12px; }
.team-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-3); margin-top: 8px;
}
.team-acts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.team-link {
  font-family: var(--mono); font-size: 11px; color: var(--mut);
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 8px; word-break: break-all;
}

.auth-legacy {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.45;
}
.auth-legacy p { margin: 0 0 8px; }

.table-hscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* A phone. The header stacks instead of overflowing, the tabs scroll on their own,
   and tables either drop the columns that don't earn their width or swipe as a
   unit so header and rows stay lined up. */
@media (max-width: 700px) {
  .shell {
    padding: 0 max(10px, env(safe-area-inset-right)) 12px max(10px, env(safe-area-inset-left));
    margin: 8px auto 24px;
  }
  .work { min-height: 0; }
  .topbar {
    height: auto; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    padding: 10px 12px;
  }
  .topbar .spacer { display: none; }
  .brand { order: 0; }
  #country { order: 1; margin-left: auto; }
  .account { order: 1; }
  #ws-switch-name { max-width: 88px; }
  .ws-switch, .sign-out { min-height: 32px; padding: 4px 6px; }
  .appsw, .storepick { order: 3; }
  .appsw { width: 100%; flex: none; min-width: 0; min-height: 40px; }
  /* No app: don't spend a whole row on two icons. They sit on the tab row,
     which already scrolls, and the switcher is gone so the width is free. */
  .topbar.noapp .storepick { order: 4; }
  .topbar.noapp .tabs { width: auto; flex: 1 1 0; min-width: 0; }
  .storepick button { min-height: 32px; min-width: 36px; }
  .tabs {
    order: 4; width: 100%; overflow-x: auto; gap: 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 8px 11px; }
  .c-check { display: none; }
  .col-rest { display: none; }
  .c-term .badges { display: none; }
  .metarow, .tfoot, .filterrow { flex-wrap: wrap; gap: 8px 12px; padding-left: 12px; padding-right: 12px; }
  .metarow .linkish, .tfoot .linkish, .comp-actions .linkish, .backuprow .linkish {
    min-height: 32px; display: inline-flex; align-items: center;
  }
  .filterrow .spacer { display: none; }
  .fchips { flex-wrap: wrap; width: 100%; }
  .fchip { padding: 7px 12px; }
  .fctl input[type="number"] { font-size: 16px; height: 32px; width: 3.2em; }
  .searchrow { flex-wrap: wrap; padding: 12px; }
  .free-bar { padding: 6px 12px; }
  .searchbox { flex: 1 1 160px; height: 40px; }
  .searchrow .btn-dark { height: 40px; flex: none; }
  .storeseg { width: 100%; }
  .storeseg button { flex: 1; justify-content: center; height: 40px; }
  .rangepick button { min-height: 32px; padding: 6px 10px; }
  .optfields .optfield { flex-direction: column; align-items: stretch; gap: 4px; }
  .optlab { width: auto; }
  .optfield input, .optfield-tall textarea,
  .searchbox input, .auth-field input, .team-form input, .addcard textarea,
  .fb-card textarea {
    font-size: 16px;
  }
  .optfield input { height: 40px; }
  .state-card { margin: 12px; padding: 14px; }
  .state-acts { gap: 10px; flex-direction: column; align-items: stretch; }
  .state-acts .btn-dark, .state-acts .btn-light, .state-acts .state-btn {
    width: 100%; justify-content: center;
  }
  .comp-head { flex-wrap: wrap; padding: 16px 12px; gap: 12px; }
  .comp-icon { width: 48px; height: 48px; border-radius: 11px; }
  .comp-name { font-size: 16px; }
  .comp-head .statrow { width: 100%; }
  .optscore { flex-wrap: wrap; gap: 18px; padding: 14px 12px; }
  .d-head { padding: 18px 12px 16px; }
  .d-head h1 { font-size: 22px; }
  .blockhead, .metabox { padding-left: 12px; padding-right: 12px; }
  .optcard, .optnote, .optfinal { margin-left: 12px; margin-right: 12px; }
  .backuprow { padding: 12px; }
  .backuprow .foot-note { min-width: 0; }
  .team-panel { padding: 12px; }
  .team-form { flex-direction: column; align-items: stretch; }
  .team-form input { min-width: 0; width: 100%; }
  .team-form .btn-dark { width: 100%; justify-content: center; }
  .toast { bottom: max(16px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .pop { max-width: calc(100vw - 16px); }
  .mention-say { width: auto; max-width: 42vw; }
  .selbar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px 12px; }
  .row { height: 44px; padding-left: 12px; padding-right: 12px; }
  .thead { padding-left: 12px; padding-right: 12px; }
  .dash { padding: 12px; gap: 10px; grid-template-columns: 1fr; }
  .c-pop, .c-diff, .c-opp, .c-rank, .c-act, .c-cov { min-width: 0; }
  .c-pop { width: 48px; }
  .c-diff { width: 72px; }
  .c-opp { width: 40px; }
  .c-rank { width: 40px; }
  .c-act { width: 36px; }
  .act-add, .act-x {
    min-width: 36px; min-height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .act-add.done { font-size: 0; }
  .act-add.done::after { content: "✓"; font-size: 14px; font-weight: 600; }
  .diffbar { gap: 4px; }
  .diffbar .segs i { width: 4px; height: 10px; }
  #view-discover .diffbar .segs { display: none; }
  #view-discover .c-diff { width: 36px; }
  .c-where { display: none; }
  #view-keywords .thead,
  #t-rows .row {
    grid-template-columns: minmax(7.5em, 1fr) 48px 72px 40px 40px 36px;
  }
  #view-keywords .c-chg,
  #view-keywords .c-hist { display: none; }
}

/* ---------- extra columns ---------- */
.c-rank { width: 74px; text-align: right; font-family: var(--mono); font-size: 12.5px; flex: none; display: flex; align-items: center; justify-content: flex-end; }
.c-rank.good { color: var(--pos); }
/* the rank belongs to whichever of your apps placed highest, so it carries that
   app's icon once you own more than one */
.rank-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.rank-cell img { width: 14px; height: 14px; border-radius: 4px; background: #e3e5e7; flex: none; }
/* another of your apps ranks for this keyword too — names on hover */
.rank-more { font-size: 12px; font-weight: 600; color: var(--mut-2); line-height: 1; cursor: help; }
.c-share { width: 70px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); flex: none; }
.c-bid { width: 76px; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); flex: none; }
.c-spark { width: 110px; padding-left: 14px; flex: none; }
#view-keywords .thead,
#t-rows .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 118px 64px 60px 72px 120px 40px;
}
#view-keywords .thead { align-items: center; }
#t-rows .row { align-items: center; }
#view-keywords .c-pop,
#view-keywords .c-diff,
#view-keywords .c-opp,
#view-keywords .c-rank {
  width: auto; min-width: 0;
}
@media (max-width: 700px) {
  #view-keywords .thead,
  #t-rows .row {
    grid-template-columns: minmax(7.5em, 1fr) 48px 72px 40px 40px 36px;
  }
  #view-keywords .c-chg,
  #view-keywords .c-hist { display: none; }
  #view-keywords .app-tag,
  #view-keywords .serp-btn,
  #view-keywords .badge-new { display: none; }
}
.rank-n {
  display: block; text-align: right;
  font-variant-numeric: tabular-nums;
}
.c-chg {
  width: auto; min-width: 0;
  padding-left: 10px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: flex-start;
  font-family: var(--mono); font-size: 12.5px;
}
.rankchg {
  display: inline-flex; align-items: center;
  box-sizing: border-box;
  font-size: 12.5px; font-weight: 400; cursor: help;
  font-variant-numeric: tabular-nums; line-height: 1;
  overflow: hidden; white-space: nowrap;
}
.rankchg.up { color: var(--pos); }
.rankchg.down { color: var(--neg); }
.rankchg.new {
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
  background: #eaf1ec; color: #2f6b4f; padding: 2px 5px; border-radius: 2px;
}
.rankchg.out { color: var(--mut-3); }
.rankchg:empty { cursor: default; }
.c-hist {
  width: auto; min-width: 0; padding: 0 4px 0 10px;
  display: flex; align-items: center;
}
.c-hist .spark { display: block; height: 26px; width: 100%; overflow: visible; }
.est-tag {
  font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--mut-3); background: var(--line-faint); border-radius: 2px; padding: 1px 4px;
  vertical-align: 1px;
}
.thead-flush { padding-left: 22px; padding-right: 22px; }

/* chart */
.chartbox { margin: 0 22px; border: 1px solid #eff0f1; border-radius: 5px; padding: 10px; height: 122px; }
.chartbox svg { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 18px; padding: 9px 22px 0; font-size: 11.5px; color: var(--mut); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: 3px; margin-right: 6px; }
/* Where the chart would be before anything has been measured: the same box, saying
   what fills it, rather than a line drawn from nothing. */
.histempty {
  margin: 0 22px; border: 1px dashed var(--line); border-radius: 5px;
  padding: 16px 18px; font-size: 12.5px; line-height: 1.55; color: var(--mut);
  background: #fcfcfd;
}
.sparknone { font-size: 11px; color: var(--mut-3); cursor: help; }

/* competitors */
.comp-head { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border-bottom: 1px solid var(--line-soft); }
.comp-icon { width: 62px; height: 62px; border-radius: 14px; background: #e3e5e7; flex: none; }
.comp-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.comp-name { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.comp-sub { font-size: 12.5px; color: var(--mut); }
.comp-sub2 { font-size: 12.5px; color: var(--mut-2); }
.metabox { display: flex; flex-direction: column; gap: 12px; padding: 0 20px; }
.metabox-card { border: 1px solid #eff0f1; border-radius: 5px; padding: 11px 12px; font-size: 13px; line-height: 1.45; }
.metabox-lbl { font-size: 10.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mut-2); padding-bottom: 5px; }
.metabox-card mark { background: #f0ece0; color: var(--ink); }
.chips-sm { display: flex; flex-wrap: wrap; gap: 5px; }
.chips-sm span { font-size: 11.5px; padding: 3px 7px; border-radius: 3px; background: #f2f3f4; color: var(--ink-2); }

/* apps — dashboard of visibility cards, one per listing */
.dash {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; padding: 16px 18px;
}
.dash-card {
  display: flex; flex-direction: column; text-align: left;
  padding: 14px 14px 0; min-height: 0; overflow: hidden; max-width: 400px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer;
}
.dash-card:hover { border-color: var(--mut-3); }
/* An inset left bar clips around the radius and reads as a broken black edge. */
.dash-card.current { border-color: var(--ink); }
.dash-card:focus { outline: none; }
.dash-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dash-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.dash-top img, .dash-card .pf-blank {
  width: 32px; height: 32px; border-radius: 8px; flex: none; background: #e3e5e7;
  object-fit: cover;
}
.dash-who { flex: 1; min-width: 0; }
.dash-who .nm {
  font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-who .nm .sglyph { margin-right: 6px; vertical-align: -1px; }
.dash-who .cat { font-size: 11.5px; color: var(--mut-3); line-height: 1.35; }
.dash-x { flex: none; margin: -4px -6px 0 0; color: var(--mut-3); }
.dash-x:hover { color: var(--ink); }
.dash-score { padding: 14px 2px 4px; }
.dash-lab {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mut-2);
}
.dash-n {
  font-size: 42px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05;
  color: var(--ink); margin: 2px 0 2px;
}
.dash-n:empty { display: none; }
.dash-band { font-size: 13.5px; font-weight: 500; }
.dash-band.hi { color: var(--pos); }
.dash-band.mid { color: var(--ink-2); }
.dash-band.lo { color: var(--neg); }
.dash-band.mute { color: var(--mut-3); font-weight: 400; }
.dash-delta { font-size: 12px; margin-left: 8px; }
.dash-chart { height: 72px; margin: 4px -14px 0; }
.dash-spark { display: block; width: 100%; height: 72px; overflow: visible; }
.dash-none {
  display: flex; align-items: center; height: 72px; padding: 0 16px;
  font-size: 12px; color: var(--mut-3);
}
.dash-meta {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  padding: 8px 2px 12px; font-size: 11.5px; color: var(--mut-2);
}
.pf-blank {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #eef0f1; color: var(--mut-2);
}
.pf-blank .sglyph svg { width: 14px; height: 14px; }
.spark { width: 100%; height: 20px; display: block; }

/* popover — app picker for per-app keyword lists */
.pop {
  position: fixed; z-index: 55; min-width: 208px; max-width: 280px;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 4px;
  max-height: 320px; overflow-y: auto;
}
.pop-head {
  padding: 7px 9px 6px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--mut-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pop-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 9px; border-radius: 4px; font-size: 12.5px; color: var(--ink-2); text-align: left;
}
.pop-row:hover { background: var(--line-faint); }
.pop-row:disabled { opacity: 0.55; }
.pop-row.on { color: var(--ink); }
.pop-row img, .pop-blank { width: 18px; height: 18px; border-radius: 5px; background: #e3e5e7; flex: none; }
.pop-blank { background: none; border: 1px dashed var(--line); }
.pop-box { width: 12px; font-family: var(--mono); font-size: 11px; color: var(--ink); flex: none; }
.pop-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-n { font-family: var(--mono); font-size: 10.5px; color: var(--mut-3); flex: none; }
.pop-foot {
  display: block; width: 100%; text-align: left; padding: 7px 9px; margin-top: 3px;
  border-top: 1px solid var(--line-faint); font-size: 11.5px; color: var(--mut); border-radius: 0 0 4px 4px;
}
.pop-foot:hover { color: var(--ink); background: var(--line-faint); }
.pop.pop-serp { min-width: 260px; max-width: 320px; max-height: 420px; }
.pop-serp .pop-head { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pop-serp .pop-row { text-decoration: none; color: inherit; }
.pop-serp a.pop-row:hover { color: var(--ink); }

/* the app a tracked keyword is filed under, clickable to move or copy it */
.app-tag {
  font-size: 10.5px; padding: 2px 6px; border-radius: 3px;
  background: #f2f3f4; color: #6b7076; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: 1px;
}
.app-tag:hover { background: #e7e9ea; color: var(--ink-2); }

@media (max-width: 1000px) { .c-share { display: none; } }
@media (max-width: 920px) { .c-bid { display: none; } }

/* ---------- filters ---------- */
.filterrow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--line-soft);
  font-size: 12px; color: var(--mut);
}
.fchips { display: flex; gap: 4px; }
.fchip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--mut); background: var(--card);
}
.fchip:hover { color: var(--ink); border-color: var(--mut-3); }
.fchip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.fctl { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--mut); cursor: pointer; white-space: nowrap; }
.fctl input[type="number"] {
  width: 44px; border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 5px; font: 500 11.5px var(--mono); color: var(--ink-2);
  outline: none; background: var(--card);
}
.fctl input[type="number"]:focus { border-color: var(--ink-2); }
.fctl input[type="checkbox"] { accent-color: var(--ink); margin: 0; }

/* sortable headers, seed chips, app chips, comp extras */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--ink); }
.sortable .arr { margin-left: 3px; }
.seedchip span { display: inline-flex; align-items: center; gap: 6px; }
.seedchip .sx { border: none; background: none; color: var(--mut-2); cursor: pointer; font-size: 12px; padding: 0 1px; }
.seedchip .sx:hover { color: var(--neg); }
.seedchip img { width: 14px; height: 14px; border-radius: 3px; }
.appchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0; }
.achip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--mut); background: var(--card);
}
.achip img { width: 16px; height: 16px; border-radius: 4px; }
.achip .n { font-family: var(--mono); font-size: 10.5px; color: var(--mut-3); }
.achip:hover { color: var(--ink); border-color: var(--mut-3); }
.achip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.achip.active .n { color: #cfd3d7; }
/* saved-competitor chip: name selects, × stops watching */
.achip-main { color: inherit; font-size: inherit; }
.achip-x { color: var(--mut-3); font-size: 13px; line-height: 1; margin: 0 -3px 0 1px; }
.achip-x:hover { color: var(--neg); }
.achip.active .achip-x { color: #9aa0a6; }
.achip.active .achip-x:hover { color: #fff; }
.comp-actions { display: flex; gap: 14px; padding: 0 18px 12px; }
/* under a single-app context the tag stops repeating the app name and just
   offers the move, so it reads as an action rather than a label */
.app-tag-move { font-style: normal; color: var(--mut-3); }
.state-hint { display: block; padding-top: 6px; color: var(--mut-3); }
/* The way out of an empty state: the action, then seeds worth trying. */
.state-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 13px; }
.state-lead { font-size: 10.5px; color: var(--mut-4); letter-spacing: 0.03em; margin-right: 1px; }
.state-btn {
  display: flex; align-items: center; height: 30px; padding: 0 13px;
  border: 1px solid #d6d9dc; border-radius: 5px; background: #fff;
  color: var(--ink-2); font-size: 12.5px; font-weight: 500;
}
.state-btn:hover { border-color: var(--mut-3); background: #fcfcfd; }
/* Both classes are one specificity apart from nothing, and .state-btn is written
   later, so the dark button restates its own background here. */
.state-btn.btn-dark { height: 30px; border-color: var(--ink); background: var(--ink); color: #fff; }
.state-btn.btn-dark:hover { background: #2c3136; border-color: #2c3136; }
.state-chip {
  height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 13px;
  background: #fbfbfc; color: var(--ink-3); font-size: 12px; font-family: var(--mono);
}
.state-chip:hover { border-color: var(--mut-3); color: var(--ink); background: #fff; }
.linkish.inline { font-size: inherit; color: var(--mut); }
.c-where { width: 86px; text-align: right; font-size: 11.5px; color: var(--mut); flex: none; }

/* ---------- paste a keyword list ---------- */
.addcard {
  margin: 14px 18px; padding: 13px 15px;
  border: 1px solid var(--line-soft); border-radius: 5px; background: var(--wash);
}
.addcard-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mut-2); padding-bottom: 10px;
}
.addcard-head .foot-note { text-transform: none; letter-spacing: 0; color: var(--mut-3); text-align: right; }
.addcard textarea {
  display: block; width: 100%; box-sizing: border-box; padding: 8px 10px; resize: vertical;
  border: 1px solid var(--line); border-radius: 4px; background: var(--card);
  font: 12.5px/1.6 var(--mono); color: var(--ink); outline: none;
}
.addcard textarea:focus { border-color: var(--mut-3); }
.addcard textarea::placeholder { color: var(--mut-3); }
.addfoot { display: flex; align-items: center; gap: 14px; padding-top: 10px; }
.addfoot .foot-note { color: var(--mut); }
.addfoot .foot-note b { color: var(--ink); font-weight: 500; }
.addfoot .foot-note .skip { color: var(--mut-3); }

/* ---------- optimize ---------- */
.optcard { margin: 14px 18px; padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 5px; background: var(--wash); }
.optcard-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mut-2); padding-bottom: 10px;
}
.optcard-head .foot-note { text-transform: none; letter-spacing: 0; color: var(--mut-3); }
.optfields { display: flex; flex-direction: column; gap: 8px; }
.optfield { display: flex; align-items: center; gap: 12px; }
.optlab {
  width: 146px; flex: none; white-space: nowrap; font-size: 10.5px; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--mut-2);
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.optlab i { font-style: normal; color: var(--mut-3); letter-spacing: 0; }
.optlab i.over { color: var(--neg); }
.optfield input {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--card);
  font: 12.5px/1 var(--mono); color: var(--ink); outline: none;
}
.optfield input:focus { border-color: var(--mut-3); }
.optfield input::placeholder { color: var(--mut-3); font-family: inherit; }

.optnote { margin: 0 18px 14px; font-size: 12px; color: var(--mut); }
.optnote.stale { color: var(--ink-3); }

.optscore { display: flex; gap: 42px; padding: 16px 18px 18px; border-bottom: 1px solid var(--line-soft); }
.optscore .val .arrow { color: var(--mut-3); font-size: 17px; padding: 0 2px; }
.optscore .val .dim { color: var(--mut-3); font-size: 15px; }

.optwarn {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 18px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
  border-bottom: 1px solid var(--line-faint);
}
.optwarn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mut-3); margin-top: 6px; flex: none; }
.optwarn.warn { background: #fdfbf7; }
.optwarn.warn .optwarn-dot { background: #b8763c; }
.optwarn.error { background: #fdf8f7; }
.optwarn.error .optwarn-dot { background: var(--neg); }
.optwarn.note { color: var(--mut); }

.optprop { border-bottom: 1px solid var(--line-soft); }
.optprop-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px;
  padding: 14px 18px 8px; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-2);
}
/* The label holds its width and the note wraps beside it. Without this the note
   squeezes "TITLE" to nothing and then runs over where it used to be. */
.optprop-head > span:first-child { flex: none; }
.optprop-head .foot-note {
  text-transform: none; letter-spacing: 0; color: var(--mut-3);
  min-width: 0; text-align: right;
}
.optopts { padding: 0 18px 12px; display: flex; flex-direction: column; gap: 3px; }
.optopt {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px;
  border: 1px solid transparent; border-radius: 4px; cursor: pointer;
}
.optopt:hover { background: var(--wash); }
.optopt.on { border-color: var(--line); background: #fafbfb; }
.optopt-box {
  width: 14px; height: 14px; flex: none; border: 1px solid #d0d4d8; border-radius: 50%;
  background: #fff; font-size: 9px; line-height: 12px; text-align: center; color: #fff;
}
.optopt.on .optopt-box { background: var(--ink); border-color: var(--ink); }
.optopt-body { flex: 1; min-width: 0; }
.optopt-text { font-size: 13.5px; color: var(--ink); }
.optopt.over .optopt-text { color: var(--mut); text-decoration: line-through; text-decoration-color: #d9b3a9; }
.optopt-why { font-size: 11.5px; color: var(--mut); padding-top: 2px; }
.optopt-offlist { font-size: 11.5px; color: #b8763c; padding-top: 2px; cursor: help; }
.optopt-len { font-size: 11px; color: var(--mut-3); flex: none; width: 46px; text-align: right; }
.optopt-len.over, .optopt.over .optopt-len { color: var(--neg); cursor: help; }
.optopt-val { font-size: 11.5px; flex: none; width: 40px; text-align: right; cursor: help; }
.optopt-val.pos { color: var(--pos); }
.optopt-val.neg { color: var(--neg); }
.optopt-val.dim { color: var(--mut-3); }

.optopts-foot { padding: 0 27px 12px; color: var(--mut-3); }
.optfinal { margin: 0 18px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px; }
.optfinal-str { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); word-break: break-all; min-height: 19px; }
.optfinal-foot { display: flex; align-items: baseline; gap: 14px; padding-top: 9px; }
.optfinal-foot .foot-note { color: var(--mut-3); flex: 1; min-width: 0; }

/* Play: the description is a box you read and write, not a line you paste */
.optfield-tall { align-items: start; }
.optfield-tall textarea {
  width: 100%; font: inherit; font-size: 13px; line-height: 1.65; color: var(--ink);
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
  resize: vertical; min-height: 96px; max-height: 340px;
}
.optfield-tall textarea:focus { outline: none; border-color: #c3c9cf; }

/* the mention quota: how often the body has to say each term, and how often it does */
.mentions { padding: 0 18px 10px; display: flex; flex-direction: column; gap: 1px; }
.mention { display: flex; align-items: center; gap: 10px; padding: 4px 9px; border-radius: 3px; cursor: help; }
.mention:hover { background: var(--wash); }
.mention-term { font-size: 13px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-bar { display: flex; gap: 2px; flex: none; width: 42px; }
.mention-bar i { width: 6px; height: 6px; border-radius: 50%; background: #e3e6e9; }
.mention-bar i.on { background: var(--pos); }
.mention.miss .mention-bar i { background: #f0dcd6; }
.mention-n { font-size: 11px; color: var(--mut-3); flex: none; width: 32px; text-align: right; }
.mention-say { font-size: 11.5px; color: var(--mut); flex: none; width: 150px; text-align: right; }
.mention.done .mention-say { color: var(--pos); }
.mention.miss .mention-say { color: var(--neg); }
.mention-none, .optbody-none { font-size: 12.5px; color: var(--mut); padding: 4px 9px; }
.mention-stuffed { font-size: 12px; color: var(--neg); padding: 6px 9px 2px; }
.optbody {
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
  max-height: 320px; overflow-y: auto; padding-right: 6px;
}
.optbody p { margin: 0 0 10px; }
.optbody p:last-child { margin-bottom: 0; }

/* score band: the headline number says how much of the ceiling is reached, and the
   word next to it says whether that's worth acting on */
.optscore .band { font-size: 11.5px; }
.optscore .band.weak { color: var(--neg); }
.optscore .band.mid { color: #b8763c; }
.optscore .band.good { color: var(--pos); }
.opthead-gap { padding-top: 4px; }

/* saved variants */
.vartable { display: flex; flex-direction: column; gap: 2px; }
.varrow {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 4px; font-size: 12.5px;
}
.varrow:hover { background: #fafbfb; }
.varrow.live { border-color: var(--line); background: #fafbfb; }
.varrow-name { width: 128px; flex: none; color: var(--ink); font-weight: 500; }
.varrow.live .varrow-name { font-weight: 400; }
.varrow-name .when { display: block; font-size: 10.5px; font-weight: 400; color: var(--mut-3); padding-top: 1px; }
.varrow-copy { flex: 1; min-width: 0; color: var(--ink-3); }
.varrow-copy .sub { color: var(--mut); }
.varrow-copy .none { color: var(--mut-3); }
.varrow-copy .field { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--mut-3); padding-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.varrow-score { width: 74px; flex: none; text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.varrow-score .d { font-size: 11px; padding-left: 5px; }
.varrow-score .d.pos { color: var(--pos); }
.varrow-score .d.neg { color: var(--neg); }
.varrow-score .d.dim { color: var(--mut-3); }
.varrow-cov { width: 78px; flex: none; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--mut); }
.varrow-act { width: 104px; flex: none; display: flex; justify-content: flex-end; gap: 10px; }
.varrow-act .linkish { font-size: 11.5px; }
.varrow-act .del:hover { color: var(--neg); }

/* coverage table */
.c-cov { width: 54px; text-align: center; flex: none; font-family: var(--mono); font-size: 12px; }
.cov-yes { color: var(--pos); }
.cov-no { color: var(--mut-3); }
#opt-rows .row.gained { background: #fafcfa; }
#opt-rows .row.lost { background: #fdfaf9; }
#opt-rows .c-term { font-size: 13px; }
#view-optimize .c-where { width: 116px; white-space: nowrap; }
.rankdelta { font-size: 11px; margin-left: 4px; }
.blockhead .spacer { flex: 1; }
/* Row internals of the Discover list, whose items are inline rather than flex. */
#typeahead .ta-sec { padding: 7px 10px 3px; font-family: var(--mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mut-3); cursor: default; }
#typeahead li img { width: 20px; height: 20px; border-radius: 5px; vertical-align: -5px; margin-right: 8px; }

@media (max-width: 700px) {
  .c-pop { width: 48px; }
  .c-diff { width: 72px; }
  .c-opp { width: 40px; }
  .c-rank { width: 40px; }
  .c-act { width: 36px; }
  #view-discover .c-diff { width: 36px; }
  .c-where, #view-optimize .c-where { display: none; }
  .c-cov { width: 44px; }
  .varrow { flex-wrap: wrap; }
  .varrow-act { width: auto; }
  .optfinal-foot, .optprop-head, .addfoot { flex-wrap: wrap; }
}

/* ---------- public legal pages ---------- */
.legal-page { max-width: 720px; margin: 18px auto 56px; padding: 0 16px; }
.legal-page .topbar { margin-bottom: 0; }
.legal-body {
  background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 6px 6px; padding: 32px 36px 40px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.legal-body h1 {
  font-size: 24px; font-weight: 500; letter-spacing: -0.03em; margin-bottom: 8px;
}
.legal-updated { font-size: 12px; color: var(--mut-2); margin-bottom: 22px; }
.legal-body h2 {
  font-size: 14px; font-weight: 600; margin: 22px 0 8px; letter-spacing: -0.01em;
}
.legal-body p, .legal-body li {
  font-size: 13.5px; color: var(--ink-3); line-height: 1.55; text-wrap: pretty;
}
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 12px; padding-left: 18px; }
.legal-body a { color: var(--ink); }
.legal-foot {
  display: flex; gap: 16px; padding: 18px 8px 0; font-size: 12px; color: var(--mut-3);
}
.legal-foot a { color: var(--mut-2); text-decoration: none; }
.legal-foot a:hover { color: var(--ink); }
@media (max-width: 700px) {
  .legal-page { margin: 8px auto 36px; padding: 0 max(12px, env(safe-area-inset-left)); }
  .legal-body { padding: 22px 16px 28px; }
}
