
/* Always respect the HTML hidden attribute. Author display rules such as
   .auth-shell { display: grid } otherwise override the browser default. */
[hidden] { display: none !important; }
:root {
  --ink: #14213d;
  --muted: #667085;
  --line: #e7e9ee;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --accent: #1f6feb;
  --accent-dark: #1559bd;
  --good: #127a55;
  --warn: #a15c00;
  --bad: #a83232;
  --shadow: 0 14px 42px rgba(20, 33, 61, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--soft); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--ink); color: white; }
.status { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16a36f; }

main { max-width: 1180px; margin: 0 auto; padding: 52px 24px 80px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 36px; margin-bottom: 42px; }
.hero > div { max-width: 790px; }
.eyebrow, .kicker { text-transform: uppercase; letter-spacing: .09em; font-size: 12px; font-weight: 800; color: var(--accent); margin: 0 0 10px; }
h1 { font-size: clamp(40px, 6vw, 72px); line-height: .98; margin: 0 0 20px; letter-spacing: -.045em; }
.hero p { max-width: 730px; font-size: 19px; color: var(--muted); line-height: 1.55; margin: 0; }

.primary, .secondary, .ghost { border-radius: 10px; padding: 12px 18px; border: 1px solid transparent; font-weight: 750; }
.primary { background: var(--accent); color: white; box-shadow: 0 5px 15px rgba(31,111,235,.18); }
.primary:hover { background: var(--accent-dark); }
.secondary { background: white; color: var(--ink); border-color: var(--line); }
.ghost { background: transparent; color: var(--accent); border-color: #cfe0ff; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 12px 16px; border-radius: 10px; font-weight: 750; }
.tab.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(20,33,61,.06); }

.panel { display: none; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 30px; }
.panel.active { display: block; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 28px; }
h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.025em; }
.muted { color: var(--muted); margin: 0; line-height: 1.5; }

