/* Glidefolio — shared styles. No external requests: fonts are self-hosted. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/fraunces-latin-wght-normal.woff2') format('woff2'); }

:root {
  --ink: #14213d; --ink-2: #3d4a63; --muted: #6b768a; --line: #e3e6e1; --line-2: #d3d8d0;
  --paper: #f6f7f3; --card: #ffffff; --accent: #1b7f79; --accent-2: #135f5a; --accent-soft: #e3f1ef;
  --gold: #c8962e; --gold-soft: #f7efdc; --good: #2f7d4f; --bad: #b4413c; --bad-soft: #f8e6e4; --warn: #8a6100; --warn-soft: #fbf1d9;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,33,61,.05), 0 4px 18px rgba(20,33,61,.05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --serif: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.btn { display: inline-flex; align-items: center; gap: .5em; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: .62em 1.1em; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent-2); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.small { padding: .35em .8em; font-size: .85rem; }
.btn.danger { border-color: var(--bad); background: transparent; color: var(--bad); }
.btn:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid rgba(27,127,121,.35); outline-offset: 2px; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(246,247,243,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; }
.tabs { display: flex; gap: 2px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; font: inherit; color: var(--ink-2); padding: .5em .85em; border-radius: 999px; cursor: pointer; white-space: nowrap; font-weight: 550; }
.tabs button:hover { background: #eceee9; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--accent-2); background: var(--accent-soft); padding: .3em .7em; border-radius: 999px; white-space: nowrap; }
select, input[type="number"], input[type="text"] { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: .45em .6em; }
input[type="number"] { width: 100%; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Layout */
main { padding: 26px 0 60px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-side { grid-template-columns: 340px minmax(0,1fr); align-items: start; }
@media (max-width: 980px) { .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-3, .g-side { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 620px) { .g-2, .g-4, .g-5 { grid-template-columns: minmax(0,1fr); } .privacy-pill { display: none; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin-bottom: .2em; }
.card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 12px; }
.kpi .label { color: var(--muted); font-size: .82rem; font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.kpi .note { font-size: .82rem; color: var(--muted); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.section-head h1 { font-size: 1.8rem; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.chart-box.short { height: 220px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .55em .6em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbf8; position: sticky; top: 0; }
td.r, th.r { text-align: right; }
tr:hover td { background: #fbfcfa; }
td .sub { display: block; font-size: .78rem; color: var(--muted); }
td input.price { width: 96px; text-align: right; padding: .3em .45em; }
.tag { display: inline-block; font-size: .72rem; padding: .1em .5em; border-radius: 999px; background: #eef0eb; color: var(--ink-2); margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.gold { background: var(--gold-soft); color: #7a5a14; }
.tag.teal { background: var(--accent-soft); color: var(--accent-2); }

/* Import */
.drop { border: 2px dashed var(--line-2); border-radius: 18px; background: #fff; padding: 38px 24px; text-align: center; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { font-size: 1.35rem; }
.drop .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.broker-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.broker { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.broker b { display: block; margin-bottom: 2px; }
.broker span { font-size: .84rem; color: var(--muted); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin: 0 0 14px; }
.notice.warn { background: var(--warn-soft); color: #5c4300; border: 1px solid #f0dca6; }
.notice.info { background: var(--accent-soft); color: #0f4b47; border: 1px solid #c4e3df; }
.notice.bad { background: var(--bad-soft); color: #7d2622; border: 1px solid #efc6c2; }
.notice ul { margin: .4em 0 0 1.1em; padding: 0; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Forms */
.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field label output { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.field select, .field input[type="number"], .field input[type="text"] { width: 100%; max-width: 100%; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.row-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: #fff; }
.seg button { border: 0; background: transparent; padding: .3em .8em; border-radius: 999px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* FIRE */
.big-rate { font-size: 3rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.rate-good { color: var(--good); } .rate-mid { color: var(--warn); } .rate-bad { color: var(--bad); }
.cohorts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.cohort { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.cohort .y { font-weight: 700; }
.cohort .l { font-size: .78rem; color: var(--muted); min-height: 2.2em; }
.cohort .res { font-size: .88rem; margin-top: 4px; font-weight: 600; }
.bar-meter { height: 8px; border-radius: 99px; background: #eceee9; overflow: hidden; margin-top: 8px; }
.bar-meter > span { display: block; height: 100%; background: var(--accent); }

/* Footer */
footer.site { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: .85rem; }
footer.site .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.hidden { display: none !important; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
details summary { cursor: pointer; font-weight: 600; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .82em; background: #eef0eb; padding: .05em .35em; border-radius: 5px; }

@media (max-width: 760px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; gap: 8px; }
  .tabs { order: 3; width: 100%; margin-left: 0; padding-bottom: 2px; }
  .topbar .right label { display: none; }
}
