/* Blue & orange — glass design.
   Loaded after ../css/app.css: re-tunes its tokens (so the reused pages fit) and adds the floating
   glass chrome. The classic design never loads this file.
   Behaviour that CSS can't do lives in liquid.js (light, refraction, sliding lenses), dock.js (tab bar),
   layers.js (sheets, alerts, toasts) and motion.js (the springs below, for scripts). */

@property --la { syntax: "<angle>"; inherits: true; initial-value: -40deg; }

:root[data-design="glass"] {
  color-scheme: light;
  /* Apple's light palette */
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --surface-3: #ececf1;
  --hover: rgba(60, 60, 67, 0.05);
  --border: #e3e3e8;
  --border-strong: #d1d1d6;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --ink: #1d1d1f;
  --ink-text: #ffffff;
  --blue: #007aff;
  --blue-soft: #e6f1ff;
  --blue-ink: #0062cc;
  --orange: #f07a2a;
  --orange-soft: #fff1e6;
  --orange-ink: #a8480b;
  --ok: #248a3d;
  --ok-soft: #e4f6e8;
  --warn: #b25000;
  --warn-soft: #fff3e0;
  --danger: #ff3b30;
  --danger-soft: #ffeceb;
  --green: #34c759;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --fill-strong: rgba(120, 120, 128, 0.26);
  --focus: 0 0 0 4px rgba(0, 122, 255, 0.28);
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 10px -4px rgba(0, 0, 0, 0.06);
  --shadow-pop: 0 30px 80px -12px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Segoe UI Variable Text", "Segoe UI", "Yu Gothic UI", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --shelf: #e5e5ea;
  /* glass */
  --glass-bg: rgba(255, 255, 255, 0.46);
  --glass-strong: rgba(250, 250, 252, 0.74);
  --glass-well: rgba(118, 118, 128, 0.1);
  --glass-pill: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-hi: rgba(255, 255, 255, 0.85);
  --glass-lo: rgba(255, 255, 255, 0.35);
  --glass-sheen: rgba(255, 255, 255, 0.34);
  --glass-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.06);
  --rim: rgba(255, 255, 255, 0.98);
  --rim-mid: rgba(255, 255, 255, 0.6);
  --rim-lo: rgba(255, 255, 255, 0.16);
  --glow: rgba(255, 255, 255, 0.38);
  --lens-fill: rgba(120, 120, 128, 0.15);
  --seg-lens: #ffffff;
  --backdrop: rgba(0, 0, 0, 0.2);
  --toast-bg: rgba(28, 28, 30, 0.84);
  --amb-a: rgba(0, 122, 255, 0.17);
  --amb-b: rgba(255, 128, 40, 0.15);
  --amb-c: rgba(175, 82, 222, 0.09);
  --live: #ff3b30;
  /* springs — the same curves as motion.js: SwiftUI-style spring(duration, bounce) sampled into linear().
     Short and nearly without overshoot — motion explains what happened, then gets out of the way. */
  --spring-smooth: linear(0, 0.039, 0.1134, 0.2049, 0.3014, 0.3955, 0.4832, 0.5624, 0.6395, 0.6992, 0.7504, 0.7937, 0.8302, 0.8607, 0.886, 0.907, 0.9242, 0.9384, 0.95, 0.9595, 0.9672, 0.9735, 0.9786, 0.9827, 0.9864, 0.9891, 0.9912, 0.9929, 0.9943, 0.9954, 0.9963, 0.9971, 1);
  --dur-smooth: 485ms;
  --spring-snappy: linear(0, 0.0335, 0.0866, 0.166, 0.2544, 0.3321, 0.4206, 0.4924, 0.5697, 0.6391, 0.6921, 0.7464, 0.793, 0.8273, 0.8614, 0.886, 0.9101, 0.9297, 0.9436, 0.9568, 0.9673, 0.9746, 0.9813, 0.9859, 0.9901, 0.9932, 0.9953, 0.9971, 0.9984, 0.9992, 0.9999, 1.0003, 1);
  --dur-snappy: 355ms;
  --spring-bouncy: linear(0, 0.0363, 0.1092, 0.2028, 0.3054, 0.4087, 0.4965, 0.5877, 0.6689, 0.7395, 0.7993, 0.8491, 0.8897, 0.9221, 0.9474, 0.9668, 0.9813, 0.9909, 0.9985, 1.0037, 1.0069, 1.0086, 1.0093, 1.0093, 1.0089, 1.0081, 1.0072, 1.0063, 1.0053, 1.0044, 1.0036, 1.0029, 1);
  --dur-bouncy: 477ms;
  --spring-press: linear(0, 0.047, 0.124, 0.2341, 0.3377, 0.4545, 0.5502, 0.6484, 0.7329, 0.7952, 0.8539, 0.8951, 0.932, 0.9566, 0.9775, 0.9906, 1.0009, 1.0073, 1.0106, 1.0124, 1.0127, 1.0122, 1.0113, 1.0099, 1.0084, 1.0071, 1.0057, 1.0046, 1.0035, 1.0027, 1.0019, 1.0014, 1);
  --dur-press: 405ms;
}

:root[data-design="glass"][data-theme="dark"] {
  color-scheme: dark;
  /* Apple's dark palette: true black, raised greys */
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #232325;
  --surface-3: #2c2c2e;
  --hover: rgba(235, 235, 245, 0.06);
  --border: #2c2c2e;
  --border-strong: #3a3a3c;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --ink: #f5f5f7;
  --ink-text: #000000;
  --blue: #0a84ff;
  --blue-soft: #0b2a4f;
  --blue-ink: #6cb2ff;
  --orange: #ff8a3d;
  --orange-soft: #3a2416;
  --orange-ink: #ffb07d;
  --ok: #30d158;
  --ok-soft: #10331b;
  --warn: #ffb340;
  --warn-soft: #3a2a0c;
  --danger: #ff453a;
  --danger-soft: #3d1614;
  --green: #30d158;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.32);
  --fill-strong: rgba(118, 118, 128, 0.36);
  --focus: 0 0 0 4px rgba(10, 132, 255, 0.4);
  --shadow: none;
  --shadow-pop: 0 30px 80px -10px rgba(0, 0, 0, 0.75);
  --shelf: #111113;
  --glass-bg: rgba(46, 46, 50, 0.46);
  --glass-strong: rgba(30, 30, 33, 0.78);
  --glass-well: rgba(118, 118, 128, 0.2);
  --glass-pill: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.2);
  --glass-lo: rgba(255, 255, 255, 0.06);
  --glass-sheen: rgba(255, 255, 255, 0.07);
  --glass-shadow: 0 14px 34px -6px rgba(0, 0, 0, 0.6);
  --rim: rgba(255, 255, 255, 0.55);
  --rim-mid: rgba(255, 255, 255, 0.26);
  --rim-lo: rgba(255, 255, 255, 0.06);
  --glow: rgba(255, 255, 255, 0.2);
  --lens-fill: rgba(255, 255, 255, 0.13);
  --seg-lens: #636366;
  --backdrop: rgba(0, 0, 0, 0.5);
  --toast-bg: rgba(64, 64, 70, 0.82);
  --amb-a: rgba(10, 132, 255, 0.24);
  --amb-b: rgba(255, 120, 30, 0.16);
  --amb-c: rgba(191, 90, 242, 0.14);
  --live: #ff453a;
}