.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 18px; }
input, textarea, select { width: 100%; margin-top: 8px; padding: 12px 13px; border: 1px solid #d8dde6; border-radius: 9px; background: white; color: var(--ink); outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,.1); }
small { color: var(--muted); font-weight: 500; }
label small { display: block; margin-top: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }

.results-heading { align-items: center; }
.scan-controls { display: flex; gap: 8px; align-items: center; }
.scan-controls select { margin: 0; width: auto; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stats div { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.stats span { display: block; font-size: 25px; font-weight: 850; letter-spacing: -.03em; }
.stats small { display: block; margin-top: 4px; }
.source-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.source-pill { font-size: 12px; padding: 7px 10px; border-radius: 100px; background: #f1f4f8; color: var(--muted); }

.loading { padding: 55px 0; text-align: center; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 4px solid #e4ebf8; border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.results-list { display: grid; gap: 14px; }
.result-card { display: grid; grid-template-columns: 88px 1fr; gap: 18px; border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: white; }
.score-ring { width: 72px; height: 72px; border: 7px solid #d9e7ff; border-radius: 50%; display: grid; place-items: center; align-content: center; }
.score-ring strong { font-size: 22px; line-height: 1; }
.score-ring small { font-size: 10px; }
.result-topline { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.recommendation, .source { font-size: 11px; border-radius: 100px; padding: 5px 8px; font-weight: 800; }
.recommendation.review { background: #e7f7f0; color: var(--good); }
.recommendation.possible { background: #fff3df; color: var(--warn); }
.recommendation.skip { background: #f8e8e8; color: var(--bad); }
.source { background: #f2f4f7; color: var(--muted); }
.result-card h3 { margin: 0 0 6px; font-size: 21px; }
.buyer { color: var(--muted); margin: 0 0 10px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meta span { font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; }
.description { line-height: 1.55; color: #3d485c; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.analysis-grid > div { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.analysis-grid h4 { margin: 0 0 8px; font-size: 13px; }
.analysis-grid ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-actions { display: flex; gap: 8px; margin-top: 16px; }
a.link { text-decoration: none; display: inline-block; }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--ink); color: white; padding: 13px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }

@media (max-width: 760px) {
  .hero, .panel-heading, .results-heading { display: block; }
  .hero .primary, .panel-heading > .secondary { margin-top: 18px; }
  .grid.two, .analysis-grid, .stats { grid-template-columns: 1fr; }
  .scan-controls { margin-top: 16px; }
  .result-card { grid-template-columns: 1fr; }
  .score-ring { width: 64px; height: 64px; }
}

/* v0.2 customer accounts, billing and automation */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: var(--soft); }
.auth-copy { padding: 9vh 7vw; display: flex; flex-direction: column; justify-content: center; }
.auth-copy h1 { max-width: 760px; }
.auth-copy > p:not(.eyebrow) { max-width: 680px; color: var(--muted); font-size: 19px; line-height: 1.6; }
.auth-brand { margin-bottom: 60px; }
.auth-points { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.auth-points span { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; color: var(--muted); font-size: 13px; }
.auth-card { align-self: center; margin: 40px 7vw 40px 20px; padding: 30px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); max-width: 470px; width: calc(100% - 40px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 10px; padding: 4px; margin-bottom: 26px; }
.auth-tabs button { border: 0; background: transparent; border-radius: 8px; padding: 10px; color: var(--muted); font-weight: 750; }
.auth-tabs button.active { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(20,33,61,.08); }
.auth-form h2 { font-size: 25px; }
.full { width: 100%; }
.form-error { background: #fff1f1; color: var(--bad); border: 1px solid #f2cccc; padding: 11px 13px; border-radius: 9px; font-size: 13px; }
.account-bar { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 7px; font-weight: 750; }
.compact-hero h1 { font-size: clamp(38px, 5vw, 64px); }
.plan-badge { padding: 9px 12px; border-radius: 999px; background: #eef4ff; color: var(--accent); font-size: 13px; font-weight: 800; }
.automation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setting-card { border: 1px solid var(--line); border-radius: 15px; padding: 22px; background: #fbfcfe; }
.setting-card h3 { margin: 3px 0 9px; }
.setting-card > p:not(.kicker) { color: var(--muted); line-height: 1.5; }
.price-line { display: flex; gap: 10px; align-items: baseline; }
.price-line strong { font-size: 42px; letter-spacing: -.04em; }
.price-line span, .monthly-line { color: var(--muted); }
.monthly-line { font-weight: 750; margin: -4px 0 18px; }
.toggle-row { display: flex; align-items: center; gap: 9px; margin: 20px 0; }
.toggle-row input { width: 18px; height: 18px; margin: 0; }
.small-message { font-size: 12px; min-height: 18px; }
.readiness-card { margin-top: 16px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; display: grid; grid-template-columns: repeat(3, 1fr); }
.readiness-card > div { padding: 16px 18px; display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; row-gap: 3px; align-items: center; }
.readiness-card > div + div { border-left: 1px solid var(--line); }
.readiness-card small { grid-column: 2; }
.readiness-dot { width: 9px; height: 9px; border-radius: 50%; background: #c8ced8; }
.readiness-dot.ready { background: #16a36f; }
button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-copy { padding: 52px 24px 12px; }
  .auth-copy h1 { font-size: 48px; }
  .auth-brand { margin-bottom: 34px; }
  .auth-card { margin: 24px auto 50px; }
  .automation-grid, .readiness-card { grid-template-columns: 1fr; }
  .readiness-card > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* v0.3 sellable checkout and owner controls */
.auth-offer { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: white; display: grid; gap: 4px; max-width: 430px; }
.auth-offer strong { font-size: 16px; }
.auth-offer span { color: var(--ink); font-weight: 750; }
.auth-offer small { margin-top: 4px; }
.access-message { margin-top: 12px !important; font-size: 13px !important; font-weight: 750; color: var(--accent) !important; }
.billing-manage { margin-top: 9px; }
.owner-setup { margin-top: 16px; background: #fffdf7; }
.secret-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin-top: 14px; }
.secret-row input { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.customer-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 13px; }
.customer-table th, .customer-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.customer-table th { color: var(--muted); background: #fafbfc; font-size: 12px; }
.customer-table tbody tr:last-child td { border-bottom: 0; }
.customer-table td:nth-child(3), .customer-table td:nth-child(4) { font-weight: 750; }

@media (max-width: 760px) {
  .secret-row { grid-template-columns: 1fr; }
}

/* v0.4 hosted beta launch checks */
.launch-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 14px; margin-bottom: 18px; }
.launch-summary > div { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fbfcfe; display: grid; gap: 3px; }
.launch-summary strong { font-size: 28px; }
.launch-summary span { color: var(--muted); font-size: 12px; }
.launch-checks { display: grid; gap: 10px; margin-bottom: 18px; }
.launch-check { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 14px 190px 1fr; gap: 10px; align-items: center; }
.launch-check .check-dot { width: 10px; height: 10px; border-radius: 50%; background: #c8ced8; }
.launch-check.ready .check-dot { background: #16a36f; }
.launch-check strong { font-size: 13px; }
.launch-check span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.launch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.launch-next { margin-top: 16px; }
.code-line { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .launch-summary, .launch-grid { grid-template-columns: 1fr; }
  .launch-check { grid-template-columns: 14px 1fr; }
  .launch-check span { grid-column: 2; }
}
