/* =============================================================================
   Glass shell — soca-control in the look of soca-edge-v8's dashboard
   (soca-edge-v8/soca-dashboard/app/static/css/glass.css), in its own tone:
   navy with an amber glow ("tone C").

   A floating frosted sidebar and a frosted content panel, 14px apart over a
   slow-drifting colour field. Everything is scoped to `body.soca-glass`
   (templates/base.html and registration/login.html). As in edge-v8, the SOCA
   tokens are RE-VALUED here rather than replaced, so every page — its shared
   components from shell.css, its daisyUI controls and its inline
   `var(--x)` styles — picks up the glass look without touching its markup.

   Rules carried over from edge-v8:
   - Colours live only in tokens.css and in the --g-* tokens below; the test
     suite fails on a hex value anywhere else in this file.
   - Only the shell and floating layers (dialogs, dropdowns, the Ctrl K sheet)
     use backdrop-filter. A backdrop-filter makes its element the containing
     block of every position:fixed descendant, which would pin the pages' own
     modals (.mo) and toasts to the panel instead of the screen. The panel
     therefore frosts a ::before layer.
   - State is never shown by colour alone: the active menu item is a raised
     chip with a bolder label.
   - Chart code (theme.js) reads tokens from <html>, not <body>, so charts keep
     drawing with the solid palette.

   One difference from edge-v8: the window does not scroll, the content area
   does — the same model soca-control's shell always had. Pages size
   themselves against 100vh (the AI chat, the help contents), and keep working.
   ============================================================================= */

.soca-glass {
  /* ---- glass tokens: tone C, navy + amber ---- */
  --g-ground: #e9ecf2;
  --g-blob-a: #8ea6d8;
  --g-blob-b: #b6c0d4;
  --g-blob-c: #a9d4ff;
  --g-blob-d: #ffc861;
  --g-blob-opacity: 0.55;
  --g-glass: rgb(255 255 255 / 0.66);
  --g-glass-strong: rgb(255 255 255 / 0.86);
  --g-glass-thin: rgb(255 255 255 / 0.42);
  --g-glass-hover: rgb(255 255 255 / 0.76);
  --g-panel: rgb(255 255 255 / 0.5);
  --g-stroke: rgb(255 255 255 / 0.75);
  --g-hair: rgb(22 26 40 / 0.1);
  --g-ink: #12141b;
  --g-ink-2: #3e4350;
  --g-muted: #565c6a;
  --g-accent: #1e3a8a;
  --g-accent-soft: rgb(30 58 138 / 0.12);
  --g-on-accent: #ffffff;
  --g-focus: #1e3a8a;
  --g-on-focus: #ffffff;
  --g-shadow: 0 12px 40px rgb(28 34 60 / 0.1), 0 2px 6px rgb(28 34 60 / 0.05);
  --g-shadow-lg: 0 30px 80px rgb(20 24 44 / 0.22);
  --g-shadow-chip: 0 2px 10px rgb(0 0 0 / 0.06);
  --g-shadow-accent: 0 6px 18px rgb(30 58 138 / 0.28);
  --g-inner: inset 0 1px 0 rgb(255 255 255 / 0.65);
  --g-blur: blur(28px) saturate(150%);
  --g-r-xl: 26px;
  --g-r-lg: 20px;
  --scrim: rgb(10 12 20 / 0.32);

  /* ---- re-valued SOCA tokens: panels become glass ---- */
  --soca-surface: var(--g-glass);
  --soca-bg-app: var(--g-glass-thin);
  --soca-bg-outer: transparent;
  --soca-border: var(--g-hair);
  --soca-border-soft: var(--g-glass-thin);
  --soca-text: var(--g-ink);
  --soca-text-2: var(--g-muted);
  --soca-shadow-card: var(--g-shadow), var(--g-inner);
  --soca-shadow-pop: var(--g-shadow-lg);
  --surface: var(--g-glass);
  --surface-2: var(--g-glass-thin);
  --surface-hover: var(--g-glass-hover);
  --surface-active: var(--g-glass-strong);
  --bg: var(--g-glass-thin);
  --bd: var(--g-hair);
  --tx: var(--g-ink);
  --tl: var(--g-muted);

  position: relative;
  isolation: isolate;
  color: var(--g-ink);
}

