/* ==========================================================================
   Genkō Night -- the 2026 redesign layer.

   Loaded AFTER style.css (see base.html). Everything visual about the new
   direction lives in this one file: new tokens for both themes, a refined
   shell (nav, panels, buttons, footer), and the gk-* components the
   marketing pages (about / download / pricing) are built from.
   To roll the whole look back, remove the <link> to this file in base.html.

   Ingredients: ink-dark ground, the same indigo accent family, a small
   vermilion "hanko" second accent, Geist (self-hosted) for all Latin text and
   UI, Zen Kaku Gothic / Zen Old Mincho for Japanese, and a faint 原稿用紙
   manuscript-paper grid + manga screentone as texture.
   ========================================================================== */
/* Geist is self-hosted (static/fonts) and preloaded in base.html, so it is there on first paint. The
   "Geist Fallback" face is Arial resized to Geist's metrics, so if Geist is ever late the text does not
   reflow when it swaps in (the same trick next/font uses). Japanese faces come from Google Fonts,
   loaded without blocking the page (see base.html). */
@font-face {
    font-family: 'Geist';
    src: url('/static/fonts/Geist-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist Fallback';
    src: local('Arial'), local('ArialMT'), local('Helvetica Neue'), local('Helvetica');
    ascent-override: 95.79%;
    descent-override: 28.12%;
    line-gap-override: 0%;
    size-adjust: 104.92%;
}
@font-face {
    font-family: 'Geist Mono';
    src: url('/static/fonts/GeistMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: optional;
}

:root {
    --bg: #08090f;
    --bg-raised: #10121c;
    --bg-input: #161926;
    --border: #22263a;
    --text: #eeeff7;
    --text-muted: #a6a9c2;
    --accent: #5f5cf5;
    --accent-hover: #7471ff;
    --accent-2: #ff8a7a;
    --error: #ff5d6c;
    --success: #5fd39a;
    --warn: #f0b75a;
    --font-body: 'Geist', 'Geist Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-body);

    --gk-serif: var(--font-body);  /* one typeface throughout (Geist); the name is kept so rules below read the same */
    --gk-jp: 'Zen Kaku Gothic New', 'Yu Gothic UI', 'Meiryo', sans-serif;
    --gk-mincho: 'Zen Old Mincho', 'Yu Mincho', serif;
    --gk-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --gk-bg-2: #0b0c14;
    --gk-bg-3: #181b28;
    --gk-line: #1b1e2c;
    --gk-line-strong: #2b2f47;
    --gk-text-2: #c4c6da;
    --gk-text-3: #80839f;
    --gk-accent-text: #a9a7ff;
    --gk-accent-soft: #1b1d3a;
    --gk-accent-deep: #12132a;
    --gk-accent-line: #3a3a7a;
    --gk-shu: #ff6b57;
    --gk-shu-soft: #2a1714;
    --gk-ghost-opacity: .04;  /* .gk-ghost: about #11131f on the dark background */
    --gk-grid-line: rgba(255, 255, 255, .035);
    --gk-paper: #eeeae1;
    --gk-ink: #16161c;
    --gk-shadow: 0 30px 70px rgba(0, 0, 0, .55);
    --gk-radius: 20px;
}

:root[data-theme="light"] {
    --bg: #f6f4ef;
    --bg-raised: #ffffff;
    --bg-input: #efece5;
    --border: #e1ddd3;
    --text: #16161c;
    --text-muted: #555869;
    --accent: #5f5cf5;
    --accent-hover: #4b48e0;
    --accent-2: #c2412d;
    --error: #c92a3a;
    --success: #1f7a47;
    --warn: #93600a;

    --gk-bg-2: #efece5;
    --gk-bg-3: #f1efe9;
    --gk-line: #e6e2d8;
    --gk-line-strong: #d6d1c4;
    --gk-text-2: #2e3040;
    --gk-text-3: #676a7c;
    --gk-accent-text: #4b48e0;
    --gk-accent-soft: #ebeafe;
    --gk-accent-deep: #f1f0ff;
    --gk-accent-line: #c9c7fb;
    --gk-shu: #e2553f;
    --gk-shu-soft: #fde9e5;
    --gk-ghost-opacity: .045;  /* about #ece8de on the light background */
    --gk-grid-line: rgba(22, 22, 28, .05);
    --gk-shadow: 0 30px 60px rgba(40, 36, 20, .16);
}

:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body { -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Shell: top nav ---------- */
body.hub .top-nav {
    position: sticky; top: 0; z-index: 40;
    height: 68px; padding: 0 40px; margin-bottom: 40px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--gk-line);
}
.top-nav-logo-mark { border-radius: 0; }  /* the logo has its own rounded tile; rounding the image would clip the ears */
.top-nav-logo { font-family: var(--font-body); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.top-nav-brand { position: relative; }
.top-nav-brand::after {
    content: ""; position: absolute; left: 18px; top: -3px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--gk-shu); border: 2px solid var(--bg);
}
.top-nav-links .nav-icon-link { font-weight: 500; font-size: 14px; border-radius: 10px; padding: 9px 12px; }
.top-nav-links .nav-icon-link:hover { background: var(--gk-bg-3); }
.top-nav-end > .cta, .top-nav-links a.cta {
    height: 36px; border-radius: 12px; font-weight: 600; font-size: 14px;
    background: var(--accent); border-color: var(--accent); color: #fff;
}
.top-nav-links a.cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.nav-account-menu { border-radius: 16px !important; box-shadow: var(--gk-shadow); }

/* ---------- Shell: headings, panels, buttons ---------- */
h1, h2, h3, .display { letter-spacing: -0.01em; }
.hub-header h1 { font-family: var(--font-body); font-weight: 600; font-size: 32px; line-height: 1.1; letter-spacing: -0.035em; margin: 0 0 6px; }
.panel { border-radius: var(--gk-radius); border-color: var(--border); padding: 28px; }
.panel h2 { font-size: 16px; font-weight: 600; }
button, .hub-shell button { border-radius: 12px; font-family: var(--font-body); }
button { font-weight: 600; }
button.secondary { background: var(--gk-bg-3); border-color: var(--gk-line-strong); }
input[type="email"], input[type="password"], input[type="text"], input[type="number"], input[type="date"], select, textarea {
    border-radius: 12px; padding: 11px 14px; font-family: var(--font-body);
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.card { border-radius: 24px; }
.button-link.cta { border-radius: 12px; }
.notice-item { border-left: 0; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--gk-line); }
.side-link { border-radius: 12px; }
.side-link.active { background: var(--gk-accent-soft); }
.side-link.active .study-icon { color: var(--gk-accent-text); }
.side-plan-chip { background: var(--gk-accent-soft); color: var(--gk-accent-text); }

/* ---------- Shell: footer ---------- */
.site-footer { border-top: 1px solid var(--gk-line); background: color-mix(in srgb, var(--bg) 70%, #000 30%); }
:root[data-theme="light"] .site-footer { background: var(--gk-bg-2); }
.site-footer-inner { max-width: 1180px; padding: 40px 24px 44px; }
.site-footer-links { gap: 10px 22px; }
.site-footer-copyright { font-family: var(--gk-mono); font-size: 12px; }
.site-footer-copyright::before { content: "ぴょんたん"; font-family: var(--gk-jp); color: var(--gk-text-3); margin-right: 10px; }

/* ==========================================================================
   Marketing pages (about / download / pricing) -- body.gk-marketing
   ========================================================================== */
/* The full-width bands (.gk-band) reach out with 50vw, which counts the scrollbar on a computer: clip on <html> too,
   since the body's clip doesn't reach the page's own scrolling. clip keeps the sticky top bar working. */
body.gk-marketing, html:has(> body.gk-marketing) { overflow-x: clip; }
body.gk-marketing .top-nav { margin-bottom: 0; }
body.gk-marketing .hub-shell { max-width: 1200px; gap: 0; padding: 0 32px; }
body.gk-marketing .site-footer { margin-top: 0; }

.gk-serif { font-family: var(--font-body); font-weight: 600; letter-spacing: -0.035em; }
.gk-jp { font-family: var(--gk-jp); }
.gk-min { font-family: var(--gk-mincho); }
.gk-mono { font-family: var(--gk-mono); }
.gk-vert { writing-mode: vertical-rl; text-orientation: upright; }
.gk-em { font-style: normal; color: var(--gk-accent-text); }
.gk-genko {
    background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px),
                      linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
}
.gk-tone { background-image: radial-gradient(circle, rgba(22, 22, 30, .55) 1.1px, transparent 1.5px); background-size: 5px 5px; }
.gk-tone-lt { background-image: radial-gradient(circle, var(--gk-grid-line) 1.2px, transparent 1.6px); background-size: 7px 7px; }
.gk-band { margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%); }
.gk-band-alt { background-color: var(--gk-bg-2); border-top: 1px solid var(--gk-line); border-bottom: 1px solid var(--gk-line); }

/* A reading wider than its kanji (勉強 べんきょう) leaves the kanji together, centred under it: browsers otherwise
   spread them apart to match its width (勉 強). */
ruby { ruby-align: center; }
ruby rt { font-size: max(13px, .4em); color: var(--gk-accent-text); font-family: var(--gk-jp); font-weight: 500; letter-spacing: .04em; }

/* Buttons (links styled as buttons -- base .hub-shell button rules don't reach <a>) */
.gk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 54px; padding: 0 24px; border-radius: 14px; box-sizing: border-box;
    font: 600 16px/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .15s;
}
.gk-btn:hover { text-decoration: none; transform: translateY(-1px); }
.gk-btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.gk-btn-primary:hover { background: var(--accent-hover); color: #fff; }
.gk-btn-ghost { background: var(--bg-raised); color: var(--text); border: 1px solid var(--gk-line-strong); }
.gk-btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.gk-btn-sm { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 12px; }
.gk-btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.hub-shell .gk-plan form button, .hub-shell button.gk-btn { width: 100%; margin: 0; height: 50px; border-radius: 13px; font-size: 15px; }

.gk-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--gk-line-strong); background: var(--bg-raised); color: var(--gk-text-2); font-size: 13px;
}
.gk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gk-shu); flex: none; }
.gk-kicker { font-family: var(--gk-mono); font-size: 13px; letter-spacing: .06em; color: var(--accent-2); text-transform: uppercase; margin: 0; }
.gk-h2 { font-family: var(--font-body); font-weight: 600; font-size: clamp(34px, 4.2vw, 54px); line-height: 1.06; letter-spacing: -0.04em; margin: 0; }
.gk-lede { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text-muted); }
.gk-section { padding: 120px 0; display: flex; flex-direction: column; gap: 56px; }
.gk-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 64px; }
.gk-section-head > div { display: flex; flex-direction: column; gap: 18px; max-width: 780px; }
.gk-section-head .gk-lede { max-width: 380px; }

