/* Dashboard additions on top of /assets/styles.css (same tokens). */
:root { --amber-bg: rgba(255, 176, 32, .14); --red-bg: rgba(255, 61, 90, .10); --gray-bg: rgba(154, 163, 181, .14); }
body.app, body.auth { font-size: 16px; }
.small { font-size: .88rem; }
.tiny { font-size: .78rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.break { word-break: break-all; }
.h3 { font-size: 1.15rem; }
.h4 { font-size: 1rem; margin-top: 1.2em; }
.inline { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.linkish:hover { color: var(--text); }
.wide { width: 100%; }
.error { color: #ff8a9b; background: var(--red-bg); border: 1px solid rgba(255, 61, 90, .35); padding: 10px 14px; border-radius: 10px; }
.ok-text { color: var(--ok); }
.flash { background: rgba(46, 204, 143, .12); border: 1px solid rgba(46, 204, 143, .4); padding: 10px 16px; border-radius: 10px; margin-bottom: 18px; }
.demo-bar { background: var(--amber-bg); border-bottom: 1px solid rgba(255, 176, 32, .35); text-align: center; padding: 8px 16px; font-size: .9rem; }
.demo-bar.warn { background: var(--red-bg); border-color: rgba(255, 61, 90, .35); }

/* Auth */
.auth-main { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.9rem; }
.nav.open-inline { display: flex; }
@media (max-width: 1000px) { .nav.open-inline { display: none; } }
.or { text-align: center; color: var(--muted); margin: 18px 0; position: relative; }
.or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.or span { position: relative; background: var(--card); padding: 0 10px; }

/* Forms */
.form { display: grid; gap: 14px; margin: 16px 0; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.form .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type="checkbox"] { width: auto; margin-top: 4px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
button.btn { cursor: pointer; font: inherit; font-weight: 600; }
button.btn.small { font-size: .9rem; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.btn.danger { color: #ff8a9b; }
.btn.danger-solid { background: #b3122c; border-color: #b3122c; }

/* Shell */
.app-main { padding-top: 28px; padding-bottom: 60px; }
.app-main section { margin-bottom: 22px; }
.app-main section:not(.card) { padding: 0; }
.app-main > section:not(.card) { margin-top: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin-bottom: .2em; }
.page-head p { margin: 0 0 .3em; }
.crumbs { margin: 0 0 4px; font-size: .9rem; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.actions form { margin: 0; }
.actions.stack { margin-top: 18px; }
.app-foot { display: flex; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 30px; }
.app-foot a { color: var(--muted); }
.split { margin-bottom: 22px; align-items: start; }
.app-main .grid { gap: 16px; }

/* Tiles */
.tiles { margin-bottom: 22px; }
.tile { display: grid; gap: 4px; padding: 18px 20px; }
.tile-label { color: var(--muted); font-size: .85rem; }
.tile-num { font-family: var(--display); font-size: 2.3rem; font-weight: 700; line-height: 1.1; }
.tile-num small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.tile-hot { border-color: rgba(255, 61, 90, .6); background: linear-gradient(180deg, rgba(255, 61, 90, .10), var(--card)); }
.tile-hot .tile-num, .hot-text { color: var(--accent); }

/* Pills */
.pill.amber { background: var(--amber-bg); color: var(--accent-2); }
.pill.gray { background: var(--gray-bg); color: var(--muted); }
.pill { margin: 2px 4px 2px 0; white-space: nowrap; }

/* Tables (stack into cards on phones) */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 700px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; background: var(--card); }
  table.data td { border: 0; padding: 6px 12px; }
  table.data td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
}

/* Filters */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type="search"] { max-width: 300px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .9rem; }
.tabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Chart (single series, so no legend; the title names it) */
.chart { width: 100%; height: auto; display: block; }
.chart .bar rect:not(.hit) { fill: var(--accent); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover rect:not(.hit) { fill: #ff7086; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }

.toplist, .msglist { margin: 0; padding-left: 1.2em; }
.msglist { list-style: none; padding: 0; }
.toplist li, .msglist li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.toplist li:last-child, .msglist li:last-child { border-bottom: 0; }
.toplist li span { display: block; }

/* Transcript */
.transcript { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.transcript li { padding: 10px 14px; border-radius: 14px; max-width: 92%; }
.transcript li p { margin: 2px 0 0; }
.transcript li.caller { background: #2a1d22; }
.transcript li.ai { background: #1d2a26; margin-left: auto; }
.transcript li.dnc_demand { outline: 2px solid var(--accent-2); }
.transcript .who { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.transcript .ts { opacity: .7; margin-left: 6px; font-family: ui-monospace, monospace; }
.tagline { display: block; color: var(--accent-2); font-size: .8rem; font-weight: 700; }
audio { width: 100%; margin-bottom: 10px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; }
@media (max-width: 500px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }

/* Offender timeline */
.timeline { list-style: none; padding: 0 0 0 18px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid var(--bg); }
.timeline li.dnc::before { background: var(--accent-2); }
.timeline li.after::before { background: var(--accent); }
.timeline li > span { display: block; }
.actions-card .links { padding-left: 1.1em; }
.actions-card .links li { margin-bottom: 6px; }
.copybox { font-family: ui-monospace, monospace; font-size: .8rem; margin: 8px 0; }
.inline-form { grid-template-columns: 1fr 1fr; align-items: end; border-top: 1px solid var(--line); padding-top: 12px; }
.inline-form p, .inline-form button { grid-column: 1 / -1; margin: 0; }
.inline-form button { justify-self: start; }
.legal h3 { font-size: 1.05rem; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }
details.more { background: none; border: 0; padding: 0; margin: 14px 0 22px; }
.blocklist { list-style: none; padding: 0; }
.blocklist li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blocklist form { margin: 0; }
.danger-zone { border-color: rgba(255, 61, 90, .35); }
.danger-zone .form { max-width: 360px; }

/* Printable evidence log and letter: light paper look on screen and in print */
body.report { background: #e9ebef; color: #111; font-size: 14px; }
.report-tools { max-width: 900px; margin: 16px auto; padding: 0 16px; color: #333; }
.report-tools a { color: #0b57d0; }
.sheet { background: #fff; color: #111; max-width: 900px; margin: 0 auto 40px; padding: 40px 44px; box-shadow: 0 2px 16px rgba(0,0,0,.12); }
.sheet h1 { font-size: 1.6rem; margin: 0; color: #111; }
.sheet h2 { font-size: 1.1rem; margin: 26px 0 8px; border-bottom: 2px solid #111; padding-bottom: 4px; color: #111; }
.sheet h3 { font-size: .95rem; margin: 18px 0 4px; color: #111; }
.sheet-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid #ff3d5a; padding-bottom: 12px; margin-bottom: 16px; }
.brandline { color: #ff3d5a; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.sheet .meta { text-align: right; color: #444; }
.sheet table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.sheet th, .sheet td { border: 1px solid #c9ccd3; padding: 6px 8px; text-align: left; vertical-align: top; }
.sheet th { background: #f2f3f5; font-weight: 600; }
.sheet .log tr.after td { background: #fff1f3; }
.sheet .txt td { border: 0; border-bottom: 1px solid #eee; padding: 3px 6px; }
.sheet .txt tr.dnc_demand td { background: #fff6dd; }
.sheet .tx { break-inside: avoid-page; }
.sheet.letter { font-size: 15px; line-height: 1.6; outline: none; }
.sheet.letter:focus { box-shadow: 0 0 0 3px #ffb020; }
@media print {
  body.report { background: #fff; }
  .noprint { display: none; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .sheet .log tr { break-inside: avoid; }
}
@media (max-width: 640px) { .sheet { padding: 20px 16px; } .sheet-head { flex-direction: column; } .sheet .meta { text-align: left; } .sheet table { font-size: 12px; } }

/* Defender picker (Settings) */
.defender-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.defender-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 400; }
.defender-list label > span:nth-child(2) { flex: 1; }
.defender-list input { width: auto; flex: none; margin: 0; }
.defender-list input:checked + span b { color: var(--accent-2, inherit); }
.defender-list li:has(input:checked) label { border-color: var(--accent-2, currentColor); }
.defender-list .play { opacity: .5; }
.defender-list li.is-playing .play { opacity: 1; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.defender-form [hidden] { display: none !important; }

/* Plan picker on Settings > Subscription */
.plan-picks { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.plan-picks form { margin: 0; }
#billing form + form { margin-top: 8px; }

/* Contacts allowlist */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.inline-search input { flex: 1 1 160px; }
[data-contacts-form] textarea { width: 100%; font: inherit; }

/* Add-to-Home-Screen tip (iPhone Safari only, shown by app.js) */
.install-tip { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center; text-align: center; padding: 10px 16px; font-size: .9rem; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.install-tip[hidden] { display: none; }
.steps { padding-left: 1.2em; margin: 0 0 12px; }
.steps li { margin: 6px 0; }