[data-theme="dark"] .soca-glass {
  --g-ground: #06080e;
  --g-blob-a: #14234f;
  --g-blob-b: #2a3242;
  --g-blob-c: #123d66;
  --g-blob-d: #5a3d00;
  --g-blob-opacity: 0.75;
  --g-glass: rgb(30 32 42 / 0.74);
  --g-glass-strong: rgb(36 38 50 / 0.9);
  --g-glass-thin: rgb(40 42 56 / 0.4);
  --g-glass-hover: rgb(52 55 72 / 0.74);
  --g-panel: rgb(30 32 42 / 0.6);
  --g-stroke: rgb(255 255 255 / 0.1);
  --g-hair: rgb(255 255 255 / 0.09);
  --g-ink: #f4f5f8;
  --g-ink-2: #c9ccd6;
  --g-muted: #a0a6b4;
  --g-accent: #93b4ff;
  --g-accent-soft: rgb(147 180 255 / 0.16);
  --g-on-accent: #06080e;
  --g-focus: #93b4ff;
  --g-on-focus: #06080e;
  --g-shadow: 0 12px 40px rgb(0 0 0 / 0.4), 0 2px 6px rgb(0 0 0 / 0.3);
  --g-shadow-lg: 0 30px 80px rgb(0 0 0 / 0.6);
  --g-shadow-chip: 0 2px 10px rgb(0 0 0 / 0.3);
  --g-shadow-accent: 0 6px 18px rgb(0 0 0 / 0.35);
  --g-inner: inset 0 1px 0 rgb(255 255 255 / 0.06);
  --scrim: rgb(0 0 0 / 0.5);
}

/* shell.css paints `body` with --bg, which is now see-through; the ground
   has to win. */
html body.soca-glass { background: var(--g-ground); }

/* ---------------------------------------------------------------- field --- */
.g-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.g-ambient span {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: var(--g-blob-opacity); animation: g-drift 28s ease-in-out infinite alternate;
}
.g-ambient .a { width: 46vw; height: 46vw; left: -8vw; top: -12vw; background: var(--g-blob-a); }
.g-ambient .b { width: 40vw; height: 40vw; right: -10vw; top: 10vh; background: var(--g-blob-b); animation-delay: -8s; }
.g-ambient .c { width: 44vw; height: 44vw; left: 26vw; bottom: -22vw; background: var(--g-blob-c); animation-delay: -14s; }
.g-ambient .d { width: 18vw; height: 18vw; right: 18vw; bottom: 8vh; background: var(--g-blob-d); opacity: calc(var(--g-blob-opacity) * 0.5); animation-delay: -20s; }
@keyframes g-drift { to { transform: translate(4vw, 3vh) scale(1.08); } }

.g-glass {
  background: var(--g-glass);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke);
  box-shadow: var(--g-shadow), var(--g-inner);
}

/* ---------------------------------------------------------------- frame --- */
/* The window is fixed; the sidebar's menu and the content area scroll on
   their own. Width and row height follow the window, as in edge-v8. */
.g-app {
  --g-side-w: clamp(224px, 18vw, 272px);
  --g-gap: clamp(10px, 1.6vh, 14px);
  display: grid; grid-template-columns: var(--g-side-w) minmax(0, 1fr); gap: var(--g-gap); padding: var(--g-gap);
  height: 100vh; height: 100dvh;
}
.g-sidebar {
  --g-row: clamp(28px, 4vh, 36px);
  --g-vgap: clamp(4px, 1vh, 12px);
  position: relative; height: 100%; min-height: 0;
  border-radius: var(--g-r-xl); display: flex; flex-direction: column;
  padding: calc(var(--g-vgap) + 4px) 10px var(--g-vgap);
}
.g-brand { display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--g-vgap) / 2 + 2px); padding: 4px 10px var(--g-vgap); min-width: 0; }
.g-brand img { max-width: 100%; max-height: min(40px, 6vh); object-fit: contain; object-position: left; }
.g-brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--g-ink); color: var(--g-ground);
}
.g-brand-mark svg { width: 19px; height: 19px; }
.g-brand-name {
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em; line-height: 1.2; color: var(--g-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.g-tag {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-top: 3px;
  border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--g-accent); background: var(--g-accent-soft);
}

.g-search-pill {
  display: flex; align-items: center; gap: 8px; margin: 2px 4px var(--g-vgap, 10px);
  min-height: calc(var(--g-row, 36px) + 2px); padding: 0 12px;
  border-radius: 12px; background: var(--g-glass-thin); border: 1px solid var(--g-hair);
  color: var(--g-muted); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
  transition: background 0.15s;
}
.g-search-pill:hover { background: var(--g-glass-hover); }
.g-search-pill svg { width: 17px; height: 17px; flex: none; }
.g-search-pill kbd {
  margin-left: auto; font-family: inherit; font-size: 11px; padding: 1px 6px;
  border-radius: 6px; border: 1px solid var(--g-hair);
}

.g-nav {
  flex: 1; overflow-y: auto; min-height: 0; padding: 0 2px 14px; margin: 0; list-style: none;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 20px), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - 20px), transparent);
}
.g-nav-label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--g-muted); line-height: 1.2;
  padding: var(--g-vgap, 12px) 10px calc(var(--g-vgap, 12px) / 3);
}
.g-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--g-row, 36px); padding: 0 10px;
  border-radius: 11px; font: inherit; font-size: 14px; font-weight: 500; color: var(--g-ink-2);
  text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s; list-style: none;
}
.g-nav-item::-webkit-details-marker { display: none; }
.g-nav-item:hover { background: var(--g-glass-thin); color: var(--g-ink); }
.g-nav-item svg { width: 19px; height: 19px; color: var(--g-muted); flex: none; }
.g-nav-item > span:not(.g-badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-nav-item.active {
  background: var(--g-glass-strong); color: var(--g-ink); font-weight: 650;
  box-shadow: var(--g-shadow-chip), var(--g-inner);
}
.g-nav-item.active svg { color: var(--g-accent); }
.g-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--soca-danger); color: var(--soca-on-primary);
}

