:root {
  --bg: #f7f6f2; --raised: #ffffff; --sunk: #f1efe9; --text: #16181a; --muted: #585b60; --faint: #8a8c90;
  --line: #e7e4dc; --line-strong: #d5d1c6;
  --accent: #17483a; --accent-hover: #0f3a2e; --accent-ink: #ffffff; --accent-soft: #e7f0eb;
  --good: #1b7448; --good-soft: #e5f2ea; --bad: #b0371f; --bad-soft: #fbebe6; --meh: #8a6610; --meh-soft: #f7efd9;
  --shadow: 0 1px 2px rgba(28, 26, 18, 0.04), 0 6px 24px rgba(28, 26, 18, 0.05);
  --radius: 14px; --radius-sm: 9px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Charter", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1110; --raised: #161a18; --sunk: #121514; --text: #ecece7; --muted: #a8aba6; --faint: #7b7f7a;
    --line: #242927; --line-strong: #323835;
    --accent: #8fd0b2; --accent-hover: #a6dcc3; --accent-ink: #0c1a14; --accent-soft: #16261e;
    --good: #74d39f; --good-soft: #13261b; --bad: #f08e78; --bad-soft: #2b1814; --meh: #e1bc5f; --meh-soft: #282213;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ base */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans);
       -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
.bar, main { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 24px; }
body.wide .bar, body.wide main { max-width: 1160px; }
[hidden] { display: none !important; }

h1, h2, h3 { color: var(--text); }
h1 { font: 600 clamp(30px, 4.6vw, 44px)/1.1 var(--serif); letter-spacing: -0.015em; margin: 0 0 14px; }
h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.eyebrow, .kicker { color: var(--accent); font-weight: 600; font-size: 12.5px; text-transform: uppercase;
                    letter-spacing: 0.09em; margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 62ch; }
.desc { color: var(--muted); font-size: 15px; margin: 0; }
.note { color: var(--faint); font-size: 14px; margin: 8px 0; }
.note:empty { display: none; }
.good { color: var(--good) !important; } .bad { color: var(--bad) !important; } .meh { color: var(--meh) !important; }

/* ------------------------------------------------------------ header and footer */

header.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line);
             background: color-mix(in srgb, var(--bg) 82%, transparent);
             -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