/* ---------- Hero ---------- */
.gk-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 600px; gap: 56px; align-items: center; padding: 72px 0 104px; }
.gk-hero::before { content: ""; position: absolute; inset: 0; margin-inline: calc(50% - 50vw); background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); pointer-events: none; }
.gk-hero > * { position: relative; }
.gk-hero-copy { display: flex; flex-direction: column; gap: 30px; }
.gk-display { font-family: var(--font-body); font-weight: 600; font-size: clamp(44px, 5.4vw, 74px); line-height: 1.02; letter-spacing: -0.045em; margin: 0; text-wrap: balance; }
.gk-hero .gk-lede { font-size: 20px; max-width: 540px; }
.gk-cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.gk-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--gk-mono); font-size: 13px; color: var(--gk-text-3); }
.gk-hero-glyph { position: absolute; left: -44px; top: 40px; font-family: var(--gk-mincho); font-size: 20px; letter-spacing: .3em; color: var(--gk-line-strong); writing-mode: vertical-rl; text-orientation: upright; }

/* Hero demo: a mock manga page with OCR + lookup popups */
.gk-demo { position: relative; height: 640px; }
.gk-manga {
    position: absolute; left: 160px; top: 10px; width: 430px; height: 600px; padding: 14px; box-sizing: border-box;
    background: var(--gk-paper); border-radius: 6px; transform: rotate(-2deg); box-shadow: var(--gk-shadow);
    display: grid; grid-template-rows: 230px 1fr; gap: 10px;
}
.gk-manga-row { display: grid; grid-template-columns: 1.35fr .65fr; gap: 10px; }
.gk-panel { position: relative; border: 3px solid var(--gk-ink); background: #fff; overflow: hidden; }
.gk-panel.gk-tone { background-color: #d8d3c8; }
.gk-panel-speed { background: repeating-linear-gradient(115deg, #fff 0 6px, var(--gk-ink) 6px 7px); }
.gk-bubble {
    position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 50%;
    background: #fff; border: 2.5px solid var(--gk-ink); color: var(--gk-ink);
    font-family: var(--gk-mincho); font-weight: 900; writing-mode: vertical-rl; text-orientation: upright; line-height: 1.2;
}
.gk-figure { position: absolute; right: 18px; bottom: 0; width: 110px; height: 150px; border-radius: 55px 55px 0 0; background: var(--gk-ink); }
.gk-ocr-box { position: absolute; border: 2px dashed var(--accent); border-radius: 8px; background: rgba(95, 92, 245, .08); }
.gk-ocr-tag { position: absolute; height: 22px; padding: 0 8px; display: flex; align-items: center; border-radius: 6px; background: var(--accent); color: #fff; font: 500 11px var(--gk-mono); }
.gk-float {
    position: absolute; box-sizing: border-box; border-radius: 20px; background: var(--bg-raised);
    border: 1px solid var(--gk-line-strong); box-shadow: var(--gk-shadow); display: flex; flex-direction: column; gap: 12px;
}
.gk-float-audio { left: 330px; top: 0; width: 290px; padding: 16px 18px; border-radius: 18px; }
.gk-float-lookup { left: 0; top: 300px; width: 340px; padding: 22px; gap: 14px; }
.gk-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gk-text-2); }
.gk-wave { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.gk-wave i { display: block; width: 3px; border-radius: 2px; background: var(--gk-accent-text); animation: gk-wave 1.2s ease-in-out infinite; transform-origin: bottom; }
.gk-wave i:nth-child(2n) { animation-delay: -.3s; } .gk-wave i:nth-child(3n) { animation-delay: -.6s; }
@keyframes gk-wave { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .gk-wave i { animation: none; } }
.gk-word { font-family: var(--gk-jp); font-weight: 700; font-size: 44px; line-height: 1; }
.gk-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.gk-tag { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--gk-accent-soft); color: var(--gk-accent-text); font-size: 12px; }
.gk-tag-shu { background: var(--gk-shu-soft); color: var(--accent-2); }
.gk-rule { height: 1px; background: var(--border); }
.gk-icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gk-line-strong); background: var(--gk-bg-3); color: var(--gk-text-2); display: inline-flex; align-items: center; justify-content: center; }
.gk-fake-btn { height: 40px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ---------- Sources strip ---------- */
.gk-strip { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 96px; flex-wrap: wrap; }
.gk-strip-label { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gk-text-3); }
.gk-strip-items { display: flex; flex-wrap: wrap; gap: 20px 44px; align-items: baseline; }
.gk-strip-items span { display: inline-flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--gk-text-3); }
.gk-strip-items b { font-family: var(--gk-jp); font-size: 22px; font-weight: 700; color: var(--text); }

/* ---------- Cards ---------- */
.gk-card { position: relative; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-raised); padding: 32px; display: flex; flex-direction: column; gap: 14px; box-sizing: border-box; overflow: hidden; }
.gk-card h3 { margin: 0; font-family: var(--font-body); font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.gk-card p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--text-muted); }
.gk-card-accent { border-color: var(--gk-accent-line); background: var(--gk-accent-deep); }
.gk-card-foot { margin-top: auto; }
.gk-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--gk-accent-soft); color: var(--gk-accent-text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gk-ic-shu { background: var(--gk-shu-soft); color: var(--accent-2); }
/* The big faint kanji behind a section. The page's own text colour, nearly transparent, rather than a near-background
   colour: a phone's automatic dark mode for websites lightens dark text, and in the Android app it did that for a
   moment even with the color-scheme meta, turning 料金 on Pricing bright. Light text and opacity it leaves alone. */
.gk-ghost { position: absolute; font-family: var(--gk-mincho); font-weight: 900; color: var(--text); opacity: var(--gk-ghost-opacity); line-height: 1; pointer-events: none; user-select: none; }
.gk-card > :not(.gk-ghost) { position: relative; }

/* The gap */
.gk-gap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.gk-gap-grid .gk-card { min-height: 360px; gap: 24px; padding: 36px; }
.gk-eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gk-text-3); }
.gk-card-accent .gk-eyebrow { color: var(--gk-accent-text); }
.gk-sentence { font-family: var(--gk-jp); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.gk-h2 .gk-jp { white-space: nowrap; letter-spacing: 0; font-weight: 700; }
.gk-i { flex: none; display: block; }
.gk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gk-chip { display: inline-flex; gap: 8px; align-items: center; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--gk-accent-soft); font-size: 14px; }
.gk-chip b { font-family: var(--gk-jp); }
.gk-chip span { color: var(--text-muted); }

/* Bento */
.gk-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(290px, auto); gap: 20px; }
.gk-span-2 { grid-column: span 2; }
.gk-split { flex-direction: row; gap: 32px; }
.gk-split > .gk-split-copy { flex: 1 1 0; display: flex; flex-direction: column; gap: 14px; }
.gk-split > .gk-split-art { width: 380px; flex: none; position: relative; }
.gk-keys { display: flex; gap: 6px; align-items: center; color: var(--gk-text-3); }
.gk-key { height: 30px; min-width: 30px; padding: 0 10px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--gk-line-strong); border-bottom-width: 3px; display: inline-flex; align-items: center; justify-content: center; font: 13px var(--gk-mono); color: var(--gk-text-2); }
.gk-bar { height: 6px; border-radius: 3px; background: var(--gk-line); overflow: hidden; }
.gk-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.gk-kanji-row { display: flex; gap: 8px; }
.gk-kanji-row span { width: 52px; height: 52px; border-radius: 12px; background: var(--gk-bg-3); border: 1px solid var(--gk-line-strong); display: inline-flex; align-items: center; justify-content: center; font: 700 24px var(--gk-jp); }
.gk-chat { display: flex; flex-direction: column; gap: 10px; justify-content: center; width: 400px; flex: none; }
.gk-msg { max-width: 300px; padding: 12px 16px; font: 15px var(--gk-jp); border-radius: 16px; }
.gk-msg-them { align-self: flex-start; background: var(--gk-bg-3); border-bottom-left-radius: 4px; }
.gk-msg-me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.gk-msg-fix { align-self: flex-end; max-width: 320px; padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--gk-accent-line); font-size: 13px; line-height: 1.5; color: var(--gk-text-2); }
.gk-levels { display: flex; gap: 6px; }
.gk-levels span { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--gk-accent-soft); color: var(--gk-text-2); display: inline-flex; align-items: center; font: 13px var(--gk-mono); }
.gk-levels span:first-child { background: var(--accent); color: #fff; }
.gk-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.gk-list div { display: flex; justify-content: space-between; }
.gk-list small { font: 12px var(--gk-mono); color: var(--gk-text-3); }

/* Two-column feature rows (tray / study) */
.gk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 80px; align-items: center; padding: 120px 0; }
.gk-row-copy { display: flex; flex-direction: column; gap: 24px; }
.gk-checks { display: flex; flex-direction: column; gap: 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.gk-checks li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.5; color: var(--gk-text-2); }
.gk-checks li::before { content: ""; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--gk-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23a9a7ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/15px no-repeat; }
.gk-link-arrow { font-size: 16px; font-weight: 500; color: var(--gk-accent-text); text-decoration: none; }
.gk-link-arrow:hover { text-decoration: underline; }

.gk-desk { position: relative; height: 520px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-raised); overflow: hidden; }
.gk-tray-menu { position: absolute; right: 24px; bottom: 76px; width: 300px; padding: 10px; box-sizing: border-box; border-radius: 18px; background: var(--gk-bg-3); border: 1px solid var(--gk-line-strong); box-shadow: var(--gk-shadow); display: flex; flex-direction: column; gap: 2px; }
.gk-tray-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.gk-tray-head small { margin-left: auto; font: 12px var(--gk-mono); color: var(--gk-text-3); }
.gk-tray-item { height: 40px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--gk-text-2); }
.gk-tray-item.is-on { background: var(--gk-accent-soft); color: var(--text); }
.gk-tray-item svg { color: var(--gk-text-3); } .gk-tray-item.is-on svg { color: var(--gk-accent-text); }
.gk-badge { margin-left: auto; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--gk-shu); color: #1a0b08; font: 600 11px var(--gk-mono); display: inline-flex; align-items: center; }
.gk-taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; background: var(--gk-bg-2); border-top: 1px solid var(--gk-line-strong); display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 20px; color: var(--gk-text-3); }
.gk-taskbar img { width: 24px; height: 24px; filter: drop-shadow(0 0 3px var(--gk-accent-soft)); }
.gk-mark { width: 30px; height: 30px; }

