/* app.css — the logged-in product + live scan surfaces.
   Builds on base.css (tokens, header, buttons). Amber marks data and the
   user's own position; positive verdicts are filled ink on light surfaces
   and amber phosphor on dark panels; red is error/degraded only. */

.plan-usage { font-size: 12.5px; color: var(--faint); align-self: center; }
.plan-usage a { color: var(--muted); }
.upgrade-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- scan page: stage rail + live feed ---------- */
.scan-shell { display: grid; grid-template-columns: 290px 1fr; gap: 36px; margin: 40px 0 20px; align-items: start; }
.rail { list-style: none; }
.rail li {
	display: flex; align-items: center; gap: 14px;
	padding: 15px 4px; border-bottom: 1px solid var(--line);
	font-weight: 600; font-size: 15px; color: var(--faint);
	transition: color 0.2s;
}
.rail li b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--faint); margin-right: 6px; transition: color 0.2s; }
.rail li i { width: 13px; height: 13px; border: 2px solid var(--line2); border-radius: 50%; flex: none; transition: all 0.2s; }
.rail li em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--faint); }
.rail li.active { color: var(--ink); }
.rail li.active b { color: var(--sig); }
.rail li.active i { border-color: var(--sig); background: var(--sig); animation: pulse 0.9s infinite alternate; }
.rail li.done { color: var(--muted); }
.rail li.done i { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--bg); }

.feed {
	background: var(--panel); color: var(--pdim);
	border: 1px solid var(--panel); border-radius: 14px;
	padding: 24px 26px; min-height: 320px;
}
.feed .bar { display: flex; gap: 6px; margin-bottom: 18px; align-items: center; }
.feed .bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--pline2); display: block; }
.feed .bar i:first-child { background: var(--sig-bright); }
.feed .bar span { margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pfaint); font-weight: 500; }
.progress-log { display: flex; flex-direction: column; max-height: 430px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--pline2) transparent; }
.progress-log .entry {
	padding: 9px 0 9px 22px; font-size: 14.5px; position: relative; font-family: var(--mono);
	border-top: 1px solid var(--pline);
	animation: enter 0.35s ease-out;
}
.progress-log .entry::before { content: "→"; position: absolute; left: 0; color: var(--sig-bright); }
.progress-log .entry:first-child { color: #fff; border-top: none; }
.frow {
	display: flex; gap: 13px; align-items: flex-start;
	padding: 10px 0; border-top: 1px solid var(--pline);
	font-size: 14px; font-family: var(--mono); color: var(--pdim);
	animation: enter 0.3s ease-out;
}
.frow:first-child { border-top: none; }
.fbody { flex: 1; min-width: 0; }
.marker {
	flex: none; width: 17px; height: 17px; margin-top: 4px;
	border: 2px solid var(--pline2); border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
}
.marker.m-live { border-color: var(--sig-bright); animation: pulse 0.9s infinite alternate; }
.marker.m-done { background: var(--sig-bright); border-color: var(--sig-bright); }
.marker.m-done svg { width: 11px; height: 11px; display: block; }
.marker.m-done svg path {
	fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round;
	stroke-dasharray: 16; stroke-dashoffset: 16;
	animation: draw 0.3s 0.04s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.frow.card .fbody { background: rgba(250, 250, 249, 0.06); border: 1px solid var(--pline); border-radius: 10px; padding: 11px 15px; color: #fafaf9; font-family: var(--sans); }
.frow.card small { display: block; font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sig-bright); margin-bottom: 4px; }
.frow.verdict .fbody { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
/* Dark-panel stamps: amber phosphor for named, hollow for absent. */
.feed .stamp, .frow .stamp { border-color: var(--pline2); color: var(--pfaint); }
.feed .stamp.hit, .frow .stamp.hit { background: var(--sig-bright); color: var(--ink); border-color: var(--sig-bright); }
.feed .stamp.miss, .frow .stamp.miss { background: transparent; color: var(--pfaint); }
.frow.check-note { color: var(--pfaint); font-size: 13px; }
.frow.ready .fbody { color: var(--sig-bright); font-weight: 700; }

/* ---------- paid matrix progress page ---------- */
.matrix-shell { margin: 40px 0 20px; display: grid; gap: 28px; }
.matrix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.mcol { background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.mcol-head { padding: 13px 16px 10px; border-bottom: 1px solid var(--line); }
.mcol-head b { display: block; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; word-break: break-all; color: var(--ink); }
.mcol-sub { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.mbar { height: 6px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mbar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--sig); transition: transform 0.4s ease; }
.mcol-live .mcol-head b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--sig); animation: pulse 0.9s infinite alternate; vertical-align: baseline; }
.mcol-degraded .mcol-head { background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(179, 55, 43, 0.06) 8px 16px); }
.mcol-degraded .mcol-sub { color: var(--red); font-weight: 700; }
.mrows { padding: 6px 0; }
.mrow { display: flex; gap: 8px; align-items: baseline; padding: 8px 15px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); animation: enter 0.35s ease-out; }
.mrow:first-child { border-top: none; }
.mrow .stamp { border-color: var(--line2); color: var(--muted); }
.mrow-hit .stamp { background: var(--ink); color: #fff; border-color: var(--ink); }
.mrow-miss .stamp { background: transparent; color: var(--faint); }
.mrow-runs { flex: none; font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--faint); }
.mrow-q { color: var(--muted); }
.mcol-waiting { grid-column: 1 / -1; }
.mcol-waiting .mbar i { animation: creep 2.2s infinite alternate ease-in-out; }
@keyframes creep { from { transform: scaleX(0.12); } to { transform: scaleX(0.46); } }
.matrix-shell .feed { min-height: 180px; }