@media (prefers-color-scheme: dark) {
  :root[data-design="glass"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --surface-3: #2c2c2e;
    --hover: rgba(235, 235, 245, 0.06);
    --border: #2c2c2e;
    --border-strong: #3a3a3c;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --ink: #f5f5f7;
    --ink-text: #000000;
    --blue: #0a84ff;
    --blue-soft: #0b2a4f;
    --blue-ink: #6cb2ff;
    --orange: #ff8a3d;
    --orange-soft: #3a2416;
    --orange-ink: #ffb07d;
    --ok: #30d158;
    --ok-soft: #10331b;
    --warn: #ffb340;
    --warn-soft: #3a2a0c;
    --danger: #ff453a;
    --danger-soft: #3d1614;
    --green: #30d158;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.32);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --focus: 0 0 0 4px rgba(10, 132, 255, 0.4);
    --shadow: none;
    --shadow-pop: 0 30px 80px -10px rgba(0, 0, 0, 0.75);
    --shelf: #111113;
    --glass-bg: rgba(46, 46, 50, 0.46);
    --glass-strong: rgba(30, 30, 33, 0.78);
    --glass-well: rgba(118, 118, 128, 0.2);
    --glass-pill: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.2);
    --glass-lo: rgba(255, 255, 255, 0.06);
    --glass-sheen: rgba(255, 255, 255, 0.07);
    --glass-shadow: 0 14px 34px -6px rgba(0, 0, 0, 0.6);
    --rim: rgba(255, 255, 255, 0.55);
    --rim-mid: rgba(255, 255, 255, 0.26);
    --rim-lo: rgba(255, 255, 255, 0.06);
    --glow: rgba(255, 255, 255, 0.2);
    --lens-fill: rgba(255, 255, 255, 0.13);
    --seg-lens: #636366;
    --backdrop: rgba(0, 0, 0, 0.5);
    --toast-bg: rgba(64, 64, 70, 0.82);
    --amb-a: rgba(10, 132, 255, 0.24);
    --amb-b: rgba(255, 120, 30, 0.16);
    --amb-c: rgba(191, 90, 242, 0.14);
    --live: #ff453a;
  }
}

:root[data-design="glass"] ::selection { background: color-mix(in srgb, var(--blue) 26%, transparent); }
:root[data-design="glass"] body { letter-spacing: 0.005em; }

/* ---------------------------------------------------------------- touch
   A finger gets instant feedback, no grey tap flash, no double-tap zoom delay, and hover looks that would
   otherwise stick after a tap are only for real pointers. Pressing shrinks a button quickly; letting go
   springs it back with a small overshoot. Glass buttons grow instead, as iOS's do. */
:root[data-design="glass"] :is(a, button, select, summary, label, .g-tile) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:root[data-design="glass"] :is(.btn, .chip, .g-pillbtn, .g-chip, .g-go, .g-x, .g-addtile, .g-selchip, .g-tile, .g-bots, .g-cost, .g-plus) {
  transition: transform var(--dur-press) var(--spring-press), background-color .2s, color .2s, box-shadow .3s, opacity .2s, filter .2s, --la .45s ease-out;
}
:root[data-design="glass"] :is(.btn, .chip, .g-pillbtn, .g-chip, .g-go, .g-x, .g-addtile, .g-selchip):active { transform: scale(0.95); transition-duration: .1s; transition-timing-function: ease-out; }
:root[data-design="glass"] :is(.g-plus, .g-bots, .g-cost):active { transform: scale(1.1); transition-duration: .14s; transition-timing-function: ease-out; }
:root[data-design="glass"] .g-tile:active { transform: scale(0.975); transition-duration: .1s; transition-timing-function: ease-out; }
:is(.g-menu a, .g-menu button.mi, .g-results .opt):active { background: var(--glass-pill); }
.g-card .ttl:active, .g-card .media:active { opacity: 0.75; }
@media (hover: none) {
  .g-tile:hover { box-shadow: var(--shadow); }
  .g-tab:hover { color: var(--text-2); }
  .g-tab.on:hover { color: var(--blue); }
  .g-pillbtn:hover, .g-plus:hover { filter: none; }
  .g-cost:hover { background: none; }
  .g-card .ttl:hover { text-decoration: none; }
  .g-addtile:hover { color: var(--text-2); border-color: color-mix(in srgb, var(--text) 22%, transparent); }
  :root[data-design="glass"] .btn:hover { background-color: var(--fill); }
}