.gk-study-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gk-review { grid-column: span 2; flex-direction: row; align-items: center; gap: 28px; padding: 28px; }
.gk-ring { width: 108px; height: 108px; flex: none; border-radius: 50%; background: conic-gradient(var(--gk-accent-text) 0 74%, var(--gk-accent-soft) 74% 100%); display: flex; align-items: center; justify-content: center; }
.gk-ring > div { width: 86px; height: 86px; border-radius: 50%; background: var(--gk-accent-deep); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gk-ring b { font-size: 26px; font-weight: 600; } .gk-ring small { font-size: 11px; color: var(--text-muted); }
.gk-mini { padding: 22px; gap: 8px; border-radius: 20px; }
.gk-mini b { font-size: 17px; font-weight: 600; }
.gk-mini span:not(.gk-ghost) { font-size: 14px; color: var(--text-muted); }
.gk-mini .gk-ghost { right: -6px; bottom: -22px; font-size: 96px; }

/* Library */
.gk-lib { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0 0 20px; }
.gk-covers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.gk-cover { height: 180px; border-radius: 12px; border: 1px solid var(--gk-line-strong); display: flex; align-items: center; justify-content: center; font: 900 26px var(--gk-mincho); writing-mode: vertical-rl; text-orientation: upright; }
.gk-cover-1 { background-color: #d8d3c8; }
.gk-cover-2 { background: repeating-linear-gradient(120deg, var(--gk-paper) 0 5px, var(--gk-ink) 5px 6px); }
.gk-cover-3 { background: var(--gk-accent-soft); color: var(--gk-accent-text); }
.gk-cover-4 { background-color: var(--gk-paper); }
.gk-cover-5 { background: var(--gk-shu-soft); color: var(--accent-2); }
.gk-stack { display: flex; flex-direction: column; gap: 20px; }
.gk-stack .gk-card { flex: 1 1 0; }

/* Pricing */
.gk-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.gk-plan { border-radius: 24px; border: 1px solid var(--border); background: var(--bg-raised); padding: 36px; display: flex; flex-direction: column; gap: 20px; }
.gk-plan-feature { border-color: var(--accent); background: var(--gk-accent-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.gk-plan-name { font-size: 18px; font-weight: 600; }
.gk-price { display: flex; align-items: baseline; gap: 8px; color: var(--gk-text-3); }
.gk-price b { font-family: var(--font-body); font-weight: 600; font-size: 56px; line-height: 1; color: var(--text); letter-spacing: -0.045em; }
.gk-plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--gk-text-2); }
.gk-plan li { display: flex; gap: 10px; }
.gk-plan li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--gk-accent-text); }
.gk-plan .gk-note { font-size: 13px; color: var(--gk-text-3); margin: 0; }
.gk-plan-action { margin-top: auto; padding-top: 4px; }
.gk-plan-action form { margin: 0; }
.gk-plan-action .gk-btn { width: 100%; white-space: normal; text-align: center; height: auto; min-height: 50px; padding-block: 12px; line-height: 1.25; }
.badge-early { white-space: nowrap; }

.gk-table { border-radius: 24px; border: 1px solid var(--border); background: var(--bg-raised); overflow: hidden; }
.gk-tr { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; min-height: 54px; align-items: center; padding: 0 32px; gap: 16px; border-top: 1px solid var(--gk-line); font-size: 15px; }
.gk-tr:first-child { border-top: 0; min-height: 64px; font-weight: 600; background: var(--gk-bg-2); }
.gk-tr > :first-child { color: var(--gk-text-2); }
.gk-tr .y { color: var(--gk-accent-text); font-weight: 700; }
.gk-tr .n { color: var(--gk-text-3); }
.gk-tr .v { font: 14px var(--gk-mono); }
.gk-tr > * { min-width: 0; overflow-wrap: anywhere; }
.gk-tr.gk-tr-group { grid-template-columns: minmax(0, 1fr); min-height: 46px; background: var(--gk-bg-2); font: 600 12px var(--gk-mono); letter-spacing: .08em; text-transform: uppercase; }
.gk-tr.gk-tr-group > span { color: var(--gk-text-3); }
.gk-faq { display: grid; grid-template-columns: 1fr 2fr; gap: 64px; padding: 0 0 120px; }
.gk-faq dl { margin: 0; }
.gk-faq dt { padding: 22px 0 8px; border-top: 1px solid var(--border); font-size: 17px; font-weight: 600; }
.gk-faq dd { margin: 0; padding: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }

/* Final CTA */
.gk-final { position: relative; overflow: hidden; min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; border-top: 1px solid var(--gk-line); }
.gk-final .gk-ghost { left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: clamp(200px, 30vw, 420px); white-space: nowrap; }
.gk-final > :not(.gk-ghost) { position: relative; }
.gk-final .gk-h2 { font-size: clamp(40px, 5vw, 68px); }

