/* Oasis shared design tokens. Lifted from thuma.co via TIP: headings Yrsa (serif), body Saira (sans). */
:root {
  --ink: #282829; --ink-2: #4d4d4f; --ink-3: #999998; --line: #e2ded6;
  --paper: #f6f4ef; --paper-2: #ffffff; --sand: #ddcba4; --sand-2: #c2a57f;
  --walnut: #684934; --walnut-2: #473729; --sage: #e8eae7;
  --ok: #3d7a52; --warn: #b7791f; --bad: #a83a32; --info: #3a5f8a;
  --ok-bg: #e6efe8; --warn-bg: #f7eddc; --bad-bg: #f5e3e1; --info-bg: #e3eaf2;
  --in-bg: #fbf6e4; --src-bg: #e7eef6; --calc-bg: #f0efed;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40,40,41,.06), 0 8px 24px rgba(40,40,41,.06);
  --font-head: "Yrsa", ui-serif, Georgia, serif;
  --font-body: "Saira", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f1ede6; --ink-2: #cfc9bf; --ink-3: #8f8a80; --line: #3a3a3c;
    --paper: #1b1b1c; --paper-2: #242426; --sand: #c2a57f; --sand-2: #ddcba4;
    --walnut: #b58a6b; --walnut-2: #d3ac8c; --sage: #2c2f2b;
    --ok-bg: #22302a; --warn-bg: #352c1c; --bad-bg: #38221f; --info-bg: #202a36;
    --in-bg: #3a3324; --src-bg: #22303d; --calc-bg: #2a2a2c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --ink: #f1ede6; --ink-2: #cfc9bf; --ink-3: #8f8a80; --line: #3a3a3c;
  --paper: #1b1b1c; --paper-2: #242426; --sand: #c2a57f; --sand-2: #ddcba4;
  --walnut: #b58a6b; --walnut-2: #d3ac8c; --sage: #2c2f2b;
  --ok-bg: #22302a; --warn-bg: #352c1c; --bad-bg: #38221f; --info-bg: #202a36;
  --in-bg: #3a3324; --src-bg: #22303d; --calc-bg: #2a2a2c;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
:root[data-theme="dark"] html, :root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-body); font-weight: 300; color: var(--ink); background: var(--paper); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 500; letter-spacing: .01em; margin: 0; color: var(--ink); }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; } h4 { font-size: 15px; }
a { color: var(--walnut); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #282829; color: #f1ede6; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; background: #ddcba4; color: #473729; font-family: var(--font-head); font-size: 19px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.brand .word { font-family: var(--font-head); font-size: 20px; letter-spacing: .08em; line-height: 1; color: #f1ede6; }
.brand .sub { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: #bdb6aa; margin-top: 3px; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: #d9d4ca; background: transparent; border: 0; cursor: pointer; font-weight: 400; font-size: 14px; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.07); }
.nav a.active, .nav button.active { background: rgba(221,203,164,.18); color: #fff; }
.nav .sect { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8f8a80; padding: 14px 10px 4px; }
.nav .cnt { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 1px 7px; }
.side .bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; font-size: 12px; color: #bdb6aa; }
.main { padding: 26px 32px 80px; max-width: 1440px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar p { margin: 4px 0 0; color: var(--ink-2); }

/* cards and panels */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.tight { padding: 12px 14px; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1000px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 720px) { .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 16px; } .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* buttons and inputs */
.btn { border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 400; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--sand-2); }
.btn.primary { background: var(--walnut); border-color: var(--walnut); color: #fff; }
.btn.primary:hover { background: var(--walnut-2); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=number], input[type=email], input[type=password], select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--paper-2); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sand); outline-offset: 0; border-color: var(--sand-2); }
input.in, select.in, .in { background: var(--in-bg); }      /* pale yellow: Merch input (sheet convention) */
input.src, .src { background: var(--src-bg); }              /* pale blue: controlled elsewhere */
.calc { background: var(--calc-bg); }                       /* light grey: calculated */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
label.f > span { font-weight: 400; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: var(--paper); font-weight: 400; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.badge.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.badge.info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.badge.sand { color: #473729; background: #ddcba4; border-color: transparent; }
:root[data-theme="dark"] .badge.sand { color: #f1ede6; background: #6b5238; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.sand { color: #f1ede6; background: #6b5238; } }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-2); font-size: 12px; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sect td { background: var(--paper); font-weight: 500; color: var(--ink-2); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }
td input, td select { padding: 5px 8px; font-size: 13px; min-width: 70px; }

/* callouts */
.note { border-left: 3px solid var(--sand-2); background: var(--paper); padding: 10px 12px; border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.note.warn { border-color: var(--warn); background: var(--warn-bg); }
.note.bad { border-color: var(--bad); background: var(--bad-bg); }
.note.ok { border-color: var(--ok); background: var(--ok-bg); }
.note.info { border-color: var(--info); background: var(--info-bg); }

/* toast, modal */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #f1ede6; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 90; font-size: 13px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.modal { background: var(--paper-2); border-radius: 14px; box-shadow: var(--shadow); width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; }

/* Omo dock (legacy panel classes) */
.omo-dock-fab { position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; background: var(--walnut); color: #fff; border: 0; cursor: pointer; box-shadow: var(--shadow); font-family: var(--font-head); font-size: 22px; z-index: 70; }
.omo-dock { position: fixed; right: 22px; bottom: 84px; width: min(410px, calc(100vw - 32px)); height: min(580px, calc(100vh - 110px)); background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 70; overflow: hidden; }
.omo-dock header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.omo-dock .scope { font-size: 11px; color: var(--ink-3); }
.omo-dock .log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 90%; padding: 9px 12px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; line-height: 1.4; }
.msg.me { align-self: flex-end; background: var(--sand); color: #282829 !important; border-bottom-right-radius: 4px; }
.msg.dw { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.dw.caution { border-color: var(--warn); background: var(--warn-bg); }
.msg.dw.decline { border-color: var(--bad); background: var(--bad-bg); }
.msg .tag { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.omo-dock form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 8px; }
.chip { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; background: var(--paper); cursor: pointer; color: var(--ink-2); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 20% -10%, var(--sand) 0%, transparent 60%), var(--paper); }
.login .card { width: min(460px, 100%); padding: 32px; }
.login .word { font-family: var(--font-head); font-size: 44px; letter-spacing: .12em; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-family: var(--font-head); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.steps button { border: 1px solid var(--line); background: var(--paper-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); }
.steps button.active { background: var(--ink); color: #f1ede6; border-color: var(--ink); }
.steps button .n { width: 18px; height: 18px; border-radius: 50%; background: #ddcba4; color: #282829; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #ddcba4; color: #282829; display: grid; place-items: center; font-weight: 500; font-size: 12px; }

/* dark-mode contrast: form controls, selects, placeholder, callouts */
input, select, textarea { color: var(--ink); background: var(--paper-2); }
::placeholder { color: var(--ink-3); opacity: 1; }
select option { color: #282829; background: #fff; }
:root[data-theme="dark"] select option { color: #f1ede6; background: #242426; }
.btn.primary { color: #fff !important; }
.note, .note.warn, .note.bad, .note.ok, .note.info { color: var(--ink-2); }
.badge.ok, .badge.warn, .badge.bad, .badge.info { filter: none; }
:root[data-theme="dark"] .badge.ok { color: #9bd3ae; } :root[data-theme="dark"] .badge.warn { color: #e6b85c; } :root[data-theme="dark"] .badge.bad { color: #ee9b94; } :root[data-theme="dark"] .badge.info { color: #9dbbe0; }
:root[data-theme="dark"] .econ-strip .cell.good .v, :root[data-theme="dark"] .good { color: #9bd3ae; } :root[data-theme="dark"] .meh, :root[data-theme="dark"] .econ-strip .cell.meh .v { color: #e6b85c; } :root[data-theme="dark"] .poor, :root[data-theme="dark"] .econ-strip .cell.poor .v { color: #ee9b94; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.ok { color: #9bd3ae; } :root:not([data-theme="light"]) .badge.warn { color: #e6b85c; } :root:not([data-theme="light"]) .badge.bad { color: #ee9b94; } :root:not([data-theme="light"]) .badge.info { color: #9dbbe0; } :root:not([data-theme="light"]) .good { color: #9bd3ae; } :root:not([data-theme="light"]) .meh { color: #e6b85c; } :root:not([data-theme="light"]) .poor { color: #ee9b94; } :root:not([data-theme="light"]) select option { color: #f1ede6; background: #242426; } }
.good { color: var(--ok); } .meh { color: var(--warn); } .poor { color: var(--bad); }

/* the rail is always dark; in dark mode it goes a step darker than the page */
:root[data-theme="dark"] .side { background: #161617; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side { background: #161617; } }
.side .btn.ghost { color: #d9d4ca; border-color: rgba(255,255,255,.25); }
.side .btn.ghost:hover { border-color: #ddcba4; }

/* Omo: the lantern artwork from the deck (slide 13). ready = soft light, thinking = glows and breathes, done = settles */
.omo-lantern { display: inline-block; line-height: 0; transition: filter .6s, transform .4s; }
.omo-lantern img { display: block; width: var(--s); height: auto; }
.omo-lantern.ready { filter: drop-shadow(0 0 6px rgba(244,217,164,.5)); }
.omo-lantern.thinking { filter: drop-shadow(0 0 16px rgba(244,200,120,.95)); animation: omo-breathe 1.1s ease-in-out infinite; }
.omo-lantern.done { filter: drop-shadow(0 0 3px rgba(200,190,170,.35)); animation: omo-settle .9s ease-out 1; }
@keyframes omo-breathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.05); } }
@keyframes omo-settle { 0% { transform: translateY(-4px); } 60% { transform: translateY(1px); } 100% { transform: translateY(0); } }
.omo-fab { position: fixed; right: 22px; bottom: 18px; width: 72px; height: 76px; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow); z-index: 70; display: grid; place-items: center; transition: transform .15s; }
.omo-fab:hover { transform: translateY(-2px); } .omo-fab.thinking { border-color: var(--sand-2); }
.omo-panel { position: fixed; right: 22px; bottom: 94px; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px)); background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 70; overflow: hidden; }
.omo-panel header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.omo-panel .scope { font-size: 11px; color: var(--ink-3); } .omo-panel .state { font-size: 11px; color: var(--walnut); }
.omo-panel .log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.omo-panel form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.msg.thinking { display: inline-flex; gap: 4px; padding: 10px 14px; } .msg.thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--sand-2); animation: omo-dots 1s infinite; } .msg.thinking span:nth-child(2) { animation-delay: .15s; } .msg.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes omo-dots { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.omo-card { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--sand) 30%, var(--paper-2)), var(--paper-2)); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.omo-card p { margin: 0; font-size: 13px; color: var(--ink-2); } .omo-card b { color: var(--ink); }
