:root {
  /* surfaces */
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --line: #E4E9EF;
  --line-strong: #D3DBE4;

  /* text */
  --ink: #13212F;
  --text: #2B3A4A;
  --muted: #475666;
  --subtle: #5E6C7B;

  /* brand */
  --brand: #0089D6;
  --brand-hover: #0079BE;
  --brand-ink: #006BA8;
  --brand-soft: #E7F3FB;
  --orange: #FF9900;

  /* sidebar */
  --navy: #0B2A43;
  --navy-2: #133856;
  --nav-text: #C3D2DF;
  --nav-subtle: #8FA6BA;

  /* meaning */
  --important: #8A4B00; --important-bg: #FFF1DB; --important-dot: #E08600;
  --watch: #0B5F94;     --watch-bg: #E6F2FB;     --watch-dot: #0089D6;
  --fyi: #4A5868;       --fyi-bg: #EEF1F5;       --fyi-dot: #8A97A5;
  --ok: #17734B;        --ok-bg: #E3F4EA;
  --bad: #B42318;       --bad-bg: #FDECEA;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,33,48,0.06), 0 2px 6px rgba(16,33,48,0.04);
  --shadow-lg: 0 8px 28px rgba(16,33,48,0.16), 0 2px 6px rgba(16,33,48,0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Poppins', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; caret-color: var(--brand); -webkit-font-smoothing: antialiased; }
::selection { background: #CDE7F8; color: var(--ink); }
a { color: var(--brand-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
html { scrollbar-color: #C5CFDA transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C5CFDA; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@keyframes cwRise { from { opacity: .4; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes cwToast { from { opacity: 0; transform: translate(-50%, 10px) } to { opacity: 1; transform: translate(-50%, 0) } }
@keyframes cwArrive { from { background: #FFF6E6 } to { background: transparent } }

.app { display: flex; height: 100vh; min-height: 640px; overflow: hidden; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.num { font-variant-numeric: tabular-nums; }
.screen { animation: cwRise .35s var(--ease); }

/* ---------- sidebar ---------- */
.sidebar { width: 240px; flex: none; display: flex; flex-direction: column; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 18px 18px; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
.brand-mark span { width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.brand-mark span::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.brand-name { font-size: 15px; font-weight: 600; line-height: 1.2; color: #fff; }
.brand-by { font-size: 11px; color: var(--nav-subtle); }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { border: none; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; padding: 7px 16px; }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16,33,48,0.12); }
.sidebar .segmented { margin: 0 14px 14px; background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.08); }
.sidebar .segmented button { flex: 1; color: var(--nav-text); font-size: 12.5px; padding: 6px 0; }
.sidebar .segmented button:hover { color: #fff; }
.sidebar .segmented button.active { background: #fff; color: var(--navy); }

.nav-label { padding: 10px 26px 6px; font-size: 11.5px; font-weight: 500; color: var(--nav-subtle); }
.nav-label.spaced { padding-top: 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px; border: none; background: transparent; color: var(--nav-text); font-size: 14px; font-weight: 500; border-radius: 8px; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.12); color: #fff; font-weight: 600; }
.nav-item svg { flex: none; opacity: .85; }
.nav-item.active svg { opacity: 1; }
.nav-item:focus-visible { outline-color: #fff; }
.count { margin-left: auto; font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 0 8px; line-height: 20px; }
.count.orange { background: var(--orange); color: #2A1700; }
.count.blue { background: rgba(255,255,255,0.14); color: #fff; }
.count.red { background: #F04438; color: #fff; }

.user-card { margin: auto 12px 14px; display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.06); }
.user-card .who { min-width: 0; line-height: 1.3; }
.user-card .name { font-size: 13px; font-weight: 600; color: #fff; }
.user-card .role { font-size: 11.5px; color: var(--nav-subtle); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar { flex: none; display: flex; align-items: center; justify-content: center; font-weight: 600; width: 36px; height: 36px; border-radius: 8px; font-size: 12.5px; letter-spacing: .3px; }
.avatar.s30 { width: 30px; height: 30px; border-radius: 7px; font-size: 11px; }
.avatar.s34 { width: 34px; height: 34px; font-size: 12.5px; }
.avatar.s40 { width: 40px; height: 40px; font-size: 13.5px; }
.avatar.s56 { width: 56px; height: 56px; border-radius: 12px; font-size: 19px; }
.avatar.brand { background: var(--brand); color: #fff; }

/* ---------- main / header ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex: none; display: flex; align-items: flex-end; gap: 18px; padding: 26px 36px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.subtitle { font-size: 13.5px; color: var(--subtle); margin-top: 3px; }
.today { margin-left: auto; font-size: 13px; color: var(--subtle); white-space: nowrap; padding-bottom: 2px; }
.content { flex: 1; overflow-y: auto; padding: 28px 36px 64px; }

/* ---------- shared blocks ---------- */
.stack { display: flex; flex-direction: column; gap: 24px; }
.card { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card.pad { padding: 22px 24px; }
.card.clip { overflow: hidden; }
.section-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.panel-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.hint { font-size: 13.5px; color: var(--subtle); }
.hint.sm { font-size: 13px; }
.link-btn { font-size: 13px; font-weight: 500; color: var(--brand-ink); background: none; border: none; padding: 0; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.tiles { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; border-radius: 5px; padding: 1px 7px; white-space: nowrap; line-height: 18px; }
.time { font-size: 12px; color: var(--subtle); margin-left: auto; white-space: nowrap; }
.priority { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 2px 10px 2px 8px; white-space: nowrap; line-height: 18px; }
.priority .dot { width: 7px; height: 7px; }

.source-logo { flex: none; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; }
.source-logo img { width: 18px; height: 18px; border-radius: 3px; }

/* ---------- dashboard ---------- */
.summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.summary > div { padding: 22px 26px; }
.summary > div + div { border-left: 1px solid var(--line); }
.summary .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.summary .value { font-size: 32px; font-weight: 600; color: var(--ink); line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.summary .note { font-size: 13px; color: var(--subtle); margin-top: 4px; }
.summary .attention .value { color: var(--important); }
.summary .attention .label { color: var(--important); }

.panel { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; gap: 10px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.panel-head .hint { font-size: 12.5px; }
.panel-head .link-btn { margin-left: auto; }
.panel-body { flex: 1; max-height: 640px; overflow-y: auto; }
.row { display: flex; gap: 14px; width: 100%; padding: 16px 22px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; }
.row:last-child { border-bottom: none; }
button.row:hover { background: var(--surface-2); }
.row.fresh { animation: cwArrive 2.4s var(--ease); }
.row .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.row .who { font-size: 13px; font-weight: 600; color: var(--ink); }
.row .headline { font-size: 14px; color: var(--text); line-height: 1.45; }
.row .foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12.5px; color: var(--subtle); }
.row .foot a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.wk-chart { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 12px; height: 210px; margin-top: 20px; }
.wk { display: flex; flex-direction: column; min-width: 0; }
.wk-plot { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--line-strong); }
.wk-count { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.wk-bar { width: min(52px, 72%); min-height: 2px; background: #A9D3EF; border-radius: 4px 4px 0 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.wk.now .wk-bar { background: var(--brand); }
.wk.now .wk-count { color: var(--ink); font-weight: 600; }
.wk-high { background: #E08600; }
.wk-label { font-size: 12px; color: var(--subtle); text-align: center; margin-top: 8px; line-height: 1.3; }
.wk.now .wk-label { color: var(--ink); font-weight: 600; }

/* ---------- feed ---------- */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-row.last { margin-bottom: 22px; }
.filter-row .label { font-size: 13px; font-weight: 500; color: var(--muted); margin-right: 4px; min-width: 76px; }
.filter-row .total { margin-left: auto; font-size: 13px; color: var(--subtle); }
.chip { font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); transition: border-color .15s, background .15s; }
.chip:hover { border-color: #AEBBC9; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.feed { display: flex; flex-direction: column; max-width: 960px; }
.feed .row { padding: 20px 24px; }
.feed .row .who { font-size: 13.5px; }
.feed .row .headline { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.4; margin: 2px 0 4px; }
.feed .row .detail { font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 70ch; }
.empty { text-align: center; padding: 44px 24px; color: var(--subtle); font-size: 14px; }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }

/* ---------- forms ---------- */
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field .help { font-size: 12.5px; color: var(--subtle); margin-top: 6px; }
.input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #8391A0; }
.input:hover { border-color: #AEBBC9; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,137,214,0.18); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; border-radius: 8px; padding: 10px 18px; border: 1px solid transparent; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn.primary { color: #fff; background: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.ghost, .btn.soft { font-weight: 500; color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.btn.ghost:hover, .btn.soft:hover { background: var(--surface-2); border-color: #AEBBC9; }
.btn.sm { font-size: 13px; padding: 8px 14px; }

/* ---------- industries ---------- */
.add-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 28px; }
.add-bar .field { flex: 1; min-width: 240px; }
.industry-card { padding: 20px 22px; display: flex; flex-direction: column; }
.industry-card .head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.industry-card .mark { width: 10px; height: 10px; flex: none; border-radius: 3px; margin-top: 6px; }
.industry-card .name { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.industry-card .sub { font-size: 12.5px; color: var(--subtle); }
.industry-card .blurb { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 18px; flex: 1; }
.follow-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--brand); background: var(--surface); color: var(--brand-ink); transition: background .15s; }
.follow-btn:hover { background: var(--brand-soft); }
.follow-btn.on { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.follow-btn.on:hover { background: var(--bad-bg); color: var(--bad); }
.follow-btn.on:hover .on-label { display: none; }
.follow-btn .off-label { display: none; }
.follow-btn.on:hover .off-label { display: inline; }

/* ---------- profile ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-head .name { font-size: 18px; font-weight: 600; color: var(--ink); }
.plan-pill { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ok); background: var(--ok-bg); border-radius: 20px; padding: 3px 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.day-picker { display: flex; }
.day-picker .chip { flex: 1; border-radius: 0; padding: 9px 0; margin-left: -1px; }
.day-picker .chip:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.day-picker .chip:last-child { border-radius: 0 8px 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.interest { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; border-radius: 20px; padding: 5px 13px; }
.chip.dashed { color: var(--brand-ink); border-style: dashed; border-color: #8CC3E6; }

/* ---------- competitors ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.add-panel { padding: 24px; margin-bottom: 24px; }
.add-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.scan { margin-top: 22px; padding: 18px 20px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.scan-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.scan-steps { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.scan-step { display: flex; align-items: center; gap: 11px; font-size: 13.5px; color: #8391A0; }
.scan-step .tick { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; }
.scan-step.done { color: var(--text); }
.scan-step.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.scan-step.active { color: var(--ink); font-weight: 500; }
.scan-step.active .tick { border-color: var(--brand); border-top-color: transparent; animation: cwSpin .8s linear infinite; }
@keyframes cwSpin { to { transform: rotate(360deg) } }
.competitor-card { padding: 20px 22px; display: flex; flex-direction: column; }
.competitor-card .head { display: flex; align-items: center; gap: 13px; }
.competitor-card .name { font-size: 15px; font-weight: 600; color: var(--ink); }
.competitor-card .domain { font-size: 12.5px; color: var(--subtle); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 2px 10px 2px 8px; white-space: nowrap; }
.status-pill .dot { width: 7px; height: 7px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 18px 0 16px; border: 1px solid var(--line); border-radius: 8px; }
.metrics > div { padding: 10px 12px; }
.metrics > div + div { border-left: 1px solid var(--line); }
.metrics .v { font-size: 18px; font-weight: 600; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.metrics .v.sm { font-size: 13.5px; font-weight: 500; line-height: 1.6; }
.metrics .k { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.keywords { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; flex: 1; align-content: flex-start; }
.keywords .label { font-size: 12.5px; color: var(--subtle); margin-right: 2px; }
.keywords span:not(.label) { font-size: 12.5px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 9px; }

/* ---------- reports ---------- */
.report { padding: 30px 32px; margin-bottom: 24px; }
.report .top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.report h2 { font-size: 24px; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.3; }
.report .for { text-align: right; font-size: 13px; color: var(--subtle); }
.report .for strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 26px; border-top: 1px solid var(--line); }
.report-stats > div { padding: 18px 20px 4px 0; }
.report-stats > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.report-stats .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.report-stats .value { font-size: 30px; font-weight: 600; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.report-stats .attention .label, .report-stats .attention .value { color: var(--important); }
.bars { display: flex; flex-direction: column; gap: 15px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
.bar-label span:last-child { color: var(--subtle); white-space: nowrap; }
.bar { height: 8px; border-radius: 4px; background: #EDF1F5; overflow: hidden; display: flex; }
.bar div { height: 100%; }
.highlight { display: flex; align-items: center; gap: 16px; padding: 15px 24px; border-bottom: 1px solid var(--line); }
.highlight:last-child { border-bottom: none; }
.highlight .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--ink); }
.highlight .headline { font-size: 14px; color: var(--text); line-height: 1.45; }
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; color: var(--ink); }

/* ---------- admin ---------- */
.banner { padding: 14px 18px; border-radius: var(--radius); background: var(--important-bg); display: flex; align-items: center; gap: 12px; margin-bottom: 24px; font-size: 14px; color: #5C3300; }
.banner strong { color: var(--important); }
.stat { padding: 18px 20px; }
.stat .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 600; color: var(--ink); margin-top: 4px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.table-head, .table-row { display: grid; gap: 12px; padding: 12px 22px; }
.table-head { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table-row { padding: 13px 22px; font-size: 13.5px; border-bottom: 1px solid var(--line); align-items: center; color: var(--text); }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--surface-2); }
.table-row .soft { color: var(--subtle); font-size: 13px; }
.cols-runs { grid-template-columns: 1.1fr 2fr 0.8fr 0.9fr 1.1fr; }
.cols-clients { grid-template-columns: 2fr 1fr 0.9fr 0.6fr 0.75fr 0.85fr 0.9fr 0.9fr; }
.cols-comp { grid-template-columns: 2fr 1.3fr 0.6fr 0.9fr 0.9fr 1.1fr; }
.cols-feeds { grid-template-columns: 2fr 1.4fr 0.6fr; }
.table-row.off > *:not(.status) { opacity: .6; }
button.client-cell { border: none; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; }
button.client-cell .ellipsis { font-weight: 600; }
button.client-cell:hover .ellipsis { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin: 26px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; border: none; background: none; padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.cols-sources { grid-template-columns: 1.6fr 1.4fr 0.9fr 0.9fr 1fr; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.client-cell > div:last-child { min-width: 0; line-height: 1.35; }
.client-cell .owner { font-size: 12.5px; color: var(--subtle); }
.failing-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.failing-row .src { font-size: 14px; font-weight: 600; color: var(--ink); }
.failing-row .err { font-size: 13px; color: var(--subtle); margin-top: 2px; }
.failing-row .since { font-size: 13px; font-weight: 500; color: var(--bad); white-space: nowrap; }

/* ---------- industries: sources, leaders, admin management ---------- */
.switch { flex: none; position: relative; width: 38px; height: 22px; border-radius: 11px; border: none; padding: 0; background: #C5CFDA; transition: background .2s var(--ease); }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,33,48,0.25); transition: transform .2s var(--ease); }
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(16px); }
.switch:hover { filter: brightness(0.95); }
.switch-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--text); }
.row-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; align-self: center; }
.row .sub { font-size: 12.5px; color: var(--subtle); margin-top: 2px; }
.row .sub a { color: var(--subtle); text-decoration: underline; text-decoration-color: var(--line-strong); }
.row .sub a:hover { color: var(--brand-ink); }
.row .latest { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 70ch; overflow-wrap: anywhere; }
.row .err { font-size: 12.5px; color: var(--bad); margin-top: 6px; }
.row.off .who, .row.off .sub { opacity: .6; }
.story-link { color: inherit; }
.story-link:hover { color: var(--brand-ink); }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.section-head .btn { margin-left: auto; align-self: center; }
.group-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 4px 0; font-size: 13.5px; font-weight: 500; color: var(--brand-ink); }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.banner.info { background: var(--brand-soft); color: var(--text); }
.banner.info svg { color: var(--brand); flex: none; }
.card-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.link-btn.danger { color: var(--bad); }
.cell-link { display: inline-flex; align-items: center; gap: 9px; border: none; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; min-width: 0; }
.cell-link:hover { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.cell-link.soft { font-weight: 400; color: var(--subtle); }
.cell-link .mark { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cols-ind { grid-template-columns: 2.4fr 0.8fr 0.7fr 0.7fr 0.8fr 1fr 1fr; }
.form-panel { padding: 22px 24px; margin-bottom: 16px; }
/* An edit form shown in place of a list row sits flush inside the list's card. */
.card .card.form-panel { margin: 0; border: none; border-radius: 0; box-shadow: none; background: var(--surface-2); border-bottom: 1px solid var(--line); }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.5; }
select.input { appearance: auto; }
button.interest { border: none; cursor: pointer; }
.industry-card .card-actions { margin-top: auto; }

/* ---------- sign-in and password pages ---------- */
.signout { margin-left: auto; flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--nav-text); }
.signout:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 0.9fr) 1.1fr; }
.auth-brand { background: var(--navy); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; }
.auth-pitch { margin: auto 0; max-width: 30rem; }
.auth-pitch h2 { font-size: 30px; font-weight: 600; line-height: 1.25; margin: 0 0 14px; letter-spacing: -0.01em; text-wrap: balance; }
.auth-pitch p { font-size: 15px; line-height: 1.6; color: var(--nav-text); margin: 0; }
.auth-foot { font-size: 12.5px; color: var(--nav-subtle); margin: 0; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 32px; }
.auth-card h1 { font-size: 22px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.auth-card > .hint { margin: 0 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { width: 100%; padding: 11px 18px; margin-top: 4px; }
.auth-help { font-size: 13px; color: var(--subtle); margin: 22px 0 0; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.alert { padding: 11px 14px; border-radius: 8px; font-size: 13.5px; line-height: 1.5; margin-bottom: 18px; }
.alert.error { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }

.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.label-row label { margin: 0; }
.label-row a { font-size: 13px; font-weight: 500; }
a.on-dark { color: #9FD3F5; font-weight: 500; }
a.on-dark:hover { color: #fff; }
.code-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.resend .link-btn { font-size: inherit; }

.plans-admin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.plan-edit.featured { border: 2px solid var(--brand); }
.plan-edit textarea.input { min-height: 72px; }
.plan-edit textarea[id$="-features"] { min-height: 150px; }
.email-body { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.55; color: var(--text); white-space: pre-wrap; max-height: 260px; overflow: auto; }
.banner code { font-size: 12.5px; background: rgba(255,255,255,0.6); padding: 1px 5px; border-radius: 4px; }

/* ---------- public site: landing, pricing, register ---------- */
body.public { background: var(--surface); }
.site-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.site-head { background: var(--navy); }
.site-head .site-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a:not(.btn) { color: var(--nav-text); font-size: 14px; font-weight: 500; }
.site-nav a:not(.btn):hover { color: #fff; text-decoration: none; }
.hero { padding: 64px 0 56px; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; font-weight: 600; color: var(--ink); margin: 0 0 18px; letter-spacing: -0.02em; text-wrap: balance; }
.hero .lead { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 26px; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 16px 18px 16px 58px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; line-height: 1.5; color: var(--muted); }
.steps li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.steps strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.pricing { padding: 56px 0 72px; background: var(--bg); }
.pricing h1, .pricing h2 { font-size: 28px; font-weight: 600; color: var(--ink); margin: 0; letter-spacing: -0.01em; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 28px 26px; }
.plan-card.featured { border: 2px solid var(--brand); padding: 27px 25px; }
.plan-flag { position: absolute; top: -12px; left: 24px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 2px 12px; }
.plan-name { font-size: 18px; font-weight: 600; color: var(--ink); }
.plan-tagline { font-size: 14px; color: var(--subtle); margin-top: 4px; min-height: 42px; line-height: 1.5; }
.plan-price { margin: 18px 0 14px; display: flex; align-items: baseline; gap: 6px; }
.plan-price .amount { font-size: 34px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-price .per { font-size: 14px; color: var(--subtle); }
.plan-limits { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.plan-limits span { font-size: 12.5px; font-weight: 600; color: var(--watch); background: var(--watch-bg); border-radius: 20px; padding: 3px 11px; }
.plan-features { list-style: none; margin: 0 0 24px; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-features li { position: relative; padding-left: 26px; font-size: 14px; line-height: 1.45; color: var(--text); }
.plan-features li::before { content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317734B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat; }
.plan-card .btn { width: 100%; }
/* On the register form each card is a radio button. */
label.plan-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
label.plan-card:hover { border-color: #AEBBC9; }
/* While choosing, only the selected card is outlined; "Most popular" keeps just its flag. */
label.plan-card.featured:not(:has(input:checked)) { border: 1px solid var(--line); padding: 28px 26px; }
label.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
label.plan-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
label.plan-card:has(input:checked) { border: 2px solid var(--brand); padding: 27px 25px; box-shadow: 0 0 0 4px rgba(0,137,214,0.12), var(--shadow); }
.plan-choose { display: flex; align-items: center; justify-content: center; border-radius: 8px; padding: 10px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--text); }
.plan-choose .when-on { display: none; }
label.plan-card:has(input:checked) .plan-choose { background: var(--brand); border-color: var(--brand); color: #fff; }
label.plan-card:has(input:checked) .when-on { display: inline; }
label.plan-card:has(input:checked) .when-off { display: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset legend { padding: 0; margin-bottom: 18px; }
.plan-picker { margin-bottom: 32px; }
.register-form { padding: 26px 28px; max-width: 760px; }
.register-form legend { float: left; width: 100%; }
.register-form .form-grid { clear: both; }
.honey { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.site-foot { padding: 22px 0; font-size: 13px; color: var(--subtle); background: var(--bg); border-top: 1px solid var(--line); }
.plan-usage { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--subtle); }
.plan-usage strong { color: var(--ink); font-weight: 600; }
.plan-usage .full { color: var(--important); font-weight: 600; }

/* ---------- toast / states ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 11px; padding: 12px 18px 12px 14px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); animation: cwToast .3s var(--ease); }
.toast .icon { width: 22px; height: 22px; flex: none; border-radius: 50%; background: #2E9E6B; display: flex; align-items: center; justify-content: center; color: #fff; }
.toast.error .icon { background: #E5483B; }
.state-msg { max-width: 520px; margin: 80px auto; text-align: center; color: var(--subtle); line-height: 1.6; }
.state-msg strong { color: var(--ink); }
.state-msg code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--ink); background: var(--fyi-bg); padding: 2px 6px; border-radius: 5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1100px) {
  .plans-admin { grid-template-columns: 1fr; max-width: 640px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4, .report-stats { grid-template-columns: 1fr 1fr; }
  .report-stats > div:nth-child(3) { padding-left: 0; border-left: none; }
  .content { padding: 24px 24px 56px; }
  .topbar { padding: 22px 24px 18px; }
}

/* Phones: the sidebar becomes a top bar with a scrolling nav row; the page scrolls as a whole. */
@media (max-width: 760px) {
  .app { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { width: auto; }
  .brand { padding: 14px 16px 12px; }
  .sidebar .segmented { margin: 0 16px 10px; }
  .nav-label { display: none; }
  .user-card { margin: 0 16px 12px; padding: 8px 10px; }
  .auth { grid-template-columns: 1fr; }
  .site-wrap { padding: 0 16px; }
  .site-nav { gap: 14px; }
  .site-nav a { white-space: nowrap; }
  .site-head .brand-by { display: none; }
  .site-nav a[href$="#pricing"] { display: none; }
  .hero { padding: 36px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .pricing { padding: 36px 0 48px; }
  .plans { grid-template-columns: 1fr; gap: 24px; }
  .plan-tagline { min-height: 0; }
  .register-form { padding: 20px; }
  .auth-brand { padding: 22px 20px; }
  .auth-pitch { margin: 22px 0 0; }
  .auth-pitch h2 { font-size: 22px; }
  .auth-foot { display: none; }
  .auth-panel { padding: 24px 16px 40px; align-items: flex-start; }
  .auth-card { padding: 24px 20px; }
  .sidebar { flex-direction: column; }
  .navs { display: flex; overflow-x: auto; scrollbar-width: none; padding: 0 10px 10px; }
  .navs::-webkit-scrollbar { display: none; }
  .nav { flex-direction: row; padding: 0 2px; }
  .nav-item { width: auto; flex: none; white-space: nowrap; padding: 8px 12px; }
  .main { overflow: visible; }
  .topbar { padding: 18px 16px 14px; }
  .topbar h1 { font-size: 20px; }
  .today { display: none; }
  .content { overflow: visible; padding: 18px 16px 48px; }
  .grid-4, .form-grid, .add-grid, .tiles { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .summary > div { padding: 16px 18px; }
  .summary > div + div { border-left: none; border-top: 1px solid var(--line); }
  .summary .value { font-size: 26px; }
  .report { padding: 20px; }
  .report .for { text-align: left; }
  .report-stats { grid-template-columns: 1fr 1fr; }
  .report-stats > div { padding-right: 12px; }
  .report-stats .value { font-size: 24px; }
  .card.clip { overflow-x: auto; }
  .table-head, .table-row { min-width: 640px; }
  .row, .feed .row { padding: 16px; }
  .panel-head { flex-wrap: wrap; padding: 16px; }
  .panel-body { max-height: none; }
  .wk-chart { gap: 4px; height: 180px; }
  .wk-label { font-size: 10.5px; }
  .filter-row .label { min-width: 0; width: 100%; }
  .failing-row { flex-wrap: wrap; }
  .row { flex-wrap: wrap; }
  .row-controls { width: 100%; justify-content: flex-start; padding-left: 50px; }
  .section-head .btn { margin-left: 0; }
  .highlight { padding: 14px 16px; flex-wrap: wrap; }
}

/* "Print or save as PDF" prints the report; keep only the report content. */
@media print {
  body { background: #fff; }
  body, .app { height: auto; overflow: visible; }
  .sidebar, .topbar, .no-print, .toast { display: none !important; }
  .main, .content { overflow: visible; padding: 0; }
  .app { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