/* Download page */
.gk-dl { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 64px; align-items: center; padding: 88px 0 96px; }
.gk-dl::before { content: ""; position: absolute; inset: 0; margin-inline: calc(50% - 50vw); background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); pointer-events: none; }
.gk-dl > * { position: relative; }
.gk-dl > .gk-hero-glyph { position: absolute; right: -40px; left: auto; }
.gk-dlcard { border-radius: 28px; border: 1px solid var(--gk-accent-line); background: var(--gk-accent-deep); padding: 36px; display: flex; flex-direction: column; gap: 22px; box-shadow: var(--gk-shadow); }
.gk-dlcard-head { display: flex; align-items: center; gap: 18px; }
.gk-dlcard-head img { width: 72px; height: 72px; }
.gk-dlcard-head b { display: block; font-size: 22px; font-weight: 600; }
.gk-dlcard-head span { font: 13px var(--gk-mono); color: var(--text-muted); }
.gk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gk-facts div { border-radius: 14px; background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.gk-facts small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gk-text-3); }
.gk-facts span { font: 15px var(--gk-mono); }
.gk-hash { border-radius: 14px; border: 1px dashed var(--gk-accent-line); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.gk-hash small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gk-text-3); flex: none; }
.gk-hash code { flex: 1 1 0; min-width: 0; font: 12px var(--gk-mono); color: var(--gk-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; }
.gk-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gk-step-n { font-family: var(--gk-mono); font-size: 14px; line-height: 1; color: var(--gk-accent-text); width: 34px; height: 34px; border-radius: 10px; background: var(--gk-accent-soft); display: inline-flex; align-items: center; justify-content: center; }
.gk-card code { background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font: .9em var(--gk-mono); }
.gk-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.gk-trio .gk-card h3 { font-size: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .gk-hero, .gk-dl { grid-template-columns: minmax(0, 1fr); }
    .gk-dl > .gk-hero-glyph { display: none; }
    .gk-demo { width: 600px; max-width: 100%; margin: 0 auto; }
    .gk-hero-glyph { display: none; }
    .gk-split { flex-direction: column; }
    .gk-split > .gk-split-art, .gk-chat { width: 100%; }
    .gk-split > .gk-split-art { height: 260px; }
}
@media (max-width: 900px) {
    body.gk-marketing .hub-shell { padding: 0 20px; }
    .gk-section, .gk-row { padding: 80px 0; }
    .gk-section-head { flex-direction: column; align-items: flex-start; gap: 20px; }
    .gk-gap-grid, .gk-row, .gk-plans, .gk-lib, .gk-steps, .gk-trio, .gk-faq, .gk-study-grid { grid-template-columns: minmax(0, 1fr); }
    .gk-bento { grid-template-columns: minmax(0, 1fr); }
    .gk-span-2, .gk-review, .gk-lib > .gk-span-2 { grid-column: auto; }
    .gk-covers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .gk-covers > :nth-child(n+4) { display: none; }
    .gk-sentence { font-size: 26px; }
    .gk-tr { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 0 16px; font-size: 13px; }
    .gk-tr .v { font-size: 12px; }
    .gk-strip { padding: 20px 0; }
}
@media (max-width: 640px) {
    .gk-demo { zoom: .56; width: 620px; }
    .gk-dlcard { padding: 24px; }
    .gk-hero { padding: 40px 0 64px; }
    .gk-cta-row .gk-btn { width: 100%; }
    .gk-review { flex-wrap: wrap; }
    .gk-facts { grid-template-columns: 1fr 1fr; }
    .gk-desk { height: 460px; }
    .gk-tray-menu { right: 12px; left: 12px; width: auto; }
}

/* ==========================================================================
   App shell (signed-in pages): sidebar, cockpit tiles, panels, buttons
   ========================================================================== */

/* Sidebar */
.side-nav { top: 92px; gap: 12px; }
.side-list { gap: 2px; }
.side-me { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--bg-raised); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.side-me:hover { border-color: var(--gk-line-strong); text-decoration: none; }
.side-me img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--gk-accent-soft); flex: none; }
.side-me-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.side-me-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me .side-plan-chip { font-size: 11px; padding: 2px 8px; }
.side-plan { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; border-radius: 16px; background: var(--gk-accent-deep); border: 1px solid var(--gk-accent-line); font-size: 13px; color: var(--gk-text-2); line-height: 1.45; }
.side-plan a { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 10px; background: var(--accent); color: #fff !important; font-weight: 600; text-decoration: none !important; }
.side-plan a:hover { background: var(--accent-hover); }
.side-heading { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; color: var(--gk-text-3); padding: 6px 12px 4px; }
.side-heading-spaced { margin-top: 12px; }
/* Groups inside a section's links (Study: Learn, Practice, Your words). */
.side-subheading { font-size: 11.5px; font-weight: 600; color: var(--gk-text-3); padding: 10px 12px 2px; }
.side-link { gap: 12px; padding: 6px 10px 6px 6px; font-size: 14px; font-weight: 500; color: var(--gk-text-2); }
.side-link .study-icon { box-sizing: content-box; width: 16px; height: 16px; padding: 7px; border-radius: 9px; background: var(--gk-bg-3); color: var(--gk-text-3); transition: background .15s, color .15s; }
.side-link:hover { background: var(--gk-bg-3); color: var(--text); }
.side-link:hover .study-icon { color: var(--text); background: var(--bg-input); }
.side-link.active { background: var(--gk-accent-soft); color: var(--text); font-weight: 600; }
.side-link.active .study-icon { background: var(--accent); color: #fff; }
/* Danger zone stays red in every state (the generic .active rules above are later in the file, so restate them). */
.side-link.side-link-danger, .side-link.side-link-danger:hover { color: var(--error); }
.side-link.side-link-danger .study-icon { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.side-link.side-link-danger.active { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.side-link.side-link-danger.active .study-icon { background: var(--error); color: #fff; }
.tab-bar { background: color-mix(in srgb, var(--bg-raised) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tab-link.active { color: var(--gk-accent-text); }

/* Page headers inside the app */
.hub-header { align-items: flex-end; margin-bottom: 4px; }
.hub-header .subtitle { color: var(--text-muted); font-size: 14px; }

/* Cockpit tiles (dashboard, library, jobs, settings headers) */
.cockpit-grid { gap: 14px; }
.cockpit-tile { border-radius: 18px; background: var(--bg-raised); border: 1px solid var(--border); padding: 18px 20px; }
.cockpit-tile-plan { background: var(--gk-accent-deep); border-color: var(--gk-accent-line); box-shadow: none; }
.cockpit-tile-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--gk-text-3); }
.cockpit-tile-value { font-weight: 600; letter-spacing: -0.03em; }
.cockpit-header .cockpit-avatar { border-radius: 16px; }

/* Buttons: one neutral bordered style for links that sit next to real buttons */
.btn-like, a.btn-like, .hub-shell a.btn-like {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--gk-line-strong);
    background: var(--gk-bg-3); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
}
a.btn-like:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
a.btn-like.disabled { opacity: .45; pointer-events: none; }
.hub-shell button.secondary, .hub-shell button.danger { border-radius: 12px; }
.admin-post-actions a.button-link { border-radius: 12px; background: var(--gk-bg-3); border-color: var(--gk-line-strong); }
.job-row-actions { display: flex; align-items: center; gap: 8px; }
.job-row-actions form { margin: 0; }
.job-row-actions button { margin: 0 !important; height: 38px; min-width: 38px; padding: 0 12px; }

/* Native checkboxes/radios pick up the accent */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

/* Manga covers without art: screentone + a big initial instead of a flat gradient */
.manga-cover { background-color: var(--gk-accent-deep); background-image: radial-gradient(circle, color-mix(in srgb, var(--gk-accent-text) 22%, transparent) 1.1px, transparent 1.5px); background-size: 7px 7px; border: 1px solid var(--gk-accent-line); border-radius: 12px; }
.manga-cover-letter { font-family: var(--gk-mincho); font-weight: 900; font-size: 48px; color: var(--gk-accent-text); }
.manga-card:hover .manga-cover { outline: 2px solid var(--accent); outline-offset: 2px; }
.manga-title { font-weight: 600; }

/* ---------- Dashboard ---------- */
.gk-dash-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
    padding: 28px; border-radius: 24px; border: 1px solid var(--border); background-color: var(--bg-raised);
    background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
}
.gk-dash-hero::after { content: "読"; position: absolute; right: 200px; top: -40px; font: 900 200px/1 var(--gk-mincho); color: color-mix(in srgb, var(--text) 4%, transparent); pointer-events: none; }
.gk-dash-hero > * { position: relative; z-index: 1; }
.gk-dash-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
.gk-dash-avatar { width: 68px; height: 68px; border-radius: 20px; object-fit: cover; background: var(--gk-accent-soft); box-shadow: 0 0 0 3px var(--bg-raised), 0 0 0 5px var(--accent); flex: none; }
.gk-dash-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gk-accent-text); }
.gk-dash-eyebrow .gk-jp { text-transform: none; letter-spacing: .04em; }
.hub-shell .gk-dash-name { margin: 4px 0 8px; font-size: 32px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.gk-dash-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gk-dash-tag { font: 12px var(--gk-mono); color: var(--gk-text-3); }
.gk-dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gk-btn-icon { width: 44px; padding: 0; }
.gk-btn[hidden] { display: none; }

.gk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
@media (max-width: 700px) { .gk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .gk-stat { padding: 14px; min-height: 0; } .gk-stat-value { font-size: 19px; } .gk-stat-label { font-size: 10.5px; } }
.gk-stat { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 20px; background: var(--bg-raised); border: 1px solid var(--border); min-height: 132px; box-sizing: border-box; }
.gk-stat-accent { background: var(--gk-accent-deep); border-color: var(--gk-accent-line); }
.gk-stat-top { display: flex; align-items: center; gap: 10px; }
.gk-stat-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--gk-accent-soft); color: var(--gk-accent-text); display: inline-flex; align-items: center; justify-content: center; }
.gk-stat-ic-shu { background: var(--gk-shu-soft); color: var(--accent-2); }
.gk-stat-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gk-text-3); }
.gk-stat-value { display: flex; align-items: baseline; gap: 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.gk-stat-value small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); white-space: nowrap; }
.gk-stat-value { flex-wrap: wrap; row-gap: 2px; }
.gk-stat-num { white-space: nowrap; }
.gk-stat-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.gk-stat-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gk-accent-text); text-decoration: none; }
.gk-stat-link:hover { text-decoration: underline; }
.gk-stat-bar { margin-top: auto; }
.gk-stat-form { margin: auto 0 0; }
.hub-shell .gk-btn-mini, .gk-btn-mini {
    display: inline-flex; align-items: center; gap: 6px; width: auto; height: 30px; margin: 0; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--gk-line-strong); background: var(--gk-bg-3); color: var(--gk-text-2); font-size: 12.5px; font-weight: 600;
}
.hub-shell .gk-btn-mini:hover { border-color: var(--accent); background: var(--gk-bg-3); color: var(--text); }
.gk-live { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); align-self: center; margin-right: 4px; flex: none; }
.gk-live-wait { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 22%, transparent); }
.gk-live-off { background: var(--gk-text-3); box-shadow: none; }
/* Connected beats like a heart (two quick beats, a rest) with a ring going out; Waiting breathes; Offline stays still. */
.gk-live { position: relative; }
.gk-live:not(.gk-live-off):not(.gk-live-wait) { animation: gk-heartbeat 2.4s ease-in-out infinite; }
.gk-live:not(.gk-live-off):not(.gk-live-wait)::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--success); animation: gk-live-ring 2.4s ease-out infinite; }
.gk-live-wait { animation: gk-breathe 2s ease-in-out infinite; }
@keyframes gk-heartbeat { 0%, 45%, 100% { transform: scale(1); } 10% { transform: scale(1.28); } 20% { transform: scale(0.96); } 30% { transform: scale(1.16); } }
@keyframes gk-live-ring { 0% { transform: scale(1); opacity: 0.5; } 55%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes gk-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .gk-live, .gk-live::after { animation: none !important; } }
.gk-spark { margin-top: auto; display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.gk-spark i { flex: 1 1 0; border-radius: 3px; background: color-mix(in srgb, var(--accent-2) 70%, transparent); min-height: 3px; }
.gk-spark i:last-child { background: var(--accent-2); }
.gk-spark-days { display: flex; gap: 4px; margin-top: 4px; }
.gk-spark-days span { flex: 1 1 0; text-align: center; font-size: 10px; line-height: 1; color: var(--text-muted); }
.gk-spark-days span.today { color: var(--accent-2); font-weight: 700; }
.gk-spark-note { margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.gk-board { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.gk-board-main, .gk-board-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.gk-box { border-radius: 22px; background: var(--bg-raised); border: 1px solid var(--border); padding: 22px 24px; }
.gk-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.gk-panel-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.gk-panel-head h2 .gk-i { color: var(--gk-accent-text); }
.gk-panel-links { display: flex; gap: 14px; }
.gk-panel-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gk-accent-text); text-decoration: none; }
.gk-panel-link:hover { text-decoration: underline; }
.gk-box .manga-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.gk-jobs { display: flex; flex-direction: column; gap: 8px; }
.gk-job { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--gk-line); background: var(--bg); color: var(--text); text-decoration: none; }
.gk-job:hover { border-color: var(--gk-line-strong); text-decoration: none; }
.gk-job-thumb { width: 44px; height: 56px; border-radius: 8px; background: var(--gk-paper); border: 2px solid var(--gk-ink); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: var(--gk-ink); }
.gk-job-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gk-job-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-job .job-row-bar { display: block; width: 100%; height: 6px; flex: none; border-radius: 3px; overflow: hidden; background: var(--gk-line); }
.gk-job .job-row-fill { height: 100% !important; border-radius: 3px; }
.gk-job-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gk-job-count { font: 12px var(--gk-mono); color: var(--gk-text-3); }

.gk-study-mini { display: flex; align-items: center; gap: 20px; }
.gk-ring-sm { width: 92px; height: 92px; }
.gk-ring-sm > div { width: 72px; height: 72px; background: var(--bg-raised); }
.gk-ring-sm b { font-size: 20px; }
.gk-kv { margin: 0; flex: 1 1 0; display: flex; flex-direction: column; gap: 8px; }
.gk-kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.gk-kv dt { color: var(--text-muted); }
.gk-kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.gk-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.gk-week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 11px var(--gk-mono); color: var(--gk-text-3); }
.gk-week-bar { width: 100%; height: 64px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--gk-bg-3); overflow: hidden; }
.gk-week-bar i { display: block; width: 100%; background: var(--accent); border-radius: 8px 8px 0 0; }
.gk-week-col:last-child .gk-week-bar i { background: var(--gk-accent-text); }
.gk-week-col span.today { color: var(--gk-accent-text); font-weight: 700; }

.gk-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gk-timeline li { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 0 0 16px 22px; }
.gk-timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gk-accent-text); box-shadow: 0 0 0 4px var(--gk-accent-soft); }
.gk-timeline li::after { content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.gk-timeline li:last-child { padding-bottom: 0; }
.gk-timeline li:last-child::after { display: none; }
.gk-timeline li.is-alert::before { background: var(--error); box-shadow: 0 0 0 4px color-mix(in srgb, var(--error) 18%, transparent); }
.gk-timeline-msg { font-size: 13.5px; line-height: 1.45; }
.gk-timeline li.is-alert .gk-timeline-msg { color: var(--error); }
.gk-timeline-time { font: 11.5px var(--gk-mono); color: var(--gk-text-3); }

.gk-news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.gk-news li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--gk-line); }
.gk-news li:first-child { border-top: 0; padding-top: 0; }
.gk-news a { color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; }
.gk-news a:hover { color: var(--gk-accent-text); }
.gk-news span { font: 11.5px var(--gk-mono); color: var(--gk-text-3); }