header.top .bar { display: flex; justify-content: space-between; align-items: center; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15.5px; color: var(--text);
         text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand .m-bg { fill: var(--accent); } .brand .m-line { stroke: var(--accent-ink); }
nav { display: flex; gap: 4px; align-items: center; }
nav a, nav button.link { text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500;
                         padding: 7px 12px; border-radius: 999px; }
nav a:hover, nav button.link:hover { color: var(--text); background: var(--sunk); }
nav a[aria-current="page"] { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
nav .cta { background: var(--accent); color: var(--accent-ink); margin-left: 6px; }
nav .cta:hover { background: var(--accent-hover); color: var(--accent-ink); }
footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 24px 0 40px; color: var(--faint); font-size: 13px; }
footer p { margin: 0; max-width: 70ch; }
@media (max-width: 560px) {
  .brand span { display: none; }
  nav a, nav button.link { padding: 7px 9px; }
}

/* ------------------------------------------------------------ surfaces */

section { margin: 48px 0; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
        box-shadow: var(--shadow); }
.card > p { margin: 0; color: var(--muted); font-size: 15px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card ul { padding-left: 18px; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.card.accent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.grid3, .grid2, .grid4 { display: grid; gap: 16px; }
.grid4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.notice { background: var(--accent-soft); color: var(--text); padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 20px; font-size: 15px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.meh { background: var(--meh-soft); color: var(--text); }
.narrow { max-width: 440px; }
.price { font-size: 34px; font-weight: 650; color: var(--text) !important; letter-spacing: -0.02em; margin: 6px 0 2px !important; }
.price span { font-size: 15px; font-weight: 400; color: var(--faint); letter-spacing: 0; }

/* ------------------------------------------------------------ controls */

form { display: flex; flex-direction: column; gap: 16px; }
form.inline { flex-direction: row; flex-wrap: wrap; gap: 10px; margin-top: 30px; max-width: 520px; }
form.inline input { flex: 1 1 240px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
input, select { font: inherit; font-size: 15.5px; color: var(--text); background: var(--raised); width: 100%;
                border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
                transition: border-color 0.15s, box-shadow 0.15s; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
         background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
         background-position: right 17px top 50%, right 12px top 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); flex: none; }
button, .button { font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; border: 0; border-radius: var(--radius-sm);
                  padding: 11px 20px; min-height: 44px; background: var(--accent); color: var(--accent-ink); text-decoration: none;
                  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.15s, transform 0.05s; }
button:hover, .button:hover { background: var(--accent-hover); color: var(--accent-ink); }
button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary, .button.secondary { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--sunk); color: var(--text); }
button.link { background: none; color: var(--muted); padding: 0; min-height: 0; font-weight: 500; }
button.link:hover { background: none; color: var(--text); text-decoration: underline; }
button.danger { background: var(--bad); color: #fff; }
button.danger:hover { background: color-mix(in srgb, var(--bad) 88%, black); }
button[disabled] { opacity: 0.55; cursor: default; }
button.wide { width: 100%; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
label.check { flex-direction: row; align-items: flex-start; gap: 12px; color: var(--text); font-size: 14.5px; font-weight: 400;
              background: var(--meh-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
label.check input { margin-top: 2px; }

details { margin-top: 4px; }
summary { cursor: pointer; color: var(--text); font-weight: 600; font-size: 15px; list-style: none;
          display: flex; align-items: center; gap: 10px; padding: 12px 0; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint);
                  transform: rotate(-45deg); transition: transform 0.15s; margin: 0 2px; }
details[open] > summary::before { transform: rotate(45deg); }

.badge { display: inline-flex; align-items: center; gap: 7px; align-self: start; font-size: 12.5px !important; font-weight: 600;
         border-radius: 999px; padding: 4px 11px 4px 9px; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); } .badge.bad { background: var(--bad-soft); } .badge.meh { background: var(--meh-soft); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent);
        animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* ------------------------------------------------------------ page heads */

.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 52px 0 36px; }
.pagehead > div:first-child { flex: 1 1 420px; }
.pagehead h1 { margin-bottom: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 32px; color: var(--muted); text-decoration: none;
        font-size: 14px; font-weight: 500; }
.back:hover { color: var(--text); }
.back + .pagehead { margin-top: 18px; }

.plan { flex: 0 1 360px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.plan .plan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan .plan-name { font-weight: 650; font-size: 15px; }
.plan .plan-sub { color: var(--faint); font-size: 13.5px; }
.plan .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan .actions button { min-height: 38px; padding: 8px 14px; font-size: 14px; }
progress.meter { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px;
                 background: var(--sunk); overflow: hidden; color: var(--accent); }
progress.meter::-webkit-progress-bar { background: var(--sunk); border-radius: 999px; }
progress.meter::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.meter::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.pill { font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
        background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------ dashboard */

.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.split > section { margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.count { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }

.builder { gap: 0; padding: 0; overflow: hidden; }
.builder .group { border-bottom: 1px solid var(--line); padding: 20px 22px 22px;
                  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.builder .step-title { margin: 0; display: flex; align-items: center; gap: 10px;
                       font-weight: 650; font-size: 15.5px; line-height: 24px; color: var(--text); }
.step { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
        font-size: 12.5px; font-weight: 700; line-height: 1; background: var(--accent-soft); color: var(--accent);
        font-variant-numeric: tabular-nums; }
.builder .foot { padding: 20px 22px 22px; background: var(--sunk); display: flex; flex-direction: column; gap: 4px; }
.builder .foot .note { margin: 0 0 10px; }
@media (max-width: 520px) {
  .builder .group { padding: 18px; }
  .builder .foot { padding: 18px; }
}

.tests { display: flex; flex-direction: column; gap: 10px; }
a.test { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; text-decoration: none; color: var(--text);
         background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
         box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.15s; }
a.test:hover { border-color: var(--line-strong); transform: translateY(-1px); color: var(--text); }
a.test strong { font-size: 16px; font-weight: 650; }
a.test .desc { display: block; font-size: 14px; margin-top: 3px; }
a.test time { grid-column: 1 / -1; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.empty { text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 24px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 14.5px; }

/* ------------------------------------------------------------ a result */

.verdict-card { display: flex; gap: 18px; align-items: flex-start; border-radius: var(--radius); padding: 24px 26px;
                background: var(--sunk); border: 1px solid var(--line); margin-bottom: 20px; }
.verdict-card.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.verdict-card.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 22%, transparent); }
.verdict-card.meh { background: var(--meh-soft); border-color: color-mix(in srgb, var(--meh) 22%, transparent); }
.verdict-card .icon { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
                      font-size: 22px; font-weight: 700; color: var(--raised); background: var(--faint); line-height: 1; }
.verdict-card.good .icon { background: var(--good); } .verdict-card.bad .icon { background: var(--bad); }
.verdict-card.meh .icon { background: var(--meh); }
.verdict-card .label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 2px 0 4px; }
.verdict-card .headline { font: 500 22px/1.35 var(--serif); color: var(--text); margin: 0; }
.verdict-card.pending { align-items: center; }
.verdict-card.pending .headline { font: 500 17px/1.4 var(--sans); }

.stat { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 500; margin: 0; }
.stat .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums;
           color: var(--text); line-height: 1.15; }
.stat .s { color: var(--faint); font-size: 12.5px; margin: 0; }
.result-grid { margin: 20px 0; }
ul.points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; color: var(--text); font-size: 15px; }
ul.points li { position: relative; padding-left: 26px; line-height: 1.5; }
ul.points li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
ul.points.dot-bad li::before { background: var(--bad); } ul.points.dot-meh li::before { background: var(--meh); }
ul.points.dot-good li::before { background: var(--good); }
.card .note:last-child { margin-bottom: 0; }

.table { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-weight: 600; color: var(--faint); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: bottom; }
th.dim, td.dim { color: var(--faint); }
td small { display: block; color: var(--faint); font-size: 12px; }
tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.card details { border-top: 1px solid var(--line); margin-top: 8px; }
.card details:first-of-type { margin-top: 0; }
.card details .table { margin-bottom: 8px; }
.locked { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
            background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 24px 26px; margin-top: 20px; }
.cta-card h3 { color: var(--accent-ink); font-size: 18px; margin: 0 0 2px; }
.cta-card p { margin: 0; opacity: 0.82; font-size: 14.5px; }
.cta-card .button { background: var(--accent-ink); color: var(--accent); }
.cta-card .button:hover { background: color-mix(in srgb, var(--accent-ink) 90%, var(--accent)); color: var(--accent); }
.fine { color: var(--faint); font-size: 13px; margin: 16px 0 0; }

/* ------------------------------------------------------------ autopilot */

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; padding: 7px 14px 7px 12px;
          border-radius: 999px; background: var(--sunk); color: var(--muted); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status.good { background: var(--good-soft); } .status.good i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.status.meh { background: var(--meh-soft); } .status.bad { background: var(--bad-soft); }
.brief { display: flex; gap: 16px; align-items: flex-start; }
.brief .headline { font: 500 19px/1.45 var(--serif); color: var(--text); margin: 0 0 6px; }
.brief .note { margin: 0; }
.controls { display: flex; flex-direction: column; gap: 4px; }
.controls .actions { display: flex; gap: 10px; margin-bottom: 8px; }
.controls details { border-top: 1px solid var(--line); }
.controls details form { padding: 4px 0 16px; }
form.danger { border-radius: var(--radius-sm); padding: 16px; background: var(--bad-soft); margin-bottom: 12px; }
form.danger p { margin: 0; font-size: 14.5px; color: var(--text); }
ul.events { list-style: none; padding: 0; margin: 0; position: relative; }
ul.events li { position: relative; padding: 0 0 18px 26px; font-size: 15px; }
ul.events li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
                       background: var(--raised); box-shadow: inset 0 0 0 2px var(--accent); }
ul.events li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 2px; width: 1px; background: var(--line-strong); }
ul.events li:last-child { padding-bottom: 0; } ul.events li:last-child::after { display: none; }
ul.events li.bad::before { box-shadow: inset 0 0 0 2px var(--bad); }
ul.events time { display: block; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 4px 0 18px; display: flex; flex-direction: column; gap: 12px; }
ol.steps li { counter-increment: s; position: relative; padding-left: 40px; color: var(--text); font-size: 15px; min-height: 26px; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%;
                      display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.keyline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
           padding: 12px 14px; border-radius: var(--radius-sm); background: var(--good-soft); font-size: 14.5px; margin-bottom: 18px; }
.keyline code { font-size: 13.5px; }

/* ------------------------------------------------------------ sign in and landing */

.auth { max-width: 420px; margin: 72px auto 0; }
.auth .card { padding: 30px; }
.auth h1 { font-size: 32px; }
.auth .desc { margin-bottom: 22px; }
.hero { margin-top: 84px; }
.hero h1 { font-size: clamp(36px, 6vw, 58px); max-width: 15ch; margin-bottom: 20px; }
.hero .lead { font-size: 19px; }
.narrow-col { max-width: 720px; }
.cta-card .button { flex: none; }
.stack > *, .result section.card, .autopilot section.card { margin: 0; }
.result section.card { margin-top: 20px; }
.result .card th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.stack .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stack .grid3 .stat .v { font-size: 24px; }
@media (max-width: 560px) { .stack .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) {
  a.test { grid-template-columns: 1fr; }
  a.test .badge { grid-row: 1; justify-self: start; }
  .pagehead { margin: 36px 0 28px; }
}
.plan .actions:empty { display: none; }

/* ------------------------------------------------------------ tabs */

nav.tabs a svg { display: none; }
@media (max-width: 640px) {
  nav.tabs { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; gap: 0; justify-content: space-around;
             padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
             background: color-mix(in srgb, var(--raised) 88%, transparent);
             -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px); }
  nav.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px;
               font-size: 11px; font-weight: 600; border-radius: 10px; color: var(--faint); }
  nav.tabs a svg { display: block; width: 24px; height: 24px; }
  nav.tabs a:hover { background: none; }
  nav.tabs a[aria-current="page"] { color: var(--accent); background: none; box-shadow: none; }
  body.app .brand span { display: inline; }
  body.app footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------ portfolio and settings */

.commands { display: flex; gap: 10px; flex-wrap: wrap; }
.meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -18px 0 22px; color: var(--muted); font-size: 14.5px; }
.meta .status { padding: 5px 12px 5px 10px; font-size: 13px; }
.meta .updated { margin-left: auto; color: var(--faint); font-size: 13px; }
button.small, .button.small { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
td.cmd { width: 1%; white-space: nowrap; }
table.positions td { vertical-align: middle; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
        background: var(--accent-soft); color: var(--accent); margin: 2px 6px 2px 0; }
.waiting { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.cta-card.quiet { background: var(--raised); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cta-card.quiet h3 { color: var(--text); }
.cta-card.quiet .button { background: var(--raised); color: var(--bad); box-shadow: inset 0 0 0 1px var(--line-strong); }
.card.list { padding-bottom: 8px; }
.card.list .line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0;
                   border-top: 1px solid var(--line); flex-wrap: wrap; }
.card.list .k { margin: 0; color: var(--faint); font-size: 13px; }
.card.list .v { margin: 2px 0 0; color: var(--text); font-size: 15.5px; font-weight: 500; overflow-wrap: anywhere; }
.settings .card { margin: 0 0 20px; }
.desc.spaced { margin: -6px 0 16px; }
.row-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
            color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.row-link .note { margin: 0; font-weight: 400; }
.row-link:hover { color: var(--accent); }
.section-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.portfolio section.card { margin: 0 0 20px; }
.empty .spin { margin: 0 auto 12px; }
@media (max-width: 640px) {
  .pagehead .commands { width: 100%; }
  .meta .updated { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  /* A blurred header would hold the fixed tab bar inside it: plain on phones. */
  body.app header.top { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .grid4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat .v { font-size: 21px; }
  .grid4 .stat .s { font-size: 12px; }

  table.positions, table.positions tbody { display: block; }
  table.positions thead, table.positions td:nth-child(2), table.positions td:nth-child(3),
  table.positions td:nth-child(4) { display: none; }
  table.positions tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 0;
                       border-bottom: 1px solid var(--line); }
  table.positions tr:last-child { border-bottom: 0; }
  table.positions td { border: 0; padding: 0; text-align: left; background: none !important; }
  table.positions td:nth-child(1) { grid-area: 1 / 1; }
  table.positions td:nth-child(5) { grid-area: 1 / 2; text-align: right; font-weight: 600; }
  table.positions td:nth-child(6) { grid-area: 2 / 2; text-align: right; }
  table.positions td:nth-child(6) small { display: inline; margin-left: 6px; }
  table.positions td:nth-child(7) { grid-area: 2 / 1; font-size: 13px; align-self: end; }
  table.positions td:nth-child(7)::before { content: attr(data-label); }
  table.positions td.cmd { grid-area: 3 / 1 / 4 / 3; width: auto; margin-top: 10px; }
  table.positions td.cmd button { width: 100%; min-height: 40px; }
  table.closed th:nth-child(3), table.closed td:nth-child(3), table.closed th:nth-child(4), table.closed td:nth-child(4) { display: none; }
  .table { margin: 0; padding: 0; }
}
.row { align-items: end; }

/* ------------------------------------------------------------ the three portfolios */

.styles-wrap { margin: -16px 0 24px; }
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px;
          background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.style-tab { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 11px; text-decoration: none;
             color: var(--muted); transition: background 0.15s; min-width: 0; }
.style-tab:hover { color: var(--text); background: color-mix(in srgb, var(--raised) 60%, transparent); }
.style-tab[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgba(28, 26, 18, 0.08), 0 0 0 1px var(--line); }
.style-tab .name { font-weight: 650; font-size: 15px; }
.style-tab .sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint);
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.good { background: var(--good); } .dot.meh { background: var(--meh); } .dot.bad { background: var(--bad); }
.style-desc { margin: 10px 2px 0; color: var(--muted); font-size: 14px; }
.autopilot .pagehead + .styles-wrap, .portfolio .pagehead + .styles-wrap { margin-top: -16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; }
.chip-toggle { min-height: 34px; padding: 5px 11px; font-size: 13.5px; font-weight: 600; border-radius: 999px;
               background: var(--raised); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip-toggle:hover { background: var(--sunk); color: var(--text); }
.chip-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.picked { margin: -4px 0 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spaced-top { margin-top: 18px; }
@media (max-width: 640px) {
  .style-tab { padding: 8px 10px; }
  .style-tab .name { font-size: 14px; }
  .style-tab .sub { font-size: 11.5px; }
}
.styles-wrap.top { margin: 36px 0 -20px; }
@media (max-width: 640px) {
  .style-tab .amt { display: none; }
  .styles-wrap.top { margin: 24px 0 -12px; }
}
.choice { display: flex; gap: 8px; margin: 0 0 16px; }

/* ------------------------------------------------------------ community */

.community .pagehead { margin-bottom: 18px; }
.chat-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 0; padding-bottom: 150px; }
.chat-msg { max-width: 86%; align-self: flex-start; background: var(--raised); border: 1px solid var(--line);
            border-radius: 16px 16px 16px 6px; padding: 9px 14px 11px; box-shadow: var(--shadow); }
.chat-msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; border-radius: 16px 16px 6px 16px; }
.chat-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--faint); margin-bottom: 2px; }
.chat-meta strong { color: var(--text); font-size: 13px; }
.chat-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.45; }
.chat-del { margin-left: auto; font-size: 12.5px; }
.chat-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
            background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--line);
            -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.chat-bar > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.chat-compose { flex-direction: row; align-items: flex-end; gap: 8px; }