/* ---------- audits page ---------- */
.account-grid { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 36px; margin: 40px 0 26px; align-items: start; }
.account-start, .account-history { background: var(--surface); border: 1px solid var(--line2); border-radius: 16px; padding: 26px 28px; }
.account-start h2, .account-history h2 { font-weight: 720; font-size: 19px; margin-bottom: 10px; }
.credits-line { font-size: 15px; margin-bottom: 14px; color: var(--muted); }
.credits-line b { background: var(--sig-soft); color: var(--sig-deep); border-radius: 999px; padding: 2px 12px; font-weight: 750; }
.scan-form { max-width: 540px; }
.scan-form .go { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 14px; }
.account-start .scan-form input[type="text"] {
	width: 100%; padding: 13px 16px; font-size: 16px; border: 1px solid var(--line2); border-radius: 10px;
	background: var(--bg); color: var(--ink); font-family: inherit; margin-bottom: 12px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.account-start .scan-form input[type="text"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink-ring); }
.hist-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--muted); }
.hist-table th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line2); font-weight: 500; }
.hist-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); }
.hist-table a { color: var(--ink); font-weight: 700; }
.hist-table .ok { color: var(--ink); font-weight: 740; }
.hist-table .run { color: var(--sig-deep); font-weight: 700; }
.hist-table .err { color: var(--red); font-weight: 700; }
.hist-table .warn { color: var(--muted); font-weight: 700; }
.logout-form { margin-top: 6px; }