@media (max-width: 1100px) { .gk-board { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
    .gk-dash-hero { padding: 20px; }
    .gk-dash-hero::after { display: none; }
    .gk-box .manga-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gk-box { padding: 18px; }
}

/* ---------- Notifications ---------- */
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-list .notif-row { border: 1px solid var(--border); border-radius: 16px; background: var(--bg-raised); padding: 4px 6px 4px 4px; }
.notif-list .notif-row.notif-unread { background: var(--gk-accent-deep); border-color: var(--gk-accent-line); }
.notif-row.notif-unread .notif-title::before { background: var(--gk-shu); }
.notif-time { font-family: var(--gk-mono); font-size: 11.5px; }
.notif-actions { display: flex; align-items: center; gap: 4px; padding-right: 6px; }
.hub-shell .notif-icon { width: 34px; height: 34px; border-radius: 10px; }
.hub-shell .notif-icon:hover { background: var(--gk-bg-3); }
.comment-badge { background: var(--gk-shu-soft); color: var(--accent-2); border-radius: 999px; }

/* ---------- Blog / Guides listing + guide article ---------- */
.blog-intro .eyebrow { font-family: var(--gk-mono); color: var(--accent-2); letter-spacing: .06em; }
.blog-intro h1 { font-size: clamp(34px, 4.4vw, 54px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.blog-search { border-radius: 14px; }
.guide-group-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; border-bottom-color: var(--gk-line); }
.blog-card { border-radius: 20px; border-color: var(--border); background: var(--bg-raised); overflow: hidden; transition: border-color .15s, transform .15s; }
.blog-card:hover { border-color: var(--gk-line-strong); transform: translateY(-2px); }
.blog-cover { background-color: var(--gk-accent-deep); background-image: radial-gradient(circle, color-mix(in srgb, var(--gk-accent-text) 20%, transparent) 1.1px, transparent 1.5px); background-size: 8px 8px; border-bottom: 1px solid var(--border); }
.blog-cover-initial { font-family: var(--gk-mincho); font-weight: 900; color: var(--gk-accent-text); opacity: .9; }
.blog-card-meta { font-family: var(--gk-mono); letter-spacing: .02em; text-transform: none; }
.blog-card-body h2 { letter-spacing: -0.02em; }
.guide-article h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; }
.guide-tag { border-radius: 999px; background: var(--gk-accent-soft); color: var(--gk-accent-text); }
.guide-toc { border-radius: 18px; background: var(--bg-raised); border: 1px solid var(--border); }
.guide-cta-box { border-radius: 22px; border: 1px solid var(--gk-accent-line); background-color: var(--gk-accent-deep); background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px); background-size: 32px 32px; }
.guide-related-card { border-radius: 16px; }

/* ---------- Auth pages (login, register, 2FA, reset) ---------- */
body.auth-body { background: var(--bg); background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px); background-size: 56px 56px; }
.auth-body .card { max-width: 400px; padding: 36px; border-radius: 24px; box-shadow: var(--gk-shadow); }
.auth-body .card h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.035em; }
.auth-brand .top-nav-logo { font-size: 20px; }
.alt-signin-button { border-radius: 12px; }

/* ---------- Landing: library section (reader mock + chapter shelf) ---------- */
.gk-lib { padding-bottom: 20px; }
.gk-reader-card { padding: 36px; gap: 28px; }
.gk-reader { border-radius: 18px; border: 1px solid var(--border); background: var(--bg); overflow: hidden; }
.gk-reader-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.gk-reader-title { font-weight: 600; }
.gk-reader-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--gk-bg-3); font-size: 12px; }
.gk-reader-toggle span { padding: 4px 10px; border-radius: 8px; color: var(--text-muted); font-family: var(--gk-jp); }
.gk-reader-toggle span.is-on { background: var(--accent); color: #fff; font-family: var(--font-body); font-weight: 600; }
.gk-reader-page { color: var(--gk-text-3); font-size: 12px; }
.gk-spread { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 22px; }
.gk-spread-arrow { color: var(--gk-accent-text); }
.gk-page { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.gk-page figcaption { font-size: 12px; color: var(--gk-text-3); text-align: center; }
.gk-page-grid { aspect-ratio: 3 / 3.4; padding: 9px; box-sizing: border-box; background: var(--gk-paper); border-radius: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.35); display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 7px; }
.gk-page-grid .gk-panel { border-width: 2.5px; }
.gk-page-grid .gk-wide { grid-column: span 2; }
.gk-bubble-en { writing-mode: horizontal-tb; font-family: var(--font-body); font-weight: 700; font-size: 11px; letter-spacing: .02em; line-height: 1.15; text-align: center; padding: 6px; box-sizing: border-box; }
.gk-shelf { gap: 14px; padding: 28px; }
.gk-ch { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--bg); border: 1px solid var(--gk-line); }
.gk-ch-thumb { width: 36px; height: 46px; border-radius: 6px; background-color: var(--gk-paper); border: 2px solid var(--gk-ink); }
.gk-ch-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gk-ch-main b { font-size: 14px; font-weight: 600; }
.gk-ch-status { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gk-accent-text); }
.gk-ch-done { color: var(--success); }
.gk-ch-wait { color: var(--gk-text-3); }
.gk-shelf-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; font-size: 13px; color: var(--text-muted); }
.gk-shelf-foot div { display: flex; align-items: center; gap: 10px; }
.gk-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 0 0 120px; }
.gk-popular { margin-left: 8px; vertical-align: middle; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff; }
@media (max-width: 900px) {
    .gk-duo { grid-template-columns: minmax(0, 1fr); padding-bottom: 80px; }
    .gk-spread { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; gap: 10px; }
    .gk-spread-arrow { display: none; }
    .gk-reader-card { padding: 22px; }
}

/* ---------- Links & focus ----------
   There was no site-wide link style, so plain inline links fell back to the browser's own
   #0000EE blue / purple visited colours and focus ring (hard to read on the dark ground).
   Only unclassed links in running text get this; nav, buttons and cards keep their own styles. */
:where(p, dd, td, label, blockquote, figcaption, .subtitle, .field-hint, .empty-state, .notice-meta, .about-tagline, .gk-lede, .help, .blog-rich-content, .blog-post-body) a:not([class]),
a.inline-link {
    color: var(--gk-accent-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--gk-accent-text) 45%, transparent);
    text-underline-offset: 3px;
    border-radius: 3px;
    transition: text-decoration-color .15s, color .15s;
}
:where(p, dd, td, label, blockquote, figcaption, .subtitle, .field-hint, .empty-state, .notice-meta, .about-tagline, .gk-lede, .help, .blog-rich-content, .blog-post-body) a:not([class]):visited { color: var(--gk-accent-text); }
:where(p, dd, td, label, blockquote, figcaption, .subtitle, .field-hint, .empty-state, .notice-meta, .about-tagline, .gk-lede, .help, .blog-rich-content, .blog-post-body) a:not([class]):hover,
a.inline-link:hover { color: var(--text); text-decoration-color: currentColor; }
/* One consistent keyboard focus ring everywhere, instead of each browser's own (some draw it red). */
a:focus { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- Phone polish (≤700px) ---------- */
@media (max-width: 1100px) {
    .gk-split > .gk-split-art .gk-float { left: auto !important; right: 0; }
}
@media (max-width: 700px) {
    /* Stat tiles: plan and sync get a full row, storage and streak share one. */
    .gk-stat-accent, .gk-stats > .gk-stat:nth-child(3) { grid-column: 1 / -1; }
    .gk-stat-value { flex-wrap: wrap; row-gap: 2px; }
    .gk-stat-form .gk-btn-mini { white-space: nowrap; }
    /* One row on a phone: Lookup, Library and the download icon share it (the download icon used to drop onto a line
       of its own). "Review N due", when there is one, gets the row above to itself. */
    .gk-dash-actions { width: 100%; }
    .gk-dash-actions .gk-btn:not(.gk-btn-icon) { flex: 1 1 0; min-width: 0; padding: 0 12px; white-space: nowrap; }
    .gk-dash-actions .gk-btn-primary:not(.gk-btn-icon) { flex: 1 1 100%; }
    .gk-dash-actions .gk-btn-icon { flex: 0 0 44px; }
    /* Admin, Lookup, Library and the download icon don't fit on one row: Admin gets its own (the installed app has
       no download icon, so there it still shares the row). */
    .gk-dash-actions:has(#gk-dash-download:not([hidden])) .gk-admin-btn { flex: 1 1 100%; }
    .gk-job { grid-template-columns: 36px minmax(0, 1fr); }
    .gk-job-thumb { width: 36px; height: 46px; }
    .gk-job-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
    .job-row-progress { flex-wrap: wrap; row-gap: 6px; }
    .job-row-count { white-space: nowrap; }
    /* Bigger touch areas for small text links, without changing how they look. */
    .site-footer-links { gap: 2px 18px; }
    .site-footer-links a, .site-footer-links label { padding: 9px 0; }
    .gk-panel-link, .gk-stat-link, .gk-link-arrow, .mobile-back-link, .guide-back { padding-block: 10px; margin-block: -10px; }
    .gk-news a { display: block; padding-block: 4px; }
    .gk-hero .gk-meta { gap: 4px 12px; }
    .blog-intro h1, .gk-display { overflow-wrap: anywhere; }
}

/* Phone nav: the menu lives inside .top-nav-inner, so that is what wraps; the bar's fixed desktop
   height is lifted so the opened menu can push down, and it gets a solid background. */
@media (max-width: 700px) {
    body.hub .top-nav { height: auto; padding: 0; background: var(--bg); }
    .top-nav-inner { flex-wrap: wrap; padding: 12px 18px; }
    .top-nav-links { max-height: calc(100dvh - 70px); overflow-y: auto; margin-top: 12px; padding-top: 10px; border-top-color: var(--gk-line); }
    .top-nav-links .nav-icon-link { font-size: 15px; padding: 12px 10px; }
    .top-nav-brand::after { left: 18px; }
    .gk-stats > .gk-stat:nth-child(3) { order: 1; }
}

/* ---------- AI Conversation (/converse) ---------- */
.gk-cv-head { margin-bottom: 4px; }
.gk-cv-head .gk-kicker { margin-bottom: 10px; }
.hub-shell .gk-cv-title { margin: 0 0 8px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; }
.gk-cv-head .subtitle { max-width: 620px; font-size: 14.5px; line-height: 1.55; }
.gk-cv { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.gk-cv-chat { display: flex; flex-direction: column; height: min(720px, calc(100dvh - 190px)); min-height: 480px; border-radius: 24px; border: 1px solid var(--border); background: var(--bg-raised); overflow: hidden; }
.gk-cv-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.gk-cv-avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: none; position: relative; }
.gk-cv-avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); border: 2px solid var(--bg-raised); }
.gk-cv-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.gk-cv-who b { font-size: 14.5px; font-weight: 600; }
.gk-cv-who span { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-cv-level { position: relative; }
.gk-cv-level summary { list-style: none; cursor: pointer; }
.gk-cv-level summary::-webkit-details-marker { display: none; }
.gk-cv-level-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 240px; padding: 16px; border-radius: 16px; background: var(--bg-raised); border: 1px solid var(--gk-line-strong); box-shadow: var(--gk-shadow); display: flex; flex-direction: column; gap: 8px; }
.gk-cv-level-pop label { margin: 0; font-weight: 600; color: var(--text); }
.gk-cv-level-pop .field-hint { margin: 0 0 4px; }
.hub-shell .gk-cv-level-pop button { width: 100%; margin: 4px 0 0; height: 40px; }