/* the feed drawer (reused) keeps its four facts as a 2×2 grid on a phone instead of four tall rows */
@media (max-width: 760px) {
  :root[data-design="glass"] .drawer .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- the material
   A tinted, blurred slab with: a sheen on its upper half, a thin rim that catches the light (brightest
   where the pointer is — liquid.js turns --la), inner light along the top edge, and a soft drop shadow.
   On Chromium, liquid.js adds real refraction at the edges (backdrop-filter: url(#…)). */
.glass {
  background: linear-gradient(180deg, var(--glass-sheen), transparent 55%), var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  border: 0;
  box-shadow: inset 0 1px 1px var(--glass-hi), inset 0 -1px 1px var(--glass-lo), var(--glass-shadow);
}
.glass::before, .g-plus::before, .g-morph::before, .g-lens::after,
:root[data-design="glass"] :is(.modal, .drawer, .toast)::before {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; padding: 1px;
  background: conic-gradient(from var(--la), var(--rim), var(--rim-lo) 15%, transparent 28%, var(--rim-mid) 50%, transparent 72%, var(--rim-lo) 85%, var(--rim));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* the light a finger makes where it touches (liquid.js sets --px / --py and .g-lit) */
.g-top::after, .g-plus::after {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  background: radial-gradient(110px circle at var(--px, 50%) var(--py, 50%), var(--glow), transparent 70%);
  mix-blend-mode: plus-lighter; opacity: 0; transition: opacity .8s ease-out;
}
.g-lit::after { opacity: 1; transition-duration: .08s; }

/* ---------------------------------------------------------------- behind everything: a slow colour field
   (glass needs something behind it to bend and tint; plain grey would make it look like frosted plastic) */
.g-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.g-ambient i { position: absolute; width: 95vmax; height: 95vmax; border-radius: 50%; }
.g-ambient .a { left: -38vmax; top: -48vmax; background: radial-gradient(closest-side, var(--amb-a), transparent); }
.g-ambient .b { right: -42vmax; bottom: -52vmax; background: radial-gradient(closest-side, var(--amb-b), transparent); }
.g-ambient .c { left: 32vw; top: 28vh; width: 62vmax; height: 62vmax; background: radial-gradient(closest-side, var(--amb-c), transparent); }

/* content scrolling under the floating bars softens and fades instead of colliding with them */
.g-edge { position: fixed; left: 0; right: 0; z-index: 49; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.g-edge.top { top: 0; height: calc(92px + env(safe-area-inset-top));
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 70%, transparent), color-mix(in srgb, var(--bg) 30%, transparent) 55%, transparent); }
.g-edge.bottom { bottom: 0; height: calc(108px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 70%, transparent), color-mix(in srgb, var(--bg) 30%, transparent) 55%, transparent); }
.g-under-top .g-edge.top, .g-under-bottom .g-edge.bottom { opacity: 1; }
body.kb .g-edge.bottom { display: none; }

/* ---------------------------------------------------------------- shell */
.g-shell { min-height: 100vh; }
.g-main { padding: calc(92px + env(safe-area-inset-top)) clamp(12px, 3vw, 32px) calc(132px + env(safe-area-inset-bottom)); outline: none; transform-origin: 50% 30vh; }
.g-main .page { max-width: 1120px; }
.g-main .page.wide { max-width: 1360px; }

.g-top {
  position: fixed; z-index: 50; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0 auto;
  width: min(880px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 999px;
  transition: --la .45s ease-out;
}
.g-bots { position: relative; z-index: 4; display: flex; align-items: center; padding: 2px 4px 2px 2px; border: 0; background: none; border-radius: 999px; cursor: pointer; }
.g-bots img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px var(--glass-hi); transition: filter .2s, box-shadow .2s; }
.g-bots img + img { margin-left: -9px; }
.g-bots img.on.b { box-shadow: 0 0 0 2px var(--glass-hi), 0 0 14px rgba(70, 120, 255, 0.75); }
.g-bots img.on.o { box-shadow: 0 0 0 2px var(--glass-hi), 0 0 14px rgba(255, 140, 60, 0.75); }
.g-bots img.off { filter: grayscale(1) opacity(0.55); }
.g-bots .warn { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-left: -6px; align-self: flex-start; box-shadow: 0 0 0 2px var(--glass-hi); }

.g-search { position: relative; z-index: 4; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  border-radius: 999px; background: var(--glass-well); transition: background-color .25s, box-shadow .25s; }
.g-search:focus-within { background: color-mix(in srgb, var(--surface) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 28%, transparent); }
.g-search svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.g-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); }
.g-search input::placeholder { color: var(--text-2); }

.g-cost { position: relative; z-index: 4; display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px 0 8px; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.g-cost:hover { background: var(--glass-well); }
.g-cost svg { width: 30px; height: 30px; }
.g-cost .arc { transition: stroke-dasharray .7s var(--spring-smooth); }

.g-results { position: fixed; z-index: 51; top: calc(78px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0 auto; transform-origin: 50% 0;
  width: min(720px, calc(100% - 24px)); max-height: min(60vh, 520px); overflow: auto; overscroll-behavior: contain; padding: 8px; border-radius: 28px;
  background: linear-gradient(180deg, var(--glass-sheen), transparent 40%), var(--glass-strong); }
.g-results .grp { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.g-results .opt { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 16px; cursor: pointer; transition: background-color .15s; }
.g-results .opt svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.g-results .opt.on { background: var(--glass-pill); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.g-results .opt .k { margin-left: auto; font-size: 12px; color: var(--text-3); }

/* ---------------------------------------------------------------- dock: tab bar + add */
.g-dock { position: fixed; z-index: 50; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; transform-origin: 50% 100%; transition: transform var(--dur-snappy) var(--spring-snappy); }
.g-tabs { position: relative; display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; touch-action: none; user-select: none; -webkit-user-select: none; transition: --la .45s ease-out; }
/* icon-only tabs (the name is the aria-label / tooltip): bar height = the + button's */
.g-tab { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 62px; height: 46px; padding: 0; border-radius: 999px;
  border: 0; background: none; color: var(--text-2); text-decoration: none; cursor: pointer; transition: color .25s; -webkit-user-drag: none; }
.g-tab svg { width: 24px; height: 24px; pointer-events: none; }
.g-tab:hover { color: var(--text); }
.g-tab.on, .g-tab.on:hover, .g-tab.hot { color: var(--blue); }
.g-tabs.dragging .g-tab.on:not(.hot) { color: var(--text-2); }
.g-tab:focus-visible { outline: none; box-shadow: var(--focus); }
/* the lens under the current tab: a resting pill that, when pressed (--lift → 1), grows into clear glass */
.g-lens { position: absolute; left: 0; top: 6px; z-index: 0; width: 62px; height: 46px; border-radius: 999px; pointer-events: none; transform-origin: 50% 50%;
  will-change: transform; --lift: 0; --la: -30deg; transition: opacity .25s;
  --rim: rgba(255, 255, 255, 1); --rim-mid: rgba(255, 255, 255, 0.7); --rim-lo: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, calc(var(--lift) * 0.14)), inset 0 0 0 0.5px rgba(0, 0, 0, calc(var(--lift) * 0.08)),
    inset 0 -6px 12px -6px rgba(0, 0, 0, calc(var(--lift) * 0.08)), inset 0 6px 10px -6px rgba(255, 255, 255, calc(var(--lift) * 0.9)); }
.g-lens::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--lens-fill); opacity: calc(1 - var(--lift) * 0.9); }
.g-lens::after { opacity: calc(0.25 + var(--lift) * 0.75); padding: calc(1px + var(--lift) * 0.6px); }
.g-lens.none { opacity: 0; }
.g-plus { position: relative; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 55%), color-mix(in srgb, var(--blue) 86%, transparent); color: #fff; border: 0;
  -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), inset 0 -1px 1px rgba(255, 255, 255, 0.18), 0 12px 28px -4px color-mix(in srgb, var(--blue) 45%, transparent); }
.g-plus { --rim: rgba(255, 255, 255, 0.9); --rim-mid: rgba(255, 255, 255, 0.5); --rim-lo: rgba(255, 255, 255, 0.2); --glow: rgba(255, 255, 255, 0.45); }
.g-plus svg { position: relative; z-index: 4; width: 26px; height: 26px; stroke-width: 2.2; }
.g-plus:hover { filter: brightness(1.06); }

