/* OneNine Finance OS: the shell (login screen, top bar, home, settings, audit, system).
   Tokens, fonts, buttons, forms, chips and notices come from base.css. No inline style anywhere:
   the Content Security Policy refuses it. */

body.os { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.quiet { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.mono { font-family: var(--mono); font-size: .85em; }
.kicker { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
em { font-style: italic; }
h1 { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.1rem); line-height: 1.02; letter-spacing: -.01em; }
h1 em, h2 em { font-family: var(--serif); }
h2 { font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; }
h3 { font-size: 1rem; font-weight: 600; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--slate); color: var(--white); }
.topbar-in { display: flex; align-items: center; gap: 22px; min-height: 60px; }
.tb-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.tb-brand img { height: 30px; width: auto; max-width: 140px; object-fit: contain; border-radius: 6px; background: var(--white); padding: 3px; }
.mono-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--butter);
  color: var(--ink); font-weight: 650; font-size: .85rem; letter-spacing: .02em; flex: none; }
.tb-client { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.tb-os { display: block; font-size: .7rem; color: rgba(255, 255, 255, .62); letter-spacing: .04em; }
.tb-nav { display: flex; gap: 4px; }
.tb-nav a { color: rgba(255, 255, 255, .78); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: .9rem; }
.tb-nav a:hover { color: var(--white); background: rgba(255, 255, 255, .08); }
.tb-nav a[aria-current="page"] { color: var(--ink); background: var(--butter); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-status { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .85); font-size: .85rem; text-decoration: none;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
a.tb-status:hover { background: rgba(255, 255, 255, .08); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #7FC79A; box-shadow: 0 0 0 3px rgba(127, 199, 154, .22); flex: none; }
.tb-status.warn .dot { background: var(--glow); box-shadow: 0 0 0 3px rgba(248, 161, 63, .25); }
.pill-support { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: .82rem;
  font-weight: 500; text-decoration: none; background: var(--glow); color: var(--ink); white-space: nowrap; }
.pill-support.allowed { background: rgba(255, 244, 194, .16); color: var(--butter); border: 1px solid rgba(255, 244, 194, .35); }
.pill-support svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tb-person { position: relative; }
.tb-person summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px;
  border-radius: 999px; }
.tb-person summary::-webkit-details-marker { display: none; }
.tb-person summary:hover { background: rgba(255, 255, 255, .08); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--dusty); color: var(--navy);
  font-size: .8rem; font-weight: 650; }
.tb-who { font-size: .85rem; line-height: 1.2; text-align: left; white-space: nowrap; }
.tb-who span { display: block; font-size: .72rem; color: rgba(255, 255, 255, .62); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--white); color: var(--ink);
  border-radius: var(--radius); box-shadow: 0 18px 50px -18px rgba(11, 22, 32, .45); padding: 8px; z-index: var(--z-menu);
  border: 1px solid var(--hair); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  background: none; border: 0; cursor: pointer; font-size: .92rem; }
.menu a:hover, .menu button:hover { background: var(--paper); }
.menu hr { border: 0; border-top: 1px solid var(--hair); margin: 6px 4px; }

/* ------------------------------------------------------------------ main and footer */
.main { flex: 1; padding: 36px 0 56px; }
.os-foot { padding: 18px 0 24px; color: var(--ink-3); font-size: .78rem; border-top: 1px solid var(--hair); }
.os-foot .wrap { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.sim-tag { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.flash { margin-bottom: 18px; display: grid; gap: 8px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { max-width: 62ch; }

/* ------------------------------------------------------------------ home */
.hello { margin-bottom: 30px; }
.hello h1 { margin-top: 8px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.app-tile { position: relative; display: grid; gap: 10px; align-content: start; min-height: 190px; padding: 22px; border-radius: 18px;
  background: var(--white); border: 1px solid var(--hair); text-decoration: none; color: var(--ink);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease); }
a.app-tile:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -28px rgba(11, 22, 32, .45); border-color: var(--line); }
.app-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--slate); color: var(--butter); }
.app-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.app-name { font-family: var(--serif); font-size: 1.65rem; line-height: 1.05; }
.app-desc { color: var(--ink-2); font-size: .92rem; }
.app-open { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: .88rem; font-weight: 500; }
.app-open > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
.app-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .2s var(--ease); }
a.app-tile:hover .app-open svg { transform: translateX(3px); }
.app-tile.soon { background: transparent; border-style: dashed; color: var(--ink-3); }
.app-tile.soon .app-icon { background: var(--paper); color: var(--ink-3); border: 1px dashed var(--line); }
.today { margin-top: 38px; display: grid; gap: 12px; }
.today h2 { font-size: 1.5rem; }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.today-list li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--white);
  border: 1px solid var(--hair); }
.today-list li .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.today-list li .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.today-list li.todo .ico { background: var(--butter); color: var(--ink); }
.today-list li.warn .ico { background: var(--warn-bg); color: var(--warn); }
.today-list li.support .ico { background: var(--peach); color: var(--orange-text); }
.today-list li.ok .ico { background: var(--ok-bg); color: var(--ok); }
.today-list li p { flex: 1; }
.today-list li a { font-size: .875rem; font-weight: 500; white-space: nowrap; }