.gk-cv-thread { position: relative; flex: 1 1 auto; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth;
    background-image: linear-gradient(var(--gk-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--gk-grid-line) 1px, transparent 1px); background-size: 40px 40px; }
.gk-cv-row { display: flex; flex-direction: column; gap: 6px; max-width: min(78%, 560px); animation: gk-cv-in .18s ease-out; }
.gk-cv-row.is-them { align-self: flex-start; align-items: flex-start; }
.gk-cv-row.is-me { align-self: flex-end; align-items: flex-end; }
@keyframes gk-cv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gk-cv-row { animation: none; } .gk-cv-thread { scroll-behavior: auto; } }
.gk-cv-bubble { padding: 10px 14px; border-radius: 18px; font-family: var(--gk-jp); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.gk-cv-row.is-them .gk-cv-bubble { background: var(--gk-bg-3); border: 1px solid var(--gk-line); border-bottom-left-radius: 6px; }
.gk-cv-row.is-me .gk-cv-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.gk-cv-note { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--gk-accent-line); background: var(--gk-accent-deep); font-size: 13px; line-height: 1.5; color: var(--gk-text-2); }
.gk-cv-note-tag { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gk-accent-text); }
.gk-cv-typing .gk-cv-bubble { display: flex; gap: 4px; padding: 14px 16px; }
.gk-cv-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gk-text-3); animation: gk-cv-dot 1s infinite ease-in-out; }
.gk-cv-typing i:nth-child(2) { animation-delay: .15s; } .gk-cv-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gk-cv-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gk-cv-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; }
.gk-cv-empty[hidden] { display: none; }
.gk-cv-empty-glyph { width: 64px; height: 64px; border-radius: 20px; background: var(--gk-accent-soft); color: var(--gk-accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.gk-cv-empty b { font-size: 17px; font-weight: 600; }
.gk-cv-empty > span:not(.gk-cv-empty-glyph) { font-size: 13px; color: var(--text-muted); }
.gk-cv-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.hub-shell .gk-cv-starter { width: auto; margin: 0; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--gk-line-strong); background: var(--bg-raised); color: var(--text); font-size: 14px; font-weight: 500; }
.hub-shell .gk-cv-starter:hover { border-color: var(--accent); background: var(--gk-accent-deep); }

.gk-cv-composer { display: flex; align-items: flex-end; gap: 10px; margin: 0; padding: 12px 14px 8px; border-top: 1px solid var(--border); }
.gk-cv-composer textarea { flex: 1 1 auto; min-height: 46px; max-height: 160px; resize: none; border-radius: 14px; padding: 12px 14px; font-family: var(--gk-jp), var(--font-body); font-size: 15px; line-height: 1.5; background: var(--bg); }
.hub-shell .gk-cv-send { flex: none; width: 46px; height: 46px; margin: 0; padding: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; }
.gk-cv-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 16px 12px; font-size: 12px; color: var(--gk-text-3); }
.gk-cv-foot #converse-usage { font-family: var(--gk-mono); }
.gk-cv-chat .error { margin: 0 16px 12px; }