.chat-compose textarea { flex: 1; font: inherit; font-size: 16px; color: var(--text); background: var(--raised); resize: none;
                         border: 1px solid var(--line-strong); border-radius: 20px; padding: 10px 14px; min-height: 44px; max-height: 160px; }
.chat-compose textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chat-compose button { border-radius: 999px; min-height: 44px; }
.chat-name { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.chat-name:empty { display: none; }
.chat-bar .note { margin: 6px auto 0; }
.inline-form { flex-direction: row; gap: 8px; margin-top: 6px; }
.inline-form input { flex: 1; min-width: 0; }
.card.list .grow { flex: 1; }
@media (max-width: 640px) {
  body.app .chat-bar { bottom: calc(62px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .chat-list { padding-bottom: 210px; }
}
body:has([data-community]) footer { display: none; }
.chat-list:empty { padding-bottom: 0; }
.community .empty { margin: 18px 0 170px; }
@media (max-width: 640px) { .community .empty { margin-bottom: 230px; } }

/* ------------------------------------------------------------ launch */

.hero-cta { margin: 28px 0 10px; }
.hero-cta .button { font-size: 16.5px; padding: 13px 24px; }
.footer-links { margin-top: 8px !important; }
.footer-links a { color: var(--muted); }
.policy { max-width: 720px; margin: 48px auto 0; }
.policy h2 { margin-top: 30px; }
.policy p, .policy li { color: var(--text); font-size: 15.5px; }
.policy-table { margin: 12px 0; font-size: 14px; }
.policy-table th, .policy-table td { text-align: left; padding: 8px 10px 8px 0; }
mark.todo { background: var(--meh-soft); color: var(--meh); padding: 1px 4px; border-radius: 4px; }
label.waiver { font-size: 13.5px; margin: 0 0 4px; }
.chat-meta select { font-size: 12.5px; min-height: 0; padding: 2px 22px 2px 6px; width: auto; border-radius: 6px;
                    background-position: right 10px top 50%, right 6px top 50%; color: var(--muted); }
.chat-meta .badge { padding: 1px 8px 1px 7px; }
.paywall .plan { margin-top: 18px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact textarea { font: inherit; font-size: 15.5px; color: var(--text); background: var(--raised); border: 1px solid var(--line-strong);
                    border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; }
.contact textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
