:root {
  color-scheme: light;
  --bg: #f1faf8;
  --surface: #ffffff;
  --surface-2: #f6fcfb;
  --surface-overlay: #ffffff;
  --text: #0f2926;
  --muted: #4b6b66;
  --border: #d5ebe6;
  --border-strong: #bce0d8;
  --button-hover: #e8f6f3;
  --tab-selected: rgba(13, 148, 136, 0.11);
  --item-hover: rgba(13, 148, 136, 0.06);
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-fg: #ffffff;
  --primary-soft: #ccfbf1;
  --primary-text: #0f766e;
  --accent: #0284c7;
  --exam: #ea580c;
  --exam-soft: #ffedd5;
  --danger: #be123c;
  --danger-bg: rgba(244, 63, 94, 0.10);
  --danger-bg-hover: rgba(244, 63, 94, 0.17);
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --ok-border: rgba(16, 185, 129, 0.30);
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --err-border: rgba(239, 68, 68, 0.28);
  --warn: #c2410c;
  --warn-bg: #fff7ed;
  --warn-hover: #9a3412;
  --shadow: 0 6px 18px -4px rgba(13, 148, 136, 0.08), 0 2px 6px -2px rgba(15, 41, 38, 0.04);
  --elevation-popover: 0 12px 24px -4px rgba(15, 41, 38, 0.12), 0 4px 8px -4px rgba(15, 41, 38, 0.06);
  --elevation-modal: 0 22px 36px -6px rgba(15, 41, 38, 0.18), 0 8px 14px -6px rgba(15, 41, 38, 0.08);
  --bento-radius: 18px;
}
body.dark {
  color-scheme: dark;
  --bg: #071316;
  --surface: #0d1e22;
  --surface-2: #12282d;
  --surface-overlay: #163137;
  --text: #ecfeff;
  --muted: #92b8b2;
  --border: rgba(45, 212, 191, 0.14);
  --border-strong: rgba(45, 212, 191, 0.24);
  --button-hover: rgba(45, 212, 191, 0.10);
  --tab-selected: rgba(45, 212, 191, 0.16);
  --item-hover: rgba(45, 212, 191, 0.08);
  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --primary-fg: #042f2e;
  --primary-soft: rgba(20, 184, 166, 0.18);
  --primary-text: #5eead4;
  --accent: #38bdf8;
  --exam: #fb923c;
  --exam-soft: rgba(251, 146, 60, 0.18);
  --danger: #fb7185;
  --danger-bg: rgba(244, 63, 94, 0.15);
  --danger-bg-hover: rgba(244, 63, 94, 0.24);
  --ok: #34d399;
  --ok-bg: rgba(16, 185, 129, 0.16);
  --ok-border: rgba(52, 211, 153, 0.32);
  --err: #f87171;
  --err-bg: rgba(239, 68, 68, 0.16);
  --err-border: rgba(248, 113, 113, 0.30);
  --warn: #fb923c;
  --warn-bg: rgba(251, 146, 60, 0.16);
  --warn-hover: #f59e0b;
  --shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.42);
  --elevation-popover: 0 14px 28px -4px rgba(0, 0, 0, 0.58), 0 4px 10px -4px rgba(0, 0, 0, 0.45);
  --elevation-modal: 0 24px 38px -6px rgba(0, 0, 0, 0.72), 0 10px 14px -6px rgba(0, 0, 0, 0.52);
}
body[data-subject="yduc"] { --primary: #0f766e; --primary-hover: #115e59; }
body.dark[data-subject="yduc"] { --primary: #14b8a6; --primary-hover: #0d9488; }
body[data-subject="cdha_daumatco"] { --primary: #4f46e5; --primary-hover: #4338ca; }
body.dark[data-subject="cdha_daumatco"] { --primary: #818cf8; --primary-hover: #6366f1; }
body[data-subject="kt_ganmat"] { --primary: #059669; --primary-hover: #047857; }
body.dark[data-subject="kt_ganmat"] { --primary: #34d399; --primary-hover: #10b981; }
body[data-subject="spyh"] { --primary: #1d4ed8; --primary-hover: #1e40af; }
body.dark[data-subject="spyh"] { --primary: #3b82f6; --primary-hover: #2563eb; }
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.tabular-nums, .stat-value, .metric-value, .bento-cd-big { font-variant-numeric: tabular-nums; }
.app-shell { max-width: 1180px; margin: 0 auto; padding: 20px 20px calc(48px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 900; width: 100%; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1180px; min-height: 56px; margin: 0 auto; padding: 6px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar-left { display: flex; align-items: center; gap: 20px; min-width: 0; flex: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(29, 78, 216, 0.09); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
body.dark .brand-icon { background: rgba(96, 165, 250, 0.14); }
.brand-text { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.brand h1 { margin: 0; font-size: 0.98rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text); white-space: nowrap; }
.brand .subtitle { margin: 0; font-size: 0.75rem; font-weight: 500; color: var(--muted); max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtitle { margin: 2px 0 0; font-size: 0.84rem; color: var(--muted); }
.top-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-ico { width: 16px; height: 16px; flex-shrink: 0; }
.nav-ico { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.78; }
.school-nav-tab.active .nav-ico { opacity: 1; }
.btn-sync { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); font-variant-numeric: tabular-nums; }
.btn-sync:hover { background: var(--button-hover); }
.btn-sync.connected { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.btn-sync.connected .sync-dot { background: #10b981; }
.btn-sync.syncing .sync-dot { background: var(--warn); animation: pulse 1s infinite; }
.btn-sync.sync-err .sync-dot { background: var(--err); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.sync-strip {
  background: var(--surface); border: 1px dashed var(--primary); border-radius: 12px; padding: 11px 15px;
  margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.sync-strip.connected { border-style: solid; border-color: var(--ok-border); }
.sync-strip-text { font-size: 0.88rem; color: var(--muted); flex: 1; min-width: 220px; }
.sync-strip-text b { color: var(--text); }
.stats-grid, .metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.stat-card, .metric-cell { background: transparent; border: none; border-right: 1px solid var(--border); border-radius: 0 !important; padding: 15px 18px; box-shadow: none; }
.stat-card:last-child, .metric-cell:last-child { border-right: none; }
.stat-label, .metric-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.stat-value, .metric-value { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; color: var(--text); margin: 4px 0 3px; line-height: 1.2; }
.stat-sub, .metric-sub { font-size: 0.78rem; color: var(--muted); }
.ok-text { color: var(--ok); }
.err-text { color: var(--err); }
.action-banner { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.action-banner h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 650; }
.action-banner p { margin: 0; font-size: 0.86rem; color: var(--muted); max-width: 580px; }
.banner-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 1.12rem; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 8px 14px; min-height: 38px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; font-weight: 600;
}
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); gap: 14px; margin-bottom: 22px; }
.deck-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease; display: flex; flex-direction: column; gap: 8px;
  text-align: left; color: var(--text);
}
.deck-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.deck-card.passed { border-color: var(--ok-border); }
.deck-card.failed { border-color: var(--err-border); }
.deck-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deck-num { font-size: 0.78rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.deck-badge { font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.passed .deck-badge { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.failed .deck-badge { background: var(--err-bg); color: var(--err); border-color: var(--err-border); }
.deck-title { font-weight: 800; font-size: 1.02rem; }
.deck-desc { font-size: 0.85rem; color: var(--muted); }
.deck-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 14px; min-height: 40px; font-size: 0.875rem; font-weight: 500; line-height: 1.25; background: var(--surface); color: var(--text); cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; text-decoration: none; }
.btn:hover { background: var(--button-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-primary { background: var(--primary); color: var(--primary-fg, #ffffff); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; font-weight: 500; }
.btn-danger:hover { background: var(--danger-bg-hover); }
.btn-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(217, 119, 6, 0.25); font-weight: 500; }
.btn-warn:hover { filter: brightness(0.97); }
.btn-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); font-weight: 600; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--button-hover); }
.btn-icon-only { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); }
.btn-icon-only:hover { background: var(--button-hover); color: var(--text); }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.tools-footer { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-top: 10px; }
.hidden { display: none !important; }
.quiz-status-bar { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.quiz-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.quiz-title-wrap h2 { margin: 0; font-size: 1.04rem; line-height: 1.35; }
.tag-pill { background: var(--primary); color: #fff; font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.quiz-metrics { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.9rem; }
.progress-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.25s ease; }
.question-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; position: relative; }
.q-meta { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--primary); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.q-text { font-size: 1.14rem; font-weight: 700; margin-bottom: 16px; line-height: 1.48; }
.q-media-box { background: #070b14; border: 1px solid #1e293b; border-radius: 12px; padding: 12px; margin-bottom: 18px; }
.q-media-grid { display: grid; gap: 10px; justify-items: center; align-items: center; }
.q-media-grid.cols-1 { grid-template-columns: 1fr; }
.q-media-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.q-media-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.q-media-item { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; padding: 0; border: 1px solid #334155; border-radius: 9px; background: #020617; overflow: hidden; cursor: zoom-in; transition: border-color 0.15s, transform 0.15s; }
.q-media-item:hover { border-color: #60a5fa; }
.q-media-item img { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.q-media-grid.cols-2 .q-media-item img, .q-media-grid.cols-3 .q-media-item img { max-height: 260px; }
.q-media-num { position: absolute; top: 7px; right: 7px; background: rgba(15, 23, 42, 0.82); color: #f8fafc; font-size: 0.72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.35); }
.q-media-hint { text-align: center; font-size: 0.78rem; color: #94a3b8; margin-top: 8px; }
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 48px; text-align: left; padding: 13px 15px; border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 0.98rem; line-height: 1.45; cursor: pointer; transition: all 0.15s; }
.option-btn:hover:not(.locked) { border-color: var(--primary); background: rgba(59, 130, 246, 0.08); }
.option-btn.locked { cursor: default; }
.option-btn.correct { background: var(--ok-bg); border-color: var(--ok-border); font-weight: 700; }
.option-btn.wrong { background: var(--err-bg); border-color: var(--err-border); }
.opt-letter { min-width: 28px; height: 28px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; }
.option-btn.correct .opt-letter { background: var(--ok); color: #fff; border-color: var(--ok); }
.option-btn.wrong .opt-letter { background: var(--err); color: #fff; border-color: var(--err); }
.explanation-box { margin-top: 16px; padding: 15px 18px; border-radius: 10px; border-left: 5px solid var(--primary); background: var(--surface-2); font-size: 0.96rem; }
.explanation-box.is-ok { border-left-color: var(--ok-border); background: var(--ok-bg); }
.explanation-box.is-err { border-left-color: var(--err-border); background: var(--err-bg); }
.quiz-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.shortcut-hint { font-size: 0.84rem; color: var(--muted); }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 20px; text-align: center; box-shadow: var(--shadow); }
.result-badge { display: inline-block; font-size: 0.9rem; font-weight: 800; padding: 6px 14px; border-radius: 999px; margin-bottom: 10px; }
.result-badge.pass { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.result-badge.fail { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-border); }
.result-score-big { font-size: 2.4rem; font-weight: 900; margin: 6px 0; }
.result-subinfo { font-size: 0.93rem; color: var(--muted); margin-bottom: 12px; }
.result-message { max-width: 680px; margin: 0 auto 20px; font-size: 0.98rem; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.review-section { text-align: left; margin-top: 26px; border-top: 1px solid var(--border); padding-top: 18px; }
.review-list { display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.review-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; font-size: 0.92rem; }
.review-q { font-weight: 700; margin-bottom: 6px; }
.review-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.review-thumb { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #020617; cursor: zoom-in; }
.review-exp { margin-top: 6px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(2, 6, 23, 0.96); display: flex; flex-direction: column; user-select: none; }
.lightbox-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: rgba(15, 23, 42, 0.92); border-bottom: 1px solid #334155; color: #f8fafc; flex-wrap: wrap; }
.lightbox-counter { font-size: 0.88rem; font-weight: 700; color: #cbd5e1; }
.lightbox-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-btn { background: #1e293b; color: #f8fafc; border: 1px solid #475569; border-radius: 8px; min-width: 40px; min-height: 38px; padding: 6px 10px; font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.lb-btn:hover { background: #334155; }
.lb-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.lb-close { background: #dc2626; border-color: #ef4444; }
.lightbox-stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.lightbox-stage:active { cursor: grabbing; }
.lightbox-stage img { max-width: 94vw; max-height: 78vh; transform-origin: center center; transition: transform 0.08s ease-out; pointer-events: none; }
.lightbox-tip { text-align: center; font-size: 0.78rem; color: #94a3b8; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(15, 23, 42, 0.92); border-top: 1px solid #1e293b; }
.modal-backdrop { position: fixed; inset: 0; z-index: 9000; background: rgba(2, 6, 23, 0.65); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 100%; max-width: 470px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); max-height: 92vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 1.12rem; }
.modal-close { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-weight: 700; flex-shrink: 0; }
.modal-desc { font-size: 0.88rem; color: var(--muted); margin: 0 0 14px; }
.modal-desc code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.84rem; font-weight: 700; margin-bottom: 5px; }
.form-group input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.96rem; }
.form-group input:focus { outline: none; border-color: var(--primary); }
.sync-modal-status { min-height: 22px; font-size: 0.86rem; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (hover: none) and (pointer: coarse) { .shortcut-hint { display: none; } }
@media (max-width: 640px) {
  .app-shell { padding: 10px 10px calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding: 12px 14px; gap: 10px; }
  .brand-icon { font-size: 1.65rem; }
  .brand h1 { font-size: 1.06rem; }
  .subtitle { font-size: 0.78rem; }
  .hide-xs { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 11px 12px; }
  .stat-value { font-size: 1.38rem; }
  .action-banner { padding: 14px; }
  .banner-buttons { width: 100%; }
  .banner-buttons .btn { width: 100%; }
  .deck-grid { grid-template-columns: 1fr; gap: 11px; }
  .question-card { padding: 14px; }
  .q-text { font-size: 1.04rem; }
  .q-media-grid.cols-2, .q-media-grid.cols-3 { grid-template-columns: 1fr; }
  .q-media-item img { max-height: 280px; }
  .option-btn { padding: 11px 12px; font-size: 0.95rem; }
  .quiz-controls { position: sticky; bottom: 0; z-index: 40; background: var(--bg); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); justify-content: stretch; }
  .quiz-controls .btn-lg { width: 100%; box-shadow: var(--shadow); }
  .result-score-big { font-size: 2rem; }
}
.game-strip { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid #f97316; border-radius: 12px; padding: 11px 15px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; box-shadow: var(--shadow); }
.game-strip-items { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; }
.game-strip-item { font-size: 0.88rem; color: var(--muted); }
.game-strip-item b { color: var(--text); font-weight: 800; }
.game-strip-milestone { font-size: 0.82rem; font-weight: 700; color: #ea580c; background: rgba(249, 115, 22, 0.12); border: 1px solid rgba(249, 115, 22, 0.35); padding: 4px 10px; border-radius: 999px; }
body.dark .game-strip-milestone { color: #fb923c; }
.quiz-metrics-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.combo-hud { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.combo-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s; }
.combo-pill.tier-1 { background: #fef3c7; color: #b45309; border-color: #f59e0b; }
.combo-pill.tier-2 { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; border-color: #c2410c; box-shadow: 0 0 14px rgba(249, 115, 22, 0.45); }
.combo-pill.tier-3 { background: linear-gradient(135deg, #eab308, #ef4444); color: #fff; border-color: #dc2626; box-shadow: 0 0 18px rgba(239, 68, 68, 0.5); animation: comboPulse 1.1s infinite alternate; }
.combo-pill.tier-4 { background: linear-gradient(135deg, #ec4899, #8b5cf6, #f59e0b); color: #fff; border-color: #a855f7; box-shadow: 0 0 22px rgba(168, 85, 247, 0.65); animation: comboPulse 0.75s infinite alternate; }
body.dark .combo-pill.tier-1 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.combo-pill.pop { transform: scale(1.12); }
@keyframes comboPulse { 0% { transform: scale(1); } 100% { transform: scale(1.05); } }
.xp-pill { display: inline-flex; align-items: center; font-size: 0.82rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(29, 78, 216, 0.12); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.35); }
.progress-fill.combo-hot { background: linear-gradient(90deg, #3b82f6, #f59e0b, #f97316); }
.progress-fill.combo-fire { background: linear-gradient(90deg, #f97316, #ef4444, #eab308, #a855f7); }
.combo-toast { position: absolute; top: 12px; right: 14px; z-index: 20; padding: 7px 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 800; background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4); pointer-events: none; animation: comboToastIn 0.3s ease-out; }
.combo-toast.is-xp { background: linear-gradient(135deg, #16a34a, #0ea5e9); box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35); }
.combo-toast.is-break { background: #334155; color: #f8fafc; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); animation: comboBreakShake 0.35s ease-in-out; }
@keyframes comboToastIn { 0% { opacity: 0; transform: translateY(10px) scale(0.9); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes comboBreakShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.result-game-summary { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.result-game-chip { font-size: 0.86rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.result-game-chip.record { background: linear-gradient(135deg, #f97316, #eab308); color: #fff; border-color: #f59e0b; }
.confetti-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9500; }
.btn-admin-discreet { font-size: 0.8rem; opacity: 0.72; }
.btn-admin-discreet:hover { opacity: 1; }
.admin-header-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow); }
.admin-header-card h2 { margin: 0; font-size: 1.16rem; }
.admin-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-search { flex: 1; min-width: 220px; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.94rem; }
.admin-sort { min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.9rem; font-weight: 600; }
.admin-list-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.admin-table-wrap { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { background: var(--surface-2); font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.admin-table tbody tr { cursor: pointer; transition: background 0.12s; }
.admin-table tbody tr:hover { background: rgba(59, 130, 246, 0.07); }
.admin-stu-name { font-weight: 800; font-size: 0.94rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.online-dot.recent { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }
.admin-stu-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: var(--muted); }
.mini-deck-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mini-deck-pill { width: 22px; height: 22px; border-radius: 5px; font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.mini-deck-pill.pass { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.mini-deck-pill.fail { background: var(--err-bg); color: var(--err); border-color: var(--err-border); }
.admin-remember-label { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--muted); margin-bottom: 10px; cursor: pointer; }
.modal-card-lg { max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; overflow-y: auto; }
.admin-detail-body { overflow-y: auto; padding-right: 4px; }
.admin-detail-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-deck-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 16px; }
.admin-deck-item { border: 1px solid var(--border); background: var(--surface-2); border-radius: 9px; padding: 9px 11px; font-size: 0.83rem; }
.admin-deck-item.pass { border-color: var(--ok-border); }
.admin-deck-item.fail { border-color: var(--err-border); }
.admin-wrong-list { display: flex; flex-direction: column; gap: 6px; font-size: 0.84rem; }
.admin-wrong-row { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; border-left: 3px solid var(--err-border); }
@media (max-width: 768px) {
  .quiz-metrics-wrap { align-items: flex-start; width: 100%; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tbody tr { border-bottom: 8px solid var(--bg); padding: 10px 12px; }
  .admin-table td { border-bottom: 1px solid var(--border); padding: 6px 2px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .admin-table td:last-child { border-bottom: none; }
  .admin-table td::before { content: attr(data-label); font-size: 0.76rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
  .admin-table td[data-label="Học viên"] { display: block; }
  .admin-table td[data-label="Học viên"]::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .combo-pill, .combo-toast { animation: none !important; transition: none !important; } }
@media (display-mode: standalone) { #btn-install-app { display: none !important; } }
.install-steps { margin: 0 0 14px; padding: 12px 14px 12px 30px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 0.9rem; line-height: 1.65; }
.install-steps li + li { margin-top: 6px; }
.home-status-bar { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; align-items: stretch; }
.home-status-bar .sync-strip, .home-status-bar .game-strip { margin-bottom: 0; padding: 10px 14px; }
.subject-switcher { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; padding: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.subject-btn { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 4px; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; cursor: pointer; min-width: 0; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease; }
.subject-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.subject-btn.active { background: var(--primary); color: #ffffff; border-color: var(--primary); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14); }
.subject-btn-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.subject-kicker { font-size: 0.67rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-btn-main { display: flex; align-items: center; gap: 7px; font-size: 0.92rem; font-weight: 800; color: var(--text); line-height: 1.25; }
.subject-btn.active .subject-btn-main { color: #ffffff; }
.subject-badge { font-size: 0.7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.22); color: inherit; flex-shrink: 0; }
.subject-btn.active .subject-badge { background: rgba(255, 255, 255, 0.24); color: #ffffff; }
.official-64-strip { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 14px; padding: 13px 16px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; box-shadow: var(--shadow); }
.official-64-info { flex: 1 1 320px; min-width: 0; }
.official-64-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.official-64-title-row h3 { margin: 0; font-size: 0.98rem; line-height: 1.3; }
.official-64-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.official-64-pill.passed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border); }
.official-64-pill.failed { background: var(--err-bg); color: var(--err); border-color: var(--err-border); }
.official-64-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mod-calc-shortcut { margin-left: auto; border-color: rgba(5, 150, 105, 0.45); color: var(--primary); }
@media (max-width: 960px) { .home-status-bar { grid-template-columns: 1fr; } .subject-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .subject-switcher { gap: 6px; padding: 5px; } .subject-btn { padding: 8px 9px; } .subject-btn-main { font-size: 0.86rem; } .mod-calc-shortcut { margin-left: 0; width: 100%; text-align: center; } .official-64-actions { width: 100%; } .official-64-actions .btn { flex: 1 1 auto; justify-content: center; } }
.mod-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mod-subtab { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.15s ease; }
.mod-subtab:hover { border-color: var(--primary); }
.mod-subtab.active { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.mod-panel { margin-top: 8px; }
.case-toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.case-toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.case-search-input { flex: 1 1 240px; min-width: 180px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.92rem; }
.case-search-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.case-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.case-pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.case-pill.active { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.case-list { display: flex; flex-direction: column; gap: 14px; }
.case-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.case-card.case-done { border-color: var(--ok-border); }
.case-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.case-num { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); background: rgba(59, 130, 246, 0.12); padding: 3px 9px; border-radius: 999px; }
.case-badge-done { font-size: 0.78rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok-border); padding: 3px 9px; border-radius: 999px; }
.case-title-line { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; color: var(--text); }
.case-diagnosis { margin: 6px 0 10px; padding: 9px 12px; border-radius: 10px; background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--text); font-size: 0.92rem; font-weight: 700; }
.case-vignette { margin: 8px 0 12px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--primary); border-radius: 8px; font-size: 0.93rem; }
.case-kv-section { margin: 10px 0; }
.case-kv-title { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.case-kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 8px; }
.case-kv-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 0.87rem; }
.case-kv-k { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.case-kv-v { color: var(--text); font-weight: 700; margin-top: 2px; }
.case-extra { margin: 10px 0; font-size: 0.86rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; }
.case-trap { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: rgba(217, 119, 6, 0.11); border: 1px solid rgba(217, 119, 6, 0.35); font-size: 0.89rem; }
.case-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.case-qa-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.case-qa-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.case-qa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.case-qa-q { font-weight: 700; font-size: 0.92rem; color: var(--text); flex: 1; }
.case-qa-a { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--text); white-space: pre-line; }
.case-empty { padding: 28px 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--muted); }
.guides-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.guide-tab-btn { padding: 8px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.87rem; font-weight: 700; cursor: pointer; }
.guide-tab-btn.active { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.guide-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.guide-head h3 { margin: 0 0 4px; font-size: 1.12rem; }
.guide-subtitle { margin: 0 0 12px; font-size: 0.88rem; color: var(--muted); }
.guide-body { font-size: 0.93rem; line-height: 1.6; }
.guide-callout, .guide-tip, .guide-info, .guide-warn, .guide-note { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: 0.9rem; border: 1px solid var(--border); background: var(--surface-2); }
.guide-callout { border-left: 4px solid var(--primary); }
.guide-tip { background: var(--ok-bg); border-color: var(--ok-border); }
.guide-info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.35); }
.guide-warn { background: var(--err-bg); border-color: var(--err-border); }
.guide-note { color: var(--muted); font-size: 0.86rem; }
.guide-table-wrap { width: 100%; overflow-x: auto; margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.guide-table th, .guide-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide-table th { background: var(--surface-2); font-weight: 700; }
.guide-highlight { background: rgba(250, 204, 21, 0.35); color: inherit; padding: 0 2px; border-radius: 3px; }
.modal-calc-card { max-width: 720px; width: 96%; max-height: 90vh; overflow-y: auto; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.calc-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.calc-field input, .calc-field select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.92rem; font-weight: 600; }
.calc-outputs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 10px; }
.calc-outputs-head h4 { margin: 0; font-size: 0.96rem; }
.calc-outputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.calc-out-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.calc-out-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.calc-out-val { font-size: 1.32rem; font-weight: 800; color: var(--primary); margin: 3px 0; }
.calc-out-tag { font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.calc-out-note { font-size: 0.77rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 680px) { .calc-grid { grid-template-columns: 1fr 1fr; } .calc-outputs { grid-template-columns: 1fr; } .case-kv-grid { grid-template-columns: 1fr 1fr; } }
.admin-official-card { background: var(--surface); border: 2px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 18px; padding: 20px; margin-bottom: 18px; box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08); }
.admin-official-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.admin-official-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.03em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); margin-bottom: 8px; }
.admin-official-head h3 { margin: 0 0 6px; font-size: 1.12rem; }
.admin-official-score-pill { padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.admin-official-score-pill.passed { background: color-mix(in srgb, var(--ok) 15%, transparent); border-color: var(--ok); color: var(--ok); }
.admin-official-score-pill.failed { background: color-mix(in srgb, var(--warn) 16%, transparent); border-color: var(--warn); color: var(--warn); }
.admin-official-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.86rem; color: var(--muted); }
.admin-official-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-sheet-modal-card { width: min(980px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
.admin-sheet-toolbar { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.admin-sheet-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-sheet-list { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.admin-sheet-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.admin-sheet-item.is-wrong { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.admin-sheet-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.admin-sheet-num { font-weight: 800; font-size: 0.85rem; color: var(--primary); }
.admin-sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-sheet-tag { font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.admin-sheet-tag.is-img { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.admin-sheet-tag.is-wrong { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.admin-sheet-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 10px; }
.admin-sheet-thumb { width: 112px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; background: #0b1120; }
.admin-sheet-q { font-weight: 700; line-height: 1.48; margin-bottom: 8px; }
.admin-sheet-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 10px; margin-bottom: 8px; }
.admin-sheet-opt { font-size: 0.85rem; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.admin-sheet-opt.is-correct { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.admin-sheet-exp { font-size: 0.84rem; color: var(--muted); line-height: 1.48; padding-top: 6px; border-top: 1px dashed var(--border); }
@media (max-width: 680px) { .admin-official-card { padding: 15px; } .admin-official-actions .btn { width: 100%; justify-content: center; } .admin-sheet-opts { grid-template-columns: 1fr; } }
.admin-private-modules { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.admin-private-card { background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--accent) 42%, var(--border)); border-radius: 18px; padding: 18px 20px; box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08); }
.admin-private-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 8px; }
.admin-private-decks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
.admin-private-deck-card { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 15px; }
.admin-private-deck-card.is-passed { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.admin-private-deck-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.admin-private-deck-tag { font-size: 0.75rem; font-weight: 800; color: var(--primary); letter-spacing: 0.03em; }
.admin-private-deck-pill { font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.admin-private-deck-pill.passed { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.admin-private-deck-pill.failed { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.admin-private-deck-title { margin: 0; font-size: 0.98rem; line-height: 1.38; color: var(--text); }
.admin-private-deck-desc { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--muted); }
.admin-private-deck-stats { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.admin-private-deck-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-guide-toolbar { margin: 4px 0 12px; }
.admin-guide-card { overflow-y: auto; padding-right: 4px; }
@media (max-width: 680px) { .admin-private-card { padding: 15px; } .admin-private-decks-grid { grid-template-columns: 1fr; } .admin-private-deck-btns .btn { flex: 1 1 auto; justify-content: center; } }
body[data-subject="yduc"] .action-banner { background: linear-gradient(135deg, #0f3d3e, #0f766e); }
body[data-subject="cdha_daumatco"] .action-banner { background: linear-gradient(135deg, #312e81, #4f46e5); }
body[data-subject="kt_ganmat"] .action-banner { background: linear-gradient(135deg, #064e3b, #059669); }
.btn-banner-lookup { background: rgba(255, 255, 255, 0.14); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.35); }
.btn-banner-lookup:hover { background: rgba(255, 255, 255, 0.24); }
.sync-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(2, 6, 23, 0.68); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sync-modal-card { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); position: relative; }
.sync-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.sync-modal-head h3 { margin: 0; font-size: 1.08rem; }
.auth-gate { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 16px 0; }
.auth-card { width: 100%; max-width: 540px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.auth-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.04em; padding: 4px 11px; border-radius: 999px; background: rgba(29, 78, 216, 0.12); color: var(--primary); margin-bottom: 12px; }
.auth-brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-logo { font-size: 2.3rem; flex-shrink: 0; }
.auth-brand-row h1 { margin: 0; font-size: 1.25rem; color: var(--text); }
.auth-notice { padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); text-align: center; margin-bottom: 12px; }
.gate-member-pill { padding: 9px 12px; border-radius: 10px; background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--text); font-size: 0.88rem; font-weight: 700; margin-bottom: 14px; }
.gate-member-pill.is-warn { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.45); }
.gate-member-pill.is-err { background: var(--err-bg); border-color: var(--err-border); color: var(--err); }
.gate-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.gate-box-title { font-size: 0.92rem; font-weight: 800; color: var(--primary); margin-bottom: 10px; }
.gate-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-submit-btn { width: 100%; margin-top: 4px; }
.gate-help-note { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; }
.auth-foot-note { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.watermark-host { position: relative; overflow: hidden; }
.member-watermark { position: absolute; inset: 0; z-index: 1; pointer-events: none; user-select: none; background-repeat: repeat; background-size: 280px 180px; opacity: 0.55; }
.watermark-host > *:not(.member-watermark) { position: relative; z-index: 2; }
.guide-quick-actions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.bank-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bank-select { min-height: 40px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.88rem; font-weight: 700; }
.account-info-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; font-size: 0.88rem; line-height: 1.6; }
.modal-sep { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }
.admin-roster-banner { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid #0f766e; border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow); }
.admin-roster-banner h3 { margin: 0 0 4px; font-size: 1.04rem; }
.admin-roster-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-device-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 0.83rem; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-border); }
.status-pill.warn { background: rgba(217, 119, 6, 0.14); color: var(--warn); border: 1px solid rgba(217, 119, 6, 0.4); }
.status-pill.err { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-border); }
@media (max-width: 640px) { .gate-grid-2 { grid-template-columns: 1fr; } .auth-card { padding: 18px; } }
.btn-ai-top { background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%); color: #ffffff; border: none; font-weight: 800; box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25); }
.btn-ai-top:hover { filter: brightness(1.07); }
.school-portal-nav { display: flex; align-items: center; gap: 4px; background: transparent; border: none; padding: 0; margin: 0; box-shadow: none; }
.school-nav-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 0.85rem; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color 0.14s ease, color 0.14s ease; }
.school-nav-tab:hover { background: var(--item-hover); color: var(--text); }
.school-nav-tab.active { background: var(--tab-selected); color: var(--text); font-weight: 600; box-shadow: none; }
.school-nav-tab.is-admin-tab { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.school-nav-tab.is-admin-tab.active { background: var(--primary); color: #ffffff; border-color: transparent; }
#btn-admin-top { display: none !important; }
.school-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; background: #ef4444; color: #ffffff; }
.school-nav-badge.is-warn { background: #f59e0b; color: #111827; }
.school-nav-pill { padding: 2px 7px; border-radius: 999px; font-size: 0.71rem; font-weight: 800; white-space: nowrap; flex-shrink: 0; background: rgba(148, 163, 184, 0.22); }
.school-nav-tab.active .school-nav-pill { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.school-view { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.school-pulse-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(29, 78, 216, 0.09) 0%, rgba(124, 58, 237, 0.09) 100%); border: 1px solid var(--border); border-left: 5px solid var(--primary); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; }
.school-pulse-left { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.pulse-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22); flex-shrink: 0; }
.school-pulse-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pending-zalo-section { background: rgba(245, 158, 11, 0.12); border: 1.5px solid rgba(245, 158, 11, 0.55); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.pending-zalo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 800; color: var(--warn); }
.pending-zalo-list { display: flex; flex-direction: column; gap: 10px; }
.pending-zalo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pending-zalo-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; flex-shrink: 0; }
.pending-zalo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.school-quick-subjects { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.school-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.school-sec-head h2 { margin: 0; font-size: 1.06rem; }
.board-subjects-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.board-subj-card { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; transition: transform 0.14s ease, border-color 0.14s ease; }
.board-subj-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.board-subj-card.is-new { border: 1.5px solid #7c3aed; background: linear-gradient(160deg, rgba(124, 58, 237, 0.09), var(--surface-2)); }
.board-subj-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.board-subj-title { font-size: 0.94rem; font-weight: 800; line-height: 1.3; }
.board-subj-prog { font-size: 0.78rem; color: var(--muted); }
.school-board-columns { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; }
.school-col-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.school-events-compact, .school-ann-list, .schedule-events-list { display: flex; flex-direction: column; gap: 10px; }
.school-event-item { border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; background: var(--surface); }
.school-event-item.is-exam { border-color: var(--err-border); }
.school-event-item.is-zalo { border-color: rgba(217, 119, 6, 0.30); }
.school-event-item.is-cancelled { opacity: 0.65; }
.school-event-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.school-countdown-pill { padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; background: rgba(29, 78, 216, 0.12); color: var(--primary); }
.school-countdown-pill.urgent { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-border); }
.school-zalo-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.73rem; font-weight: 800; background: rgba(245, 158, 11, 0.18); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.45); }
.school-event-title { font-weight: 800; font-size: 0.96rem; margin-bottom: 4px; }
.school-event-meta { font-size: 0.83rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.school-event-foot { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.school-ann-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.school-ann-item.is-pinned { border-color: rgba(29, 78, 216, 0.45); background: linear-gradient(180deg, rgba(29, 78, 216, 0.05), var(--surface-2)); }
.school-ann-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ann-cat-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: rgba(29, 78, 216, 0.14); color: var(--primary); }
.ann-cat-badge.is-urgent { background: var(--err-bg); color: var(--err); }
.ann-cat-badge.is-zalo { background: rgba(245, 158, 11, 0.18); color: var(--warn); }
.school-ann-title { font-weight: 800; font-size: 0.95rem; margin-bottom: 4px; }
.school-ann-body { font-size: 0.86rem; color: var(--text); white-space: pre-line; }
.school-ann-foot { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.76rem; color: var(--muted); }
.school-schedule-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: var(--shadow); }
.school-schedule-hero h2 { margin: 0 0 4px; font-size: 1.12rem; }
.school-schedule-cta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.school-filter-bar { margin-bottom: 12px; }
.handbook-cards-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.handbook-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.handbook-card.full-span { grid-column: 1 / -1; }
.handbook-card h3 { margin: 0 0 10px; font-size: 1.02rem; color: var(--primary); }
.handbook-card ul { margin: 0; padding-left: 18px; font-size: 0.88rem; }
.handbook-card li { margin-bottom: 6px; }
.pnt-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.pnt-contact-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); font-size: 0.84rem; }
.pnt-contact-item b { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.zalo-upload-zone { border: 2px dashed var(--primary); border-radius: 14px; padding: 14px; text-align: center; background: var(--surface-2); cursor: pointer; transition: background 0.15s ease; }
.zalo-upload-zone:hover { background: rgba(29, 78, 216, 0.06); }
.zalo-preview-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.zalo-preview-wrap img { max-height: 150px; max-width: 260px; border-radius: 10px; border: 1px solid var(--border); }
.zalo-patch-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.gate-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.zalo-report-modal textarea, .modal-card textarea, .admin-ai-config-card textarea { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 9px 11px; font-family: inherit; font-size: 0.9rem; resize: vertical; }
.ai-drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.52); backdrop-filter: blur(3px); z-index: 1200; display: flex; justify-content: flex-end; }
.ai-drawer { width: min(500px, 100vw); height: 100%; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; box-shadow: -10px 0 32px rgba(0, 0, 0, 0.25); }
.ai-drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ai-drawer-head h3 { margin: 0 0 4px; font-size: 1.02rem; }
.ai-scope-badge { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: rgba(124, 58, 237, 0.12); color: var(--accent); }
.ai-quick-chips { padding: 8px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; overflow-x: auto; }
.ai-chip { white-space: nowrap; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.ai-chip:hover { border-color: var(--primary); color: var(--primary); }
.ai-messages-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { padding: 11px 13px; border-radius: 14px; font-size: 0.89rem; line-height: 1.56; max-width: 94%; }
.ai-msg.is-user { align-self: flex-end; background: var(--primary); color: #ffffff; border-bottom-right-radius: 4px; }
.ai-msg.is-bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.is-bot h3, .ai-msg.is-bot h4 { margin: 4px 0 6px; font-size: 0.95rem; }
.ai-msg.is-bot ul, .ai-msg.is-bot ol { margin: 6px 0; padding-left: 18px; }
.ai-msg-meta { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 0.74rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.ai-input-bar { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); display: flex; gap: 8px; background: var(--surface); }
.ai-input-bar input { flex: 1; min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 0.9rem; }
.ai-fab-btn { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 950; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-overlay); color: var(--text); font-size: 0.84rem; font-weight: 600; cursor: pointer; box-shadow: var(--elevation-popover); transition: background-color 0.15s ease; }
.ai-fab-btn:hover { background: var(--button-hover); }
.btn-ai-explain { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 0.81rem; font-weight: 500; cursor: pointer; }
.btn-ai-explain:hover { background: var(--button-hover); }
.admin-ai-config-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; }
.admin-ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-ai-head h3 { margin: 0 0 3px; font-size: 1rem; }
.admin-ai-form-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.admin-ai-form-row textarea { flex: 1; min-width: 260px; }
.admin-ai-btns { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.role-monitor-pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; background: rgba(124, 58, 237, 0.14); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.35); }
body.dark .role-monitor-pill { color: #c4b5fd; }

.bento-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: none; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head-title h2, .card-head-title h3 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.card-text-link { background: transparent; border: none; padding: 4px 0; font-size: 0.84rem; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.card-text-link:hover { color: var(--text); text-decoration: underline; }
.inline-text-link { background: transparent; border: none; padding: 0; font: inherit; font-weight: 500; color: var(--primary); cursor: pointer; }
.inline-text-link:hover { text-decoration: underline; }
.bento-hero-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.bento-hero-grid .school-quick-subjects { margin-bottom: 0; padding: 20px; }
.bento-hero-grid .board-subjects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.board-subj-card { border-radius: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); transition: background-color 0.15s ease, border-color 0.15s ease; }
.board-subj-card:hover { transform: none; border-color: var(--border-strong); background: var(--surface-2); box-shadow: none; }
.board-subj-card.is-new { border: 1px solid var(--border); background: var(--surface); }
.board-subj-top { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.board-subj-top span:last-child { white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.board-subj-title { font-size: 0.94rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.board-subj-prog { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bento-subj-bar { width: 100%; height: 6px; border-radius: 999px; background: var(--tab-selected); overflow: hidden; margin-top: 8px; }
.bento-subj-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.3s ease; }
.bento-tile-countdown { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; background: var(--surface); }
.bento-eyebrow { font-size: 0.75rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.bento-cd-big { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; color: var(--text); margin: 2px 0 6px; }
.bento-tile-countdown.is-urgent .bento-cd-big { color: var(--warn); }
.bento-cd-title { font-size: 0.98rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.bento-cd-meta { font-size: 0.83rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.bento-cd-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.school-col-card { padding: 20px; border-radius: 16px; box-shadow: none; }
.school-ann-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.school-ann-item.is-pinned { border-color: var(--border-strong); background: var(--surface-2); }
.ann-cat-badge, .status-pill, .school-countdown-pill, .school-zalo-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 500; border: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); }
body.dark .ann-cat-badge, body.dark .status-pill, body.dark .school-countdown-pill, body.dark .school-zalo-badge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); }
.admin-bento-subtabs { display: inline-flex; gap: 4px; flex-wrap: wrap; padding: 4px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.admin-subtab-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 13px; border-radius: 8px; border: none; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 500; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; }
.admin-subtab-btn:hover { background: var(--item-hover); color: var(--text); }
.admin-subtab-btn.active { background: var(--tab-selected); color: var(--text); font-weight: 600; }
.admin-ops-card, .admin-private-shortcut-card { padding: 20px; margin-bottom: 16px; }
.admin-ops-empty { padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 0.86rem; }
body[data-subject="yduc"] .action-banner, body[data-subject="cdha_daumatco"] .action-banner, body[data-subject="kt_ganmat"] .action-banner, body[data-subject="spyh"] .action-banner { background: var(--surface); color: var(--text); }
.btn:focus:not(:focus-visible), .school-nav-tab:focus:not(:focus-visible), .admin-subtab-btn:focus:not(:focus-visible), .pill:focus:not(:focus-visible) { outline: none; }
.btn:focus-visible, .school-nav-tab:focus-visible, .admin-subtab-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 1160px) { .brand .subtitle, #btn-open-ai-top span, #btn-install-app span { display: none; } #btn-open-ai-top, #btn-install-app { width: 34px; padding: 0; } .topbar-left { gap: 12px; } .school-nav-tab { padding: 0 9px; font-size: 0.82rem; } }
@media (max-width: 960px) { .bento-hero-grid { grid-template-columns: 1fr; } .bento-hero-grid .board-subjects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .school-board-columns, .handbook-cards-wrap { grid-template-columns: 1fr; } .hide-sm { display: none; } }
@media (max-width: 920px) { .app-shell { padding: 14px 14px calc(82px + env(safe-area-inset-bottom)); } .topbar-inner { padding: 6px 14px; min-height: 52px; } #btn-open-ai-top { display: none; } .school-portal-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 920; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--surface); border-top: 1px solid var(--border-strong); padding: 5px 6px calc(5px + env(safe-area-inset-bottom)); } .school-portal-nav.has-admin-tab { grid-template-columns: repeat(5, minmax(0, 1fr)); } .school-nav-tab { flex-direction: column; gap: 3px; height: auto; min-height: 48px; padding: 4px 2px; font-size: 0.69rem; border-radius: 10px; border: none !important; background: transparent !important; } .school-nav-tab.active, .school-nav-tab.is-admin-tab.active { color: var(--primary) !important; font-weight: 650; } .school-nav-tab .nav-ico { width: 19px; height: 19px; } .school-nav-tab .school-nav-badge { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 16px; height: 16px; font-size: 0.65rem; padding: 0 4px; } .stats-grid, .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-card:nth-child(2), .metric-cell:nth-child(2) { border-right: none; } .stat-card:nth-child(1), .stat-card:nth-child(2), .metric-cell:nth-child(1), .metric-cell:nth-child(2) { border-bottom: 1px solid var(--border); } .ai-fab-btn { bottom: calc(70px + env(safe-area-inset-bottom)); right: 14px; padding: 10px; } .ai-fab-btn span { display: none; } }
@media (max-width: 560px) { .bento-hero-grid .board-subjects-grid { grid-template-columns: 1fr; } .gate-grid-3 { grid-template-columns: 1fr; } }

/* === v16 SUNLIT CAMPUS TEAL & CORAL + AVATAR + ABOUT + GOOGLE CALENDAR === */
body { font-family: "Be Vietnam Pro", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.52; }
.app-shell { max-width: 1240px; }
.topbar-inner { max-width: 1240px; gap: 10px; }
.topbar-left { gap: 12px; }
#btn-admin-top { display: none !important; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }
.brand-crest-btn { display: inline-flex; align-items: center; gap: 9px; background: transparent; border: none; padding: 2px; cursor: pointer; color: var(--text); font: inherit; }
.brand-crest-avatar { position: relative; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%); box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.16s ease, box-shadow 0.16s ease; }
.brand-crest-btn:hover .brand-crest-avatar { transform: translateY(-1px) scale(1.03); box-shadow: 0 6px 15px rgba(13, 148, 136, 0.36); }
.crest-svg { width: 28px; height: 28px; }
.brand-live-dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 999px; background: #10b981; border: 2px solid var(--surface); }
.brand-text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand-title-main { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.brand-class-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); border: 1px solid rgba(13, 148, 136, 0.22); font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: filter 0.15s ease, transform 0.15s ease; }
.brand-class-chip:hover { filter: brightness(0.96); transform: translateY(-1px); }
.chip-info-dot { width: 14px; height: 14px; border-radius: 999px; background: var(--primary); color: #ffffff; font-size: 0.64rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.doc-avatar-chip { width: 24px; height: 24px; border-radius: 999px; background: #ecfdf5; color: #047857; box-shadow: inset 0 0 0 1.5px #6ee7b7; font-size: 0.72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-avatar-chip.tone-1 { background: #f0f9ff; color: #0369a1; box-shadow: inset 0 0 0 1.5px #7dd3fc; }
.doc-avatar-chip.tone-2 { background: #fff7ed; color: #c2410c; box-shadow: inset 0 0 0 1.5px #fdba74; }
.doc-avatar-chip.tone-3 { background: #fdf2f8; color: #be185d; box-shadow: inset 0 0 0 1.5px #f9a8d4; }
.doc-avatar-chip.tone-4 { background: #f0fdf4; color: #15803d; box-shadow: inset 0 0 0 1.5px #86efac; }
body.dark .doc-avatar-chip { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.4); }
.auth-crest-emblem { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%); box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

.bento-tile, .metric-strip, .school-schedule-hero { box-shadow: var(--shadow); }
.sunlit-momentum-banner { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; margin-bottom: 16px; background: linear-gradient(125deg, #0d9488 0%, #0284c7 68%, #0f766e 100%); color: #ffffff; display: flex; align-items: center; justify-content: space-between; gap: 18px; box-shadow: 0 12px 28px -8px rgba(13, 148, 136, 0.34); }
.sunlit-momentum-banner::after { content: ""; position: absolute; right: -40px; top: -60px; width: 240px; height: 240px; border-radius: 999px; background: radial-gradient(circle, rgba(254, 243, 199, 0.24) 0%, transparent 70%); pointer-events: none; }
.sunlit-momentum-left { position: relative; z-index: 1; max-width: 720px; }
.sunlit-eyebrow { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); color: #f0fdfa; margin-bottom: 6px; }
.sunlit-headline { margin: 0; font-size: 1.24rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; color: #ffffff; }
.sunlit-subline { margin: 5px 0 0; font-size: 0.86rem; color: rgba(240, 253, 250, 0.92); }
.sunlit-momentum-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.btn-sunlit-white { background: #ffffff; color: #0f766e; border: 1px solid #ffffff; font-weight: 700; }
.btn-sunlit-white:hover { background: #f0fdfa; color: #115e59; }
.btn-sunlit-outline { background: rgba(255, 255, 255, 0.14); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.38); font-weight: 600; }
.btn-sunlit-outline:hover { background: rgba(255, 255, 255, 0.24); }

.metric-cell-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-ico-box { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-ico-box svg { width: 16px; height: 16px; }
.metric-ico-box.is-teal { background: #ccfbf1; color: #0d9488; }
.metric-ico-box.is-sky { background: #e0f2fe; color: #0284c7; }
.metric-ico-box.is-coral { background: #ffedd5; color: #ea580c; }
.metric-ico-box.is-emerald { background: #dcfce7; color: #16a34a; }
body.dark .metric-ico-box.is-teal { background: rgba(20, 184, 166, 0.2); color: #5eead4; }
body.dark .metric-ico-box.is-sky { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
body.dark .metric-ico-box.is-coral { background: rgba(251, 146, 60, 0.2); color: #fdba74; }
body.dark .metric-ico-box.is-emerald { background: rgba(74, 222, 128, 0.2); color: #86efac; }

.board-subj-card { border-radius: 14px; padding: 15px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 3px 10px rgba(15, 41, 38, 0.03); transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.board-subj-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.board-subj-card[data-subj="spyh"] { background: #f0fdfa; border-color: #99f6e4; --subj-c: #0d9488; --subj-bg: #ccfbf1; --subj-fg: #115e59; }
.board-subj-card[data-subj="yduc"] { background: #fff7ed; border-color: #fed7aa; --subj-c: #ea580c; --subj-bg: #ffedd5; --subj-fg: #9a3412; }
.board-subj-card[data-subj="cdha"] { background: #f0f9ff; border-color: #bae6fd; --subj-c: #0284c7; --subj-bg: #e0f2fe; --subj-fg: #075985; }
.board-subj-card[data-subj="cdha_daumatco"] { background: #fff1f2; border-color: #fecdd3; --subj-c: #e11d48; --subj-bg: #ffe4e6; --subj-fg: #9f1239; }
.board-subj-card[data-subj="kt_ganmat"] { background: #f0fdf4; border-color: #bbf7d0; --subj-c: #16a34a; --subj-bg: #dcfce7; --subj-fg: #166534; }
body.dark .board-subj-card[data-subj="spyh"] { background: rgba(13, 148, 136, 0.13); border-color: rgba(45, 212, 191, 0.28); --subj-c: #2dd4bf; --subj-bg: rgba(45, 212, 191, 0.2); --subj-fg: #99f6e4; }
body.dark .board-subj-card[data-subj="yduc"] { background: rgba(234, 88, 12, 0.13); border-color: rgba(251, 146, 60, 0.28); --subj-c: #fb923c; --subj-bg: rgba(251, 146, 60, 0.2); --subj-fg: #fed7aa; }
body.dark .board-subj-card[data-subj="cdha"] { background: rgba(2, 132, 199, 0.13); border-color: rgba(56, 189, 248, 0.28); --subj-c: #38bdf8; --subj-bg: rgba(56, 189, 248, 0.2); --subj-fg: #bae6fd; }
body.dark .board-subj-card[data-subj="cdha_daumatco"] { background: rgba(225, 29, 72, 0.13); border-color: rgba(251, 113, 133, 0.28); --subj-c: #fb7185; --subj-bg: rgba(251, 113, 133, 0.2); --subj-fg: #fecdd3; }
body.dark .board-subj-card[data-subj="kt_ganmat"] { background: rgba(22, 163, 74, 0.13); border-color: rgba(74, 222, 128, 0.28); --subj-c: #4ade80; --subj-bg: rgba(74, 222, 128, 0.2); --subj-fg: #bbf7d0; }
.board-subj-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.board-subj-ico { width: 32px; height: 32px; border-radius: 10px; background: var(--subj-bg, var(--primary-soft)); color: var(--subj-c, var(--primary)); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.board-subj-ico svg { width: 17px; height: 17px; }
.board-subj-count-pill { padding: 2px 8px; border-radius: 999px; background: var(--subj-bg, var(--primary-soft)); color: var(--subj-fg, var(--primary-text)); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.board-subj-title { font-size: 0.96rem; font-weight: 700; }
.bento-subj-bar { height: 7px; background: rgba(15, 41, 38, 0.08); }
body.dark .bento-subj-bar { background: rgba(255, 255, 255, 0.10); }
.bento-subj-fill { background: var(--subj-c, var(--primary)); }
.bento-tile-countdown.is-urgent { background: linear-gradient(160deg, #fff7ed 0%, #ffffff 65%); border-color: #fed7aa; }
body.dark .bento-tile-countdown.is-urgent { background: linear-gradient(160deg, rgba(234, 88, 12, 0.16) 0%, var(--surface) 70%); border-color: rgba(251, 146, 60, 0.34); }

.portal-about-showcase { margin-top: 16px; padding: 22px 24px; border-radius: 18px; background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); }
.about-showcase-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 20px; align-items: center; }
.about-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; color: var(--primary); text-transform: uppercase; margin-bottom: 4px; }
.about-story-col h3 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 800; color: var(--text); }
.about-story-col p { margin: 0 0 8px; font-size: 0.87rem; line-height: 1.6; color: var(--muted); }
.about-story-col p:last-child { margin-bottom: 0; }
.founder-badge-card { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); display: flex; flex-direction: column; gap: 14px; }
.founder-avatar-row { display: flex; align-items: center; gap: 12px; }
.founder-crest-circle { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%); color: #ffffff; font-size: 0.95rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 14px rgba(13, 148, 136, 0.25); }
.founder-role-label { font-size: 0.72rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; }
.founder-name { font-size: 1rem; font-weight: 800; color: var(--text); }
.founder-affil { font-size: 0.78rem; color: var(--muted); }
.short-domain-box { padding: 10px 12px; border-radius: 11px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.short-domain-label { font-size: 0.73rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.short-domain-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.short-domain-row code { font-size: 0.84rem; font-weight: 700; color: var(--primary-text); }
.about-modal-card { max-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden; }
.about-modal-hero { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(125deg, #0d9488 0%, #0284c7 100%); color: #ffffff; margin-bottom: 12px; flex-shrink: 0; }
.about-modal-crest { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, 0.16); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.about-modal-badge { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; opacity: 0.9; }
.about-modal-hero h4 { margin: 3px 0 0; font-size: 0.98rem; font-weight: 800; }
.about-modal-body { overflow-y: auto; flex: 1; min-height: 0; padding-right: 4px; }
.about-modal-body p { font-size: 0.87rem; line-height: 1.56; color: var(--text); margin: 0 0 8px; }
.about-feature-list { margin: 6px 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 0.84rem; color: var(--muted); }
.about-modal-credit { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.gcal-toolbar { padding: 12px 16px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gcal-nav-group { display: inline-flex; align-items: center; gap: 8px; }
.gcal-period-title { margin: 0; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.02em; min-width: 142px; }
.gcal-arrows { display: inline-flex; align-items: center; gap: 3px; }
.gcal-view-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.gcal-seg-btn { border: none; background: transparent; color: var(--muted); font: inherit; font-size: 0.8rem; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: background-color 0.14s ease, color 0.14s ease; }
.gcal-seg-btn.active { background: var(--primary); color: var(--primary-fg); font-weight: 700; }
.gcal-workspace { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(295px, 1fr); gap: 16px; align-items: start; }
.gcal-main-board { padding: 0; overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.gcal-dow-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.gcal-dow-cell { padding: 9px 6px; text-align: center; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.gcal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gcal-day-cell { min-height: 102px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background-color 0.12s ease; }
.gcal-day-cell:nth-child(7n) { border-right: none; }
.gcal-day-cell:hover { background: var(--surface-2); }
.gcal-day-cell.is-outside { background: rgba(15, 41, 38, 0.02); }
body.dark .gcal-day-cell.is-outside { background: rgba(0, 0, 0, 0.18); }
.gcal-day-cell.is-selected { background: rgba(13, 148, 136, 0.08); box-shadow: inset 0 0 0 2px var(--primary); }
.gcal-day-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.gcal-day-num { width: 25px; height: 25px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gcal-day-cell.is-outside .gcal-day-num { color: var(--muted); opacity: 0.45; }
.gcal-day-cell.is-today .gcal-day-num { background: var(--primary); color: var(--primary-fg); font-weight: 800; }
.gcal-day-count-dot { font-size: 0.68rem; font-weight: 700; color: var(--muted); }
.gcal-day-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gcal-ev-pill { display: flex; align-items: center; gap: 4px; width: 100%; padding: 2px 6px; border-radius: 6px; font-size: 0.71rem; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: none; text-align: left; cursor: pointer; background: #ccfbf1; color: #115e59; transition: filter 0.12s ease, transform 0.12s ease; }
.gcal-ev-pill:hover { filter: brightness(0.95); transform: translateY(-1px); }
.gcal-ev-pill.is-spyh { background: #ccfbf1; color: #115e59; }
.gcal-ev-pill.is-yduc { background: #ffedd5; color: #9a3412; }
.gcal-ev-pill.is-cdha { background: #e0f2fe; color: #075985; }
.gcal-ev-pill.is-daumatco { background: #ffe4e6; color: #9f1239; }
.gcal-ev-pill.is-ganmat { background: #dcfce7; color: #166534; }
.gcal-ev-pill.is-exam { background: #ea580c !important; color: #ffffff !important; font-weight: 700; }
.gcal-ev-pill.is-zalo { background: #fef3c7; color: #92400e; border: 1px dashed #d97706; }
.gcal-ev-pill.is-cancelled { opacity: 0.55; text-decoration: line-through; }
body.dark .gcal-ev-pill.is-spyh { background: rgba(45, 212, 191, 0.22); color: #99f6e4; }
body.dark .gcal-ev-pill.is-yduc { background: rgba(251, 146, 60, 0.22); color: #fed7aa; }
body.dark .gcal-ev-pill.is-cdha { background: rgba(56, 189, 248, 0.22); color: #bae6fd; }
body.dark .gcal-ev-pill.is-daumatco { background: rgba(251, 113, 133, 0.22); color: #fecdd3; }
body.dark .gcal-ev-pill.is-ganmat { background: rgba(74, 222, 128, 0.22); color: #bbf7d0; }
body.dark .gcal-ev-pill.is-zalo { background: rgba(245, 158, 11, 0.22); color: #fde68a; border-color: #f59e0b; }
.gcal-more-label { font-size: 0.69rem; font-weight: 700; color: var(--primary); padding-left: 4px; }
.gcal-week-wrap { overflow-x: auto; }
.gcal-week-table { min-width: 720px; display: grid; grid-template-columns: 78px repeat(7, minmax(0, 1fr)); }
.gcal-wk-head { padding: 10px 6px; text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 0.76rem; font-weight: 700; }
.gcal-wk-head.is-today { color: var(--primary); background: rgba(13, 148, 136, 0.08); }
.gcal-wk-shift { padding: 12px 8px; font-size: 0.73rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.gcal-wk-cell { min-height: 86px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; cursor: pointer; }
.gcal-wk-cell:hover { background: var(--surface-2); }
.gcal-agenda-wrap { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.gcal-agenda-day-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.gcal-agenda-day-row:last-child { border-bottom: none; padding-bottom: 0; }
.gcal-agenda-date-badge { display: flex; flex-direction: column; }
.gcal-agenda-dd { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--primary); font-variant-numeric: tabular-nums; }
.gcal-agenda-dow { font-size: 0.76rem; font-weight: 700; color: var(--muted); }
.gcal-agenda-cards { display: flex; flex-direction: column; gap: 10px; }
.gcal-side-panel { display: flex; flex-direction: column; gap: 14px; }
.gcal-inspector-card { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.gcal-insp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.gcal-insp-date { font-size: 0.92rem; font-weight: 800; color: var(--text); }
.gcal-insp-list { display: flex; flex-direction: column; gap: 12px; }
.gcal-legend-card { padding: 15px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.gcal-legend-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; }
.gcal-legend-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 0.78rem; font-weight: 600; }
.gcal-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.lg-dot { width: 11px; height: 11px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
.lg-dot.is-exam { background: #ea580c; }
.lg-dot.is-spyh { background: #0d9488; }
.lg-dot.is-yduc { background: #f59e0b; }
.lg-dot.is-cdha { background: #0284c7; }
.lg-dot.is-ganmat { background: #16a34a; }
.lg-dot.is-zalo { background: #fef3c7; border: 1.5px dashed #d97706; }

@media (max-width: 1440px) {
  #btn-install-app span, #btn-open-ai-top span { display: none; }
  #btn-install-app, #btn-open-ai-top { width: 34px; padding: 0; }
  .school-nav-tab { padding: 0 9px; font-size: 0.82rem; }
}
@media (max-width: 1080px) {
  .brand-class-chip { display: none; }
  .topbar-left { gap: 10px; }
}
@media (max-width: 960px) {
  .gcal-workspace, .about-showcase-grid { grid-template-columns: 1fr; }
  .sunlit-momentum-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 680px) {
  .brand-class-chip, #btn-install-app { display: none !important; }
  .brand-crest-avatar { width: 34px; height: 34px; border-radius: 10px; }
  .brand-title-main { font-size: 0.92rem; }
  .gcal-day-cell { min-height: 66px; padding: 4px; }
  .gcal-ev-pill { font-size: 0.64rem; padding: 1px 4px; }
  .gcal-agenda-day-row { grid-template-columns: 1fr; gap: 6px; }
}