@media (max-width: 600px) {
  .g-top { gap: 4px; }
  .g-cost { padding: 0 10px 0 4px; }
  .g-cost span { display: none; }
  .g-tab { width: 54px; height: 40px; }
  .g-lens { width: 54px; height: 40px; }
  .g-plus { width: 54px; height: 54px; }
  .g-dock { gap: 6px; }
  /* typing a search: the bar gives the field the whole width */
  .g-bots, .g-cost { max-width: 140px; transition: max-width .5s var(--spring-smooth), opacity .25s, padding .5s var(--spring-smooth), transform var(--dur-press) var(--spring-press); }
  .g-top:focus-within .g-bots, .g-top:focus-within .g-cost { max-width: 0; opacity: 0; padding: 0; overflow: hidden; }
}
/* reading downwards on a phone: the dock steps back (it returns on the way up, or when touched) */
@media (max-width: 760px) {
  .g-dock.mini { transform: translateX(-50%) translateY(10px) scale(0.84); }
}
body.kb .g-dock { display: none; }

/* reused classic pages under the floating bar */
.g-main .page > div[style*="sticky"] { top: calc(78px + env(safe-area-inset-top)) !important; border-radius: 999px; padding: 6px 8px !important;
  background: var(--glass-strong) !important; -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%); }
.g-main section[id^="sec-"] { scroll-margin-top: calc(150px + env(safe-area-inset-top)) !important; }
.g-main .bulkbar { top: calc(80px + env(safe-area-inset-top)); border-radius: 999px; }

/* a switch's label never wraps letter by letter when its row gets tight */
.g-main .toggle { flex: none; }
.g-main .toggle em { white-space: nowrap; }