/* Reports group: a disclosure; the open state comes from the server on report
   pages and from the user elsewhere. */
.g-grp > summary .g-chev { width: 14px; height: 14px; margin-left: auto; transition: transform 0.2s; }
.g-grp[open] > summary .g-chev { transform: rotate(90deg); }
.g-sub { list-style: none; margin: 2px 0 4px 19px; padding: 0 0 0 10px; border-left: 1px solid var(--g-hair); }
.g-sub .g-nav-item { font-size: 13.5px; min-height: calc(var(--g-row, 36px) - 4px); }
.g-sub .g-nav-item svg { width: 16px; height: 16px; }

.g-side-foot {
  border-top: 1px solid var(--g-hair); margin-top: 4px; padding: var(--g-vgap) 4px 0;
  display: flex; align-items: center; gap: 10px;
}
.g-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--g-accent); color: var(--g-on-accent);
}
.g-who { min-width: 0; flex: 1; line-height: 1.3; }
.g-who b { display: block; font-size: 13px; color: var(--g-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-who span { display: block; font-size: 12px; color: var(--g-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-version { padding: 8px 10px 0; font-size: 11px; color: var(--g-muted); }

@media (max-height: 760px) {
  .g-version { display: none; }
  .g-sidebar .g-avatar { width: 30px; height: 30px; font-size: 12px; }
  .g-sidebar .g-icon-btn { width: 34px; height: 34px; }
}

/* The panel's frost sits on ::before (see the header). */
.g-main {
  position: relative; isolation: isolate; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; border-radius: var(--g-r-xl); overflow: hidden;
}
.g-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  background: var(--g-panel); border: 1px solid var(--g-stroke);
  box-shadow: var(--g-shadow), var(--g-inner);
}
.g-navbar {
  position: relative; z-index: 2; flex: none;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 22px; min-height: 66px;
  border-bottom: 1px solid transparent; transition: border-color 0.2s, background 0.2s;
}
.g-navbar.scrolled { border-bottom-color: var(--g-hair); background: var(--g-glass-thin); }
.g-title { min-width: 0; flex: 1; }
.g-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-title h1 {
  margin: 0; font-size: 20px; line-height: 1.2; font-weight: 750; letter-spacing: -0.02em;
  color: var(--g-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.g-eyebrow {
  display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--g-muted); margin-bottom: 1px;
}
.g-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.g-actions select.fil { height: 38px; border-radius: 12px; max-width: 220px; }
.g-clock {
  font-size: 13px; font-weight: 600; color: var(--g-ink-2); font-variant-numeric: tabular-nums;
  padding: 0 12px; height: 38px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; background: var(--g-glass-thin); border: 1px solid var(--g-hair);
}
.g-clock .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.g-icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--g-glass-thin); border: 1px solid var(--g-hair); color: var(--g-ink);
  cursor: pointer; transition: background 0.15s, transform 0.1s; flex: none; text-decoration: none;
  padding: 0;
}
.g-icon-btn:hover { background: var(--g-glass-hover); }
.g-icon-btn:active { transform: scale(0.94); }
.g-icon-btn svg { width: 19px; height: 19px; }
.g-icon-btn .g-badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; font-size: 10px;
  padding: 0 4px; border: 2px solid var(--g-ground);
}
.g-content { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; padding: 6px 22px 28px; }
.g-content > .msg-list { margin-bottom: 14px; }
/* Pages that size themselves to the window (the AI chat) leave this much room
   at the bottom; their own height already stops short of the panel edge. */
.soca-glass { --g-page-bottom: 16px; }
.g-content:has(.ai-shell) { padding-bottom: 0; }

/* Theme icons: the moon offers dark, the sun offers light. */
.g-theme .i-sun { display: none; }
[data-theme="dark"] .g-theme .i-sun { display: block; }
[data-theme="dark"] .g-theme .i-moon { display: none; }

/* ------------------------------------------- shared components (shell.css) --- */
.soca-glass .cd,
.soca-glass .kpi,
.soca-glass .rb-w:not(.rb-w--bare) {
  border-radius: var(--g-r-lg); border-color: var(--g-stroke);
  box-shadow: var(--g-shadow), var(--g-inner);
}
.soca-glass .kpi-ico { background: var(--g-accent-soft); border-color: transparent; color: var(--g-accent); }
.soca-glass .sc-btn { border-radius: 12px; }
.soca-glass .sc-btn-s { border-radius: 9px; }
.soca-glass .sc-btn-p { box-shadow: var(--g-shadow-accent); }
.soca-glass .sc-btn-o { background: var(--g-glass-strong); border-color: var(--g-hair); box-shadow: var(--g-inner); }
.soca-glass .sc-btn-o:hover { background: var(--g-glass-hover); }
.soca-glass .sc-btn:active { transform: scale(0.97); }

/* Period selector: the iOS segmented control edge-v8 uses. */
.soca-glass .tg { background: var(--g-glass-thin); border-color: var(--g-hair); border-radius: 12px; }
.soca-glass .tg-btn { border-radius: 9px; color: var(--g-ink-2); }
.soca-glass .tg-btn.active { background: var(--g-glass-strong); color: var(--g-ink); box-shadow: 0 2px 8px rgb(0 0 0 / 0.08), var(--g-inner); }

.soca-glass :is(select.fil, input.fil, .form-input) {
  background: var(--g-glass-thin); border-color: var(--g-hair); border-radius: 12px; color: var(--g-ink);
}
.soca-glass :is(select.fil, input.fil, .form-input):focus {
  background: var(--g-glass-strong); border-color: var(--soca-primary-600);
  box-shadow: 0 0 0 3px var(--g-accent-soft);
}
/* Native option lists cannot be translucent; give them the solid ground. */
.soca-glass select option { background: var(--g-ground); color: var(--g-ink); }

.soca-glass .dt tbody tr:hover { background: var(--g-glass-thin); }

.soca-glass .msg { border-radius: 16px; }

/* Page modals: the dialog is a frosted sheet over a scrim. */
.soca-glass .mo { background: var(--scrim); }
.soca-glass .ml {
  background: var(--g-glass-strong);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke); border-radius: 24px; box-shadow: var(--g-shadow-lg);
}