/* ---------- monitoring dashboard ---------- */
.dash { padding: 44px 32px 90px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.dash-head .sub { margin-top: 12px; max-width: 62ch; font-size: 16px; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 40px; }
.brand-card {
	display: block; text-decoration: none; color: inherit;
	background: var(--surface); border: 1px solid var(--line2); border-radius: 14px;
	padding: 20px 22px; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.brand-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(22, 24, 28, 0.07); }
.bc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.bc-name { display: block; font-weight: 730; font-size: 18px; letter-spacing: -0.02em; }
.bc-domain { font-size: 12.5px; color: var(--faint); }
.bc-score { text-align: right; flex: none; }
.bc-score b { font-size: 30px; font-weight: 790; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.bc-score small { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.bc-none { color: var(--line2); }
.bc-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bc-meta span { display: flex; align-items: center; }

.empty { border: 1px dashed var(--line2); border-radius: 14px; padding: 26px 28px; margin-bottom: 34px; color: var(--muted); font-size: 15.5px; max-width: 70ch; }
.empty b { color: var(--ink); }

.panel { background: var(--surface); border: 1px solid var(--line2); border-radius: 16px; padding: 26px 28px; margin-bottom: 22px; }
.panel > h2 { font-weight: 720; font-size: 19px; letter-spacing: -0.01em; margin-bottom: 14px; }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { font-weight: 720; font-size: 19px; letter-spacing: -0.01em; }
.panel-head .count { color: var(--faint); font-size: 13px; }
.panel-note { color: var(--muted); font-size: 14px; max-width: 58ch; margin-bottom: 16px; }

.brandform label { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.brandform label .opt { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; }
.brandform .field { margin-top: 7px; }
.bf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.bf-engines { border: 0; margin-bottom: 6px; }
.bf-engines legend { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.chk { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; margin: 0; padding: 11px 14px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--ink); transition: border-color 0.15s, background 0.15s; }
.chk:hover { border-color: var(--ink); }
.chk input { accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
.chk:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.brandform .btn-solid { margin-top: 8px; }
.brandform .fineprint { margin-top: 14px; max-width: 66ch; }

.brandhdr { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 10px 0 14px; }
.brandhdr h1 { margin-bottom: 4px; }
.brandhdr-score { text-align: right; flex: none; }
.brandhdr-score b { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.brandhdr-score small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.brand-status { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 12px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.brand-status span { display: flex; align-items: center; }
.chart-empty { border: 1px dashed var(--line2); border-radius: 12px; padding: 30px 26px; color: var(--muted); font-size: 15px; max-width: 72ch; }
.chart-empty b { color: var(--ink); }

.ph-right { margin-left: auto; }

/* Charts: ink trace on light panels, amber last point (the "now"). */
.chart { margin-top: 6px; }
.chart svg { width: 100%; height: 200px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .gridlab { fill: var(--faint); font-family: var(--mono); font-size: 9px; }
.chart .area { fill: var(--sig-soft); opacity: 0.7; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.chart .dot-last { fill: var(--sig); }

.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 12px; align-items: center; font-size: 14px; }
.bar-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row:not(.is-you) .bar-name { color: var(--muted); font-weight: 500; }
.bar-track { height: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--line2); border-radius: 999px; min-width: 2px; }
.bar-row.is-you .bar-track i { background: var(--sig); }
.bar-val { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.bar-row.is-you .bar-val { color: var(--ink); font-weight: 700; }

.citelist { list-style: none; }
.citelist li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.citelist li:first-child { border-top: none; }
.citelist .cite-n { color: var(--faint); font-size: 12px; }

.brand-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.brand-cols .panel { margin-bottom: 0; }
.itemlist { list-style: none; margin: 4px 0 18px; }
.itemlist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.itemlist li:first-child { border-top: none; }
.itemlist .tag { font-style: normal; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sig-deep); background: var(--sig-soft); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.itemlist .x { background: none; border: none; color: var(--faint); cursor: pointer; font-size: 14px; padding: 4px 6px; line-height: 1; border-radius: 6px; transition: color 0.15s, background 0.15s; }
.itemlist .x:hover { color: var(--red); background: var(--surface); }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.addrow-2 { grid-template-columns: 1fr 1fr auto; }
.addrow .btn-line { white-space: nowrap; }

.danger { margin-top: 30px; }
.btn-danger { color: var(--red); border-color: var(--line2); }
.btn-danger:hover { border-color: var(--red); background: var(--surface); }

/* live run progress + async form feedback */
.run-progress { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.form-err { font-size: 13px; color: var(--red); margin: 8px 0 0; }
.item-link { text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.item-link:hover { text-decoration: underline; }

/* prompt drill-down */
.prompt-title { font-size: clamp(20px, 3vw, 28px); max-width: 70ch; }
.matrix-scroll { overflow-x: auto; }
.matrix-table th { text-transform: none; }
.cell-none { color: var(--faint); }
.answer { border-top: 1px dashed var(--line2); padding: 10px 0; }
.answer summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.answer summary:hover { color: var(--ink); }
.answer-body { padding: 12px 0 4px; }
.answer-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; max-width: 78ch; }

/* integrations cockpit */
.conn-actions { display: flex; gap: 8px; align-items: center; }
.conn-actions form { display: inline; }
.tag-err { color: var(--red); border-color: var(--red); background: transparent; }
.site-list { grid-template-columns: 1fr; }
.site-list .chk span { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
	.marker.m-live { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
	.scan-shell { grid-template-columns: 1fr; }
	.account-grid { grid-template-columns: 1fr; }
	.brand-cols { grid-template-columns: 1fr; }
	.bf-row, .bf-row-3 { grid-template-columns: 1fr; }
	.addrow-2 { grid-template-columns: 1fr; }
}