/* ------------------------------------------------------------------ cards, tables, settings */
.card { background: var(--white); border: 1px solid var(--hair); border-radius: 16px; padding: 22px; }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }
.card + .grid-2, .card + .grid-3, .grid-2 + .card, .grid-3 + .card, .grid-2 + .grid-2 { margin-top: 16px; }
.state + form, .state + p { margin-top: 18px; }
.card ul + p, .card .meter + p, .card .big + .meter { margin-top: 12px; }
.act { display: block; }
.act-code { display: block; font-family: var(--mono); font-size: .72rem; color: var(--ink-3); }
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.subnav { position: sticky; top: 84px; display: grid; gap: 2px; }
.subnav a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: .95rem; }
.subnav a:hover { background: var(--white); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--orange); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 12px 10px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.t tr.off td { color: var(--ink-3); }
table.t td.actions { white-space: nowrap; text-align: right; }
.table-wrap { overflow-x: auto; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select.input { min-height: 34px; padding: .25rem .5rem; width: auto; font-size: .85rem; }
.btn-xs { min-height: 30px; padding: .25rem .7rem; font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 12px; }
.form-grid .input { height: 46px; }
.once { border: 2px solid var(--glow); background: var(--cream); }
.once code { font-family: var(--mono); font-size: 1.05rem; background: var(--white); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--hair); }
.state { display: flex; gap: 16px; align-items: flex-start; }
.state-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.state-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.state.off .state-ico { background: var(--paper); color: var(--slate); border: 1px solid var(--hair); }
.state.on .state-ico { background: var(--peach); color: var(--orange-text); }
.state.connected .state-ico { background: var(--glow); color: var(--ink); }
.state h2 { margin-bottom: 4px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.choices label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; font-size: .92rem; }
.choices label:has(input:checked) { border-color: var(--slate); background: var(--butter); }
.choices input { accent-color: var(--slate); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.ticks { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; color: var(--ink-2); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.facts dt { color: var(--ink-3); font-size: .875rem; }
dl.facts dd { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: .85rem; color: var(--ink-2); }
.filters a[aria-current="true"] { background: var(--slate); border-color: var(--slate); color: var(--white); }
.meter { height: 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--hair); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--slate); }
.meter span.w10 { width: 10%; } .meter span.w20 { width: 20%; } .meter span.w30 { width: 30%; } .meter span.w40 { width: 40%; }
.meter span.w50 { width: 50%; } .meter span.w60 { width: 60%; } .meter span.w70 { width: 70%; } .meter span.w80 { width: 80%; }
.meter span.w90 { width: 90%; } .meter span.w100 { width: 100%; }
.big { font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.logo-preview { width: 180px; height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: var(--white); }
.logo-preview img { max-width: 160px; max-height: 70px; object-fit: contain; }

/* ------------------------------------------------------------------ sign in screens */
body.auth-page { background: var(--white); }
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { position: relative; overflow: hidden; background: var(--slate); color: var(--white); padding: 44px clamp(24px, 5vw, 72px);
  display: flex; flex-direction: column; }
.auth-brand .wave { width: 560px; right: -210px; top: -150px; opacity: .95; }
.auth-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.auth-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; background: var(--white); border-radius: 12px; padding: 6px 10px; }
.auth-mono { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 15px; background: var(--butter); color: var(--ink);
  font-weight: 650; font-size: 1.2rem; }
.auth-client { position: relative; z-index: 1; margin-top: auto; padding-bottom: 40px; }
.auth-client h1 { color: var(--white); font-size: clamp(2.4rem, 4.6vw, 3.6rem); max-width: 12ch; }
.auth-client h1 em { color: var(--butter); }
.auth-client p { color: rgba(255, 255, 255, .72); margin-top: 14px; max-width: 40ch; }
.auth-meta { position: relative; z-index: 1; display: flex; gap: 8px 16px; flex-wrap: wrap; font-size: .78rem; color: rgba(255, 255, 255, .6); }
.auth-meta img { height: 14px; width: auto; opacity: .9; }
.auth-form { display: grid; align-content: center; padding: 44px clamp(24px, 6vw, 96px); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.auth-card.wide { max-width: 520px; }
.auth-card h2 { font-size: 2.2rem; }
.auth-card form { display: grid; gap: 14px; }
.auth-foot { font-size: .85rem; color: var(--ink-3); }
.btn-block { width: 100%; }
.qr { width: 196px; height: 196px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; }
.codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.codes code { display: block; text-align: center; padding: 8px; border-radius: 8px; background: var(--paper); font-family: var(--mono); }
.secret { font-family: var(--mono); }
.code-input { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .2em; text-align: center; }
ol.how { margin: 0; padding-left: 1.2rem; color: var(--ink-2); display: grid; gap: 6px; }
.center { text-align: center; }

@media (max-width: 980px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .subnav { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tb-nav { display: none; }
  .tb-who { display: none; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { min-height: 260px; padding: 28px 20px; }
  .auth-brand .wave { width: 380px; right: -170px; top: -120px; }
  .auth-client { padding-bottom: 10px; }
  .auth-form { padding: 32px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .tb-status .lbl { display: none; }
  .pill-support .lbl { display: none; }
  .wrap { padding: 0 16px; }
}
