/* Liquid-glass admin panel (admin/public/admin-glass.css): frosted dark sheets for
   every admin surface, same canonical tokens as client/glass.css. Loaded after
   admin.css; every rule sits behind body.glass, so turning the toggle off (or a
   browser without backdrop-filter, via the guard at the bottom) restores the
   classic opaque look. admin.css keeps the opaque fallbacks untouched. One
   backdrop blur per panel (on the root); inner rows, lists and grids stay flat
   translucent so each surface reads as one sheet. Teal/amber/red/green accents
   are semantic (status, warnings, primary actions) and stay; HP/MP/FP/EXP bar
   fills, dots and charts are untouched. */
:root {
  --hud-alpha: .22;
  --glass-blur: 18px;
  --glass-sat: 1.6;
  --glass-sheen: linear-gradient(165deg, rgb(255 255 255 / .12), rgb(255 255 255 / .03) 32%, transparent 50%);
  --glass-shadow: 0 8px 28px rgb(0 0 0 / .35), inset 0 1px 0 rgb(255 255 255 / .22), inset 0 -1px 0 rgb(0 0 0 / .18);
  --frost-0: #f2f7ff;
  --frost-1: #dce8ff;
  --frost-2: #a9bcd8;
  --frost-dim: #8b94a8;
}

/* one frosted blur per panel (roots only; everything below stays flat).
   .tp-wrap table wells always sit inside a blurred card and .qp-list dropdowns
   always sit inside the quest dialog, so both stay flat (sheet below) and are
   deliberately not blur roots — nested backdrop-filters must never stack. */
body.glass #side,
body.glass main .card,
body.glass dialog,
body.glass .sktip {
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) brightness(1.06);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) brightness(1.06);
}
/* nested cards never blur twice (character sheet guards its own layout) */
body.glass .card .card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: transparent;
}