@media (max-width: 600px) {
  /* 予定: button and "過去も表示" share the first line, the Discord hint goes under them */
  .g-main .row.mb-12:has(> .toggle) { flex-wrap: wrap; row-gap: 6px; }
  .g-main .row.mb-12:has(> .toggle) > .grow { order: 3; flex-basis: 100%; }
  .g-main .row.mb-12:has(> .toggle) > .toggle { margin-left: auto; }
  /* agenda: the date on its own line; each event = time · calendar, then the title (up to 2 lines) */
  .g-main .agenda .day { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 16px; }
  .g-main .agenda .day .d { display: flex; align-items: baseline; gap: 8px; }
  .g-main .agenda .day .d small { display: inline; font-size: 13px; }
  .g-main .agenda .ev { display: grid; grid-template-columns: 3px auto minmax(0, 1fr) auto; grid-template-areas: "bar tm bell src" "bar title title title";
    column-gap: 10px; row-gap: 2px; align-items: center; padding: 7px 0; }
  .g-main .agenda .ev > .cal { grid-area: bar; }
  .g-main .agenda .ev > .tm { grid-area: tm; width: auto; font-size: 12.5px; }
  .g-main .agenda .ev > .grow { grid-area: title; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
  .g-main .agenda .ev > .faint { grid-area: bell; }
  .g-main .agenda .ev > .tag { grid-area: src; justify-self: end; max-width: 48vw; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  /* タスク: the title field takes the whole first line, date and 追加 the next */
  .g-main .card.pad.row:not(.wrap) { flex-wrap: wrap; }
  .g-main .card.pad.row:not(.wrap) > .input:first-child { flex-basis: 100%; }

  /* 費用 › 最近の呼び出し: a table of 8 columns can't fit — each call becomes two short lines
     (when · cost / purpose · model, then the token counts) */
  .g-main .card.mt-16 .tbl:has(th:nth-child(8)) thead { display: none; }
  .g-main .tbl:has(th:nth-child(8)) tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; padding: 10px 0;
    border-bottom: 1px solid var(--border); }
  .g-main .tbl:has(th:nth-child(8)) tr:last-child { border-bottom: 0; }
  .g-main .tbl:has(th:nth-child(8)) td { padding: 0; border: 0; text-align: left; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(1) { order: 1; flex: 1 0 calc(100% - 96px); font-weight: 600; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(8) { order: 2; flex: 0 0 86px; text-align: right; font-weight: 650; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(2) { order: 3; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(3) { order: 4; flex: 1 1 auto; color: var(--text-2); overflow-wrap: anywhere; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(n+4):nth-child(-n+7) { order: 5; font-size: 12px; color: var(--text-3); }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(4)::before { content: "入力 "; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(5)::before { content: "キャッシュ "; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(6)::before { content: "出力 "; }
  .g-main .tbl:has(th:nth-child(8)) td:nth-child(7)::after { content: " 秒"; }
  /* 費用 › モデル別・用途別: drop the little bar column so names get the room */
  .g-main .tbl th:last-child:empty, .g-main .tbl td:last-child:has(> div[style*="series-track"]) { display: none; }
  .g-main .tbl td:first-child { overflow-wrap: anywhere; }

  /* orange › 試す: the chat fits between the floating bars, so the message box is never under the dock */
  .g-main .chat { height: calc(100dvh - 330px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 320px; }

  /* orange › 記憶 and 予定 › タスク: the text gets the full row; the label / due date / source go on a second line */
  .g-main .list .li:has(> span.mono:first-child), .g-main .list .li:has(> input.cb:first-child):has(> .grow > .input) {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "lead text act" ". meta meta"; column-gap: 8px; row-gap: 0; align-items: center; }
  .g-main .list .li:has(> span.mono:first-child) > span.mono, .g-main .list .li:has(> input.cb:first-child) > input.cb { grid-area: lead; }
  .g-main .list .li:has(> span.mono:first-child) > .grow, .g-main .list .li:has(> input.cb:first-child) > .grow { grid-area: text; }
  .g-main .list .li:has(> span.mono:first-child) > button, .g-main .list .li:has(> input.cb:first-child) > button { grid-area: act; }
  .g-main .list .li:has(> span.mono:first-child) > .tag, .g-main .list .li:has(> input.cb:first-child) > .tag { grid-area: meta; justify-self: start; margin-left: 11px; }
  .g-main .list .li:has(> span.mono:first-child) > span.nowrap { grid-area: meta; justify-self: end; margin-right: 6px; }

  /* the feed list's filter chips scroll edge to edge (glass pages have 12px gutters) */
  .g-main .toolbar .chips { margin: 0 -12px; padding: 2px 12px; }
}

/* ---------------------------------------------------------------- Apple-style controls on the reused pages */
:root[data-design="glass"] .card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
:root[data-design="glass"] .card-head h3, :root[data-design="glass"] h2.sec { color: var(--text-2); font-weight: 600; letter-spacing: 0; }
:root[data-design="glass"] .list .li { border-top-color: color-mix(in srgb, var(--border) 85%, transparent); }
:root[data-design="glass"] .list .li.click:hover, :root[data-design="glass"] table.tbl tr.click:hover td { background: var(--hover); }
:root[data-design="glass"] .stat .value, :root[data-design="glass"] .hero-value { letter-spacing: -0.02em; font-weight: 700; }

:root[data-design="glass"] .btn { border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font-weight: 600; }
:root[data-design="glass"] .btn:hover { background: var(--fill-2); }
:root[data-design="glass"] .btn.primary, :root[data-design="glass"] .btn.blue { background: var(--blue); color: #fff; }
:root[data-design="glass"] .btn.primary:hover, :root[data-design="glass"] .btn.blue:hover { opacity: 1; filter: brightness(1.08); }
:root[data-design="glass"] .btn.orange { background: var(--orange); color: #fff; }
:root[data-design="glass"] .btn.ghost { background: transparent; color: var(--text-2); }
:root[data-design="glass"] .btn.ghost:hover { background: var(--fill); color: var(--text); }
:root[data-design="glass"] .btn.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
:root[data-design="glass"] .btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
:root[data-design="glass"] .btn:focus-visible { box-shadow: var(--focus); }
:root[data-design="glass"] .bulkbar .btn, :root[data-design="glass"] .bulkbar .select { background-color: color-mix(in srgb, var(--ink-text) 14%, transparent); color: var(--ink-text); border: 0; }

:root[data-design="glass"] :is(.input, .select, textarea.input) { border: 0; border-radius: 12px; background-color: var(--fill); transition: background-color .2s, box-shadow .2s; }
:root[data-design="glass"] :is(.input, .select, textarea.input):focus { background-color: color-mix(in srgb, var(--surface) 80%, transparent); box-shadow: var(--focus); }
:root[data-design="glass"] .input.invalid { box-shadow: 0 0 0 2px var(--danger); }
:root[data-design="glass"] .chip { border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font-weight: 550; }
:root[data-design="glass"] .chip:hover { background: var(--fill-2); color: var(--text); }
:root[data-design="glass"] .chip.on { background: var(--blue); color: #fff; }
:root[data-design="glass"] .tag { border-radius: 999px; padding: 0 8px; }
:root[data-design="glass"] .notice { border-radius: 16px; padding: 12px 16px; }
:root[data-design="glass"] .favicon { border: 0; border-radius: 8px; }
:root[data-design="glass"] .thumb, :root[data-design="glass"] .pitem img, :root[data-design="glass"] .pitem .noimg { border: 0; border-radius: 12px; }
:root[data-design="glass"] .meter { border-radius: 999px; }
:root[data-design="glass"] .meter i { border-radius: 999px; transition: width .5s var(--spring-smooth); }

/* switches: iOS proportions; while held the knob stretches into a clear drop of glass, then springs over */
:root[data-design="glass"] .toggle span { width: 46px; height: 28px; border-radius: 14px; background: var(--fill-strong); transition: background-color .25s ease; }
:root[data-design="glass"] .toggle span::after { top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 12px; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform var(--dur-bouncy) var(--spring-bouncy), width var(--dur-snappy) var(--spring-snappy), background-color .2s, box-shadow .25s; }
:root[data-design="glass"] .toggle input:checked + span { background: var(--green); }
:root[data-design="glass"] .toggle.blue input:checked + span { background: var(--blue); }
:root[data-design="glass"] .toggle.orange input:checked + span { background: var(--orange); }
:root[data-design="glass"] .toggle input:checked + span::after { transform: translateX(18px); }
:root[data-design="glass"] .toggle:active span::after { width: 31px; transform: scale(1.12); background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.95), inset 0 1px 6px rgba(255, 255, 255, 0.6), 0 6px 16px rgba(0, 0, 0, 0.2); }
:root[data-design="glass"] .toggle:active input:checked + span::after { transform: translateX(11px) scale(1.12); }
:root[data-design="glass"] .toggle input:focus-visible + span { box-shadow: var(--focus); }
@media (pointer: coarse) {
  :root[data-design="glass"] .toggle span { width: 51px; height: 31px; border-radius: 16px; }
  :root[data-design="glass"] .toggle span::after { width: 27px; height: 27px; border-radius: 14px; }
  :root[data-design="glass"] .toggle input:checked + span::after { transform: translateX(20px); }
  :root[data-design="glass"] .toggle:active span::after { width: 35px; }
  :root[data-design="glass"] .toggle:active input:checked + span::after { transform: translateX(12px) scale(1.12); }
}

/* round check marks (tasks, picking rows), popping when ticked */
:root[data-design="glass"] input[type="checkbox"].cb { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: transparent no-repeat center / 12px; cursor: pointer;
  transition: background-color .2s, border-color .2s, transform var(--dur-press) var(--spring-press); }
:root[data-design="glass"] input[type="checkbox"].cb:checked { border-color: var(--blue); background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3 5 8.6l4.6-5.2' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  animation: g-tick var(--dur-bouncy) var(--spring-bouncy); }
:root[data-design="glass"] input[type="checkbox"].cb:active { transform: scale(0.88); transition-duration: .1s; }
:root[data-design="glass"] input[type="checkbox"].cb:focus-visible { outline: none; box-shadow: var(--focus); }
@keyframes g-tick { from { transform: scale(0.6); } }

/* tabs and segmented controls: a capsule with a lens that glides to the choice (liquid.js sets --sx/--sw) */
:root[data-design="glass"] :is(.tabs, .seg) { position: relative; display: flex; width: max-content; max-width: 100%; gap: 2px; padding: 3px; border: 0;
  border-radius: 999px; background: var(--fill); overflow-x: auto; scrollbar-width: none; }
:root[data-design="glass"] .tabs { margin-bottom: 18px; padding: 4px; }
:root[data-design="glass"] .seg { display: inline-flex; }
:root[data-design="glass"] :is(.tabs, .seg)::-webkit-scrollbar { display: none; }
:root[data-design="glass"] :is(.tabs, .seg) > button { position: relative; z-index: 1; flex: none; margin: 0; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-2); font-weight: 600; box-shadow: none; transition: color .25s, transform var(--dur-press) var(--spring-press); }
:root[data-design="glass"] .tabs > button { padding: 8px 16px; }
:root[data-design="glass"] .seg > button { padding: 6px 14px; }
:root[data-design="glass"] :is(.tabs, .seg) > button.on { color: var(--text); background: transparent; box-shadow: none; }
:root[data-design="glass"] :is(.tabs, .seg) > button:active { transform: scale(0.94); transition-duration: .1s; }
:root[data-design="glass"] :is(.tabs, .seg):not(.g-seg) > button.on { background: var(--seg-lens); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
:root[data-design="glass"] :is(.tabs, .seg).g-seg::before { content: ""; position: absolute; z-index: 0; left: 0; top: 3px; bottom: 3px; width: var(--sw, 0);
  transform: translateX(var(--sx, 0)); border-radius: 999px; background: var(--seg-lens);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 3px 10px -2px rgba(0, 0, 0, 0.14);
  transition: transform var(--dur-snappy) var(--spring-snappy), width var(--dur-snappy) var(--spring-snappy); }
:root[data-design="glass"] .tabs.g-seg::before { top: 4px; bottom: 4px; }
:root[data-design="glass"] .g-seg-still::before { transition: none !important; }

/* chat: message bubbles like Messages, the newest one pops in */
:root[data-design="glass"] .msg .bubble { border-radius: 20px; padding: 10px 15px; background: var(--fill); }
:root[data-design="glass"] .msg.user .bubble { background: var(--blue); color: #fff; }
:root[data-design="glass"] .chat .composer { border-top: 0; }
:root[data-design="glass"] .chat .msgs > .msg:last-child { animation: g-bubble var(--dur-bouncy) var(--spring-bouncy); }
:root[data-design="glass"] .chat .msgs > .msg.user:last-child { transform-origin: 100% 100%; }
:root[data-design="glass"] .chat .msgs > .msg.assistant:last-child { transform-origin: 0 100%; }
@keyframes g-bubble { from { opacity: 0; transform: translateY(6px) scale(0.94); } }

/* ---------------------------------------------------------------- sheets, alerts, drawer, toasts
   layers.js plays their entrances / exits (morph from the button that opened them, pull to dismiss) */
:root[data-design="glass"] .backdrop { background: var(--backdrop); animation: none; }
:root[data-design="glass"] .modal { left: 0; right: 0; margin: 0 auto; transform: none; animation: none; border: 0; border-radius: 30px; overflow: hidden;
  background: linear-gradient(180deg, var(--glass-sheen), transparent 40%), var(--glass-strong);
  -webkit-backdrop-filter: blur(34px) saturate(190%); backdrop-filter: blur(34px) saturate(190%);
  box-shadow: inset 0 1px 1px var(--glass-hi), var(--shadow-pop); }
:root[data-design="glass"] .modal .m-head { border-bottom: 0; padding: 18px 18px 6px 22px; }
:root[data-design="glass"] .modal .m-head h3 { font-size: 17px; font-weight: 700; }
:root[data-design="glass"] .modal .m-head .btn.icon { width: 32px; height: 32px; background: var(--fill); color: var(--text-2); }
:root[data-design="glass"] .modal .m-body { padding: 12px 22px 20px; }
:root[data-design="glass"] .modal .m-foot { border-top: 0; padding: 4px 18px 18px; }
:root[data-design="glass"] .modal .m-foot .btn { height: 42px; padding: 0 20px; }
:root[data-design="glass"] .modal .card { background: color-mix(in srgb, var(--surface) 76%, transparent); }
.modal.glass .m-body { padding: 18px 20px 22px; }

/* alerts (confirm / ask for a name): small, centred, the choices side by side */
:root[data-design="glass"] .modal.g-alert { width: min(320px, calc(100vw - 48px)); top: 24vh; bottom: auto; padding-bottom: 0; border-radius: 32px; text-align: center; }
:root[data-design="glass"] .modal.g-alert .m-head { justify-content: center; padding: 24px 22px 2px; }
:root[data-design="glass"] .modal.g-alert .m-head h3 { flex: 1; text-align: center; line-height: 1.45; }
:root[data-design="glass"] .modal.g-alert .m-head .btn { display: none; }
:root[data-design="glass"] .modal.g-alert .m-body { padding: 6px 22px 18px; font-size: 14px; }
:root[data-design="glass"] .modal.g-alert .m-foot { padding: 0 14px 14px; gap: 8px; }
:root[data-design="glass"] .modal.g-alert .m-foot .btn { flex: 1; height: 48px; font-size: 16px; }

:root[data-design="glass"] .drawer { top: 10px; right: 10px; bottom: 10px; width: min(560px, calc(100vw - 20px)); border: 0; border-radius: 30px; overflow: hidden; animation: none;
  background: linear-gradient(180deg, var(--glass-sheen), transparent 30%), var(--glass-strong);
  -webkit-backdrop-filter: blur(34px) saturate(190%); backdrop-filter: blur(34px) saturate(190%);
  box-shadow: inset 0 1px 1px var(--glass-hi), var(--shadow-pop); }
:root[data-design="glass"] .drawer .d-head { border-bottom: 0; padding: 18px 18px 8px 22px; }
:root[data-design="glass"] .drawer .d-head > .btn.icon { background: var(--fill); }
:root[data-design="glass"] .drawer .card { background: color-mix(in srgb, var(--surface) 76%, transparent); }

@media (max-width: 760px) {
  /* sheets float inside the screen edge with rounded corners all round, and can be pulled down */
  :root[data-design="glass"] .modal:not(.g-alert) { left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-height: calc(100vh - 64px - env(safe-area-inset-top));
    border-radius: 38px; padding-bottom: env(safe-area-inset-bottom); }
  :root[data-design="glass"] .modal:not(.g-alert) .m-head { padding-top: 24px; }
  :root[data-design="glass"] .modal:not(.g-alert):not(:has(.g-grab))::after,
  :root[data-design="glass"] .drawer::after { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px;
    background: color-mix(in srgb, var(--text) 24%, transparent); }
  :root[data-design="glass"] .drawer { top: calc(env(safe-area-inset-top) + 14px); left: 0; right: 0; bottom: 0; width: auto; border-radius: 38px 38px 0 0; }
  :root[data-design="glass"] .drawer .d-head { padding-top: 24px; }
}
.g-grab { display: none; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 24%, transparent); margin: -6px auto 10px; }
@media (max-width: 760px) { .g-grab { display: block; } }
.g-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--fill); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.g-x svg { width: 16px; height: 16px; }

/* the shell a sheet grows out of / goes back into (layers.js) */
.g-morph { position: fixed; z-index: 61; pointer-events: none; overflow: hidden; --la: -40deg;
  background: linear-gradient(180deg, var(--glass-sheen), transparent 50%), var(--glass-strong);
  -webkit-backdrop-filter: blur(28px) saturate(190%); backdrop-filter: blur(28px) saturate(190%);
  box-shadow: inset 0 1px 1px var(--glass-hi), var(--glass-shadow); }
#g-ghosts > * { pointer-events: none !important; }

/* toasts drop out of the top bar (layers.js) as a dark capsule */
:root[data-design="glass"] .toasts { top: calc(80px + env(safe-area-inset-top)); bottom: auto; left: 12px; right: 12px; align-items: center; }
:root[data-design="glass"] .toast { position: relative; min-width: 0; max-width: min(520px, 100%); padding: 10px 8px 10px 18px; border-radius: 24px; animation: none;
  background: var(--toast-bg); color: #fff; font-size: 14.5px; font-weight: 550; transform-origin: 50% 0;
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 16px 40px -10px rgba(0, 0, 0, 0.45);
  --rim: rgba(255, 255, 255, 0.4); --rim-mid: rgba(255, 255, 255, 0.18); --rim-lo: rgba(255, 255, 255, 0.05); }
:root[data-design="glass"] .toast.error { background: color-mix(in srgb, var(--danger) 86%, #000); }
:root[data-design="glass"] .toast button { color: #fff; border-radius: 999px; }

/* ---------------------------------------------------------------- today */
.g-hero { position: relative; height: 300px; border-radius: 34px; overflow: hidden; background: #000; color: #fff; margin-bottom: 20px; }
.g-hero img { position: absolute; left: 50%; top: 50%; width: 1400px; height: 1400px; transform: translate(-28%, -50%); pointer-events: none; animation: g-hero-in .5s ease-out both; }
.g-hero .t { position: absolute; left: clamp(20px, 4vw, 52px); bottom: 34px; right: 20px; display: flex; flex-direction: column; gap: 8px; }
.g-hero .d { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.82); }
.g-hero h1 { margin: 0; font-size: clamp(30px, 4.4vw, 54px); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
.g-hero h1 .n { font-variant-numeric: tabular-nums; }
.g-hero.still img { animation: none; }
@keyframes g-hero-in { from { opacity: 0; } }
@media (max-width: 600px) { .g-hero { height: 220px; border-radius: 30px; } .g-hero img { width: 640px; height: 640px; transform: translate(-30%, -55%); } }

.g-cards { column-width: 300px; column-gap: 18px; }
.g-card { break-inside: avoid; margin: 0 0 18px; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.g-card.warm { background: var(--orange-soft); }
.g-card .pad { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.g-card .media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.g-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s ease; }
.g-card .media img.ok { opacity: 1; }
.g-card .media img.now { transition: none; }
.g-card .pill { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--live); color: #fff; font-size: 12px; font-weight: 700; }
.g-card .pill.ended { background: rgba(20, 22, 28, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.g-card .pill i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: g-live 1.6s ease-in-out infinite; }
@keyframes g-live { 50% { opacity: 0.35; } }
.g-card .meta { font-size: 13px; color: var(--text-2); }
.g-card .ttl { font-size: 16.5px; font-weight: 600; line-height: 1.55; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.g-card .ttl:hover { text-decoration: underline; text-underline-offset: 3px; }
.g-card .big { font-size: 17px; font-weight: 550; line-height: 1.6; }
.g-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  /* a card under the pointer only deepens its shadow — nothing moves, so scrolling past cards stays clean */
  .g-card { transition: box-shadow .2s ease; }
  .g-card:hover { box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.05); }
}
.g-pillbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--fill); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.g-pillbtn:hover { filter: brightness(0.97); }
.g-pillbtn svg { width: 16px; height: 16px; }
.g-pillbtn img { width: 18px; height: 18px; border-radius: 50%; }
.g-pillbtn.on { background: var(--blue-soft); color: var(--blue-ink); }
.g-pillbtn.dark { background: var(--ink); color: var(--ink-text); }
.g-card .sum { font-size: 14px; line-height: 1.7; background: var(--orange-soft); border-radius: 18px; padding: 12px 14px; overflow-wrap: anywhere; }
.g-card .sum.fresh { animation: g-reveal .3s ease-out; }
@keyframes g-reveal { from { opacity: 0; transform: translateY(3px); } }
.g-card .sum p { margin: 0; }
.g-card .sum p + p, .g-card .sum .pts + p, .g-card .sum p + .pts { margin-top: 6px; }
.g-card .sum .lead { font-weight: 650; font-size: 14.5px; }
.g-card .sum .pts { margin: 6px 0 0; padding-left: 1.15em; display: flex; flex-direction: column; gap: 3px; }
.g-card .sum .note { color: var(--text-2); font-size: 13px; }
.g-card .sum .clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-card .sum .more { margin-top: 6px; padding: 0; min-height: 32px; border: 0; background: none; color: var(--orange-ink); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.g-card .sum.loading { display: flex; flex-direction: column; gap: 9px; padding: 14px; }
.g-card .sum.loading .skeleton { height: 11px; background: linear-gradient(90deg, color-mix(in srgb, var(--orange-ink) 12%, transparent),
  color-mix(in srgb, var(--orange-ink) 26%, transparent), color-mix(in srgb, var(--orange-ink) 12%, transparent)); background-size: 200% 100%; }
.g-card .sum .sum-foot { margin-top: 4px; }
.g-card .sum .redo { color: var(--text-2); font-weight: 550; }
.g-card .snip { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* 記事: search + filters above the cards */
.g-filter { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; max-width: 720px; }
.g-filter .g-paste input::-webkit-search-cancel-button { cursor: pointer; }
.g-selchip { height: 44px; flex: 1 1 0; min-width: 0; max-width: 340px; padding: 0 34px 0 16px; border: 0; border-radius: 999px; appearance: none; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 78%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23868a93' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); font: inherit; font-size: 15px; box-shadow: var(--shadow); text-overflow: ellipsis; }
.g-loadmore { display: flex; justify-content: center; margin: 4px 0 8px; }
.g-loadmore .g-pillbtn { height: 44px; padding: 0 22px; }

.g-spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.g-pillbtn[disabled] { cursor: default; }
.g-pillbtn.busy { opacity: 0.85; }
.g-card .row-media { display: flex; gap: 14px; align-items: center; padding: 16px; }
.g-card .sq { width: 84px; height: 84px; border-radius: 18px; flex: none; background: var(--surface-3); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.g-card .sq svg { width: 28px; height: 28px; }
.g-ask { display: flex; align-items: center; gap: 12px; }
.g-ask .ic-wrap { width: 40px; height: 40px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--orange-soft); color: var(--orange-ink); }
.g-ask .ic-wrap.red { background: var(--danger-soft); color: var(--danger); }
.g-ask .ic-wrap svg { width: 20px; height: 20px; }
.g-inline { display: flex; gap: 8px; }
.g-inline .input { height: 44px; border-radius: 14px; }
.g-inline .btn { height: 44px; }

/* ---------------------------------------------------------------- channels board */
.g-boardbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.g-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr)); gap: 14px; align-items: start; }
.g-col { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 30px; background: var(--shelf); min-height: 140px; transition: box-shadow .2s, background-color .2s; }
.g-col.drop { background: color-mix(in srgb, var(--blue) 9%, var(--shelf)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 60%, transparent); }
.g-col.danger { background: color-mix(in srgb, var(--danger) 8%, var(--shelf)); }
.g-col h2 { margin: 0; padding: 4px 6px 2px; display: flex; align-items: baseline; gap: 6px; font-size: 17px; font-weight: 700; min-width: 0; }
.g-col h2 .hash { color: var(--text-3); }
.g-col h2 .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-col h2 .tag { margin-left: auto; align-self: center; }
.g-tile { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 13px 14px 13px 15px; border-radius: 20px; background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; user-select: none; text-align: left; border: 0; width: 100%; color: var(--text); font: inherit; }
.g-tile:hover { box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.16); }
.g-tile.off { opacity: 0.55; }
.g-tile.dragging { opacity: 0.35; }
.g-tile .src { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-height: 20px; padding-right: 34px; }
.g-tile .src i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16); }
.g-tile .chip2 { margin-left: auto; padding: 2px 8px; border-radius: 999px; font-weight: 650; font-size: 11.5px; background: var(--orange-soft); color: var(--orange-ink); white-space: nowrap; }
.g-tile .chip2.red { background: var(--danger-soft); color: var(--danger); }
.g-tile .chip2.gray { background: var(--surface-3); color: var(--text-2); }
.g-tile .nm { font-size: 15.5px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.g-tile .when { font-size: 13px; color: var(--text-2); }
.g-tile .mv { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--text-3);
  display: flex; align-items: center; justify-content: center; cursor: pointer; }
.g-tile .mv:hover { background: var(--fill); color: var(--text); }
.g-tile .mv svg { width: 18px; height: 18px; }
.g-addtile { height: 88px; border-radius: 20px; border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); background: transparent; color: var(--text-2);
  font: inherit; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.g-addtile:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.g-addtile svg { width: 20px; height: 20px; }
.g-newch { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px 0 12px; border-radius: 14px; background: var(--surface); }
.g-newch span { color: var(--text-3); font-size: 17px; font-weight: 650; }
.g-newch input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; font-weight: 650; color: var(--text); }
.g-newch button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--ink); color: var(--ink-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ---------------------------------------------------------------- add sheet */
.g-add .m-body { display: flex; flex-direction: column; gap: 16px; }
.g-add-head { display: flex; align-items: center; gap: 12px; }
.g-add-head .favicon { width: 48px; height: 48px; border-radius: 14px; }
.g-add-head .nm { width: 100%; border: 0; outline: none; background: transparent; font-size: 19px; font-weight: 700; color: var(--text); padding: 2px 0; border-bottom: 1.5px solid transparent; }
.g-add-head .nm:focus { border-bottom-color: var(--blue); }
.g-add-head .sub { font-size: 13px; color: var(--text-2); }
.g-paste { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 8px 0 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .25s; }
.g-paste:focus-within { box-shadow: var(--shadow), var(--focus); }
.g-paste svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.g-paste input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 17px; color: var(--text); }
.g-preview { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 26px; background: color-mix(in srgb, var(--surface) 82%, transparent); box-shadow: var(--shadow); animation: g-reveal .25s ease-out; }
.g-preview .lbl { font-size: 13px; font-weight: 650; color: var(--text-2); }
.g-post { display: flex; gap: 10px; }
.g-post > img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.g-post .who { font-size: 14px; font-weight: 650; }
.g-post .who small { font-size: 12px; font-weight: 400; color: var(--text-2); margin-left: 6px; }
.g-post .emb { margin-top: 6px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.g-post .emb img { width: 100%; max-height: 170px; object-fit: cover; display: block; }
.g-post .emb .tx { padding: 10px 12px; font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.g-post .emb .tx small { display: block; font-weight: 400; color: var(--text-2); margin-top: 2px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.g-chip { height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--text);
  font: inherit; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; box-shadow: var(--shadow); }
.g-chip.on { background: var(--blue); color: #fff; font-weight: 650; }
.g-chip svg { width: 14px; height: 14px; stroke-width: 3; }
.g-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); }
.g-go { height: 56px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font: inherit; font-size: 17px; font-weight: 650; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 24px -4px color-mix(in srgb, var(--blue) 45%, transparent); }
.g-go[disabled] { opacity: 0.45; pointer-events: none; }
.g-go.busy { opacity: 0.6; pointer-events: none; }
.g-more summary { cursor: pointer; font-size: 14px; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.g-more summary::-webkit-details-marker { display: none; }
.g-more[open] summary svg { transform: rotate(90deg); }
.g-more summary svg { width: 14px; height: 14px; transition: transform var(--dur-snappy) var(--spring-snappy); }
.g-more[open] > :not(summary) { animation: g-reveal .22s ease-out; }

/* ---------------------------------------------------------------- menus (more / bots) */
.g-menu { display: flex; flex-direction: column; gap: 4px; }
.g-menu a, .g-menu button.mi { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border-radius: 18px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: 15.5px; text-decoration: none; cursor: pointer; text-align: left; width: 100%; transition: background-color .15s; }
.g-menu a:hover, .g-menu button.mi:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.g-menu svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.g-menu .sub { margin-left: auto; font-size: 13px; color: var(--text-3); }
.g-sep { height: 1px; background: color-mix(in srgb, var(--text) 10%, transparent); margin: 6px 8px; }
.g-bot { display: flex; align-items: center; gap: 14px; padding: 10px 6px; }
.g-bot img { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.g-bot img.off { filter: grayscale(1) opacity(0.6); }
.g-bot .nm { font-size: 17px; font-weight: 700; }
.g-bot .st { font-size: 13px; color: var(--text-2); }

/* ---------------------------------------------------------------- login */
.g-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #000; position: relative; overflow: hidden; }
.g-login > img { position: absolute; width: 1100px; height: 1100px; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0.9; pointer-events: none; animation: g-hero-in .6s ease-out both; }
.g-login form { position: relative; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 34px;
  background: rgba(255, 255, 255, 0.14); color: #fff; --rim: rgba(255, 255, 255, 0.7); --rim-mid: rgba(255, 255, 255, 0.3); --rim-lo: rgba(255, 255, 255, 0.08);
  animation: g-rise var(--dur-snappy) var(--spring-snappy) .08s both; }
@keyframes g-rise { from { opacity: 0; transform: translateY(12px); } }
.g-login .input { height: 52px; border-radius: 16px; font-size: 16px; background: rgba(255, 255, 255, 0.9); color: #1c1d21; border: 0; }
.g-login .g-go { width: 100%; }
.g-login .brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.g-login .brand img { width: 40px; height: 40px; border-radius: 50%; }
.g-login .brand img + img { margin-left: -14px; }

/* ---------------------------------------------------------------- accessibility */
@media (prefers-reduced-transparency: reduce) {
  :root[data-design="glass"] :is(.glass, .modal, .drawer, .toast, .g-morph, .g-plus) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  :root[data-design="glass"] :is(.glass, .modal, .drawer, .g-morph) { background: var(--surface) !important; }
  .g-ambient, .g-edge { display: none; }
}