/* ------------------------------------------------------------- daisyUI --- */
.soca-glass .bg-base-100 { --tw-bg-opacity: 0.62; }
.soca-glass .bg-base-200 { --tw-bg-opacity: 0.42; }
.soca-glass .bg-base-300 { --tw-bg-opacity: 0.5; }
.soca-glass .border-base-200,
.soca-glass .border-base-300 { border-color: var(--g-hair); }

.soca-glass .card {
  border-radius: var(--g-r-lg); border: 1px solid var(--g-stroke);
  box-shadow: var(--g-shadow), var(--g-inner);
}
.soca-glass .card-title { color: var(--g-ink); letter-spacing: -0.01em; }

.soca-glass .btn { border-radius: 12px; font-weight: 600; text-transform: none; }
.soca-glass .btn:active:hover,
.soca-glass .btn:active:focus { transform: scale(0.97); }
.soca-glass .btn-sm { border-radius: 10px; }
.soca-glass .btn-xs { border-radius: 8px; }
.soca-glass .btn-circle { border-radius: 50%; }
.soca-glass .btn:not(.btn-primary, .btn-error, .btn-warning, .btn-success, .btn-secondary, .btn-ghost, .btn-link, .btn-outline) {
  background: var(--g-glass-strong); border-color: var(--g-hair); box-shadow: var(--g-inner); color: var(--g-ink);
}
.soca-glass .btn:not(.btn-primary, .btn-error, .btn-warning, .btn-success, .btn-secondary, .btn-ghost, .btn-link, .btn-outline):hover {
  background: var(--g-glass-hover);
}
.soca-glass .btn-outline:not(.btn-primary, .btn-error, .btn-warning, .btn-success, .btn-secondary) {
  background: var(--g-glass-thin); border-color: var(--g-hair); color: var(--g-ink);
}
.soca-glass .btn-ghost:hover { background: var(--g-glass-thin); }
.soca-glass .btn-primary:not(.btn-outline) { box-shadow: var(--g-shadow-accent); }

