/* OpenGa^3in · dark green app shell (single theme, deliberate) */
:root {
  --bg: #131917;
  --panel: #1A2220;
  --panel-2: #202A27;
  --panel-3: #263230;
  --line: rgba(230,235,232,.10);
  --line-2: rgba(230,235,232,.18);
  --ink: #E6EBE8;
  --muted: #A9B5B0;
  --faint: #7C8883;
  --gold: #4FAE93;
  --gold-hover: #66C2A8;
  --gold-ink: #0E1A16;
  --navy-soft: #7FA8CC;
  --good: #6FBF8F;
  --good-bg: rgba(111,191,143,.14);
  --warn: #D0A24E;
  --warn-bg: rgba(208,162,78,.14);
  --crit: #D4796A;
  --crit-bg: rgba(212,121,106,.14);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 14px; line-height: 1.55;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; color: var(--ink); line-height: 1.2; text-wrap: balance; }
h1 { font-size: 34px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .93em; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ribbon */
.demo-ribbon {
  background: var(--panel-2); color: var(--muted); text-align: center;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 5px 12px;
  border-bottom: 1px solid var(--line);
}
.demo-ribbon b { color: var(--gold); font-weight: 500; }

/* header */
header.app { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.appbar { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 16px; }
.appbar .brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; text-decoration: none; }
.appbar .brand img { width: 26px; height: 26px; }
.appbar .brand .word { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; white-space: nowrap; }
.appbar .brand .word b { color: var(--gold); font-weight: 600; }
.appbar .search { flex: 1; max-width: 360px; position: relative; }
.appbar .search input {
  width: 100%; padding: 7px 40px 7px 32px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink);
}
.appbar .search input::placeholder { color: var(--faint); }
.appbar .search .icon { position: absolute; left: 11px; top: 7px; color: var(--faint); font-size: 13px; }
.appbar .search .kbd {
  position: absolute; right: 8px; top: 6px; font-size: 10.5px; color: var(--faint);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px;
  font-family: ui-monospace, Menlo, monospace;
}
.appbar nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.appbar nav a { padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.appbar nav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.appbar nav a.active { color: var(--ink); background: var(--panel-2); font-weight: 500; }
.appbar nav a.cta {
  background: var(--gold); color: var(--gold-ink); font-weight: 600; margin-left: 8px; padding: 7px 14px;
}
.appbar nav a.cta:hover { background: var(--gold-hover); }
@media (max-width: 960px) { .appbar .search { display: none; } .appbar nav a.hide-m { display: none; } }

main { padding: 30px 0 60px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.panel.pad { padding: 18px 20px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold); color: var(--gold-ink); font-weight: 600;
  border: none; border-radius: 9px; padding: 10px 20px; font-size: 14px; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--gold-hover); text-decoration: none; }
.btn.ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); font-weight: 500; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: transparent; color: var(--crit); border: 1px solid var(--crit); font-weight: 500; }
.btn.danger:hover { background: var(--crit-bg); }
.btn.good { background: transparent; color: var(--good); border: 1px solid var(--good); font-weight: 500; }
.btn.good:hover { background: var(--good-bg); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* pills */
.pill { display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--crit); }
.pill.neutral { background: var(--panel-2); color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; padding: 9px 12px 7px; border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }

/* stats */
.stat { padding: 14px 16px; }
.stat .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.stat .value { font-size: 25px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--gold); border-radius: 999px; }

/* hero (home) */
.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 600; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .sub { color: var(--muted); font-size: 16.5px; max-width: 56ch; margin: 14px auto 0; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.bigstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 40px 0 10px; text-align: center; }
.bigstats .n { font-size: clamp(30px, 4.5vw, 44px); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.bigstats .l { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
@media (max-width: 760px) { .bigstats { grid-template-columns: repeat(2, 1fr); } }
.feature h3 { margin-bottom: 6px; }
.feature p { font-size: 13px; color: var(--muted); margin: 0; }
.feature .art {
  height: 92px; border-radius: 8px; background: var(--panel-2); margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}

/* model rows */
.model-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.model-row:last-child { border-bottom: none; }
.model-row:hover { background: var(--panel-2); }
.model-row .name { font-size: 14.5px; font-weight: 600; }
.model-row .name .mono { color: var(--gold); }
.model-row .desc { font-size: 12.5px; color: var(--muted); max-width: 62ch; }
.model-row .stats { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.model-row .price { font-variant-numeric: tabular-nums; }
.model-row .price .strike { text-decoration: line-through; color: var(--faint); }
.model-row .price b { color: var(--ink); font-weight: 600; }
.model-row.off { opacity: .55; }
@media (max-width: 700px) { .model-row { grid-template-columns: 1fr; } .model-row .stats { text-align: left; } }

/* forms */
label.f { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
input.f, select.f, textarea.f {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); color: var(--ink);
}
/* selects and inputs render at different native heights (Safari especially);
   pin both so side-by-side form rows and their labels always align */
input.f, select.f { height: 41px; }
select.f { -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.formrow { display: grid; gap: 10px; align-items: end; }
.formrow label.f { margin-top: 0; }
input.f::placeholder, textarea.f::placeholder { color: var(--faint); }
textarea.f { resize: vertical; }

/* code */
pre.code {
  background: #080B11; border: 1px solid var(--line); color: var(--ink); border-radius: 10px;
  padding: 15px 18px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; margin: 0;
}
pre.code .c { color: var(--faint); }
pre.code .s { color: var(--gold); }

/* charts */
.chart-host { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--panel-3); color: var(--ink);
  border: 1px solid var(--line-2); font-size: 12px; padding: 5px 9px; border-radius: 6px;
  white-space: nowrap; transform: translate(-50%, -130%); display: none;
  font-variant-numeric: tabular-nums; z-index: 5;
}
.barrow { display: grid; grid-template-columns: 170px 1fr 92px; align-items: center; gap: 10px; margin: 8px 0; }
.barrow .track { height: 14px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.barrow .fill { height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.barrow .lbl { font-size: 12.5px; }
.barrow .val { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .barrow { grid-template-columns: 120px 1fr 84px; } }

/* chat */
.chat-shell { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 260px); min-height: 420px; }
.chat-msgs { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 72ch; }
.msg .who { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.msg .bubble { padding: 10px 14px; border-radius: 10px; font-size: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; }
.msg.user .bubble { background: var(--gold); color: var(--gold-ink); }
.msg.user .who { text-align: right; }
.msg.ai .bubble { background: var(--panel-2); }
.msg .meta { font-size: 11.5px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }
.chat-input { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; }

footer.app { border-top: 1px solid var(--line); padding: 20px; font-size: 12.5px; color: var(--faint); }
footer.app .inner { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.app a { color: var(--muted); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
