/* css/glass.css: the glass look of the workspace (/app) and the public record (/record). Loaded after css/app.css
   and only restyles: no layout lives here.

   How it stays light: the backdrop (img/glass.webp, tools/glass-bg.py) is already blurred, so the panels above it
   are plain translucent fills with a lit top edge. Live backdrop blur is kept for the four surfaces that really sit
   over moving content: the top bar, the phone drawer, the composer and the toast. */

body.app {
  /* the app's own tokens, turned to glass */
  --night-2: rgba(255, 255, 255, .045);
  --night-3: rgba(255, 255, 255, .075);
  --night-4: rgba(255, 255, 255, .12);
  --night-line: rgba(255, 255, 255, .11);
  --night-muted: #a4a5ae;
  --radius: 16px;
  --radius-lg: 24px;
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .03));
  --glass-line: rgba(255, 255, 255, .12);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .11), 0 18px 40px -22px rgba(0, 0, 0, .8);
  --well: rgba(0, 0, 0, .3);
  --solid: #101116;
  background: #050507;
}
/* the backdrop: one fixed picture under everything */
body.app::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: #050507 url(/img/glass.webp) center / cover no-repeat;
}
.shell, .rec-main, .rec-foot { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ bars */

.top {
  background: rgba(7, 7, 10, .55); border-bottom-color: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .03);
}
.side { background: rgba(255, 255, 255, .025); border-right-color: rgba(255, 255, 255, .08); }
.composer {
  background: rgba(7, 7, 10, .5); border-top-color: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
}
.chat-head { border-bottom-color: rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .02); }
.scrim { background: rgba(2, 2, 4, .6); }
.toast {
  background: rgba(20, 21, 27, .72); border-color: var(--glass-line); border-radius: 14px;
  -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .1);
}

/* ------------------------------------------------------------------ panes */

.card, .panel-card, .stat, .tpl, .office, .steps li, .pass-form, fieldset.rule {
  background: var(--glass); border-color: var(--glass-line); box-shadow: var(--glass-shadow);
}
.pass-form { border: 1px solid var(--glass-line); }
.card .card, .panel-card .card, .panel-card .stat, .card .pass-form, .panel-card fieldset.rule {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .04);
}
.steps li { opacity: .6; }
.steps li.now, .steps li.done { opacity: 1; }
.steps li.now, .office:hover, .office.is-on {
  border-color: rgba(244, 71, 0, .55);
  box-shadow: var(--glass-shadow), 0 0 0 1px rgba(244, 71, 0, .12), 0 0 34px -12px rgba(244, 71, 0, .55);
}
.card.approval.open {
  border-color: rgba(244, 71, 0, .55);
  background: linear-gradient(180deg, rgba(244, 71, 0, .16), rgba(244, 71, 0, .03) 62%), var(--glass);
  box-shadow: var(--glass-shadow), 0 0 44px -16px rgba(244, 71, 0, .6);
}
.card.receipt.ok { border-color: rgba(62, 207, 142, .45); box-shadow: var(--glass-shadow), 0 0 40px -18px rgba(62, 207, 142, .5); }
.prelim-card { background: radial-gradient(120% 90% at 100% 0, rgba(244, 71, 0, .22), rgba(244, 71, 0, 0) 60%), var(--glass); }
.tpl { transition: border-color .2s, transform .2s, box-shadow .2s; }
.tpl:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow), 0 0 36px -14px rgba(244, 71, 0, .55); }
.card-result, .post-text, .bubble code { background: rgba(255, 255, 255, .06); }
.msg.user .bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .08));
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.msg.note p { background: rgba(255, 255, 255, .035); border-color: rgba(255, 255, 255, .14); }
.facts > div, .tbl th, .tbl td, .rec-row, .side-foot { border-color: rgba(255, 255, 255, .08); }

/* ------------------------------------------------------------------ side list */

.nav-i, .side-add, .side-bot, .side-chat { transition: background .15s, box-shadow .15s; }
.nav-i.is-on, .side-add.is-on, .side-bot.is-on, .side-chat.is-on {
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px rgba(255, 255, 255, .06);
}

/* ------------------------------------------------------------------ buttons, chips */

.btn, .chip, .ans, .seg-i, .sym-pick, .icon-btn, .wallet-chip.on, .pill, .rec-kind {
  border-color: rgba(255, 255, 255, .14);
}
.btn, .ans, .chip, .wallet-chip.on {
  background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn:hover, .ans:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .08)); }
.chip:hover { border-color: rgba(244, 71, 0, .7); }
.icon-btn { background: rgba(255, 255, 255, .05); }
.btn.ghost, .ans-deny { background: transparent; box-shadow: none; }
.btn.ghost:hover, .ans-deny:hover { background: rgba(255, 255, 255, .07); }
.btn.brand, .ans-once, .wallet-chip:not(.on), .send {
  background: linear-gradient(180deg, #ff6a2b, #f44700 58%, #e03f00); border-color: rgba(255, 150, 100, .55); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px -12px rgba(244, 71, 0, .9);
}
.btn.brand:hover, .ans-once:hover, .wallet-chip:not(.on):hover, .send:hover { background: linear-gradient(180deg, #ff7a40, #ff5210 58%, #ee4600); }
.ans-once[aria-disabled="true"] { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); box-shadow: none; color: var(--night-ink); }
.btn.danger { background: rgba(229, 83, 61, .08); border-color: rgba(229, 83, 61, .4); box-shadow: none; }
.btn.danger:hover { background: rgba(229, 83, 61, .16); }
.seg-i:has(input:checked), .sym-pick:has(input:checked) {
  border-color: rgba(244, 71, 0, .8); background: rgba(244, 71, 0, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 22px -10px rgba(244, 71, 0, .8);
}
.mode-chip { background: rgba(244, 71, 0, .1); }
.badge.zero { background: rgba(255, 255, 255, .1); }
.steps .n { background: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }

/* ------------------------------------------------------------------ fields */

input, select, textarea, .in-wrap {
  background: var(--well); border-color: rgba(255, 255, 255, .13);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus, .in-wrap:focus-within {
  border-color: rgba(244, 71, 0, .75); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 3px rgba(244, 71, 0, .16);
}
.in-wrap input, .in-wrap select, .comp-row textarea, input[type=checkbox], input[type=radio] { background: transparent; box-shadow: none; }
.in-wrap input:focus, .in-wrap select:focus, .comp-row textarea:focus { box-shadow: none; }
select option { background: var(--solid); color: var(--night-ink); }
.comp-row {
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); border-color: rgba(255, 255, 255, .14);
  border-radius: 22px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 34px -20px rgba(0, 0, 0, .9);
}
.comp-row:focus-within { border-color: rgba(244, 71, 0, .7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 3px rgba(244, 71, 0, .14); }
.spin { border-color: rgba(255, 255, 255, .14); border-top-color: var(--brand); }

/* thin, quiet scrollbars */
.side, .main, .stream { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }

/* ------------------------------------------------------------------ phone */

@media (max-width: 860px) {
  /* the drawer slides over the page, so it carries its own blur and a fill dark enough to read on */
  .side {
    background: rgba(10, 10, 14, .78); border-right-color: rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%);
  }
  body.drawer-open .side { box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .8); }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .composer, .toast, .side { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--solid); }
}

/* a Bot's face is its own outline (js/lib/faces.js): no circle clips it */
.avatar { border-radius: 0; overflow: visible; }