.soca-glass :is(.input, .select, .textarea, .file-input) {
  background-color: var(--g-glass-thin); border-color: var(--g-hair); border-radius: 12px; color: var(--g-ink);
}
.soca-glass :is(.input, .select, .textarea):focus,
.soca-glass :is(.input, .select, .textarea):focus-within {
  background-color: var(--g-glass-strong); border-color: var(--soca-primary-600);
  outline: none; box-shadow: 0 0 0 3px var(--g-accent-soft);
}

.soca-glass .table :where(thead, tfoot) { color: var(--g-muted); }
.soca-glass .table :where(thead tr, tbody tr:not(:last-child)) { border-bottom-color: var(--g-hair); }
.soca-glass .table tbody tr:hover { background: var(--g-glass-thin); }

.soca-glass .alert { border-radius: 16px; border: 1px solid var(--g-stroke); box-shadow: var(--g-inner); }
.soca-glass .collapse { border-radius: 16px; }
.soca-glass .divider::before,
.soca-glass .divider::after { background-color: var(--g-hair); }
.soca-glass .badge-ghost { background: var(--g-glass-thin); border-color: var(--g-hair); }

.soca-glass .dropdown-content,
.soca-glass .menu.bg-base-100 {
  background: var(--g-glass-strong);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke); box-shadow: var(--g-shadow-lg); border-radius: 16px;
}
.soca-glass .modal { background-color: var(--scrim); }
.soca-glass .modal-backdrop { background: transparent; }
.soca-glass .modal-box {
  background: var(--g-glass-strong);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke); border-radius: 28px; box-shadow: var(--g-shadow-lg);
}

/* ------------------------------------------------------ Ctrl K spotlight --- */
.g-spot {
  position: fixed; inset: 12vh auto auto 50%; transform: translateX(-50%);
  margin: 0; padding: 0; width: min(620px, calc(100vw - 32px)); max-height: 70vh;
  border-radius: 22px; overflow: hidden; color: var(--g-ink);
  background: var(--g-glass-strong);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke); box-shadow: var(--g-shadow-lg);
}
.g-spot::backdrop { background: var(--scrim); }
.g-spot-field {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
  border-bottom: 1px solid var(--g-hair); color: var(--g-muted);
}
.g-spot-field svg { width: 20px; height: 20px; flex: none; }
.g-spot-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--g-ink); font: inherit; font-size: 18px;
}
.g-spot-list { max-height: 50vh; overflow-y: auto; padding: 6px; margin: 0; list-style: none; }
.g-spot-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: 12px; text-decoration: none; color: inherit; font-size: 14px;
}
.g-spot-row svg { width: 18px; height: 18px; color: var(--g-muted); flex: none; }
.g-spot-row .s { margin-left: auto; font-size: 12px; color: var(--g-muted); }
.g-spot-row.hl { background: var(--g-focus); color: var(--g-on-focus); }
.g-spot-row.hl svg,
.g-spot-row.hl .s { color: var(--g-on-focus); }
.g-spot-empty { padding: 18px; color: var(--g-muted); font-size: 14px; }