/* sidebar: frosted rail, hairline edge */
body.glass #side {
  background-color: rgb(18 24 38 / var(--hud-alpha));
  background-image: var(--glass-sheen);
  border-right: 1px solid rgb(255 255 255 / .16);
  box-shadow: var(--glass-shadow);
}
/* cards + dialogs + table wells: dark sheet, hairline, soft corners */
body.glass main .card,
body.glass dialog {
  background-color: rgb(18 24 38 / var(--hud-alpha));
  background-image: var(--glass-sheen);
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}
body.glass .tp-wrap,
body.glass .qp-list,
body.glass .sktip {
  background-color: rgb(18 24 38 / var(--hud-alpha));
  background-image: var(--glass-sheen);
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 10px;
  box-shadow: var(--glass-shadow);
}
/* dialog backdrop stays a dim veil (native dialogs have no sheet behind them) */
body.glass dialog::backdrop {
  background: rgb(0 0 0 / .55);
}
/* semantic structural accents survive the hairline (status, danger, attention, verdict) */
body.glass .card.svc { border-top: 3px solid #33405a; }
body.glass #svcGame { border-top-color: #22c55e; }
body.glass #svcDb { border-top-color: #38bdf8; }
body.glass .card.danger { border-color: rgb(255 110 90 / .55); }
body.glass .card.conn.attention,
body.glass .card.install.attention {
  border-color: rgb(245 165 36 / .65);
  box-shadow: 0 0 0 1px rgb(245 165 36 / .65) inset, var(--glass-shadow);
}
body.glass .ltverdict { border-left: 4px solid var(--teal); }
body.glass .ltverdict.bad { border-left-color: var(--red); }

/* one-sheet rule: nested panels, lists, grids and rows go transparent so each
   surface reads as ONE sheet (borders and text stay for readability) */
body.glass .qsec,
body.glass .itgrid fieldset,
body.glass .qdlg-head,
body.glass .qdlg-body,
body.glass .qdlg-foot,
body.glass .q-row,
body.glass .tp-table,
body.glass table.grid,
body.glass .pl-table,
body.glass .ann-slots,
body.glass .chstats,
body.glass .chbag,
body.glass .cheq-mid,
body.glass .skgrid,
body.glass .dbcols,
body.glass .ltfields,
body.glass .qf,
body.glass .srv,
body.glass .qp-chip,
body.glass .qp-opt,
body.glass .sktabs,
body.glass .chskills,
body.glass .dbacts,
body.glass .srv-btns,
body.glass .tp-bar,
body.glass .tp-add,
body.glass .ltpresets {
  background-color: transparent;
}
/* section bands and sticky heads keep a legibility veil (they scroll content under them) */
body.glass .tp-table th {
  background-color: rgb(10 14 24 / .5);
}
/* row/table hairlines replace the solid dark lines */
body.glass .top { border-bottom-color: rgb(255 255 255 / .12); }
body.glass .brand { border-bottom-color: rgb(255 255 255 / .12); }
body.glass .srv { border-top-color: rgb(255 255 255 / .12); }
body.glass .grid th { border-bottom-color: rgb(255 255 255 / .12); }
body.glass .grid td { border-bottom-color: rgb(255 255 255 / .08); }
body.glass .tp-table td { border-top-color: rgb(255 255 255 / .08); }
body.glass .qdlg-head { border-bottom-color: rgb(255 255 255 / .12); }
body.glass .qdlg-foot { border-top-color: rgb(255 255 255 / .12); }
body.glass .dactions.accacts { border-top-color: rgb(255 255 255 / .12); }
body.glass .qsec,
body.glass .itgrid fieldset { border-color: rgb(255 255 255 / .12); }
body.glass .sktip th,
body.glass .sktip td { border-bottom-color: rgb(255 255 255 / .08); }
/* sidebar links: frosted hover, active teal rail kept */
body.glass #side a:hover { background-color: rgb(140 175 255 / .25); }
body.glass #side a.on { background-color: rgb(45 212 191 / .16); }
body.glass tr.accrow:hover,
body.glass tr.accrow:focus-visible { background-color: rgb(140 175 255 / .12); }
body.glass .qp-opt.on,
body.glass .qp-opt:hover { background-color: rgb(45 212 191 / .16); }
body.glass .skcell:hover,
body.glass .skcell:focus { border-color: var(--teal); }

/* badges, chips, id buttons, small cells: flat translucent, badge-scale corners, no blur */
body.glass .badge,
body.glass .grid .tags span,
body.glass .skcell,
body.glass .chstat,
body.glass .chcell,
body.glass .ann-slot,
body.glass .idbtn,
body.glass .sktab,
body.glass .qp-chip {
  border-radius: 8px;
}
body.glass .skcell,
body.glass .chstat,
body.glass .chcell,
body.glass .ann-slot,
body.glass .tp-add,
body.glass .chbag,
body.glass .chmoney span {
  background-color: rgb(255 255 255 / .04);
  border-color: rgb(255 255 255 / .12);
}
body.glass .ann-slot.full { border-color: rgb(45 212 191 / .35); }
body.glass .ann-slot.over {
  border-color: #2dd4bf;
  background-color: rgb(45 212 191 / .12);
}
body.glass .chcell.empty { background-color: transparent; }
body.glass .idbtn {
  background-color: rgb(45 212 191 / .12);
  border-color: rgb(45 212 191 / .4);
}
body.glass .idbtn:hover { border-color: var(--teal); }
body.glass .idbtn.ok { background-color: var(--teal); }
body.glass .qp-chip {
  background-color: rgb(45 212 191 / .12);
  border-color: rgb(45 212 191 / .5);
}
/* default buttons go frosted flat; semantic fills (go/stop/teal/ok) keep their
   fallback fills (this selector would otherwise outrank them and leave dark
   text on near-transparent chrome) */
body.glass .btn:not(.go):not(.stop):not(.teal):not(.ok) {
  background-color: rgb(255 255 255 / .06);
  border-color: rgb(255 255 255 / .16);
}
body.glass .btn:not(.go):not(.stop):not(.teal):not(.ok):hover:not(:disabled) { border-color: #a8c8ff; }
body.glass .sktab {
  background-color: rgb(255 255 255 / .06);
  border-color: rgb(255 255 255 / .16);
}

/* typed-text fields + log views keep a legible dark veil (never thinned to the sheet) */
body.glass input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]),
body.glass select,
body.glass textarea {
  background-color: rgb(0 0 0 / .35);
  border-color: rgb(150 175 220 / .4);
  color: #fff;
}
body.glass .logs pre,
body.glass #insLog,
body.glass #ltLog {
  background-color: rgb(10 14 24 / .5);
  border-color: rgb(255 255 255 / .12);
  color: var(--frost-1);
}
body.glass select option { background-color: #111827; color: #fff; }
body.glass input::placeholder,
body.glass textarea::placeholder { color: var(--frost-dim); }
body.glass .itgrid .changed { outline-color: #f5a524; }

/* frost text: one soft shadow under every light text so it lifts off the blur;
   dim/secondary labels move to the frost scale (teal/amber/red/green brand and
   status inks are semantic and untouched) */
body.glass #side,
body.glass main .card,
body.glass dialog,
body.glass .tp-wrap,
body.glass .qp-list,
body.glass .sktip {
  text-shadow: 0 1px 2px rgb(0 0 0 / .85), 0 0 1px rgb(0 0 0 / .6);
}
body.glass .dim,
body.glass .card h5,
body.glass .qdlg-head h5,
body.glass .qsec h6,
body.glass .qsec summary,
body.glass #side h6,
body.glass dt,
body.glass .grid th,
body.glass .tp-table th,
body.glass .shead .port,
body.glass .srv-info small,
body.glass .srv-status,
body.glass .pager,
body.glass .legend,
body.glass .rates label,
body.glass .announce label,
body.glass .ann-slots-title,
body.glass .ltfields label,
body.glass .ltverdict p,
body.glass .qf label,
body.glass .qfld,
body.glass .itgrid legend,
body.glass .itgrid label,
body.glass dialog label,
body.glass #view-database .fields label,
body.glass .qp-note,
body.glass .qp-opt small,
body.glass .skhint,
body.glass .chstat span,
body.glass .chlock,
body.glass .chmoney span,
body.glass .itname small,
body.glass .itdesc,
body.glass .itkind,
body.glass .skmode h3 {
  color: var(--frost-dim);
}
/* section numbers keep their teal ink on a thinned teal veil */
body.glass .qn { background-color: rgb(45 212 191 / .16); }
body.glass .sktip,
body.glass .qp-list,
body.glass .logs pre,
body.glass #insLog { color: var(--frost-1); }

/* focus rings stay visible on the dark sheets */
body.glass a:focus-visible,
body.glass button:focus-visible,
body.glass summary:focus-visible {
  outline: 2px solid #a8c8ff;
  outline-offset: 1px;
}
body.glass input:focus,
body.glass select:focus,
body.glass textarea:focus {
  outline: 2px solid #a8c8ff;
  outline-offset: 0;
  border-color: #a8c8ff;
}
/* shop add-item form: same frost secondary labels, error ink and focus as the rest */
body.glass #wsForm .ws-fld { color: var(--frost-dim); }
body.glass input[aria-invalid="true"],
body.glass select[aria-invalid="true"] {
  outline-color: #ff9a9d;
  border-color: #ff9a9d;
}
body.glass #wsMsg:focus-visible { outline-color: #a8c8ff; }

/* sidebar glass toggle (layout lives in admin.css so it renders with glass off too) */
body.glass .side-foot { border-top-color: rgb(255 255 255 / .12); }
body.glass .side-foot label { color: var(--frost-dim); }

/* marquee preview, charts, dots, bars and thumbs are content, not chrome: no rule
   (.ann-preview, .chart canvas, .dot, .chbar i, .thumb, .qp-ic, .ithead img,
   .chcell img, .cheq-mid art, .brand art, .stat art, .msg inks, .badge fills,
   .btn.go/.stop/.teal/.ok fills, .sktab.on, .qp-any, .ltok/.ltbad, .chcell em,
   .cheq-mid inks, .shead inks, .stat b inks, .gw inks, .qn ring, .log spans). */

/* no backdrop-filter: raise the frost to legible near-opaque fills */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.glass #side,
  body.glass main .card,
  body.glass dialog,
  body.glass .tp-wrap,
  body.glass .qp-list,
  body.glass .sktip {
    background-color: rgb(18 24 38 / .85);
  }
  body.glass input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]),
  body.glass select,
  body.glass textarea,
  body.glass .logs pre,
  body.glass #insLog,
  body.glass #ltLog {
    background-color: rgb(0 0 0 / .7);
  }
}