.gk-cv-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; background: var(--bg-raised); border: 1px solid var(--border); }
.gk-cv-side .gk-btn { width: 100%; }
.gk-cv-side-label { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gk-text-3); padding: 6px 4px 0; }
.gk-cv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 480px; overflow-y: auto; }
.gk-cv-list li { display: flex; align-items: center; border-radius: 10px; }
.gk-cv-list li:hover, .gk-cv-list li.is-on { background: var(--gk-bg-3); }
.gk-cv-list li.is-on .converse-conversation-open { color: var(--text); font-weight: 600; }
.hub-shell .gk-cv-list .converse-conversation-open { flex: 1 1 auto; min-width: 0; width: auto; margin: 0; padding: 9px 10px; background: none; border: 0; text-align: left; color: var(--gk-text-2); font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 10px; }
.hub-shell .gk-cv-list .gk-cv-item-btn { flex: none; width: 28px; height: 30px; margin: 0; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--gk-text-3); display: inline-flex; align-items: center; justify-content: center; opacity: 0; }
.gk-cv-list li:hover .gk-cv-item-btn, .gk-cv-list .gk-cv-item-btn:focus-visible, .gk-cv-list li:focus-within .gk-cv-item-btn { opacity: 1; }
.gk-cv-list .converse-conversation-delete { margin-right: 4px !important; }
.hub-shell .gk-cv-list .converse-conversation-rename:hover { color: var(--gk-accent-text); background: var(--gk-accent-soft); }
.gk-cv-list li.is-editing { background: var(--gk-bg-3); }
.gk-cv-list li.is-editing .gk-cv-item-btn { display: none; }
.hub-shell .gk-cv-list input.gk-cv-rename { flex: 1 1 auto; min-width: 0; width: auto; height: 34px; margin: 2px; padding: 0 9px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text); background: var(--gk-bg-2); border: 1px solid var(--gk-accent-text); border-radius: 8px; box-shadow: 0 0 0 3px var(--gk-accent-soft); outline: none; }
.hub-shell .gk-cv-list .converse-conversation-delete:hover { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.gk-cv-list-empty { padding: 8px 10px; font-size: 13px; color: var(--gk-text-3); }

.gk-cv-locked { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; padding: 32px; border-radius: 24px; border: 1px solid var(--gk-accent-line); background: var(--gk-accent-deep); }
.gk-cv-locked-art { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 18px; background: var(--bg); border: 1px solid var(--border); }
.gk-cv-locked-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.gk-cv-locked-copy h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.gk-cv-locked-copy p { margin: 0 0 6px; color: var(--text-muted); line-height: 1.55; }
.gk-cv-lock { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

.hub-shell .gk-cv-more { width: 100%; margin: 4px 0 0; padding: 8px; background: none; border: 1px solid var(--gk-line); border-radius: 10px; color: var(--gk-text-2); font-size: 13px; font-weight: 500; }
.hub-shell .gk-cv-more:hover { background: var(--gk-bg-3); color: var(--text); }
.hub-shell .gk-cv-chats { display: none; margin: 0; padding: 0; }
.gk-cv-side-backdrop { display: none; }
/* Narrower than the two columns: Recent opens over the page from the chat bar's clock button instead of sitting above
   the chat (where it pushed the chat down the screen), as a sheet from the bottom. */
@media (max-width: 1100px) {
    .gk-cv { grid-template-columns: minmax(0, 1fr); }
    .hub-shell .gk-cv-chats { display: inline-flex; }
    .gk-cv-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1001; max-height: min(70dvh, 560px); border-radius: 20px 20px 0 0;
                  padding: 16px 16px max(16px, env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0, 0, 0, .4); transform: translateY(105%); visibility: hidden;
                  transition: transform .22s ease, visibility .22s; }
    .gk-cv-side.is-open { transform: none; visibility: visible; }
    .gk-cv-side-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(5, 6, 10, .55); }
    .gk-cv-list { max-height: none; min-height: 0; flex: 1 1 auto; }
    .gk-cv-list .gk-cv-item-btn { opacity: 1; }
}
@media (max-width: 1100px) and (prefers-reduced-motion: reduce) { .gk-cv-side { transition: none; } }
@media (max-width: 700px) {
    .gk-cv-chat { height: calc(100dvh - 250px); min-height: 400px; border-radius: 20px; }
    .gk-cv-keys { display: none; }
    .gk-cv-row { max-width: 88%; }
    .gk-cv-thread { padding: 16px 12px; }
    .gk-cv-locked { grid-template-columns: minmax(0, 1fr); padding: 22px; }
}
.gk-cv-promo { display: flex; flex-direction: column; gap: 14px; background-color: var(--gk-accent-deep); border-color: var(--gk-accent-line); }
/* The dashboard's Ask box (top of .gk-cv-promo): a one-line question for the AI Tutor, and the last one asked. */
.gk-cv-promo .gk-panel-head { margin: 0; }
.gk-ask { display: flex; gap: 8px; margin: 0; }
.hub-shell .gk-ask input { flex: 1 1 auto; min-width: 0; margin: 0; height: 42px; border-radius: 12px; font-size: 14px; }
.hub-shell .gk-ask .gk-ask-go { flex: none; width: 42px; height: 42px; margin: 0; padding: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.gk-ask-last { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--text); background: var(--bg); border: 1px solid var(--gk-line); }
.gk-ask-last:hover { border-color: var(--gk-accent-line); }
.gk-ask-last small { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gk-text-3); }
.gk-ask-last span { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-ask-rule { margin: 2px 0; border: 0; border-top: 1px solid var(--gk-accent-line); }
/* The dashboard's Notebook box */
.gk-dash-nb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gk-dash-nb-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--gk-line); text-decoration: none; color: var(--text); }
.gk-dash-nb-list a:hover { border-color: var(--gk-accent-line); background: var(--gk-bg-3); }
.gk-dash-nb-list .gk-nb-tag { flex: none; }
.gk-dash-nb-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gk-dash-nb-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-dash-nb-main span { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-dash-nb-when { flex: none; font-size: 12px; color: var(--gk-text-3); }
.gk-dash-nb-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.hub-shell .gk-dash-nb-foot .gk-btn { width: auto; margin: 0; }
.gk-dash-nb-cap { font-size: 12.5px; color: var(--text-muted); }
.gk-nb-card.is-flash { animation: gk-nb-flash 1.6s ease-out; }
@keyframes gk-nb-flash { from { box-shadow: 0 0 0 3px var(--gk-accent-line); } to { box-shadow: 0 0 0 3px transparent; } }
.gk-cv-promo-top { display: flex; align-items: center; gap: 12px; }
.gk-cv-promo-top div { display: flex; flex-direction: column; gap: 2px; }
.gk-cv-promo-top b { font-size: 15px; font-weight: 600; }
.gk-cv-promo-top span { font-size: 12.5px; color: var(--text-muted); }
.gk-cv-promo .gk-cv-avatar::after { border-color: var(--gk-accent-deep); }
.gk-cv-promo-chat { display: flex; padding: 16px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--gk-line); }
.gk-cv-promo .gk-btn { width: 100%; }
.gk-dash-unread { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--gk-shu-soft); color: var(--accent-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.gk-dash-unread:hover { text-decoration: none; filter: brightness(1.1); }

/* AI Conversation: settings cog + popover */
.gk-cv-cog { list-style: none; cursor: pointer; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--gk-line-strong); background: var(--gk-bg-3); color: var(--gk-text-2); display: inline-flex; align-items: center; justify-content: center; }
.gk-cv-cog::-webkit-details-marker { display: none; }
.gk-cv-cog:hover, .gk-cv-level[open] .gk-cv-cog { color: var(--text); border-color: var(--accent); }
.gk-cv-level[open] .gk-cv-cog .gk-i { transform: rotate(45deg); }
.gk-cv-cog .gk-i { transition: transform .2s; }
.gk-cv-level-pop { width: 280px; gap: 10px; }
.gk-cv-pop-title { font-size: 14px; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.gk-cv-level-pop label { font-size: 13px; }
.gk-cv-level-pop select { margin: 0; }
.gk-cv-level-pop .field-hint { margin: -2px 0 2px; font-size: 12px; line-height: 1.5; }
.gk-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--border); cursor: pointer; }
.gk-switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--gk-line-strong); cursor: pointer; transition: background .15s; }
.gk-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--gk-text-3); transition: left .15s, background .15s; }
.gk-switch:checked { background: var(--accent); }
.gk-switch:checked::after { left: 19px; background: #fff; }
.gk-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gk-cv-pop-link { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--gk-accent-text); text-decoration: none; }
.gk-cv-pop-link:hover { text-decoration: underline; }
.hub-shell .gk-cv-inline-btn { width: auto; margin: 0 0 0 4px; padding: 0; background: none; border: 0; color: var(--gk-accent-text); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hub-shell .gk-cv-inline-btn:hover { background: none; color: var(--text); }
@media (max-width: 700px) { .gk-cv-level-pop { width: min(280px, calc(100vw - 48px)); } }

/* Dashboard: install the website as an app on a phone (_install_app.html) */
.gk-install { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 12px 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-raised); }
.gk-install[hidden], .gk-install-btn[hidden] { display: none; }
.gk-install img { flex: none; border-radius: 10px; }
.gk-install-text { flex: 1; margin: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.gk-install-share { vertical-align: -3px; color: var(--gk-accent-text, var(--accent)); }
.hub-shell .gk-install button.gk-install-btn { flex: none; margin: 0; width: auto; height: 38px; border-radius: 11px; font-size: 14px; }  /* beats .hub-shell button.gk-btn (full width, 50px tall) */
.hub-shell .gk-install-close { flex: none; margin: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; }
.hub-shell .gk-install-close:hover { color: var(--text); background: var(--bg-input); }

/* ---- Dashboard: the Admin box and button (admins and moderators; admin_users.dashboard_overview) */
.gk-admin-btn { position: relative; overflow: visible; }
/* In the corner, like the bell's: it takes no width, so the button fits its grid cell on a phone. */
.gk-admin-count { position: absolute; top: -7px; right: -7px; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gk-shu, #e5484d); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px var(--gk-bg-2, #0b0c14); }
.gk-admin-search { display: flex; gap: 6px; margin: 0 0 12px; }
.gk-admin-search input { margin: 0; flex: 1 1 0; width: auto; min-width: 0; }
.gk-admin-search .gk-btn { margin: 0; flex: 0 0 44px; width: 44px; padding: 0; justify-content: center; }
.gk-admin-box .gk-kv dt a { color: inherit; text-decoration: none; }
.gk-admin-box .gk-kv dt a:hover { color: var(--text); text-decoration: underline; }
.gk-admin-box .gk-kv dd small { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.gk-admin-waiting dd { color: var(--gk-shu, #e5484d); }
.gk-admin-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.gk-admin-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.gk-admin-links a:hover { border-color: var(--accent); }

/* The footer's language picker, beside the theme button. */

/* AI Tutor (/tutor): a question box, then answer cards, newest first */
.gk-tu { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.gk-tu-ask { border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.hub-shell .gk-tu-ask textarea { width: 100%; margin: 0; resize: vertical; min-height: 64px; font-size: 15px; line-height: 1.55; }
.gk-tu-ask-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gk-tu-pick { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.hub-shell .gk-tu-pick select { width: auto; margin: 0; height: 34px; padding: 0 28px 0 10px; font-size: 13px; }
.gk-tu-usage { flex: 1 1 auto; font-size: 12.5px; color: var(--text-muted); }
.hub-shell .gk-tu-ask-row .gk-btn { margin: 0; }
.gk-tu-ask .field-hint { margin: 0; }
.gk-tu-starters { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-shell .gk-tu-starter { width: auto; margin: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--gk-line); background: var(--gk-bg-3); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.hub-shell .gk-tu-starter:hover { border-color: var(--gk-accent-line); }
.gk-tu-answers { display: flex; flex-direction: column; gap: 14px; }
.gk-tu-card { border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); padding: 18px 20px; animation: gk-cv-in .18s ease-out; }
.gk-tu-q { font-weight: 600; font-size: 15px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--gk-line); overflow-wrap: anywhere; }
.gk-tu-answer p { margin: 0 0 10px; line-height: 1.65; font-size: 14.5px; }
.gk-tu-thinking { color: var(--text-muted); font-size: 14px; }
.gk-tu-h { margin: 16px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.gk-tu-examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gk-tu-examples li { padding: 10px 12px; border-radius: 12px; background: var(--gk-bg-3); border: 1px solid var(--gk-line); }
.gk-tu-ja { font-family: var(--gk-jp); font-size: 17px; line-height: 1.9; }
.gk-tu-ja rt { font-size: 10px; color: var(--text-muted); }
.gk-tu-en { font-size: 13.5px; color: var(--text-muted); }
.gk-tu-words, .gk-tu-lessons { display: flex; flex-wrap: wrap; gap: 8px; }
.gk-tu-word { display: inline-flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--gk-line); background: var(--gk-bg-3); color: var(--text); text-decoration: none; min-width: 80px; }
.gk-tu-word:hover, .gk-tu-lesson:hover { border-color: var(--gk-accent-line); }
.gk-tu-word-ja { font-family: var(--gk-jp); font-size: 17px; font-weight: 600; }
.gk-tu-word-reading { font-family: var(--gk-jp); font-size: 12px; color: var(--text-muted); }
.gk-tu-word-meaning { font-size: 12.5px; color: var(--gk-text-2); }
.gk-tu-lesson { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--gk-line); background: var(--gk-bg-3); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.gk-tu-level { font-size: 11px; font-weight: 600; color: var(--gk-accent-text); }
.gk-tu-lesson .gk-tu-level { margin-left: 2px; }
.hub-shell .gk-tu-ask-row .gk-btn { width: auto; height: 36px; padding: 0 16px; }
.hub-shell .gk-tu-ask-row .gk-btn-ghost { background: var(--bg-raised); color: var(--text); border: 1px solid var(--gk-line-strong); }
.hub-shell .gk-tu-ask-row .gk-btn-ghost:hover { border-color: var(--accent); background: var(--bg-raised); }

/* Notebook (/notebook) */
.gk-nb { max-width: 820px; display: flex; flex-direction: column; gap: 16px; }
.gk-nb-new, .gk-nb-card { border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.hub-shell .gk-nb input[type="text"], .hub-shell .gk-nb textarea { width: 100%; margin: 0; }
.hub-shell .gk-nb textarea { resize: vertical; line-height: 1.55; }
.gk-nb-row { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.gk-nb-row .error { margin: 0 auto 0 0; }
.hub-shell .gk-nb-row .gk-btn { width: auto; margin: 0; height: 34px; padding: 0 16px; }
.hub-shell .gk-nb-row .gk-btn-ghost { background: var(--bg-raised); color: var(--text); border: 1px solid var(--gk-line-strong); }
.gk-nb-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gk-nb-kinds { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.gk-nb-kind { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gk-line); color: var(--text-muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.gk-nb-kind span { margin-left: 4px; font-size: 11.5px; opacity: .75; }
.gk-nb-kind.is-on { background: var(--gk-accent-deep); border-color: var(--gk-accent-line); color: var(--text); }
.hub-shell .gk-nb-filters input[type="search"] { width: 220px; max-width: 100%; margin: 0; height: 36px; }
.gk-nb-list { display: flex; flex-direction: column; gap: 12px; }
.gk-nb-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gk-nb-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gk-accent-text); }
.gk-nb-title { font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.gk-nb-title:hover { text-decoration: underline; }
.gk-nb-title[lang="ja"] { font-family: var(--gk-jp); font-size: 17px; }
.gk-nb-when { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.gk-nb-sub { margin: 0; color: var(--gk-text-2); font-size: 14px; }
.gk-nb-from { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.gk-nb-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; padding: 10px 12px; border-radius: 12px; background: var(--gk-bg-3); border: 1px solid var(--gk-line); }
.gk-nb-tutor summary { cursor: pointer; font-size: 13px; color: var(--text-muted); }
.gk-nb-tutor[open] summary { margin-bottom: 8px; }
.gk-nb-tutor .gk-tu-examples, .gk-nb-tutor .gk-tu-words { margin-bottom: 10px; }
.gk-nb-editor { display: flex; flex-direction: column; gap: 8px; }
.gk-nb-actions { display: flex; gap: 14px; }
.hub-shell .gk-nb-actions button { width: auto; margin: 0; padding: 0; height: auto; border: 0; background: none; color: var(--text-muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.hub-shell .gk-nb-actions button:hover { color: var(--text); }
.hub-shell .gk-nb-actions .gk-nb-delete:hover { color: var(--danger, #e5484d); }
.gk-nb-actions { align-items: center; }
.hub-shell .gk-nb-actions .gk-nb-delete { margin-left: auto; }  /* away from Edit */
.gk-nb-card.is-openable { cursor: pointer; transition: border-color .15s; }
.gk-nb-card.is-openable:hover { border-color: var(--gk-accent-line, var(--accent)); }
.gk-nb-open { color: var(--text-muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.gk-nb-open:hover { color: var(--text); }
.gk-nb-locked { font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--gk-line-strong); cursor: help; }
.gk-nb-over { margin: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--gk-accent-line, var(--border)); background: var(--gk-accent-deep, transparent); font-size: 13.5px; line-height: 1.5; }
.gk-nb-over a { color: var(--gk-accent-text); }
/* Notebook tags: the filter row, and the chips on each entry */
.gk-nb-tagfilters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gk-nb-tagclear { font-size: 13px; color: var(--text-muted); margin-left: 4px; }
.gk-nb-tagrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gk-nb-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--gk-accent-deep, var(--gk-bg-3)); border: 1px solid var(--gk-accent-line, var(--gk-line)); font-size: 12px; }
.gk-nb-chip a { padding: 2px 4px 2px 9px; color: var(--gk-accent-text); text-decoration: none; }
.hub-shell .gk-nb-chip-x { width: auto; height: auto; margin: 0; padding: 0 8px 0 3px; border: 0; background: none; color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer; }
.hub-shell .gk-nb-chip-x:hover { color: var(--text); }
.hub-shell .gk-nb-tagadd { width: auto; height: auto; margin: 0; padding: 2px 9px; border-radius: 999px; border: 1px dashed var(--gk-line-strong); background: none; color: var(--text-muted); font-size: 12px; cursor: pointer; }
.hub-shell .gk-nb-tagadd:hover { color: var(--text); border-color: var(--accent); }
.hub-shell .gk-nb-taginput { width: 140px; height: 26px; margin: 0; padding: 0 9px; border-radius: 999px; border: 1px solid var(--accent); background: var(--bg-input); color: var(--text); font: inherit; font-size: 12px; }
.hub-shell .gk-tu-save { display: inline-block; width: auto; margin: 14px 0 0; padding: 7px 14px; height: auto; border-radius: 999px; border: 1px solid var(--gk-line-strong); background: none; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.hub-shell .gk-tu-save:hover { border-color: var(--accent); }
.hub-shell .gk-tu-save.is-saved { border-color: var(--gk-accent-line); color: var(--gk-accent-text); }
.gk-tu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* AI Tutor: Recent */
.gk-tu-recent { margin-top: 28px; }
.gk-tu-recent-head { display: flex; align-items: baseline; gap: 12px; }
.gk-tu-recent-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.hub-shell .gk-tu-clear { width: auto; height: auto; margin: 0 0 0 auto; padding: 0; border: 0; background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; }
.hub-shell .gk-tu-clear:hover { color: var(--danger, #e5484d); }
.gk-tu-recent .field-hint { margin: 4px 0 10px; }
.gk-tu-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gk-tu-recent-item { display: flex; align-items: center; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-raised); }
.gk-tu-recent-item.is-on { border-color: var(--gk-accent-line, var(--accent)); }
.hub-shell .gk-tu-recent-open { flex: 1 1 auto; min-width: 0; width: auto; height: auto; margin: 0; padding: 10px 14px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.gk-tu-recent-q { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-tu-recent-when { font-size: 12px; color: var(--text-muted); }
.hub-shell .gk-tu-recent-del { flex: none; width: 36px; height: 36px; margin: 0 6px 0 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
.hub-shell .gk-tu-recent-del:hover { background: var(--gk-bg-3); color: var(--text); }
.hub-shell .gk-nb-filters input[type="search"] { padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text); font: inherit; font-size: 13.5px; }

/* Fonts picked in the editors (notes, blog posts, guides): blog_sanitize.FONT_NAMES; the faces load from
   templates/_note_fonts.html. Each has a Japanese face, or falls back to one that's on most computers. */
.ql-font-serif { font-family: Georgia, 'Zen Old Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif; }
.ql-font-rounded { font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', sans-serif; }
.ql-font-hand { font-family: 'Klee One', 'UD Digi Kyokasho N-R', 'Yu Mincho', cursive; }
.ql-font-mono { font-family: 'Geist Mono', 'Cascadia Mono', Consolas, ui-monospace, monospace; }
/* The editors' Font menu: each name in its own face (the names come from the page, translated). */
.ql-snow .ql-picker.ql-font { width: 120px; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { font-family: Georgia, 'Zen Old Mincho', serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=rounded]::before { font-family: 'M PLUS Rounded 1c', sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=hand]::before { font-family: 'Klee One', 'UD Digi Kyokasho N-R', cursive; }
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=mono]::before { font-family: 'Geist Mono', monospace; }

/* Notebook: formatted notes, and the full-size editor (static/note_editor.js) */
.gk-nb-top { display: flex; justify-content: flex-start; }
.hub-shell .gk-nb-top .gk-btn { width: auto; margin: 0; height: 38px; padding: 0 18px; }
.gk-note { white-space: normal; }
.gk-note p, .gk-note h2, .gk-note h3, .gk-note ul, .gk-note ol, .gk-note blockquote, .gk-note pre { margin: 0 0 8px; }
.gk-note > :last-child { margin-bottom: 0; }
.gk-note h2 { font-size: 19px; } .gk-note h3 { font-size: 16.5px; }
.gk-note blockquote { padding-left: 12px; border-left: 3px solid var(--gk-accent-line); color: var(--gk-text-2); }
.gk-note ul, .gk-note ol { padding-left: 22px; }
.gk-note .ql-indent-1 { margin-left: 2em; } .gk-note .ql-indent-2 { margin-left: 4em; } .gk-note .ql-indent-3 { margin-left: 6em; }
.gk-note pre { padding: 8px 10px; border-radius: 8px; background: var(--bg-input); white-space: pre-wrap; }
.gk-nb-body.is-clamped { max-height: 280px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.hub-shell .gk-nb-more { width: auto; margin: 0; padding: 0; height: auto; border: 0; background: none; color: var(--gk-accent-text); font-size: 13px; font-weight: 600; cursor: pointer; align-self: flex-start; }

body.ne-open { overflow: hidden; }
.ne-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(5, 6, 10, .6); backdrop-filter: blur(3px); }
.ne-modal { width: min(920px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-raised); box-shadow: 0 24px 64px rgba(0, 0, 0, .45); overflow: hidden; }
.ne-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ne-heading { flex: 1 1 auto; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ne-modal .ne-close { width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--text-muted); font-size: 22px; cursor: pointer; }
.ne-modal .ne-close:hover { background: var(--gk-bg-3); color: var(--text); }
.ne-modal .ne-title { margin: 0; padding: 14px 20px 6px; border: 0; background: none; color: var(--text); font: inherit; font-size: 22px; font-weight: 600; outline: none; width: 100%; box-shadow: none; }
.ne-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ne-quill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ne-modal .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); padding: 8px 14px; }
.ne-modal .ql-container.ql-snow { border: 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; font: inherit; font-size: 15.5px; }
.ne-modal .ql-editor { min-height: 100%; padding: 18px 22px 40px; line-height: 1.7; color: var(--text); }
.ne-modal .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; left: 22px; }
.ne-modal .ql-snow .ql-stroke { stroke: var(--text-muted); } .ne-modal .ql-snow .ql-fill { fill: var(--text-muted); }
.ne-modal .ql-snow .ql-picker { color: var(--text-muted); }
.ne-modal .ql-snow button:hover .ql-stroke, .ne-modal .ql-snow .ql-active .ql-stroke { stroke: var(--gk-accent-text); }
.ne-modal .ql-snow button:hover .ql-fill, .ne-modal .ql-snow .ql-active .ql-fill { fill: var(--gk-accent-text); }
.ne-modal .ql-snow .ql-picker-options { background: var(--bg-raised); border-color: var(--border); }
.ne-modal .ql-snow .ql-tooltip { background: var(--bg-raised); border-color: var(--border); color: var(--text); box-shadow: none; }
.ne-modal button { width: auto; margin: 0; }
.ne-modal .ql-toolbar button { height: 28px; padding: 3px 5px; }
.ne-plain { flex: 1 1 auto; margin: 0; padding: 18px 22px; border: 0; background: none; color: var(--text); font: inherit; font-size: 15.5px; line-height: 1.7; resize: none; outline: none; }
.ne-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); }
.ne-status { flex: 1 1 auto; font-size: 13px; color: var(--text-muted); }
.ne-foot .gk-btn { height: 36px; padding: 0 16px; }
.ne-foot .gk-btn-ghost { background: var(--bg-raised); color: var(--text); border: 1px solid var(--gk-line-strong); }
@media (max-width: 640px) {
    .ne-overlay { padding: 0; }
    .ne-modal { width: 100%; height: 100%; border-radius: 0; border: 0; }
}
.gk-nb-top { align-items: center; gap: 12px; }
.gk-nb-cap { font-size: 13px; color: var(--text-muted); }
.hub-shell .gk-nb-top .gk-btn:disabled { opacity: .5; cursor: default; }
.hub-shell .gk-nb-star { width: 26px; height: 26px; margin: 0 -4px 0 -4px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
.gk-nb-star svg { fill: none; stroke: var(--text-muted); stroke-width: 1.8; stroke-linejoin: round; transition: fill .12s, stroke .12s; }
.hub-shell .gk-nb-star:hover svg { stroke: #f5b301; }
.gk-nb-star.is-on svg { fill: #f5b301; stroke: #f5b301; }
/* Just saved to the notebook: the "Saved" that replaces the Save button pops, with a ✓ in front. */
.is-just-saved { animation: saved-pop 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.is-just-saved::before { content: "✓"; display: inline-block; margin-right: 0.35em; animation: saved-check 0.55s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes saved-pop { from { transform: scale(0.85); } }
@keyframes saved-check { from { transform: scale(0) rotate(-45deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .is-just-saved, .is-just-saved::before { animation: none; } }