/* ------------------------------------------------------------ mobile --- */
.g-tabbar, .g-only-phone { display: none; }
.g-more {
  position: fixed; inset: auto 0 0 0; margin: 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 100%; max-height: calc(100dvh - 40px); overflow-y: auto;
  border-radius: 30px 30px 0 0; color: var(--g-ink);
  background: var(--g-glass-strong);
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur);
  border: 1px solid var(--g-stroke); box-shadow: var(--g-shadow-lg);
}
.g-more::backdrop { background: var(--scrim); }
.g-grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--g-hair); margin: 0 auto 6px; }
.g-more-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px; }
.g-more-head h2 { font-size: 20px; font-weight: 700; margin: 0; color: var(--g-ink); }
.g-more .g-nav { overflow: visible; -webkit-mask-image: none; mask-image: none; padding: 0; }
.g-more .g-nav-item { padding: 11px 14px; font-size: 15px; }
.g-more-done {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--g-hair);
  background: var(--g-glass-thin); color: var(--g-ink); font: inherit; font-weight: 600; cursor: pointer;
}

@media (max-width: 1023.98px) {
  .g-app { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .g-sidebar { display: none; }
  .g-main { border-radius: 0; }
  .g-main::before { border: 0; box-shadow: none; }
  .g-navbar { padding-inline: max(16px, env(safe-area-inset-left, 0px)) 12px; background: var(--g-glass-strong); border-bottom-color: var(--g-hair); }
  .g-content { padding: 14px 16px calc(104px + env(safe-area-inset-bottom, 0px)); }
  .g-only-phone { display: grid; }
  .soca-glass { --g-page-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .g-clock { display: none; }
  .g-tabbar {
    display: flex; position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 24px));
    border-radius: 30px; padding: 6px; justify-content: space-around;
  }
  .g-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0 5px; border-radius: 22px; font: inherit; font-size: 10.5px; font-weight: 600;
    color: var(--g-muted); text-decoration: none; background: none; border: 0; cursor: pointer;
  }
  .g-tab svg { width: 23px; height: 23px; }
  .g-tab.active { color: var(--g-ink); background: var(--g-glass-strong); }
}
@media (max-width: 640px) {
  /* The title gets its own row; the workspace switcher takes the room left
     beside the icon buttons on the next. */
  .g-navbar { flex-wrap: wrap; min-height: 58px; row-gap: 8px; padding-block: 10px; }
  .g-title { flex: 1 1 100%; }
  .g-title h1 { font-size: 18px; }
  .g-actions { flex: 1 1 100%; }
  .g-actions form:has(select.fil) { flex: 1; min-width: 0; }
  .g-actions select.fil { width: 100%; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .g-ambient span { animation: none; }
  .soca-glass *, .soca-glass *::before, .soca-glass *::after { transition: none !important; }
}

/* ================================================================ sign-in === */
html body.soca-glass.g-auth-page { height: auto; min-height: 100dvh; overflow: auto; }
.g-auth { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }
.g-auth__col { display: flex; flex-direction: column; gap: 14px; width: min(420px, 100%); }
.g-auth__card { border-radius: 28px; padding: 30px 28px 28px; background: var(--g-glass-strong); box-shadow: var(--g-shadow-lg), var(--g-inner); }
.g-auth__badge { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; min-width: 0; }
.g-auth__badge img { max-height: 36px; max-width: 160px; object-fit: contain; }
.g-auth__card h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; color: var(--g-ink); margin: 0; }
.g-auth__sub { margin: 6px 0 22px; font-size: 14px; color: var(--g-muted); }
.g-auth__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.g-auth__field label { font-size: 13px; font-weight: 600; color: var(--g-ink-2); }
.g-auth__field input {
  height: 46px; padding: 0 14px; border-radius: 14px; font: inherit; font-size: 15px;
  background: var(--g-glass-thin); border: 1px solid var(--g-hair); color: var(--g-ink);
}
.g-auth__field input:focus { outline: none; border-color: var(--soca-primary-600); box-shadow: 0 0 0 3px var(--g-accent-soft); background: var(--g-glass-strong); }
.g-auth__submit {
  width: 100%; height: 48px; margin-top: 8px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 650;
  background: var(--soca-primary-600); color: var(--g-on-accent);
  box-shadow: var(--g-shadow-accent); transition: background 0.15s, transform 0.1s;
}
.g-auth__submit:hover { background: var(--soca-primary-700); }
.g-auth__submit:active { transform: scale(0.98); }
.g-auth__note { margin: 0; font-size: 13px; color: var(--g-muted); text-align: center; }
.g-auth__error {
  padding: 10px 12px; margin-bottom: 14px; border-radius: 14px; font-size: 14px; color: var(--g-ink);
  background: color-mix(in srgb, var(--soca-danger-bg) 85%, transparent); border: 1px solid var(--soca-danger);
}
.g-auth__top { position: fixed; top: 16px; right: 16px; }
