@font-face {
    font-family: "SolaimanLipi";
    src: url("../fonts/SolaimanLipi.woff") format("woff"),
         url("../fonts/SolaimanLipi.ttf") format("truetype");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --mix: #000;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-soft: #eef2ff;
    --color-success: #059669;
    --color-success-soft: #ecfdf5;
    --color-warning: #b45309;
    --color-warning-soft: #fffbeb;
    --color-danger: #e11d48;
    --color-danger-soft: #fff1f2;
    --color-info: #2563eb;
    --color-info-soft: #eff6ff;
    --color-bg: #f3f4fa;
    --color-surface: #ffffff;
    --color-surface-2: #f6f7fc;
    --color-border: #e5e7f1;
    --color-text: #1a1d3a;
    --color-muted: #667091;
    --color-inverse: #ffffff;
    --grad-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
    --grad-side: linear-gradient(180deg, #1e1b4b 0%, #2e1065 60%, #3b0764 100%);
    --font-sans: "Instrument Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --font-bn: "SolaimanLipi", "SolaimanLipiNormal", "Noto Sans Bengali", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --text-title: 1.65rem;
    --text-section: 1.05rem;
    --text-card: 1rem;
    --text-body: 0.95rem;
    --text-small: 0.8125rem;
    --text-table: 0.9rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;
    --shadow-card: 0 1px 2px rgba(26, 29, 58, 0.04), 0 8px 24px rgba(26, 29, 58, 0.05);
    --shadow-raised: 0 14px 34px rgba(26, 29, 58, 0.12);
    --shadow-pop: 0 20px 48px rgba(26, 29, 58, 0.2);
    --sidebar-width: 272px;
    --sidebar-collapsed: 84px;
    --topbar-height: 72px;
    --tabbar-height: 66px;
    --content-max: 1240px;
    --focus: 0 0 0 3px rgba(99, 102, 241, 0.35);
    --tone: #4f46e5;
    --tone-a: #818cf8;
    --tone-soft: color-mix(in srgb, var(--tone) 12%, transparent);
    --tone-ink: color-mix(in srgb, var(--tone) 82%, var(--mix));
    --tone-grad: linear-gradient(135deg, var(--tone-a), var(--tone));
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --mix: #fff;
    --color-primary: #818cf8;
    --color-primary-hover: #a5b4fc;
    --color-primary-soft: rgba(129, 140, 248, 0.16);
    --color-success: #34d399;
    --color-success-soft: rgba(52, 211, 153, 0.14);
    --color-warning: #fbbf24;
    --color-warning-soft: rgba(251, 191, 36, 0.14);
    --color-danger: #fb7185;
    --color-danger-soft: rgba(251, 113, 133, 0.14);
    --color-info: #60a5fa;
    --color-info-soft: rgba(96, 165, 250, 0.14);
    --color-bg: #0d0f1f;
    --color-surface: #151833;
    --color-surface-2: #1c2042;
    --color-border: #282d55;
    --color-text: #eceefd;
    --color-muted: #a0a6cc;
    --color-inverse: #0d0f1f;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-raised: 0 14px 34px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 20px 48px rgba(0, 0, 0, 0.55);
    --focus: 0 0 0 3px rgba(129, 140, 248, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --mix: #fff;
        --color-primary: #818cf8;
        --color-primary-hover: #a5b4fc;
        --color-primary-soft: rgba(129, 140, 248, 0.16);
        --color-success: #34d399;
        --color-success-soft: rgba(52, 211, 153, 0.14);
        --color-warning: #fbbf24;
        --color-warning-soft: rgba(251, 191, 36, 0.14);
        --color-danger: #fb7185;
        --color-danger-soft: rgba(251, 113, 133, 0.14);
        --color-info: #60a5fa;
        --color-info-soft: rgba(96, 165, 250, 0.14);
        --color-bg: #0d0f1f;
        --color-surface: #151833;
        --color-surface-2: #1c2042;
        --color-border: #282d55;
        --color-text: #eceefd;
        --color-muted: #a0a6cc;
        --color-inverse: #0d0f1f;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
        --shadow-raised: 0 14px 34px rgba(0, 0, 0, 0.4);
        --shadow-pop: 0 20px 48px rgba(0, 0, 0, 0.55);
        --focus: 0 0 0 3px rgba(129, 140, 248, 0.45);
    }
}

.t-indigo, .t-blue, .t-amber, .t-emerald, .t-violet, .t-rose, .t-cyan {
    --tone-soft: color-mix(in srgb, var(--tone) 12%, transparent);
    --tone-ink: color-mix(in srgb, var(--tone) 82%, var(--mix));
    --tone-grad: linear-gradient(135deg, var(--tone-a), var(--tone));
}
.t-indigo { --tone: #4f46e5; --tone-a: #818cf8; }
.t-blue { --tone: #2563eb; --tone-a: #38bdf8; }
.t-amber { --tone: #ea580c; --tone-a: #fbbf24; }
.t-emerald { --tone: #059669; --tone-a: #34d399; }
.t-violet { --tone: #7c3aed; --tone-a: #c084fc; }
.t-rose { --tone: #e11d48; --tone-a: #fb7185; }
.t-cyan { --tone: #0891b2; --tone-a: #22d3ee; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button, input, summary { font: inherit; color: inherit; }
a { color: var(--color-primary); }
:focus { outline: none; }
:focus-visible { box-shadow: var(--focus); border-radius: var(--radius-sm); }
.skip {
    position: absolute;
    left: var(--space-lg);
    top: -40px;
    background: var(--color-surface);
    padding: var(--space-sm) var(--space-md);
    z-index: 20;
}
.skip:focus { top: var(--space-sm); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.muted { color: var(--color-muted); }

.icon { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Colour icon chip */
.ico {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--tone-grad);
    color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--tone) 28%, transparent);
}
.ico.sm { width: 32px; height: 32px; border-radius: 10px; }
.ico.sm .icon { width: 1.05rem; height: 1.05rem; }
.ico.lg { width: 52px; height: 52px; border-radius: 16px; }
.ico.lg .icon { width: 1.5rem; height: 1.5rem; }

/* Buttons */
.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--grad-brand);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 650;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99, 102, 241, 0.32); }
.btn .icon { width: 1rem; height: 1rem; }
.btn.secondary, a.btn.secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
    box-shadow: none;
}
.btn.secondary:hover { background: var(--color-surface-2); }
.btn.soft, a.btn.soft {
    min-height: 36px;
    padding: 0.35rem 0.8rem;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: none;
    font-size: var(--text-small);
}
.btn.soft:hover { background: var(--grad-brand); color: #fff; }
.btn.soft.danger, button.btn.soft.danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.btn.soft.danger:hover, button.btn.soft.danger:hover { background: var(--color-danger); color: #fff; }
.btn:disabled, .is-disabled { opacity: 0.55; cursor: not-allowed; }
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-muted);
    text-decoration: none;
    cursor: pointer;
}
.icon-button:hover { background: var(--color-surface-2); }
.icon-button:disabled { opacity: 0.6; cursor: not-allowed; }
.note-bell { position: relative; overflow: visible; }
.note-bell .tool-count { position: absolute; top: -6px; right: -6px; z-index: 1; }
.note-bell.has-notice {
    border-color: color-mix(in srgb, #f43f5e 45%, var(--color-border));
    color: #e11d48;
    background: color-mix(in srgb, #fff1f2 80%, var(--color-surface));
}
.note-menu { position: relative; }
.note-menu > summary { list-style: none; cursor: pointer; }
.note-menu > summary::-webkit-details-marker { display: none; }
.note-menu[open] > .note-bell {
    border-color: #6366f1;
    color: #4f46e5;
    background: var(--color-surface);
}
.note-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    left: auto;
    z-index: 20;
    width: min(360px, calc(100vw - 1.25rem));
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16);
    animation: note-panel-in 160ms ease-out;
}
@keyframes note-panel-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.note-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(244, 63, 94, 0.10), transparent 55%),
        radial-gradient(100% 120% at 0% 0%, rgba(99, 102, 241, 0.10), transparent 50%),
        var(--color-surface);
}
.note-panel-head strong {
    display: block;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.note-panel-head small {
    display: block;
    margin-top: 0.12rem;
    color: var(--color-muted);
    font-size: 0.76rem;
}
.note-panel-total {
    display: inline-grid;
    place-items: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}
.note-panel-body {
    display: grid;
    gap: 0.65rem;
    max-height: min(58vh, 420px);
    overflow: auto;
    padding: 0.7rem;
}
.note-section { display: grid; gap: 0.4rem; }
.note-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.25rem;
    color: var(--color-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.note-chip {
    display: inline-grid;
    place-items: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: var(--color-surface-2, #f1f5f9);
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}
.note-list { display: grid; gap: 0.35rem; }
.note-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: start;
    padding: 0.7rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--color-surface-2, #f8fafc);
    color: inherit;
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.note-item:hover {
    border-color: color-mix(in srgb, #6366f1 35%, var(--color-border));
    background: color-mix(in srgb, #eef2ff 70%, var(--color-surface));
    transform: translateY(-1px);
}
.note-item-icon {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 12px;
    flex-shrink: 0;
}
.note-item-icon .icon { width: 1.05rem; height: 1.05rem; }
.note-item-icon.t-chat {
    color: #0f766e;
    background: linear-gradient(160deg, #ccfbf1, #99f6e4);
}
.note-item-icon.t-renew {
    color: #9f1239;
    background: linear-gradient(160deg, #ffe4e6, #fecdd3);
}
.note-item-copy { display: grid; gap: 0.12rem; min-width: 0; }
.note-item-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.55rem;
}
.note-item-title strong {
    font-size: 0.88rem;
    font-weight: 780;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-item-title time {
    flex-shrink: 0;
    color: var(--color-muted);
    font-size: 0.68rem;
    font-weight: 650;
}
.note-item-sub,
.note-item-preview {
    color: var(--color-muted);
    font-size: 0.78rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-item-preview { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-item-badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}
.note-empty {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    padding: 1.6rem 1rem;
    text-align: center;
}
.note-empty-icon {
    display: inline-grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    margin-bottom: 0.35rem;
    border-radius: 999px;
    color: #64748b;
    background: var(--color-surface-2, #f1f5f9);
}
.note-empty-icon .icon { width: 1.2rem; height: 1.2rem; }
.note-empty strong { font-size: 0.92rem; }
.note-empty p {
    margin: 0;
    max-width: 16rem;
    color: var(--color-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}
.note-panel-foot {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    padding: 0.7rem;
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface-2, #f8fafc) 80%, transparent);
}
.note-panel-foot a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0 0.7rem;
    border-radius: 11px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}
.note-panel-foot a:hover {
    border-color: #6366f1;
    color: #4f46e5;
    background: #eef2ff;
}
html[data-theme="dark"] .note-bell.has-notice {
    background: rgba(244, 63, 94, 0.12);
}
html[data-theme="dark"] .note-panel {
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .note-item { background: rgba(15, 23, 42, 0.45); }
html[data-theme="dark"] .note-item:hover { background: rgba(99, 102, 241, 0.16); }
html[data-theme="dark"] .note-item-icon.t-chat { color: #5eead4; background: rgba(13, 148, 136, 0.28); }
html[data-theme="dark"] .note-item-icon.t-renew { color: #fda4af; background: rgba(190, 18, 60, 0.28); }
html[data-theme="dark"] .note-panel-foot { background: rgba(15, 23, 42, 0.35); }
html[data-theme="dark"] .note-panel-foot a:hover { background: rgba(99, 102, 241, 0.2); }
.theme-toggle { width: auto; gap: 0.35rem; padding: 0 0.75rem; font-size: 0.78rem; font-weight: 750; color: var(--color-text); }
.mobile-header .theme-toggle { width: auto; padding: 0 0.55rem; }
.visit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 42px;
    padding: 0 0.9rem;
    border-radius: 12px;
    background: var(--grad-brand);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}
.visit-link .icon { width: 1rem; height: 1rem; }
.visit-link:hover { color: #fff; filter: brightness(1.08); }
.mobile-header .visit-link { height: 36px; padding: 0 0.7rem; box-shadow: none; }

/* Badges and pills */
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.1rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
}
.badge.current { background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3); }
.badge.neutral { background: var(--color-surface-2); color: var(--color-muted); }
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--tone-soft);
    color: var(--tone-ink);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.code-pill {
    display: inline-flex;
    padding: 0.1rem 0.5rem;
    border-radius: 7px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
}
.card + .card, .stack { margin-top: var(--space-lg); }
.paper-block { margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--color-border); }
.paper-block h2 {
    margin: 0 0 0.8rem;
    font-size: var(--text-section);
    line-height: 1.4;
    letter-spacing: -0.015em;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: 0.9rem; }
.card-title {
    margin: 0;
    font-size: var(--text-section);
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: -0.015em;
    overflow: visible;
}
.card > .card-title { margin-bottom: 0.85rem; }
.card-hint { color: var(--color-muted); font-size: var(--text-small); }
.card-link { display: inline-flex; align-items: center; gap: 0.15rem; font-size: var(--text-small); font-weight: 700; text-decoration: none; }
.card-link .icon { width: 1rem; height: 1rem; }
.notice {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 0 var(--space-lg);
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-md);
    background: var(--tone-soft);
    color: var(--tone-ink);
    font-size: var(--text-small);
    font-weight: 650;
}
.notice .icon { width: 1.1rem; height: 1.1rem; }
.notice a { color: inherit; font-weight: 800; text-decoration: underline; }

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--color-muted); }
.empty-state strong { display: block; color: var(--color-text); margin-bottom: var(--space-xs); font-size: 1rem; }
.empty-state p { margin: 0 auto; max-width: 40ch; font-size: var(--text-small); }
.empty-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.empty-icon .icon { width: 1.6rem; height: 1.6rem; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tone-soft);
    color: var(--tone-ink);
    border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent);
    font-weight: 750;
    font-size: var(--text-small);
    flex: 0 0 auto;
}
.avatar.lg { width: 84px; height: 84px; font-size: 1.7rem; }
img.avatar { object-fit: cover; }

/* Page header */
.page-header { margin-bottom: 1.1rem; }
.page-header.is-compact { margin-bottom: var(--space-md); }
.page-head { display: flex; align-items: center; gap: var(--space-lg); }
.page-head-copy { min-width: 0; flex: 1; }
.page-title {
    margin: 0;
    font-size: var(--text-title);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    overflow: visible;
}
.page-description { margin: 0.3rem 0 0; color: var(--color-muted); max-width: 70ch; }
.page-actions { align-self: flex-start; margin-left: auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 var(--space-md); color: var(--color-muted); font-size: var(--text-small); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--color-primary); }
.crumbs span:last-child { color: var(--color-text); font-weight: 650; }

.summary-chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
    color: var(--tone-ink);
    font-size: var(--text-small);
    font-weight: 600;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--tone) 10%, transparent);
}
a.summary-chip { text-decoration: none; }
a.summary-chip[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--tone); }
.summary-chip .icon { width: 1rem; height: 1rem; }
.summary-chip b { font-weight: 800; }
.progress-meter {
    --progress: 0%;
    width: min(100%, 14rem);
    height: 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border, #d7d7d7) 80%, transparent);
    overflow: hidden;
    margin: 0.25rem 0;
}
.progress-meter--lg { width: min(100%, 28rem); height: 0.85rem; }
.progress-meter__bar {
    display: block;
    height: 100%;
    width: var(--progress);
    border-radius: inherit;
    background: linear-gradient(90deg, #6d28d9, #8b5cf6);
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-lg); }
.toolbar .search-box { margin: 0; flex: 1 1 28rem; }
.toolbar .summary-chips { margin: 0; }

.search-box { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.search-field { position: relative; flex: 1 1 16rem; display: block; }
.search-field .icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.search-field input {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.9rem 0.65rem 2.7rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-field input:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16); }
.search-box .btn { min-height: 46px; }

.domain-list > .table-tools { padding: 1rem 1rem 0; margin-bottom: 0.75rem; }
.domain-list .table-scroll { overflow-x: auto; }
.domain-list .data-table { min-width: 76rem; }
.domain-list .data-table th,
.domain-list .data-table td { white-space: nowrap; vertical-align: middle; }
.domain-actions { display: flex; align-items: center; gap: 0.5rem; }
.domain-update { display: flex; align-items: center; gap: 0.5rem; }
.domain-update .field { width: 14rem; min-width: 14rem; margin: 0; }
.domain-update .field input,
.domain-update .btn { min-height: 2.4rem; }
.domain-update .btn { flex: none; }

/* Custom Domain — mobile school list */
.domain-mobile-list {
    display: grid;
    gap: 0.85rem;
    padding: 0 1rem 1rem;
}
.domain-mobile-card {
    position: relative;
    display: block;
    padding: 1.05rem 1rem 1rem;
    border-radius: 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.domain-mobile-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
    background: var(--tone-grad, linear-gradient(90deg, #06b6d4, #6366f1));
}
.domain-mobile-card:active {
    transform: scale(0.985);
}
.domain-mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}
.domain-mobile-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.domain-mobile-meta {
    margin: 0.7rem 0 0;
    display: grid;
    gap: 0.35rem;
}
.domain-mobile-meta > div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: var(--color-surface-2);
}
.domain-mobile-meta dt {
    color: var(--color-muted);
    font-size: var(--text-small);
    flex: 0 0 auto;
}
.domain-mobile-meta dd {
    margin: 0;
    font-size: var(--text-small);
    font-weight: 650;
    text-align: right;
}
.domain-mobile-cta {
    display: inline-flex;
    margin-top: 0.85rem;
    color: #0e7490;
    font-size: 0.88rem;
    font-weight: 700;
}
.domain-break,
.domain-link {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.domain-link {
    display: inline-block;
    font-weight: 700;
    color: #0e7490;
}

/* Custom Domain — branch detail */
.domain-show {
    display: grid;
    gap: 0.9rem;
}
.domain-show-chips {
    margin: 0;
}
.domain-show-card {
    margin: 0;
}
.domain-fact-list {
    margin: 0;
    display: grid;
    gap: 0.55rem;
}
.domain-fact-list > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: var(--color-surface-2);
    border: 1px solid transparent;
}
.domain-fact-list dt {
    color: var(--color-muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.domain-fact-list dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}
.domain-fact-list--tight {
    margin-bottom: 1rem;
}
.domain-hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
}
.domain-show-form {
    display: grid;
    gap: 0.75rem;
}
.domain-show-form .field {
    margin-bottom: 0;
}
.domain-show-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}
.domain-show-actions--secondary {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
}
.domain-show-actions form {
    margin: 0;
}
.domain-pin-display {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    margin: 0.25rem 0 0.85rem;
    padding: 0.85rem 1rem;
    text-align: center;
    border-radius: 14px;
    background: color-mix(in srgb, #06b6d4 12%, var(--color-surface));
    border: 1px solid color-mix(in srgb, #06b6d4 28%, transparent);
}
.domain-pin-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 46px;
    font-size: 0.92rem;
    font-weight: 600;
}
.theme-choices { display: grid; gap: 0.6rem; }
.theme-choices label { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.75rem 0.85rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.theme-choices label:has(input:checked) { border-color: #0f6e78; box-shadow: 0 0 0 3px rgba(15, 110, 120, 0.15); }
.theme-choices strong, .theme-choices small { display: block; }
.theme-choices small { color: var(--color-muted); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-lg); }
.field > span:first-child { font-size: var(--text-small); font-weight: 650; }
.input-wrap { position: relative; display: block; }
.input-wrap .icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.input-wrap input { width: 100%; padding-left: 2.75rem; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16); }
.field .input-wrap input { padding-left: 2.75rem; }
.form-error {
    background: var(--color-danger-soft);
    color: var(--color-danger);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.filter-card { margin-bottom: var(--space-lg); }
.filter-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
.filter-search { grid-column: 1 / -1; }
.filter-card .field { margin-bottom: 0; }
.allocation-filter-grid { align-items: end; }
.allocation-jump { min-height: 46px; align-self: end; white-space: nowrap; }
.schedule-sheet-bar { display: flex; justify-content: flex-end; margin: 0 0 1rem; }
.schedule-grid input,
.schedule-grid select {
    width: 100%;
    min-width: 6.5rem;
    min-height: 2rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}
.data-table.schedule-grid th {
    white-space: normal;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: bottom;
}
.schedule-marks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
}
.schedule-marks-btn .icon { width: 1.15rem; height: 1.15rem; }
.schedule-marks-dialog {
    width: min(32rem, calc(100vw - 2rem));
    border: 0;
    border-radius: 16px;
    padding: 1.25rem;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.schedule-marks-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.schedule-marks-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.schedule-marks-head h3 { margin: 0; font-size: 1.05rem; }
.schedule-marks-x {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
@media (min-width: 640px) {
    .schedule-marks-dialog .form-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
    .no-print, .schedule-marks-dialog, .sidebar, .topbar, .page-strip, .page-header, .filter-card { display: none !important; }
    .schedule-sheet { box-shadow: none !important; border: 0 !important; }
}
.template-bg-preview-wrap { display: block; margin-top: 0.55rem; }
.template-bg-preview { display: block; width: 4.5rem; height: 6rem; object-fit: cover; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; }
.admit-print-row { display: flex; align-items: flex-end; gap: 0.75rem; margin-bottom: var(--space-md); }
.admit-print-row .field { flex: 0 1 16rem; margin-bottom: 0; }
.admit-print-row .btn { min-height: 46px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-md); }
.filter-actions .btn { min-height: 46px; }
.timeline-action { margin-top: var(--space-sm); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.row-actions form { margin: 0; }
.profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}
.profile-actions-main,
.profile-actions-side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.profile-actions-side { margin-left: auto; }
.profile-actions .student-pin-delete { align-items: center; }
.profile-actions .student-pin-field { position: relative; min-width: 7.5rem; margin: 0; }
.profile-actions .student-pin-field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.profile-actions .btn,
.profile-summary-btn,
.profile-actions .student-pin-field input {
    min-height: 2.55rem;
    box-sizing: border-box;
}
.profile-summary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 11.5rem;
}
.profile-summary-btn svg { width: 1rem; height: 1rem; }
.profile-dialog[hidden] { display: none !important; }
.profile-dialog {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.profile-dialog-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.55);
    cursor: pointer;
}
.profile-dialog-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 58rem);
    max-height: min(86vh, 46rem);
    display: flex;
    flex-direction: column;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
}
.profile-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.profile-dialog-head h2 { margin: 0; font-size: 1.2rem; }
.profile-dialog-x {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.profile-dialog-body {
    overflow: auto;
    margin-top: 0.35rem;
    padding-right: 0.15rem;
}
body.profile-dialog-open { overflow: hidden; }
@media (max-width: 760px) {
    .profile-actions,
    .profile-actions-main,
    .profile-actions-side { width: 100%; }
    .profile-actions-side { margin-left: 0; }
    .profile-actions-main .btn,
    .profile-actions-side .profile-summary-btn { flex: 1 1 calc(50% - 0.5rem); }
    .profile-actions .student-pin-delete { width: 100%; }
    .profile-actions .student-pin-field { flex: 1 1 8rem; }
    .profile-actions .student-pin-field input { max-width: none; }
    .profile-dialog { padding: 0.65rem; align-items: end; }
    .profile-dialog-panel {
        width: 100%;
        max-height: 88vh;
        border-radius: 16px 16px 12px 12px;
        padding: 0.95rem 0.85rem 1rem;
    }
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); }
.form-grid .field { margin-bottom: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
fieldset.field { border: 0; padding: 0; min-inline-size: 0; }
fieldset.field legend { font-size: var(--text-small); font-weight: 650; padding: 0; }
.mark-distribution-grid th,
.mark-distribution-grid td { text-align: center; padding: 0.35rem 0.75rem; }
.mark-distribution-grid th:first-child,
.mark-distribution-grid th:nth-child(2),
.mark-distribution-grid th:nth-child(3),
.mark-distribution-grid .class-cell,
.mark-distribution-grid .section-cell,
.mark-distribution-grid .subject-cell { text-align: left; }
.mark-distribution-grid .class-cell,
.mark-distribution-grid .section-cell { vertical-align: middle; font-weight: 650; }
.data-table.mark-distribution-grid tbody tr:last-child td { border-bottom: 1px solid var(--color-border); }
.mark-distribution-grid tbody[hidden] { display: none !important; }
.mark-distribution-grid input {
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    accent-color: #4f46e5;
}
.check-list { display: grid; gap: 0.45rem; margin-top: 0.35rem; }
.check-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 42px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}
.field .check-row input {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    padding: 0;
    flex: 0 0 auto;
}

/* Dashboard */
.hero, .profile-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.25);
}
.hero { display: grid; gap: 1.25rem; padding: 1.4rem; margin-bottom: 1.1rem; }
.hero-orb { position: absolute; border-radius: 50%; pointer-events: none; }
.hero-orb.orb-1 { width: 300px; height: 300px; top: -120px; right: -80px; background: radial-gradient(circle, rgba(56, 189, 248, 0.55), transparent 70%); }
.hero-orb.orb-2 { width: 260px; height: 260px; bottom: -130px; left: 25%; background: radial-gradient(circle, rgba(251, 191, 36, 0.4), transparent 70%); }
.hero > *:not(.hero-orb), .profile-hero > *:not(.hero-orb) { position: relative; }
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: var(--text-small);
    font-weight: 650;
}
.hero-kicker .icon { width: 1rem; height: 1rem; }
.hero-title { margin: 0.65rem 0 0.2rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.hero-text { margin: 0; color: rgba(255, 255, 255, 0.88); }
.hero-chips { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-lg); }
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: var(--text-small);
    font-weight: 600;
}
.hero-chip .icon { width: 1rem; height: 1rem; }
.hero-stat {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.15s ease;
}
.hero-stat:hover { background: rgba(255, 255, 255, 0.22); }
.hero-stat-value { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.hero-stat-label { color: rgba(255, 255, 255, 0.85); font-size: var(--text-small); }
.hero-stat-link { display: inline-flex; align-items: center; gap: 0.15rem; margin-top: var(--space-sm); font-size: var(--text-small); font-weight: 700; }
.hero-stat-link .icon { width: 1rem; height: 1rem; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.mobile-stat-grid .stat-card,
.stat-grid.mobile-stat-grid .stat-card {
    padding: 0.65rem 0.55rem 0.7rem;
    border-radius: 14px;
    min-height: 0;
}
.mobile-stat-grid .stat-top { margin-bottom: 0.35rem; }
.mobile-stat-grid .ico {
    width: 28px;
    height: 28px;
    border-radius: 9px;
}
.mobile-stat-grid .ico .icon { width: 0.85rem; height: 0.85rem; }
.mobile-stat-grid .stat-go { width: 22px; height: 22px; }
.mobile-stat-grid .stat-go .icon { width: 0.75rem; height: 0.75rem; }
.mobile-stat-grid .stat-value { font-size: 1.15rem; }
.mobile-stat-grid .stat-label { font-size: 0.68rem; line-height: 1.25; }
.mobile-stat-grid .stat-note { font-size: 0.62rem; margin-top: 0.1rem; }
.mobile-stat-grid .stat-card::after { width: 72px; height: 72px; top: -34px; right: -28px; }
.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.stat-card::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    top: -50px;
    right: -40px;
    border-radius: 50%;
    background: var(--tone-soft);
    pointer-events: none;
}
.stat-card > * { position: relative; z-index: 1; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-raised); border-color: color-mix(in srgb, var(--tone) 40%, transparent); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.stat-go { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface); color: var(--tone-ink); }
.stat-go .icon { width: 0.95rem; height: 0.95rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { color: var(--color-muted); font-size: var(--text-small); font-weight: 650; }
.stat-note { color: var(--tone-ink); font-size: 0.75rem; font-weight: 600; margin-top: 0.2rem; }

.dash-grid { display: grid; gap: var(--space-lg); margin-top: 1.1rem; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.result-banner { margin-bottom: 1rem; padding: 1.35rem 1.5rem 1.15rem; border: 1px solid #d7e8f8; border-radius: 18px; background: linear-gradient(180deg, #eef8ff 0%, #fff 78%); }
.result-banner h1 { margin: 0; font-size: 1.7rem; }
.result-banner p { margin: 0.3rem 0 0; color: var(--color-muted); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.result-card { display: flex; align-items: center; gap: 0.8rem; min-height: 84px; padding: 0.9rem 1rem; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-surface); color: inherit; text-decoration: none; }
.result-card:hover { border-color: color-mix(in srgb, var(--tone) 35%, var(--color-border)); box-shadow: var(--shadow); }
.result-card .ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--tone-soft); color: var(--tone); }
.result-card .ico .icon { width: 1.15rem; height: 1.15rem; }
.result-card strong { display: block; }
.result-card small { display: block; color: var(--color-muted); font-size: 0.82rem; }
.result-card .go { margin-left: auto; color: var(--color-muted); }
.result-card .go .icon { width: 1rem; height: 1rem; }
@media (max-width: 980px) { .result-grid { grid-template-columns: 1fr; } }
.action-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem;
    border-radius: 16px;
    background: var(--tone-soft);
    border: 1px solid color-mix(in srgb, var(--tone) 18%, transparent);
    color: var(--color-text);
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease;
}
.action-tile:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--tone) 18%, transparent); }
.action-copy strong { display: block; font-size: 0.9rem; }
.action-copy span { display: block; color: var(--color-muted); font-size: 0.75rem; line-height: 1.35; }

.gender-bar { display: flex; gap: 3px; height: 14px; border-radius: var(--radius-pill); overflow: hidden; background: var(--color-surface-2); }
.gender-bar span { display: block; background: var(--tone-grad); min-width: 4px; }
.legend { list-style: none; margin: var(--space-lg) 0 0; padding: 0; display: grid; gap: var(--space-sm); }
.legend li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: var(--color-surface-2);
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone-grad); }
.legend-label { font-weight: 600; }
.legend-pct { padding: 0.1rem 0.5rem; border-radius: var(--radius-pill); background: var(--tone-soft); color: var(--tone-ink); font-size: 0.75rem; font-weight: 700; }

.person-list { display: grid; gap: var(--space-sm); }
.person-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-md);
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    min-height: 68px;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.person-row:hover { border-color: color-mix(in srgb, var(--color-primary) 45%, transparent); box-shadow: var(--shadow-card); }
.person-copy { min-width: 0; }
.person-copy strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.25rem 0; }
.person-meta { display: flex; align-items: center; gap: 0.3rem; color: var(--color-muted); font-size: var(--text-small); min-width: 0; }
.person-meta .icon { width: 0.9rem; height: 0.9rem; }
.person-action { display: inline-flex; align-items: center; gap: 0.1rem; font-size: var(--text-small); font-weight: 700; color: var(--color-primary); }
.person-action .icon { width: 1.05rem; height: 1.05rem; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin: 0; }
.info-item { padding: 0.65rem 0.8rem; border-radius: 12px; background: var(--color-surface-2); min-width: 0; }
.info-item dt { color: var(--color-muted); font-size: 0.75rem; font-weight: 600; }
.info-item dd { margin: 0.1rem 0 0; font-weight: 650; overflow-wrap: anywhere; }

.soon-list { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.soon-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-pill);
    border: 1px dashed var(--color-border);
    color: var(--color-muted);
    font-size: var(--text-small);
    font-weight: 600;
    cursor: not-allowed;
}
.soon-item .icon { width: 1rem; height: 1rem; }

.bulk-error-list {
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.2rem;
    font-size: 0.88rem;
}
.bulk-ref-list {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Tables */
.student-pin-delete {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
}
.student-pin-delete .student-pin-field {
    margin-bottom: 0;
    min-width: 8.5rem;
}
.student-pin-delete .student-pin-field input,
.student-delete-pin-highlight input {
    width: 100%;
    max-width: 12rem;
    letter-spacing: 0.22em;
    font-weight: 700;
    text-align: center;
}
.student-pin-hint { margin: 0.35rem 0 0; font-size: var(--text-small); }
.student-bulk-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-small);
    font-weight: 650;
    margin-right: auto;
}
body.student-delete-modal-open { overflow: hidden; }
.student-delete-modal[hidden] { display: none !important; }
.student-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.student-delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.student-delete-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 28rem);
    padding: 1.25rem 1.35rem 1.35rem;
    border-radius: 18px;
    background: var(--color-surface);
    border: 2px solid color-mix(in srgb, #e11d48 55%, var(--color-border));
    box-shadow:
        0 0 0 4px color-mix(in srgb, #e11d48 18%, transparent),
        0 22px 48px rgba(15, 23, 42, 0.28);
    animation: student-delete-pop 0.18s ease-out;
}
@keyframes student-delete-pop {
    from { transform: translateY(8px) scale(0.98); opacity: 0.6; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.student-delete-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.student-delete-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #be123c;
}
.student-delete-modal-x {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}
.student-delete-modal-warning {
    margin: 0 0 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: color-mix(in srgb, #e11d48 10%, var(--color-surface));
    border: 1px solid color-mix(in srgb, #e11d48 28%, var(--color-border));
    color: var(--color-text);
    font-weight: 600;
}
.student-delete-modal-count {
    margin: 0 0 0.85rem;
    font-weight: 700;
    color: var(--color-muted);
}
.student-delete-pin-highlight {
    margin-bottom: 0.35rem;
    padding: 0.85rem;
    border-radius: 14px;
    background: color-mix(in srgb, #f59e0b 14%, var(--color-surface));
    border: 2px dashed color-mix(in srgb, #f59e0b 55%, var(--color-border));
}
.student-delete-pin-highlight > span:first-child {
    color: #b45309;
    font-weight: 800;
}
.student-delete-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 1rem;
}
.table-card { padding: 0; overflow: hidden; }
/* Keep section titles clear of the rounded overflow edge */
.table-card > .card-title,
.table-card > .card-head {
    margin-bottom: 0;
    padding: 1.1rem 1.15rem 0.9rem;
}
.table-card > .card-head .card-title { margin-bottom: 0; }
.table-card > .table-tools {
    margin-bottom: 0;
    padding: 1rem 1.15rem 0.85rem;
}
.table-card > .empty-state { padding: 2rem 1.15rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-table); }
.data-table th, .data-table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.data-table th { background: var(--color-surface-2); color: var(--color-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary) 5%, transparent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-end { text-align: right !important; }
.name-cell { display: flex; align-items: center; gap: var(--space-md); }
.name-link { color: var(--color-text); font-weight: 650; text-decoration: none; }
.name-link:hover { color: var(--color-primary); }
.contact-cell { display: flex; flex-direction: column; }
.contact-cell small { color: var(--color-muted); font-size: 0.78rem; }

/* Tiles */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.85rem; }
.tile {
    position: relative;
    overflow: hidden;
    padding: 1.15rem 1.1rem 1.05rem;
    border-radius: 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--tone-grad); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-raised); }
.tile.is-current {
    border-color: color-mix(in srgb, var(--tone) 45%, transparent);
    background: linear-gradient(180deg, var(--tone-soft), var(--color-surface) 70%);
}
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: 0.8rem; }
.tile-title { margin: 0; font-size: 1.15rem; font-weight: 750; letter-spacing: -0.01em; }
.tile-sub { margin: 0.2rem 0 0; color: var(--color-muted); font-size: var(--text-small); }
.tile-number { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 0.4rem; border-radius: 50%; background: var(--tone-soft); color: var(--tone-ink); font-weight: 800; }
.tile-meta { margin: 0.75rem 0 0; display: grid; gap: 0.35rem; }
.tile-meta div { display: flex; justify-content: space-between; gap: var(--space-md); padding: 0.45rem 0.65rem; border-radius: 10px; background: var(--color-surface-2); }
.tile-meta dt { color: var(--color-muted); font-size: var(--text-small); }
.tile-meta dd { margin: 0; font-size: var(--text-small); font-weight: 650; text-align: right; overflow-wrap: anywhere; }

/* Student profile */
.profile-hero { display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem; margin-bottom: var(--space-lg); }
.profile-hero .avatar.lg { background: #fff; color: #4f46e5; border: 4px solid rgba(255, 255, 255, 0.35); background-clip: padding-box; box-shadow: 0 10px 24px rgba(30, 27, 75, 0.25); }
.profile-hero-copy { min-width: 0; }
.profile-hero h2 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.profile-hero p { margin: 0.25rem 0 0; color: rgba(255, 255, 255, 0.88); }
.profile-hero .hero-chips { margin-top: var(--space-md); }

.lookup-query { margin: 0 0 0.85rem; }
.lookup-board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
.lookup-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    padding: 1rem 1.05rem 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}
.lookup-card-head { display: flex; align-items: center; gap: 0.6rem; }
.lookup-card-head h2 { margin: 0; font-size: 1.05rem; }
.lookup-person { display: flex; align-items: center; gap: 0.8rem; }
.lookup-name { display: block; font-size: 1.15rem; }
.lookup-sub { display: block; color: var(--color-muted); font-size: 0.88rem; }
.lookup-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.75rem; margin: 0; }
.lookup-facts div { min-width: 0; }
.lookup-facts dt { color: var(--color-muted); font-size: 0.75rem; }
.lookup-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.lookup-invoice { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: 0.02em; }
.lookup-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: auto; }
.lookup-today { margin: 0; }
.lookup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.45rem; }
.lookup-stats div {
    padding: 0.65rem 0.4rem;
    border-radius: 12px;
    text-align: center;
    background: color-mix(in srgb, var(--color-border) 55%, transparent);
}
.lookup-stats strong { display: block; font-size: 1.25rem; }
.lookup-stats span { color: var(--color-muted); font-size: 0.75rem; }
.lookup-table { font-size: 0.88rem; }
.lookup-card .btn { align-self: flex-start; margin-top: auto; }
@media (min-width: 760px) {
    .lookup-board { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
    .lookup-board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; margin-bottom: var(--space-lg); }
.fact {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    min-width: 0;
}
.fact .ico { width: 36px; height: 36px; border-radius: 11px; }
.fact .ico .icon { width: 1.05rem; height: 1.05rem; }
.fact-copy { min-width: 0; }
.fact-label { display: block; color: var(--color-muted); font-size: 0.72rem; font-weight: 600; }
.fact-value { display: block; font-weight: 700; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profile-grid { display: grid; gap: var(--space-md); }
.profile-col { display: grid; gap: var(--space-md); align-content: start; min-width: 0; }
.fold {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 0 1.1rem 0.9rem;
}
.fold:not([open]) { padding-bottom: 0; }
.fold summary { min-height: 60px; display: flex; align-items: center; gap: 0.7rem; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after {
    content: "";
    margin-left: auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--color-muted);
    border-bottom: 2px solid var(--color-muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform 0.15s ease;
}
.fold[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.finance-table { overflow-x: auto; }
.finance-years { margin-top: 0.85rem; }
.fold .finance-years > summary {
    pointer-events: auto;
    min-height: 0;
    width: fit-content;
    margin-top: 0.85rem;
}
.fold .finance-years > summary::after { display: none; }
.fold summary h2 {
    margin: 0;
    font-size: var(--text-section);
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: -0.015em;
}
.meta-list { margin: 0; }
.meta-row { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-md); padding: 0.6rem 0; border-top: 1px solid var(--color-border); }
.meta-row dt { color: var(--color-muted); font-size: 0.85rem; }
.meta-row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.sub-title { margin: var(--space-md) 0 var(--space-sm); color: var(--color-muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: 0.4rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--color-border); }
.timeline-item { position: relative; margin-bottom: var(--space-md); }
.timeline-dot { position: absolute; left: -1.3rem; top: 1rem; width: 12px; height: 12px; border-radius: 50%; background: var(--grad-brand); box-shadow: 0 0 0 3px var(--color-surface); }
.timeline-body { padding: 0.8rem 0.9rem; border-radius: 14px; background: var(--color-surface-2); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: var(--space-sm); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--space-sm); margin: 0; }
.mini-grid dt { color: var(--color-muted); font-size: 0.72rem; }
.mini-grid dd { margin: 0; font-weight: 650; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-md); margin-top: var(--space-lg); color: var(--color-muted); font-size: var(--text-small); }
.pager p { margin: 0; }
.pager b { color: var(--color-text); }
.pager-links { display: flex; gap: 0.4rem; align-items: center; }
.page-step {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 650;
    text-decoration: none;
}
a.page-step:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-step.is-off { opacity: 0.45; }
.page-now { padding: 0.5rem 0.9rem; border-radius: var(--radius-pill); background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }

/* App shell: mobile first */
.only-desktop { display: none; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar, .topbar { display: none; }
.workspace-main {
    flex: 1;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-lg) calc(var(--tabbar-height) + 2.25rem + env(safe-area-inset-bottom));
}

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: calc(0.65rem + env(safe-area-inset-top)) 0.9rem 0.75rem;
    background: var(--grad-brand);
    color: #fff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}
.app-bar-btn, .app-bar-mark, .app-bar-logo, .app-bar-profile {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}
.app-bar-logo img,
.app-bar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.app-bar-title { min-width: 0; text-align: left; }
.app-bar-school-label {
    margin: 0 0 0.1rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}
.app-bar-title h1 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(15, 23, 42, 0.18);
}
.app-bar-title h1 a {
    color: inherit;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-bar-title span { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.app-bar-avatar { width: 44px; height: 44px; background: rgba(255, 255, 255, 0.2); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.app-bar-end { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; min-width: 0; }
.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.55rem;
    border-radius: 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    line-height: 1;
}
.lang-toggle:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.lang-toggle-badge { display: block; }
.mobile-header .lang-toggle,
.lang-toggle-compact {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}
.mobile-header .lang-toggle:hover,
.lang-toggle-compact:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}
.appearance-tools .lang-toggle {
    height: 42px;
}
.mobile-tools .lang-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
}
html[lang="bn"] {
    --font-sans: var(--font-bn);
}
html[lang="bn"] body,
html[lang="bn"] .app-shell {
    font-family: var(--font-bn);
}
html[lang="bn"] [data-notepad-body],
html[lang="bn"] .school-pad-body,
html[lang="bn"] .edusou-ai,
html[lang="bn"] .edusou-bot {
    font-family: var(--font-bn);
}
.appearance-tools { display: inline-flex; align-items: center; gap: 0.45rem; }
.mobile-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem 0.2rem;
}
.mobile-tools-start,
.mobile-tools-end {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.mobile-tools-end {
    flex: 1;
    justify-content: flex-end;
}
.mobile-tools .mobile-search {
    flex: 1;
    max-width: 12.5rem;
    min-width: 0;
}
.mobile-tools .mobile-search input {
    height: 40px;
    padding: 0 2.4rem 0 2.1rem;
    font-size: 0.82rem;
    border-radius: 12px;
}
.mobile-tools .mobile-search .icon { left: 0.65rem; width: 0.95rem; height: 0.95rem; }
.mobile-tools .topbar-scan {
    width: 34px;
    height: 34px;
    right: 0.25rem;
}
.mobile-tools .edusou-ai-launch {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    padding: 0;
}
.mobile-tools .mobile-dash-style > summary {
    list-style: none;
    cursor: pointer;
}
.mobile-tools .mobile-dash-style > summary::-webkit-details-marker { display: none; }
.mobile-tools .mobile-dash-style .tool-panel {
    left: 0;
    right: auto;
    width: min(16rem, calc(100vw - 2rem));
}
.mobile-shortcut-strip { margin: 0.85rem 0 1rem; }
.mobile-shortcut-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.mobile-shortcut-head h2 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.mobile-shortcut-head a {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.mobile-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: 0.4rem;
}
.mobile-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    min-height: 4.4rem;
    padding: 0.45rem 0.15rem;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 650;
    text-align: center;
    line-height: 1.15;
}
.mobile-shortcut .ico {
    width: 30px;
    height: 30px;
    border-radius: 10px;
}
.mobile-shortcut .ico .icon { width: 0.9rem; height: 0.9rem; }
.mobile-shortcut span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    padding: 0 0.1rem;
}
.mobile-shortcut.is-empty {
    border-style: dashed;
    color: var(--color-muted);
    opacity: 0.85;
}
.exams-hub-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.15rem 0 1rem;
}
.exams-hub-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    min-height: 5rem;
    padding: 0.65rem 0.25rem 0.55rem;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}
.exams-hub-tile .ico {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--tone-soft);
    color: var(--tone);
}
.exams-hub-tile .ico .icon { width: 1rem; height: 1rem; }
.exams-hub-tile > span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    padding: 0 0.1rem;
}
@media (max-width: 1023px) {
    body:has(.exams-hub-grid) .page-header .page-description { display: none; }
}
.sheet-id {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-primary);
}
.sheet-password {
    margin-top: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface-2);
    padding: 0.15rem 0.85rem 0.85rem;
}
.sheet-password > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.75rem 0;
    font-weight: 700;
}
.sheet-password > summary::-webkit-details-marker { display: none; }
.sheet-password-form { display: grid; gap: 0.55rem; }
.sheet-password-form .btn { width: 100%; }
.sheet-tile-wide { margin-top: 0.75rem; }
.sheet-empty { margin: 0.35rem 0 0; color: var(--color-muted); font-size: 0.85rem; }
.mobile-tools .appearance-tools { gap: 0.4rem; }
.mobile-tools .note-bell.tool-icon,
.mobile-tools a.note-bell.tool-icon,
.mobile-tools button.note-bell.tool-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    padding: 0;
}
.mobile-tools .note-bell .icon { width: 1.15rem; height: 1.15rem; }
.mobile-tools button.note-bell[aria-expanded="true"] {
    border-color: #6366f1;
    color: #4f46e5;
    background: var(--color-surface);
}
.note-sheet {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: min(88vh, 640px);
    padding-top: 0.45rem;
    animation: note-sheet-in 220ms ease-out;
}
@keyframes note-sheet-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.note-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0.15rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(244, 63, 94, 0.10), transparent 55%),
        radial-gradient(100% 120% at 0% 0%, rgba(99, 102, 241, 0.10), transparent 50%);
    margin: -0.15rem -0.15rem 0;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    border-radius: 18px 18px 0 0;
}
.note-sheet-head strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.note-sheet-head small {
    display: block;
    margin-top: 0.15rem;
    color: var(--color-muted);
    font-size: 0.8rem;
}
.note-sheet-body {
    display: grid;
    gap: 0.85rem;
    overflow: auto;
    padding: 0.15rem 0.1rem;
    -webkit-overflow-scrolling: touch;
}
.note-sheet .note-item {
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
}
.note-sheet .note-item-title strong { font-size: 0.94rem; }
.note-sheet .note-item-sub,
.note-sheet .note-item-preview { font-size: 0.82rem; }
.note-sheet .note-empty { padding: 2rem 1rem 1.5rem; }
.note-sheet-foot {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--color-border);
}
.note-sheet-foot .btn { width: 100%; min-height: 2.55rem; justify-content: center; }
@media (min-width: 420px) {
    .note-sheet-foot {
        grid-template-columns: 1fr 1fr;
    }
}
html[data-theme="dark"] .note-sheet-head {
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(244, 63, 94, 0.16), transparent 55%),
        radial-gradient(100% 120% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 50%);
}
.appearance-tools.is-icon-only .tool-icon,
.mobile-tools .tool-icon,
.mobile-tools .visit-link.icon-only {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    box-shadow: none;
}
.appearance-tools.is-icon-only .net-status { gap: 0; }
.appearance-tools.is-icon-only .theme-toggle { width: 40px; gap: 0; }
.appearance-tools.is-icon-only .net-log .icon,
.mobile-tools .visit-link .icon,
.appearance-tools.is-icon-only .theme-toggle .icon { width: 1.15rem; height: 1.15rem; }
.sheet-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.sheet-grid-modules { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 420px) {
    .sheet-grid-modules { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.net-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}
.net-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.net-status.is-offline { color: var(--color-warning); }
.net-status.is-offline .net-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.net-status.is-syncing .net-dot { background: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.net-log {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}
.net-log:hover { background: var(--color-surface-2); }
.net-left {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 0.7rem;
    border: 1px solid #fdba74;
    border-radius: 12px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}
.net-left.is-low {
    background: #fff1f2;
    color: #be123c;
    border-color: #fb7185;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
}
.net-left.is-ended {
    background: #e11d48;
    color: #fff;
    border-color: #be123c;
}
.status-live {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--color-success-soft);
    color: var(--color-success);
    font-size: 0.78rem;
    font-weight: 750;
}
.sync-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    max-width: min(24rem, calc(100vw - 2rem));
    box-shadow: var(--shadow-raised);
}

.tabbar {
    position: fixed;
    left: 0.6rem;
    right: 0.6rem;
    bottom: calc(0.6rem + env(safe-area-inset-bottom));
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: var(--tabbar-height);
    padding: 0.35rem;
    border-radius: 22px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 12px 32px rgba(26, 29, 58, 0.16);
}
.tabbar a, .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-height: 54px;
    padding: 0.15rem 0.1rem;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.58rem;
    font-weight: 650;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
}
.tab-ico { display: grid; place-items: center; width: 40px; height: 28px; border-radius: var(--radius-pill); transition: background 0.15s ease; }
.tab-ico .icon { width: 1.2rem; height: 1.2rem; }
.tabbar .active { color: var(--color-primary); }
.tabbar .active .tab-ico { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35); }

.more-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    max-height: 86vh;
    overflow-y: auto;
    padding: 0.6rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
    background: var(--color-surface);
    box-shadow: var(--shadow-pop);
}
.more-panel.mobile-sidebar {
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    max-height: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: calc(0.75rem + env(safe-area-inset-top)) 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    border-radius: 0 22px 22px 0;
    background: var(--grad-side);
    color: #e0e7ff;
    box-shadow: 12px 0 36px rgba(15, 17, 40, 0.35);
    overflow: hidden;
}
.mobile-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.15rem 0.2rem 0.85rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-sidebar-logo,
.mobile-sidebar-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 13px;
    object-fit: cover;
}
.mobile-sidebar-mark {
    display: grid;
    place-items: center;
    background: var(--grad-brand);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}
.mobile-sidebar-copy {
    min-width: 0;
    flex: 1;
}
.mobile-sidebar-copy strong {
    display: block;
    color: #fff;
    font-size: 0.98rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-sidebar-copy span {
    display: block;
    color: rgba(224, 231, 255, 0.65);
    font-size: 0.72rem;
}
.mobile-sidebar-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #c7d2fe;
    cursor: pointer;
    padding: 0;
}
.mobile-sidebar-close:hover { background: rgba(255, 255, 255, 0.16); }
.mobile-sidebar-close .icon { width: 1.05rem; height: 1.05rem; }
.mobile-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    overflow-y: auto;
    margin: 0 -0.2rem;
    padding: 0 0.2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.mobile-sidebar .sheet-empty { color: rgba(199, 210, 254, 0.7); }
.mobile-sidebar .app-credit { color: rgba(199, 210, 254, 0.45); margin-top: 0.5rem; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 7; background: rgba(15, 17, 40, 0.45); backdrop-filter: blur(2px); }
.sheet-handle { width: 42px; height: 5px; margin: 0.2rem auto 0.9rem; border-radius: var(--radius-pill); background: var(--color-border); }
.sheet-account { display: flex; align-items: center; gap: var(--space-md); padding: 0.8rem; border-radius: 16px; background: var(--color-primary-soft); }
.sheet-account strong { display: block; }
.sheet-account div span { display: block; color: var(--color-muted); font-size: var(--text-small); }
.sheet-title { margin: 1rem 0 0.5rem; color: var(--color-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.sheet-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 0.3rem;
    border-radius: 16px;
    background: var(--color-surface-2);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 650;
    text-align: center;
}
.sheet-tile .ico { width: 42px; height: 42px; }
.sheet-tile.is-soon { opacity: 0.55; cursor: not-allowed; }
.sheet-tile.is-soon .ico { background: var(--color-surface); color: var(--color-muted); box-shadow: none; border: 1px dashed var(--color-border); }
.sheet-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    margin-top: 1rem;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--color-danger) 30%, transparent);
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-weight: 700;
    cursor: pointer;
}

/* Desktop sidebar */
.sidebar {
    position: sticky;
    top: 0;
    flex-direction: column;
    flex: 0 0 auto;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 1rem 0.8rem 0.8rem;
    background: var(--grad-side);
    color: #e0e7ff;
    transition: width 0.2s ease;
}
.brand { display: flex; gap: 0.7rem; align-items: center; padding: 0.2rem 0.35rem 1rem; margin-bottom: 0.25rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--grad-brand);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(219, 39, 119, 0.35);
}
.brand-logos {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.brand-logo {
    display: block;
    max-height: 48px;
    max-width: min(168px, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
}
.brand-logo.is-sidebar { display: block; }
.brand-copy { flex: 1; min-width: 0; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { color: #fff; font-size: 1.08rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { color: rgba(224, 231, 255, 0.65); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-toggle { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.08); color: #c7d2fe; cursor: pointer; }
.side-toggle:hover { background: rgba(255, 255, 255, 0.16); }
.side-toggle .icon { width: 1.1rem; height: 1.1rem; }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 0.12rem; overflow-y: auto; margin: 0 -0.3rem; padding: 0 0.3rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
.nav-section { margin: 0.9rem 0.6rem 0.35rem; color: rgba(199, 210, 254, 0.5); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 42px;
    padding: 0.3rem 0.5rem;
    border-radius: 12px;
    color: rgba(224, 231, 255, 0.82);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 550;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; background: rgba(255, 255, 255, 0.07); color: var(--tone-a); }
.nav-ico .icon { width: 1.05rem; height: 1.05rem; }
a.nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-link.active { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 700; }
.nav-link.active::before { content: ""; position: absolute; left: -0.3rem; top: 25%; bottom: 25%; width: 3px; border-radius: 3px; background: var(--tone-a); }
.nav-link.active .nav-ico { background: var(--tone-grad); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--tone) 45%, transparent); }
.nav-group { display: flex; flex-direction: column; }
.nav-group > summary { list-style: none; cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
summary.nav-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-caret { display: grid; place-items: center; margin-left: auto; width: 1rem; height: 1rem; color: rgba(199, 210, 254, 0.7); transition: transform 0.15s ease; }
.nav-caret .icon { width: 0.95rem; height: 0.95rem; }
.nav-group[open] > summary .nav-caret { transform: rotate(90deg); }
.nav-branch { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.nav-branch > a.nav-link { grid-column: 1; grid-row: 1; }
.nav-branch > details { display: contents; }
.nav-branch-toggle { grid-column: 2; grid-row: 1; display: grid; place-items: center; width: 1.75rem; height: 2rem; margin-right: 0.15rem; border-radius: 8px; list-style: none; cursor: pointer; color: rgba(199, 210, 254, 0.7); }
.nav-branch-toggle::-webkit-details-marker { display: none; }
.nav-branch-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-branch > details > .nav-sub { grid-column: 1 / -1; grid-row: 2; }
.nav-branch > details:not([open]) > .nav-sub { display: none; }
.nav-branch > details[open] > .nav-branch-toggle .nav-caret { transform: rotate(90deg); }
.nav-group:not([open]) > .nav-sub { display: none; }
.nav-sub { display: flex; flex-direction: column; gap: 0.08rem; margin: 0.15rem 0 0.35rem 1.35rem; padding-left: 0.55rem; border-left: 1px solid rgba(255, 255, 255, 0.12); }
.nav-sub .nav-link { min-height: 36px; font-size: 0.84rem; }
.nav-sub .nav-ico { width: 26px; height: 26px; border-radius: 8px; }
.nav-sub .nav-link.active::before { left: -0.7rem; }
.nav-sub .nav-group > summary.nav-link { min-height: 32px; font-size: 0.78rem; font-weight: 700; }
.nav-sub .nav-sub { margin-left: 0.75rem; }
.nav-disabled { opacity: 0.5; cursor: not-allowed; }
.nav-disabled .nav-ico { color: rgba(224, 231, 255, 0.7); }
.soon-tag { margin-left: auto; padding: 0.08rem 0.45rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.1); color: #c7d2fe; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.side-account { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.user-line { display: flex; gap: 0.6rem; align-items: center; padding: 0.55rem; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.sidebar .avatar { background: var(--tone-grad); color: #fff; border: 0; }
.user-copy { flex: 1; min-width: 0; }
.user-copy strong { display: block; color: #fff; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-credit { margin: var(--space-sm) 0 0; padding: 0 var(--space-sm); color: var(--color-muted); font-size: 0.72rem; text-align: center; }
.sidebar .app-credit { color: rgba(199, 210, 254, 0.45); }

/* Desktop topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    align-items: center;
    gap: var(--space-lg);
    min-height: var(--topbar-height);
    padding: 0.75rem 1.75rem;
    background: color-mix(in srgb, var(--color-surface) 86%, transparent);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
}
.topbar-heading { min-width: 0; }
.topbar-title { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-date { color: var(--color-muted); font-size: 0.78rem; }
.topbar-search-cluster {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 440px;
    margin-left: auto;
}
.topbar-search { position: relative; display: flex; align-items: center; flex: 1; width: 100%; max-width: none; margin-left: 0; }
.topbar-search .icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; width: 1.1rem; height: 1.1rem; }
.topbar-search input {
    width: 100%;
    min-height: 42px;
    padding: 0 5.2rem 0 2.6rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.topbar-search input:focus { border-color: #6366f1; background: var(--color-surface); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-sm); }
.year-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.85rem; border-radius: var(--radius-pill); background: var(--tone-soft); color: var(--tone-ink); font-size: var(--text-small); font-weight: 700; white-space: nowrap; }
.year-chip .icon { width: 1rem; height: 1rem; }
.year-chip-label { display: none; max-width: 8.5rem; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: relative; }
.user-menu summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.8rem 0.25rem 0.25rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    list-style: none;
}
.user-menu summary:hover { border-color: color-mix(in srgb, var(--color-primary) 40%, transparent); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .avatar { width: 36px; height: 36px; }
.user-menu-name strong { display: block; font-size: 0.85rem; line-height: 1.2; max-width: 12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-name small { display: block; color: var(--color-muted); font-size: 0.72rem; }
.user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 10;
    min-width: 250px;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
}
.user-menu-role { margin: 0; font-weight: 700; }
.user-menu-mail { margin: 0.15rem 0 0; color: var(--color-muted); font-size: var(--text-small); overflow-wrap: anywhere; }
.user-menu-links {
    display: grid;
    gap: 0.2rem;
    margin: 0.75rem 0 0;
}
.user-menu-links a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    border-radius: 12px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
}
.user-menu-links a:hover,
.user-menu-links a.is-active {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}
.user-menu-links .icon { width: 1.05rem; height: 1.05rem; }
.user-menu-panel form { margin-top: var(--space-md); }
.user-menu-panel .btn { width: 100%; }
.support-panel { min-width: 220px; padding: 0.75rem; }
.support-panel-head {
    margin: 0 0 0.45rem;
    padding: 0 0.35rem 0.45rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.support-links { display: grid; gap: 0.2rem; }
.support-links a,
.support-links button,
.support-links .is-disabled {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.7rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}
.support-links a:hover,
.support-links button:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.support-links .is-disabled { opacity: 0.45; cursor: not-allowed; }
.support-links .icon { width: 1.05rem; height: 1.05rem; }
.support-tutorial-layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
    align-items: start;
}
.support-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}
.support-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.support-video-grid {
    display: grid;
    gap: 0.75rem;
    max-height: 70vh;
    overflow: auto;
}
.support-video-card {
    display: grid;
    grid-template-columns: 118px 1fr;
    gap: 0.7rem;
    align-items: center;
    padding: 0.45rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-surface);
}
.support-video-card img {
    width: 118px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--color-surface-2);
}
.support-video-card strong,
.support-video-card small { display: block; }
.support-video-card small { color: var(--color-muted); margin-top: 0.2rem; }
.support-video-card:hover,
.support-video-card.is-active {
    border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
    background: var(--color-primary-soft);
}
@media (max-width: 960px) {
    .support-tutorial-layout { grid-template-columns: 1fr; }
}
.seat-token-preview-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.seat-token-preview-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.seat-token-preview-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.seat-token {
    border: 1.5px solid #0f4c81;
    border-radius: 14px;
    overflow: hidden;
    background: var(--color-surface);
}
.seat-token header {
    background: linear-gradient(135deg, #0f4c81, #1f6fb2);
    color: #fff;
    padding: 0.7rem 0.85rem;
}
.seat-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.seat-head-logo {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.15rem;
    flex: 0 0 auto;
}
.seat-head-copy {
    min-width: 0;
    flex: 1;
    text-align: center;
}
.seat-token header strong { display: block; font-size: 0.92rem; }
.seat-token header span {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.92;
}
.seat-exam {
    margin: 0.55rem 0.8rem 0;
    text-align: center;
    color: #1f6fb2;
    font-weight: 700;
    font-size: 0.82rem;
}
.seat-center {
    margin: 0.25rem 0.8rem 0;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.78rem;
}
.seat-center strong { color: #0f4c81; }
.seat-body { display: flex; gap: 0.7rem; padding: 0.8rem; align-items: center; }
.seat-photo {
    width: 64px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}
.seat-photo img { width: 100%; height: 100%; object-fit: cover; }
.seat-photo span { font-size: 0.68rem; color: var(--color-muted); text-align: center; padding: 0.3rem; }
.seat-meta { min-width: 0; flex: 1; }
.seat-pill {
    display: inline-block;
    min-width: 46%;
    margin: 0 2% 0.4rem 0;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    vertical-align: top;
}
.seat-pill small { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.seat-pill strong { display: block; font-size: 1.15rem; line-height: 1.15; margin-top: 0.15rem; }
.seat-class { background: #e8f3ff; color: #0f4c81; }
.seat-roll { background: #fff1d6; color: #8a4b00; border: 1px solid #f0c36a; }
.seat-id { background: #e8f8f0; color: #0f6b4a; border: 1px solid #9ad7bb; min-width: 96%; margin-right: 0; }
.seat-id strong { font-size: 1rem; }
.seat-name { margin: 0.25rem 0 0; font-weight: 750; }
.seat-sub { margin: 0.15rem 0 0; color: var(--color-muted); font-size: 0.78rem; }
@media (max-width: 960px) {
    .seat-token-preview-grid { grid-template-columns: 1fr; }
}
.sheet-account-links {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.9rem;
}
.sheet-account-links a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: var(--color-surface-2);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 650;
}
.sheet-account-links a:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.sheet-account-links .icon { width: 1.1rem; height: 1.1rem; }

html.sidebar-collapsed { --sidebar-width: var(--sidebar-collapsed); }
html.sidebar-collapsed .brand { flex-direction: column; gap: 0.6rem; }
html.sidebar-collapsed .brand-logos { justify-content: center; flex: 0 0 auto; }
html.sidebar-collapsed .brand-logo { max-width: 40px; max-height: 40px; }
html.sidebar-collapsed .brand-copy,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .nav-caret,
html.sidebar-collapsed .nav-sub,
html.sidebar-collapsed .soon-tag,
html.sidebar-collapsed .user-copy,
html.sidebar-collapsed .sidebar .app-credit { display: none; }
html.sidebar-collapsed .nav-section { height: 1px; margin: 0.6rem 0.5rem; font-size: 0; background: rgba(255, 255, 255, 0.1); }
html.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 0; }
html.sidebar-collapsed .user-line { flex-direction: column; }

/* Welcome */
.welcome-screen { min-height: 70vh; display: grid; place-items: center; padding: var(--space-xl) var(--space-lg); }
.welcome-card {
    width: min(100%, 440px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: 2.5rem 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-raised);
}
.welcome-card .login-mark { width: 56px; height: 56px; border-radius: 16px; font-size: 1.4rem; background: var(--grad-brand); color: #fff; }
.welcome-card h1 { margin: 0; font-size: 2rem; letter-spacing: -0.02em; }
.welcome-card .page-description { margin: 0; }
.welcome-card .btn { min-width: 12rem; min-height: 48px; }

.school-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}
.school-menu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: var(--space-sm);
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-md));
}
.school-menu a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--text-small);
    font-weight: 650;
}
.school-menu a .icon { width: 1rem; height: 1rem; }
.school-menu a.active { background: var(--grad-brand); color: #fff; }
.school-menu a:hover:not(.active) { background: var(--color-surface-2); }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--space-lg); }
.choice-row a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--text-small);
    font-weight: 650;
}
.choice-row a.active { background: var(--grad-brand); color: #fff; border-color: transparent; }
.field .choice-row { margin-bottom: 0; gap: 0.75rem; }
.choice {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-surface-2);
    font-weight: 650;
    cursor: pointer;
}
.choice input { width: 1rem; height: 1rem; }

@media (max-width: 1023px) {
    .school-layout { grid-template-columns: 1fr; }
    .school-menu { flex-direction: row; overflow-x: auto; position: static; }
    .school-menu a { flex: 0 0 auto; }
}

/* Login */
.login-screen { min-height: 100vh; display: grid; }
.login-brand {
    display: none;
    padding: var(--space-2xl);
    background: var(--color-primary);
    color: #f6f3ec;
}
.login-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: rgba(255,255,255,0.14); font-weight: 750; }
.login-logo {
    display: block;
    max-height: 56px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.login-logo-mobile {
    max-height: 64px;
    max-width: 200px;
    margin-bottom: var(--space-sm);
}
.login-brand h1 { font-size: 2.2rem; line-height: 1.15; margin: var(--space-xl) 0 var(--space-md); max-width: 12ch; }
.login-brand p { max-width: 34ch; color: rgba(246, 243, 236, 0.82); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: var(--space-xl) var(--space-lg); }
.login-card { width: min(100%, 420px); }
.login-card-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    margin: 0 0 var(--space-lg);
}
.login-card-logo {
    display: block;
    max-height: 72px;
    max-width: min(240px, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}
.login-card-intro { text-align: center; }
.login-card-intro .page-description { margin-left: auto; margin-right: auto; }
.login-card h2 { margin: 0 0 var(--space-sm); font-size: var(--text-title); }
.login-mark.on-solid { background: var(--color-primary); color: #fff; }
.login-orb, .login-brand-top, .login-eyebrow, .login-features, .login-brand-foot, .login-welcome { display: none; }
.login-card .btn { width: 100%; min-height: 48px; }

@media (min-width: 640px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .action-grid { grid-template-columns: repeat(3, 1fr); }
    .fact-grid { grid-template-columns: repeat(4, 1fr); }
    .info-grid { grid-template-columns: repeat(3, 1fr); }
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
    .domain-fact-list {
        grid-template-columns: 1fr 1fr;
    }
    .domain-fact-list .domain-fact-wide {
        grid-column: 1 / -1;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .workspace-main { padding-inline: var(--space-xl); }
}
@media (max-width: 1023px) {
    .crumbs { display: none; }
    .page-head { gap: var(--space-md); align-items: flex-start; flex-wrap: wrap; }
    .page-actions { width: 100%; }
    .page-actions .btn { width: 100%; min-height: 46px; }
    .filter-actions { flex-direction: column; }
    .filter-actions .btn { width: 100%; }
    .page-head .ico.lg { width: 44px; height: 44px; border-radius: 14px; }
    .page-title { font-size: 1.3rem; }
    .page-description { font-size: var(--text-small); }

    /* Custom Domain mobile */
    .domain-list {
        padding: 0;
        overflow: hidden;
    }
    .domain-list > .table-tools {
        padding: 0.95rem 1rem 0;
    }
    .domain-list .table-tools + * {
        margin-inline: 0;
    }
    .domain-mobile-list {
        padding: 0.15rem 0.85rem 1rem;
        gap: 0.75rem;
    }
    .domain-mobile-card {
        padding: 1rem 0.95rem 0.95rem;
        border-radius: 16px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }
    .domain-mobile-title {
        font-size: 1.12rem;
    }
    .domain-show {
        gap: 0.75rem;
    }
    .domain-show-chips {
        margin-inline: calc(var(--space-lg) * -1);
        padding-inline: var(--space-lg);
    }
    .domain-show-card {
        border-radius: 16px;
        padding: 1rem 0.95rem 1.05rem;
    }
    .domain-fact-list > div {
        padding: 0.75rem 0.8rem;
    }
    .domain-show-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .domain-show-actions .btn,
    .domain-show-actions form,
    .domain-show-actions form .btn {
        width: 100%;
    }
    .domain-show-actions .btn {
        min-height: 48px;
        justify-content: center;
    }
    .domain-pin-clear {
        width: 100%;
        justify-content: flex-start;
        padding: 0.35rem 0.15rem;
    }
    .domain-pin-display {
        font-size: 1.7rem;
        letter-spacing: 0.28em;
        padding: 1rem;
    }
    .domain-show-form .field input {
        min-height: 50px;
        font-size: 1rem;
    }
    .summary-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--space-lg) * -1); padding: 0.1rem var(--space-lg) 0.3rem; scrollbar-width: none; }
    .summary-chips::-webkit-scrollbar { display: none; }
    .summary-chip { flex: 0 0 auto; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .search-box { flex: 0 0 auto; }
    .toolbar .summary-chips { margin-inline: calc(var(--space-lg) * -1); }
    .search-box { flex-wrap: nowrap; }
    .search-box .btn { flex: 0 0 auto; padding-inline: 1rem; }
    .pager { flex-direction: column; align-items: stretch; text-align: center; }
    .pager-links { justify-content: space-between; }
    .profile-hero { flex-direction: column; text-align: center; padding: 1.5rem 1.1rem; }
    .profile-hero .avatar.lg,
    .profile-hero .student-profile-photo {
        width: 140px;
        height: 140px;
        font-size: 2.4rem;
        border-width: 4px;
    }
    .profile-hero .hero-chips { justify-content: center; }
    .hero-stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
    .hero-stat-value { font-size: 1.9rem; }
    .hero-stat-link { margin: 0 0 0 auto; }
    .login-screen { display: flex; flex-direction: column; }
    .login-mobile-hero {
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
        padding: calc(2.75rem + env(safe-area-inset-top)) var(--space-xl) 5.5rem;
        text-align: center;
        color: #fff;
        background: linear-gradient(150deg, #4338ca 0%, #7c3aed 50%, #db2777 100%);
        border-radius: 0 0 32px 32px;
    }
    .login-mobile-hero > *:not(.hero-orb) { position: relative; }
    .login-mobile-hero .hero-orb-a { width: 260px; height: 260px; top: -110px; right: -80px; background: radial-gradient(circle, rgba(56, 189, 248, 0.6), transparent 70%); }
    .login-mobile-hero .hero-orb-b { width: 220px; height: 220px; bottom: -90px; left: -70px; background: radial-gradient(circle, rgba(251, 191, 36, 0.5), transparent 70%); }
    .login-mobile-hero .login-mark {
        width: 64px;
        height: 64px;
        border-radius: 20px;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 10px 24px rgba(30, 27, 75, 0.25);
        margin-bottom: var(--space-sm);
    }
    .login-mobile-hero strong { font-size: 1.3rem; line-height: 1.25; letter-spacing: -0.01em; max-width: 22ch; }
    .login-mobile-hero span:not(.hero-orb) { color: rgba(255, 255, 255, 0.85); font-size: 0.95rem; }
    .login-panel {
        position: relative;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin-top: -3.5rem;
        padding: 0 var(--space-lg) calc(var(--space-xl) + env(safe-area-inset-bottom));
    }
    .login-card {
        width: min(100%, 440px);
        padding: 1.75rem 1.35rem;
        border-radius: 24px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        box-shadow: 0 20px 44px rgba(67, 56, 202, 0.16), 0 2px 6px rgba(28, 36, 48, 0.05);
    }
    /* Mobile: one logo only — in the hero (green area), not inside the card. */
    .login-card-brand { display: none; }
    .login-card h2 { font-size: 1.6rem; }
    .login-card .page-description { margin-bottom: var(--space-lg); }
    .login-card .field input { min-height: 52px; border-radius: 12px; font-size: 1rem; }
    .login-card .field input:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
    .login-card .btn {
        min-height: 54px;
        margin-top: var(--space-xs);
        border-radius: 14px;
        font-size: 1.05rem;
        background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #db2777);
        box-shadow: 0 10px 22px rgba(99, 102, 241, 0.32);
    }
    .login-card .btn:active { transform: scale(0.98); }
    .login-mobile-foot { margin: var(--space-xl) 0 0; color: var(--color-muted); font-size: var(--text-small); text-align: center; }
}
@media (min-width: 1024px) {
    .only-desktop { display: block; }
    .only-mobile { display: none !important; }
    .year-menu.only-desktop { display: block; }
    .year-chip-label { display: inline; }
    .app-shell { flex-direction: row; }
    .sidebar { display: flex; }
    .topbar { display: flex; }
    .mobile-header, .mobile-tools, .tabbar, .more-panel, .sheet-backdrop, .mobile-shortcut-strip { display: none !important; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
    .mobile-stat-grid .stat-card,
    .stat-grid.mobile-stat-grid .stat-card {
        padding: 1rem;
        border-radius: 18px;
    }
    .mobile-stat-grid .stat-top { margin-bottom: 0.7rem; }
    .mobile-stat-grid .ico { width: auto; height: auto; border-radius: inherit; }
    .mobile-stat-grid .stat-value { font-size: 1.75rem; }
    .mobile-stat-grid .stat-label { font-size: var(--text-small); }
    .mobile-stat-grid .stat-note { font-size: 0.75rem; }
    .workspace-main { width: min(100%, var(--content-max)); padding: 1.75rem; }
    .filter-grid { grid-template-columns: repeat(4, 1fr); }
    .filter-grid.allocation-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(7.5rem, 0.72fr) minmax(7.5rem, 0.72fr); }
    .filter-grid.allocation-filter-grid.is-branch { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(7.25rem, 0.62fr) minmax(7.25rem, 0.62fr); }
    .hero { grid-template-columns: 1fr auto; align-items: center; padding: 2rem 2.25rem; }
    .hero-title { font-size: 2rem; }
    .hero-stat { min-width: 220px; }
    .dash-grid { grid-template-columns: repeat(12, 1fr); }
    .dash-actions, .dash-recent { grid-column: span 7; }
    .dash-gender, .dash-account { grid-column: span 5; }
    .dash-soon { grid-column: 1 / -1; }
    .dash-account .info-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: start; }
    .profile-col { gap: var(--space-lg); }
    .profile-hero { padding: 1.75rem 2rem; }
    .profile-hero h2 { font-size: 1.85rem; }
    .fold summary { pointer-events: none; }
    .fold summary::after { display: none; }
    .meta-row { grid-template-columns: 9.5rem 1fr; }
    .login-screen {
        grid-template-columns: 1.1fr 0.9fr;
        background:
            radial-gradient(circle at 85% 10%, rgba(99, 102, 241, 0.12), transparent 40%),
            radial-gradient(circle at 70% 95%, rgba(236, 72, 153, 0.10), transparent 40%),
            var(--color-bg);
    }
    .login-brand {
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: var(--space-2xl);
        padding: 3rem 3.5rem;
        color: #fff;
        background: linear-gradient(135deg, #4338ca 0%, #6d28d9 45%, #db2777 100%);
    }
    .login-orb { display: block; position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
    .orb-a { width: 420px; height: 420px; top: -140px; right: -120px; background: radial-gradient(circle, rgba(56, 189, 248, 0.55), transparent 70%); }
    .orb-b { width: 360px; height: 360px; bottom: -120px; left: -100px; background: radial-gradient(circle, rgba(251, 191, 36, 0.45), transparent 70%); }
    .orb-c { width: 220px; height: 220px; top: 45%; right: 18%; background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%); }
    .login-brand > *:not(.login-orb) { position: relative; }
    .login-brand-top { display: flex; align-items: center; gap: var(--space-md); }
    .login-brand-name { font-weight: 750; font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.15; }
    .login-brand-name small { display: block; font-size: var(--text-small); font-weight: 500; color: rgba(255, 255, 255, 0.78); letter-spacing: 0; }
    .login-mark { background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.35); backdrop-filter: blur(6px); }
    .login-eyebrow {
        display: inline-block;
        padding: 0.3rem 0.8rem;
        border-radius: var(--radius-pill);
        background: rgba(255, 255, 255, 0.16);
        border: 1px solid rgba(255, 255, 255, 0.3);
        font-size: var(--text-small);
        font-weight: 650;
    }
    .login-brand h1 { font-size: 2.75rem; line-height: 1.1; letter-spacing: -0.03em; margin: var(--space-lg) 0 var(--space-md); max-width: 15ch; }
    .login-brand p { max-width: 42ch; color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; margin: 0; }
    .login-features { display: grid; gap: var(--space-md); list-style: none; margin: var(--space-2xl) 0 0; padding: 0; max-width: 420px; }
    .login-features li {
        display: flex;
        align-items: center;
        gap: var(--space-md);
        padding: var(--space-md) var(--space-lg);
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.22);
        backdrop-filter: blur(8px);
    }
    .login-features strong { display: block; font-size: 0.975rem; }
    .login-features li > span:last-child { color: rgba(255, 255, 255, 0.82); font-size: var(--text-small); }
    .feature-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; color: #fff; }
    .tone-blue { background: linear-gradient(135deg, #38bdf8, #2563eb); }
    .tone-amber { background: linear-gradient(135deg, #fbbf24, #f97316); }
    .tone-rose { background: linear-gradient(135deg, #f472b6, #e11d48); }
    .login-brand-foot { display: block; color: rgba(255, 255, 255, 0.7); font-size: var(--text-small); margin: 0; }
    .login-mobile-hero, .login-mobile-foot { display: none; }
    .login-panel { padding: 3rem; }
    .login-card {
        width: min(100%, 440px);
        padding: 2.75rem 2.5rem;
        border-radius: var(--radius-lg);
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        box-shadow: 0 24px 60px rgba(67, 56, 202, 0.14), 0 2px 6px rgba(28, 36, 48, 0.05);
    }
    .login-welcome {
        display: inline-block;
        margin-bottom: var(--space-sm);
        padding: 0.25rem 0.7rem;
        border-radius: var(--radius-pill);
        background: #eef2ff;
        color: #4338ca;
        font-size: var(--text-small);
        font-weight: 700;
    }
    .login-card h2 { font-size: 2rem; letter-spacing: -0.02em; }
    .login-card .page-description { margin-bottom: var(--space-xl); }
    .login-card .field input { min-height: 52px; border-radius: 12px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
    .login-card .field input:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
    .login-card .btn {
        min-height: 52px;
        margin-top: var(--space-sm);
        border-radius: 12px;
        background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #db2777);
        box-shadow: 0 10px 24px rgba(99, 102, 241, 0.3);
        font-size: 1rem;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .login-card .btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(99, 102, 241, 0.38); }
}
@media (min-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (prefers-color-scheme: dark) {
    .login-welcome { background: #312e81; color: #e0e7ff; }
    .sidebar { background: linear-gradient(180deg, #111230 0%, #1a0f3d 60%, #230b3f 100%); }
}

.saas-layout { display: grid; gap: var(--space-lg); align-items: start; }
.saas-side { display: flex; flex-direction: column; gap: 0.2rem; padding: var(--space-sm); }
.saas-side a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.72rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 650;
}
.saas-side a svg { width: 1.05rem; height: 1.05rem; flex: none; }
.saas-side a.active { background: var(--color-primary-soft); color: var(--color-primary); }
@media (min-width: 1024px) {
    .saas-layout { grid-template-columns: 250px minmax(0, 1fr); }
}
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.table-tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.table-tool-actions .table-tool-btn,
.table-tool-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: none;
    font-size: var(--text-small);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}
.table-tool-actions .table-tool-btn:hover,
.table-tool-actions .btn:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}
.table-tools-search { margin: 0; }
.table-search { min-width: min(100%, 16rem); margin: 0; }
.table-search input { min-height: 2.4rem; }
.dues-check-col { width: 2.6rem; text-align: center; }
.dues-check { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.dues-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--color-primary); }
.dues-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-2);
    font-weight: 650;
}
.dues-bulk-bar[hidden] { display: none !important; }
.fee-group-lines { display: grid; gap: 0.75rem; }
.fee-group-lines-head .card-title { margin-bottom: 0.2rem; }
.fee-group-table-wrap { overflow-x: auto; }
.fee-group-table th, .fee-group-table td { vertical-align: middle; }
.fee-group-check-col { width: 2.6rem; text-align: center; }
.fee-group-input {
    width: 100%;
    min-height: 2.2rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}
.fee-type-form { display: grid; gap: 0.55rem; }
.fee-type-table-wrap { overflow-x: auto; }
.fee-type-table th, .fee-type-table td { vertical-align: middle; }
.fee-type-table .fee-group-input { min-width: 7rem; }
.fee-type-action-col { width: 2.6rem; text-align: center; }
.fee-type-add-wrap {
    display: flex;
    justify-content: flex-start;
    padding-left: 0.15rem;
}
.fee-type-add,
.fee-type-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-primary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.fee-type-add:hover,
.fee-type-remove:hover {
    background: var(--color-primary-soft);
}
.fee-type-remove {
    color: var(--color-danger);
    font-size: 1.1rem;
}
.fee-type-remove[hidden] { display: none !important; }
.qr-layout { display: grid; gap: var(--space-lg); }
.qr-scan { position: relative; height: 240px; border-radius: var(--radius-md); background: #111; overflow: hidden; }
.qr-scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.qr-frame { position: absolute; z-index: 1; inset: 36px; border: 3px solid #fff; border-radius: 8px; pointer-events: none; }
.qr-scan p { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; margin: 0; padding: 0.55rem; text-align: center; background: #16a34a; color: #fff; font-weight: 700; }
.qr-modes { display: flex; gap: 1rem; margin-top: 0.75rem; }
.qr-confirm { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
@media (min-width: 1024px) {
    .qr-layout { grid-template-columns: 280px minmax(0, 1fr); }
    .qr-students { grid-column: 2; }
}
.campus-split { display: grid; gap: var(--space-lg); }
.folder-list { display: grid; gap: 0.45rem; }
.folder-list a.active { font-weight: 700; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 0.75rem; text-align: center; }
.month-label { font-size: 0.75rem; font-weight: 700; opacity: 0.7; }
.month-day { padding: 0.45rem 0; border-radius: 8px; }
.month-day.is-muted { opacity: 0.35; }
.month-day.is-today { outline: 2px solid #6366f1; }
.month-day.has-event { background: #eef2ff; font-weight: 700; }
.is-unread { font-weight: 700; }
@media (min-width: 1024px) {
    .campus-split { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); }
    .campus-split.mailbox { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (prefers-color-scheme: dark) {
    .month-day.has-event { background: #312e81; }
}
.page-strip { display: none; }
.topbar-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.topbar-school {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: min(42vw, 320px);
    min-width: 0;
    min-height: 42px;
    padding: 0.3rem 0.85rem 0.3rem 0.35rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #4f46e5 28%, var(--color-border));
    background: linear-gradient(135deg, color-mix(in srgb, #4f46e5 14%, var(--color-surface)), var(--color-surface));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.topbar-school-logo {
    flex: none;
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 0.15rem;
    border: 1px solid color-mix(in srgb, #4f46e5 18%, var(--color-border));
}
.topbar-school-name {
    min-width: 0;
    color: #312e81;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html[data-theme="dark"] .topbar-school {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(15, 23, 42, 0.65));
    border-color: rgba(129, 140, 248, 0.45);
}
html[data-theme="dark"] .topbar-school-name { color: #e0e7ff; }
@media (max-width: 1180px) {
    .topbar-school { max-width: min(34vw, 240px); }
    .topbar-school-name { font-size: 0.84rem; }
}
.tool-menu { position: relative; }
.tool-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.tool-button::-webkit-details-marker { display: none; }
.tool-button .icon { width: 1rem; height: 1rem; }
.tool-button:hover, .tool-menu[open] > .tool-button { border-color: #6366f1; color: #4f46e5; background: var(--color-surface); }
.tool-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 6;
    display: grid;
    gap: 0.25rem;
    min-width: 220px;
    padding: 0.4rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}
.tool-panel-wide { width: min(420px, 70vw); }
.tool-panel button {
    width: 100%;
    min-height: 38px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}
.tool-panel button:hover, .tool-panel button.is-active { background: var(--color-primary-soft); color: var(--color-primary); }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; max-height: 70vh; overflow: auto; }
.quick-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}
.quick-link:hover { background: var(--color-surface-2); }
.quick-link .ico { display: inline-flex; color: var(--tone-ink); }
.quick-link .icon { width: 1rem; height: 1rem; }
.year-chip.icon-only, .visit-link.icon-only, .tool-button.icon-only {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    justify-content: center;
    gap: 0;
}
.topbar-scan {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
}
.topbar-scan:hover,
.topbar-scan:focus-visible {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.12);
    outline: none;
}
.topbar-scan .icon {
    position: static;
    transform: none;
    width: 1.05rem;
    height: 1.05rem;
    pointer-events: auto;
    color: inherit;
}
body.barcode-scan-open {
    overflow: hidden;
}
.barcode-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.28);
    pointer-events: auto;
}
.barcode-scan-overlay[hidden] {
    display: none !important;
}
.barcode-scan-panel {
    width: min(280px, calc(100vw - 2rem));
    display: grid;
    gap: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}
.barcode-scan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.88rem;
}
.barcode-scan-head .btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    min-height: 0;
}
.barcode-scan-reader,
.barcode-scan-fallback {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    border-radius: 10px;
    background: #111;
}
.barcode-scan-reader video,
.barcode-scan-fallback video {
    width: 100% !important;
    height: 150px !important;
    object-fit: cover;
    background: #111;
    border-radius: 10px;
}
.barcode-scan-reader img {
    display: none !important;
}
.barcode-scan-frame {
    position: absolute;
    inset: 16% 14%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}
.barcode-scan-status {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
}
.chart-grid {
    display: grid;
    gap: 1rem;
    margin: 1rem 0 1.25rem;
    align-items: stretch;
}
.chart-grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    margin-top: 0 !important;
}
.chart-grid > .card > .card-head {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    min-height: 1.75rem;
    margin-bottom: 0.75rem;
}
.chart-grid > .card > .card-head .card-title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}
.chart-grid > .card > .card-head .card-hint {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
}
.chart-grid > .card > .bar-chart,
.chart-grid > .card > .line-chart {
    width: 100%;
    flex: 1 1 auto;
    min-height: 200px;
}
.chart-grid > .card > .finance-pie-stage,
.chart-grid > .card > .pie-wrap {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    min-height: 200px;
    margin: 0;
}
.chart-grid > .card > .chart-note,
.chart-grid > .card > .x-empty-state,
.chart-grid > .card > [class*="empty-state"] {
    margin-top: auto;
    padding-top: 0.35rem;
}
.line-chart { width: 100%; height: auto; }
.line-chart line { stroke: var(--color-border); stroke-width: 1; }
.line-chart polyline { fill: none; stroke: #6366f1; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.line-chart text { fill: var(--color-muted); font-size: 11px; text-anchor: middle; }
.line-chart circle { fill: #6366f1; stroke: var(--color-surface, #fff); stroke-width: 2; }
.line-chart-point[data-has-value] circle { fill: #4f46e5; }
.line-chart-value { fill: #312e81; font-size: 12px; font-weight: 700; text-anchor: middle; }
.chart-note { margin: 0.35rem 0 0; color: var(--color-muted); font-size: 0.8rem; }
.pie-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.pie { width: 148px; height: 148px; border-radius: 50%; box-shadow: inset 0 0 0 18px var(--color-surface); }
.menu-board { display: grid; gap: 1rem; }
.menu-group .card-title { margin-bottom: 0.75rem; }
.menu-subhead { margin: 0.85rem 0 0.4rem; color: var(--color-muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.menu-buttons { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.menu-buttons .action-tile { flex: 1 1 180px; max-width: 280px; }
[data-dashboard-panel][hidden] { display: none !important; }
.finance-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.55rem; margin-bottom: 0.75rem; }
.finance-bar .btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0 0.8rem; font-size: 0.84rem; }
.finance-bar .btn .icon { width: 1rem; height: 1rem; }
.finance-period { display: inline-flex; align-items: center; }
.finance-period select {
    min-height: 36px;
    padding: 0 2rem 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
    cursor: pointer;
}
.finance-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}
.finance-stat-card {
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    gap: 0.05rem;
}
.finance-stat-card .stat-top { margin-bottom: 0.35rem; }
.finance-stat-card .ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}
.finance-stat-card .ico .icon { width: 0.9rem; height: 0.9rem; }
.finance-stat-card .stat-value { font-size: 1.05rem; letter-spacing: -0.02em; }
.finance-stat-card .stat-label { font-size: 0.72rem; }
.finance-stat-card .stat-note { font-size: 0.68rem; margin-top: 0.1rem; }
.finance-stat-card::after { width: 72px; height: 72px; top: -34px; right: -28px; }
.finance-chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 0.9rem;
    align-items: stretch;
}
.finance-chart-grid > .card,
.finance-chart-grid > .card + .card {
    margin-top: 0 !important;
}
.finance-chart-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 1rem;
}
.finance-chart-card .card-title { font-size: 0.95rem; }
.finance-chart-card .card-hint { font-size: 0.72rem; }
.finance-chart-card .card-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 1.75rem;
    margin-bottom: 0.55rem;
    flex: 0 0 auto;
}
.finance-chart-card .card-head .card-title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}
.finance-chart-card .card-head .card-hint {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
}
.finance-chart-card .bar-chart,
.finance-chart-card .line-chart {
    width: 100%;
    flex: 1 1 auto;
    min-height: 180px;
}
.finance-chart-card .finance-pie-stage,
.finance-chart-card .finance-doughnut-stage {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    min-height: 180px;
}
.finance-chart-card .finance-chart-legend,
.finance-chart-card .empty-state,
.finance-chart-card .x-empty-state,
.finance-chart-card [class*="empty-state"] {
    margin-top: auto;
}
.finance-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-muted);
    font-size: 0.75rem;
    font-weight: 650;
}
.finance-chart-legend .swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.35rem;
    border-radius: 3px;
    vertical-align: -0.05rem;
}
.bar-chart { width: 100%; height: auto; }
.bar-chart line { stroke: var(--color-border); stroke-width: 1; }
.bar-chart text { fill: var(--color-muted); font-size: 10px; text-anchor: middle; }
.bar-chart-value { fill: var(--color-text); font-size: 9px; font-weight: 700; text-anchor: middle; }
.bar-chart .bar-fill.is-income { fill: #10b981; }
.bar-chart .bar-fill.is-expense { fill: #f43f5e; }
.bar-chart .bar-fill.is-students { fill: #6366f1; }
.finance-pie-wrap {
    justify-content: center;
    gap: 0.75rem;
    margin: 0;
}
.finance-pie-wrap .pie { width: 120px; height: 120px; }
.finance-pie-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.finance-pie-card .card-head { margin-bottom: 0.45rem; }
.finance-pie-stage {
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    margin: 0;
    padding: 0.15rem 0;
    min-height: 0;
}
.finance-pie-label,
.finance-pie-value,
.finance-pie-pct {
    fill: #ffffff;
    text-anchor: middle;
    paint-order: stroke;
    stroke: rgba(15, 23, 42, 0.45);
    stroke-width: 2.5px;
    stroke-linejoin: round;
}
.finance-pie-label {
    font-size: 12px;
    font-weight: 800;
}
.finance-pie-value {
    font-size: 13px;
    font-weight: 800;
}
.finance-pie-pct {
    font-size: 11px;
    font-weight: 700;
}
.finance-pie-svg {
    width: min(100%, 240px);
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
}
.finance-doughnut-svg {
    width: min(100%, 250px);
    max-width: 250px;
    aspect-ratio: 380 / 320;
    margin: 0 auto;
}
.finance-doughnut-hole { fill: var(--color-surface); }
.finance-doughnut-total,
.finance-doughnut-sub {
    text-anchor: middle;
    fill: var(--color-text);
}
.finance-doughnut-total {
    font-size: 18px;
    font-weight: 800;
}
.finance-doughnut-sub {
    font-size: 11px;
    font-weight: 650;
    fill: var(--color-muted);
}
.finance-doughnut-leader {
    stroke-width: 1.6;
    stroke-linecap: round;
    opacity: 0.9;
}
.finance-doughnut-out-label,
.finance-doughnut-out-value,
.finance-doughnut-out-pct {
    font-weight: 800;
    paint-order: stroke;
    stroke: var(--color-surface);
    stroke-width: 3px;
    stroke-linejoin: round;
}
.finance-doughnut-out-label { font-size: 11px; }
.finance-doughnut-out-value { font-size: 13px; }
.finance-doughnut-out-pct { font-size: 11px; font-weight: 700; }
@media (min-width: 640px) {
    .finance-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .finance-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finance-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .finance-bar {
        justify-content: flex-end;
        margin-bottom: 0.55rem;
        min-height: 0;
    }
}
.amount-mask { display: none; letter-spacing: 0.12em; }
.amounts-hidden .amount-mask { display: inline; }
.amounts-hidden .amount-figure { display: none; }
html.is-swapping { cursor: progress; }
html.is-swapping .workspace-main { opacity: 0.55; transition: opacity 0.15s ease; }
.topbar-actions { margin-left: auto; }
.tool-panel-end { left: auto; right: 0; }
.year-menu > summary { cursor: pointer; list-style: none; }
.year-menu > summary::-webkit-details-marker { display: none; }
.year-menu[open] > summary { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 30%, transparent); }
.year-panel { min-width: 230px; max-height: 70vh; overflow: auto; }
.year-panel form { display: grid; gap: 0.2rem; }
.year-panel-head { margin: 0 0 0.25rem; padding: 0.4rem 0.75rem 0.6rem; border-bottom: 1px solid var(--color-border); }
.year-panel-head small { display: block; color: var(--color-muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.year-panel-head strong { display: block; font-size: 0.95rem; }
.user-menu summary { padding: 0.2rem; }
.user-menu-panel { min-width: 290px; }
.user-menu-head { display: flex; align-items: center; gap: 0.7rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--color-border); }
.user-menu-head strong { display: block; font-size: 0.92rem; }
.user-menu-head small { display: block; color: var(--color-muted); font-size: 0.75rem; }
.account-list { display: grid; gap: 0.4rem; margin: 0.75rem 0 0; }
.account-list div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.82rem; }
.account-list dt { color: var(--color-muted); white-space: nowrap; }
.account-list dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.dash-calendar .card-head { flex-wrap: wrap; gap: 0.5rem; }
.cal-nav { display: flex; align-items: center; gap: 0.4rem; }
.cal-nav .btn { min-height: 34px; padding: 0 0.7rem; }
.cal-nav strong { min-width: 8.5rem; text-align: center; font-size: 0.9rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-label { padding: 0.25rem 0; color: var(--color-muted); font-size: 0.72rem; font-weight: 700; text-align: center; }
.cal-day { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 64px; padding: 0.35rem 0.4rem; border-radius: 10px; background: var(--color-surface-2); font-size: 0.8rem; }
.cal-day b { font-weight: 700; }
.cal-day small { overflow: hidden; font-size: 0.68rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.is-muted { opacity: 0.4; }
.cal-day.has-event { background: #eef2ff; color: #3730a3; }
.cal-day.is-upcoming { background: linear-gradient(135deg, #f59e0b, #f43f5e); color: #fff; box-shadow: 0 6px 16px rgba(244, 63, 94, 0.25); }
.cal-day.is-today { outline: 2px solid #6366f1; outline-offset: -2px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.75rem 0 0; padding: 0; list-style: none; color: var(--color-muted); font-size: 0.78rem; }
.cal-legend li { display: flex; align-items: center; gap: 0.35rem; }
.cal-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--color-surface-2); }
.cal-swatch.has-event { background: #c7d2fe; }
.cal-swatch.is-upcoming { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.cal-swatch.is-today { background: transparent; outline: 2px solid #6366f1; outline-offset: -2px; }
.upcoming-list { display: grid; gap: 0.5rem; }
.upcoming-item { display: grid; gap: 0.15rem; padding: 0.7rem 0.85rem; border-left: 4px solid #f59e0b; border-radius: 12px; background: color-mix(in srgb, #f59e0b 10%, transparent); color: var(--color-text); text-decoration: none; }
.upcoming-item.is-now { border-left-color: #f43f5e; background: color-mix(in srgb, #f43f5e 12%, transparent); }
a.upcoming-item:hover { filter: brightness(0.97); }
.upcoming-title { font-weight: 700; }
.upcoming-meta { color: var(--color-muted); font-size: 0.78rem; }
.tool-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 0.3rem; border-radius: 999px; background: linear-gradient(135deg, #f59e0b, #f43f5e); color: #fff; font-size: 0.72rem; }
.shortcut-panel { gap: 0.5rem; }
.shortcut-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0.4rem 0.6rem; border-bottom: 1px solid var(--color-border); }
.shortcut-panel-head strong { display: block; font-size: 0.92rem; }
.shortcut-panel-head small { display: block; color: var(--color-muted); font-size: 0.74rem; }
.shortcut-panel-head .btn { min-height: 34px; padding: 0 0.75rem; font-size: 0.8rem; }
.shortcut-empty { margin: 0; padding: 0.4rem; color: var(--color-muted); font-size: 0.84rem; }
.shortcut-bar { position: sticky; top: 0.5rem; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.shortcut-bar .form-error { flex-basis: 100%; }
.shortcut-count { margin: 0; font-weight: 650; }
.shortcut-count b { font-size: 1.15rem; color: var(--color-primary); }
.shortcut-full { display: block; color: #b45309; font-size: 0.8rem; font-weight: 600; }
.shortcut-full[hidden] { display: none; }
.shortcut-board { display: grid; gap: 1rem; }
.shortcut-group { min-width: 0; }
.shortcut-board > .card + .card { margin-top: 0; }
.shortcut-group .card-title { margin-bottom: 0.75rem; }
.shortcut-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem; }
.shortcut-option { display: flex; align-items: center; gap: 0.55rem; min-height: 46px; padding: 0.45rem 0.7rem; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); font-size: 0.86rem; font-weight: 650; cursor: pointer; }
.shortcut-option:hover { border-color: #6366f1; }
.shortcut-option input { flex: none; width: 1.05rem; height: 1.05rem; accent-color: #6366f1; }
.shortcut-ico { flex: none; display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 9px; background: color-mix(in srgb, var(--tone, #6366f1) 14%, transparent); color: var(--tone-ink, #4f46e5); }
.shortcut-ico .icon { width: 1rem; height: 1rem; }
.shortcut-option-label { display: grid; gap: 0.1rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.shortcut-option.is-picked { border-color: #6366f1; background: var(--color-primary-soft); }
.shortcut-option.is-locked { cursor: not-allowed; opacity: 0.5; }
.shortcut-kind { justify-self: start; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--color-surface-2); color: var(--color-muted); font-size: 0.66rem; font-weight: 700; white-space: nowrap; }
@media (min-width: 1024px) {
    .shortcut-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shortcut-bar { top: calc(72px + 0.5rem); }
}
@media (max-width: 1023px) {
    .shortcut-bar { top: 5rem; }
}
@media (max-width: 640px) {
    .cal-day { min-height: 42px; }
    .cal-day small { display: none; }
}
@media (prefers-color-scheme: dark) {
    .cal-day.has-event { background: #312e81; color: #e0e7ff; }
}
@media (min-width: 1024px) {
    .page-strip {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        padding: 0.65rem 1.75rem 0;
    }
    .page-strip-heading { min-width: 180px; }
    .page-strip .topbar-search-cluster { margin-left: 0; max-width: none; width: 100%; }
    .page-strip .topbar-search { margin-left: 0; }
    /* Page strip already shows the title — drop the duplicate title block and empty band. */
    .workspace-main { padding: 0.85rem 1.75rem 1.75rem; }
    .page-header {
        margin-bottom: 0.75rem;
    }
    .page-header .crumbs { margin-bottom: 0.45rem; }
    .page-header .page-head > .ico,
    .page-header .page-head-copy {
        display: none;
    }
    .page-header .page-head {
        justify-content: flex-end;
        gap: 0;
        min-height: 0;
    }
    .page-header .page-head:not(:has(.page-actions)) {
        display: none;
    }
    .page-header:not(:has(.crumbs)):not(:has(.page-actions)) {
        display: none;
        margin: 0;
    }
    .finance-bar {
        display: flex;
        justify-content: flex-end;
        margin: 0 0 0.55rem;
        min-height: 0;
    }
    .chart-grid {
        grid-template-columns: 1.45fr 0.85fr;
        align-items: stretch;
    }
    .chart-grid > .card > .finance-pie-stage .finance-pie-svg {
        width: min(100%, 220px);
    }
    .dash-calendar { grid-column: span 7; }
    .dash-upcoming { grid-column: span 5; }
}
@media print {
    .sidebar, .topbar, .page-strip, .tabbar, .mobile-header, .mobile-tools, .table-tools, .page-actions, .filter-actions,
    .filter-card, .dues-bulk-bar, .no-print, .fees-collect-note, .page-header .breadcrumbs,
    .page-header p, .summary-chips { display: none !important; }
    .only-desktop { display: block !important; }
    .only-mobile { display: none !important; }
    .card, .table-card {
        box-shadow: none !important;
        border: 0 !important;
        background: #fff !important;
    }
    .data-table { width: 100% !important; border-collapse: collapse !important; }
    .data-table th, .data-table td {
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        background: #fff !important;
        padding: 6px 8px !important;
    }
    .data-table thead th { background: #f1f5f9 !important; font-weight: 700 !important; }
    body { background: #fff !important; }
}

html[data-theme="dark"] body,
html.theme-dark body {
    background: var(--color-bg);
    color: var(--color-text);
}
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .workspace-main,
html.theme-dark .workspace,
html.theme-dark .workspace-main {
    background: var(--color-bg);
    color: var(--color-text);
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .page-strip,
html[data-theme="dark"] .card,
html[data-theme="dark"] .tool-button,
html[data-theme="dark"] .tool-panel,
html[data-theme="dark"] .net-status,
html[data-theme="dark"] .net-log,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .data-table,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
html[data-theme="dark"] .mobile-tools .theme-toggle,
html[data-theme="dark"] .mobile-tools .note-bell,
html[data-theme="dark"] .mobile-tools .net-status,
html[data-theme="dark"] .mobile-tools .net-log,
html[data-theme="dark"] .mobile-tools .visit-link {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.table-card .table-scroll { overflow-x: auto; }
.notepad-voice { display: flex; gap: 0.8rem; align-items: center; }
.notepad-voice p { margin: 0; color: var(--color-muted); }
[data-notepad-body] { min-height: 18rem; font-family: "Hind Siliguri", "Nirmala UI", sans-serif; font-size: 1.05rem; line-height: 1.7; }
.school-pad { position: relative; width: min(800px, 100%); margin: 0 auto 1.5rem; background: #fff; color: #17323a; border: 1px solid #d7e3e6; box-shadow: 0 10px 28px rgba(16, 48, 56, 0.08); overflow: hidden; }
.school-pad-mark { position: absolute; left: 50%; top: 46%; width: 220px; transform: translate(-50%, -50%); opacity: 0.08; pointer-events: none; }
.school-pad-head, .school-pad-foot { position: relative; z-index: 1; padding: 16px 20px; text-align: center; }
.school-pad-head { border-bottom: 3px solid #0e4c57; }
.school-pad-head img { display: block; height: 84px; width: auto; max-width: 100%; margin: 0 auto 8px; object-fit: contain; }
.school-pad-head h1 { margin: 0; color: #b42318; font-size: 1.7rem; }
.school-pad-body { position: relative; z-index: 1; min-height: 280px; padding: 22px 26px; font-family: "Hind Siliguri", "Nirmala UI", sans-serif; font-size: 1.05rem; line-height: 1.75; white-space: normal; }
.school-pad-foot { border-top: 3px solid #0e4c57; display: block; text-align: center; }
.school-pad-foot p { margin: 0; }
.topbar-search-cluster,
.page-strip {
    overflow: visible;
}
.edusou-ai {
    position: fixed;
    inset: auto 0.75rem calc(var(--tabbar-height) + 5.25rem) auto;
    z-index: 30;
    font-family: "Hind Siliguri", "Instrument Sans", sans-serif;
    pointer-events: none;
}
.edusou-ai.is-open {
    z-index: 40;
}
.edusou-ai-launch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    cursor: pointer;
    flex: 0 0 auto;
}
.edusou-ai-launch:hover,
.edusou-ai-launch:focus-visible,
.edusou-ai-launch[aria-expanded="true"] {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.12);
    outline: none;
}
.edusou-ai-ico {
    display: grid;
    place-items: center;
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}
.edusou-ai-ico .icon {
    position: static;
    transform: none;
    width: 1.05rem;
    height: 1.05rem;
    pointer-events: auto;
    color: inherit;
    stroke-width: 1.7;
}
.edusou-ai-launch.is-listening {
    background: rgba(180, 35, 24, 0.18);
    color: #b42318;
}
.edusou-ai-launch.is-listening:hover,
.edusou-ai-launch.is-listening:focus-visible,
.edusou-ai-launch.is-listening[aria-expanded="true"] {
    background: #b42318;
    color: #fff;
}
.edusou-ai-panel {
    position: fixed;
    right: 0.75rem;
    left: auto;
    top: auto;
    bottom: calc(var(--tabbar-height) + 5.25rem);
    transform: none;
    width: min(320px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    overflow: auto;
    background: var(--color-surface, #fff);
    color: var(--color-text, #17323a);
    border: 1px solid var(--color-border, #d7e3e6);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 32, 48, 0.18);
    padding: 12px;
    z-index: 50;
    pointer-events: auto;
}
.edusou-ai-panel header { display: flex; justify-content: space-between; align-items: center; }
.edusou-ai-panel header button { border: 0; background: transparent; font-size: 1.3rem; cursor: pointer; }
.edusou-ai-langs { display: flex; gap: 6px; margin: 8px 0; }
.edusou-ai-langs button { border: 1px solid var(--color-border, #d7e3e6); background: transparent; border-radius: 999px; padding: 4px 10px; font: inherit; cursor: pointer; }
.edusou-ai-langs button.is-on { background: #0e4c57; color: #fff; border-color: #0e4c57; }
.edusou-ai-panel form { display: flex; gap: 6px; }
.edusou-ai-panel input { flex: 1; min-width: 0; }
.edusou-ai-panel ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.schedule-builder { display: grid; gap: 1rem; }
.schedule-days { display: grid; gap: 0.65rem; }
.schedule-days-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; }
.schedule-days-head span { color: var(--color-muted, #5d7278); font-size: 0.92rem; }
.day-check-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.day-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--color-border, #d7e3e6);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: var(--color-surface-2, #f3f7f8);
    cursor: pointer;
    font-weight: 650;
}
.day-check:has(input:checked) {
    background: #0e4c57;
    border-color: #0e4c57;
    color: #fff;
}
.schedule-period-table select,
.schedule-period-table input[type="time"],
.schedule-period-table input[type="text"] {
    width: 100%;
    min-width: 7rem;
    min-height: 38px;
}
.schedule-period-table .sl-cell { width: 3rem; text-align: center; font-weight: 700; color: var(--color-muted, #5d7278); }
.schedule-period-table .center-cell { text-align: center; }
.schedule-period-table .action-cell { white-space: nowrap; }
.schedule-period-table .btn.danger { color: #b42318; }
.student-photo-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }
.student-photo-preview {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    border: 1px solid var(--color-border, #d7e3e6);
    background: var(--color-surface-2, #f3f7f8);
    overflow: hidden;
    display: grid;
    place-items: center;
}
.student-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.student-profile-photo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    display: block;
}
.student-photo-placeholder { color: var(--color-muted, #5d7278); font-size: 0.82rem; text-align: center; padding: 0.4rem; }
img.avatar.staff-photo {
    object-fit: cover;
    display: block;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, 0.7);
    background: #fff;
}
.edusou-ai-panel li button { width: 100%; text-align: left; border: 1px solid var(--color-border, #d7e3e6); background: transparent; border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; }
.edusou-ai-panel li small, .edusou-ai-panel li em { display: block; color: var(--color-muted, #5d7278); font-style: normal; }
.edusou-ai-panel li strong { display: block; }
@media (min-width: 1024px) {
    .edusou-ai,
    .edusou-ai-panel {
        right: 1.5rem;
        top: 6.75rem;
        bottom: auto;
    }
}

/* EduSou AI chat (floating robot) */
.edusou-bot {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 85;
    font-family: "Hind Siliguri", "Instrument Sans", sans-serif;
}
.edusou-bot-launch {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    overflow: visible;
    box-shadow: none;
}
.edusou-bot-launch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 999px;
    background: transparent;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}
.edusou-bot-launch:hover,
.edusou-bot-launch:focus-visible,
.edusou-bot-launch[aria-expanded="true"] {
    outline: none;
    transform: scale(1.04);
}
.edusou-bot-launch:hover img,
.edusou-bot-launch:focus-visible img,
.edusou-bot-launch[aria-expanded="true"] img {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
}
.edusou-bot-panel {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    width: min(360px, calc(100vw - 88px));
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface, #fff);
    color: var(--color-text, #17323a);
    border: 1px solid var(--color-border, #d7e3e6);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(16, 32, 48, 0.2);
    overflow: hidden;
}
.edusou-bot-panel[hidden] { display: none !important; }
.edusou-bot-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    background: #0e4c57;
    color: #fff;
}
.edusou-bot-head strong { display: block; font-size: 0.95rem; }
.edusou-bot-head span { display: block; font-size: 0.75rem; opacity: 0.85; margin-top: 0.15rem; }
.edusou-bot-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}
.edusou-bot-thread {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem;
    overflow: auto;
    min-height: 220px;
    max-height: min(46vh, 340px);
    background: var(--color-surface-2, #f3f7f8);
}
.edusou-bot-msg {
    max-width: 92%;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.edusou-bot-msg.is-bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--color-border, #d7e3e6);
}
.edusou-bot-msg.is-user {
    align-self: flex-end;
    background: #0e4c57;
    color: #fff;
}
.edusou-bot-msg a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}
.edusou-bot-msg.is-bot a { color: #0e4c57; }
.edusou-bot-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem 0.55rem;
    border-top: 1px solid var(--color-border, #d7e3e6);
    background: var(--color-surface, #fff);
}
.edusou-bot-form input {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    border: 1px solid var(--color-border, #d7e3e6);
    border-radius: 999px;
    padding: 0 0.8rem;
    font: inherit;
    background: var(--color-surface-2, #f3f7f8);
}
.edusou-bot-form .btn {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 0.9rem;
}
.edusou-bot-mic {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-muted, #5d7278);
    cursor: pointer;
    flex: 0 0 auto;
}
.edusou-bot-mic .icon { width: 1.1rem; height: 1.1rem; }
.edusou-bot-mic:hover,
.edusou-bot-mic:focus-visible {
    color: #0e4c57;
    background: rgba(14, 76, 87, 0.1);
    outline: none;
}
.edusou-bot-mic.is-listening {
    color: #fff;
    background: #b42318;
}
.edusou-bot-status {
    margin: 0;
    padding: 0 0.85rem 0.7rem;
    color: var(--color-muted, #5d7278);
    font-size: 0.78rem;
}
@media (max-width: 720px) {
    .edusou-bot {
        right: 12px;
        top: auto;
        bottom: 88px;
        transform: none;
    }
    .edusou-bot-panel {
        right: 0;
        top: auto;
        bottom: calc(100% + 10px);
        transform: none;
        width: min(340px, calc(100vw - 28px));
    }
}

.mark-filters { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1rem; }
.mark-filters select { min-width: 11rem; min-height: 42px; border: 1px solid var(--color-border); border-radius: 999px; padding: 0 0.9rem; background: var(--color-surface); font: inherit; }
.mark-table input[data-part] { width: 4.6rem; min-height: 36px; text-align: center; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; }
.mark-table td[data-total] { font-weight: 750; }
.mark-table input[type="checkbox"] { width: 1.05rem; height: 1.05rem; }
.result-passed { color: var(--color-success); font-weight: 650; }
.result-failed { color: var(--color-danger); font-weight: 650; }
.marksheet-settings { display: grid; gap: 1rem; }
.marksheet-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.marksheet-panel-head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1rem; }
.marksheet-panel-head h2 { margin: 0; font-size: 1.05rem; }
.marksheet-panel-head p { margin: 0.2rem 0 0; color: var(--color-muted); font-size: 0.92rem; }
.marksheet-panel-icon {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    flex: 0 0 auto;
    background: var(--color-surface-2);
}
.marksheet-panel-icon.t-amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.marksheet-panel-icon.t-violet { background: rgba(99, 102, 241, 0.14); color: #6366f1; }
.marksheet-label { display: block; margin-bottom: 0.45rem; font-weight: 650; font-size: 0.92rem; }
.marksheet-upload { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }
.marksheet-preview {
    width: min(220px, 100%);
    min-height: 96px;
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--color-border);
    border-radius: 12px;
    background: #f3f4f8;
    overflow: hidden;
    padding: 0.65rem;
}
.marksheet-preview.is-empty { color: var(--color-muted); font-size: 0.9rem; }
.marksheet-preview img { max-width: 100%; max-height: 88px; object-fit: contain; }
.marksheet-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.marksheet-actions .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.marksheet-help { margin: 0.55rem 0 0; font-size: 0.86rem; }
.marksheet-design-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.marksheet-design-card {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0.85rem;
    background: var(--color-surface-2);
}
.marksheet-design-card.is-default { border-color: #6366f1; box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35); }
.marksheet-design-card h3 { margin: 0.55rem 0 0.25rem; font-size: 0.98rem; }
.marksheet-design-card p { margin: 0 0 0.7rem; color: var(--color-muted); font-size: 0.86rem; min-height: 2.4em; }
.marksheet-design-preview {
    height: 88px;
    border-radius: 10px;
    border: 1px dashed var(--color-border);
    background:
        linear-gradient(180deg, rgba(30, 58, 110, 0.12), transparent 40%),
        repeating-linear-gradient(90deg, #dbe4f3 0 8px, transparent 8px 16px),
        #f7f4ea;
}
.marksheet-design-preview[data-design="classic"] {
    background:
        linear-gradient(180deg, rgba(91, 75, 214, 0.16), transparent 45%),
        #fff;
}
.marksheet-design-preview[data-design="navy_board"] {
    background:
        linear-gradient(180deg, rgba(30, 58, 110, 0.28), transparent 50%),
        repeating-linear-gradient(0deg, transparent 0 10px, rgba(30, 58, 110, 0.08) 10px 11px),
        #fff;
}
.marksheet-design-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    color: #4f46e5;
    font-size: 0.82rem;
    font-weight: 700;
}
@media (max-width: 980px) {
    .marksheet-design-grid { grid-template-columns: 1fr; }
}

.student-list-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--color-surface-2);
    color: var(--color-muted);
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
}
.student-list-photo.is-empty {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    color: #1d4ed8;
}
.student-inline-input {
    width: 100%;
    min-width: 8rem;
    max-width: 14rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    font: inherit;
}
.student-list-table tr.is-editing td {
    background: rgba(99, 102, 241, 0.06);
}
.student-inline-form {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}
.student-inline-form[hidden] {
    display: none !important;
}

.fees-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: var(--space-lg);
}
.fees-stat-card {
    padding: 1.05rem 1.2rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}
.fees-stat-label {
    display: block;
    color: var(--color-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.fees-stat-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.fees-mobile-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    margin: 0 0 0.85rem;
}
.fees-mobile-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 4.35rem;
    padding: 0.45rem 0.2rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.fees-mobile-action .ico {
    width: 30px;
    height: 30px;
    border-radius: 10px;
}
.fees-mobile-action .ico .icon { width: 0.9rem; height: 0.9rem; }
.fees-mobile-action span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    padding: 0 0.1rem;
}
.fees-invoice-lookup-note {
    margin: 0 0 0.65rem;
    color: var(--color-muted);
    font-size: 0.78rem;
    font-weight: 650;
}
.fees-invoice-lookup-grid {
    display: grid;
    gap: 0.65rem;
}
.fees-lookup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}
.fees-lookup-copy {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}
.fees-lookup-card .btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 0.95rem;
}
.fees-desktop-actions {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}
.fees-filter-card { margin-bottom: var(--space-lg); }
.fees-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}
.fees-filter-grid .field { margin: 0; }
.fees-filter-card .filter-actions { margin-top: var(--space-md); }
.fees-invoice-table td { vertical-align: top; }
.fees-invoice-no { display: block; font-weight: 800; }
.fees-invoice-sub {
    display: block;
    margin-top: 0.2rem;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
}
.fees-status {
    display: inline-flex;
    align-items: center;
    min-height: 1.55rem;
    padding: 0.1rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: lowercase;
}
.fees-status.is-unpaid {
    background: color-mix(in srgb, #f59e0b 16%, transparent);
    color: #b45309;
}
.fees-status.is-paid {
    background: color-mix(in srgb, #10b981 16%, transparent);
    color: #047857;
}
.fees-status.is-partial {
    background: color-mix(in srgb, #8b5cf6 16%, transparent);
    color: #6d28d9;
}
.fee-txn-edit { position: relative; }
.fee-txn-edit > summary { list-style: none; cursor: pointer; width: fit-content; }
.fee-txn-edit > summary::-webkit-details-marker { display: none; }
.fee-txn-edit-form {
    position: absolute;
    z-index: 5;
    right: 0;
    top: calc(100% + 0.35rem);
    width: min(26rem, 80vw);
    padding: 0.85rem;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}
@media (max-width: 760px) {
    .fee-txn-edit-form { position: static; width: 100%; margin-top: 0.45rem; }
}
.fees-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
    align-items: center;
}
.fees-receipt-link {
    color: var(--color-muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}
.fees-receipt-link:hover { color: var(--color-ink); text-decoration: underline; }
.fees-collect-summary { margin-bottom: var(--space-md); }
.fees-collect-card { padding: 0; overflow: hidden; }
.fees-collect-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 1.15rem 0.85rem;
}
.fees-collect-note {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 46rem;
}
.dues-filter-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 0.9rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background:
        linear-gradient(90deg, #f59e0b 0 5px, transparent 5px),
        linear-gradient(135deg, #fff7ed 0%, #ffedd5 55%, #fef3c7 100%);
    color: #9a3412;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), 0 8px 22px rgba(180, 83, 9, 0.12);
    animation: dues-alert-in 0.28s ease-out;
}
.dues-filter-alert[hidden] { display: none !important; }
.dues-filter-alert.is-visible { display: flex; }
.dues-filter-alert-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    margin-top: 0.05rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}
.dues-filter-alert-body { flex: 1 1 auto; min-width: 0; }
.dues-filter-alert-title {
    display: block;
    margin: 0 0 0.15rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #b45309;
}
.dues-filter-alert-text {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.45;
    color: #7c2d12;
}
.dues-filter-alert-close {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.65);
    color: #9a3412;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.dues-filter-alert-close:hover {
    background: #fff;
}
.filter-card .field.is-attention select,
.filter-card select.is-attention {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28);
    background: #fffbeb;
}
@keyframes dues-alert-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.fees-collect-table-wrap { overflow-x: auto; }
.fees-collect-table th,
.fees-collect-table td { vertical-align: middle; }
.fees-collect-table th.num,
.fees-collect-table td.num { text-align: right; }
.fees-collect-table tfoot td {
    background: color-mix(in srgb, #eef2ff 70%, var(--color-surface));
    font-weight: 700;
}
.fees-collect-check { width: 2.6rem; text-align: center; }
.fees-collect-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}
.fees-collect-check-label input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: #4f46e5;
}
.fees-collect-input {
    width: 7.25rem;
    max-width: 100%;
    min-height: 2.35rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    text-align: right;
    font: inherit;
}
.fees-collect-table tr:not(.is-selected) .fees-collect-input {
    opacity: 0.55;
    background: color-mix(in srgb, var(--color-border) 18%, var(--color-surface));
}
.fees-collect-table tr.is-selected td:first-child {
    box-shadow: inset 3px 0 0 #4f46e5;
}
.fees-collect-footer {
    padding: 1rem 1.15rem 1.15rem;
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, #f8fafc 80%, var(--color-surface));
}
.fees-collect-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}
.fees-collect-selected {
    margin-right: auto;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 650;
}
.table-card tr.is-muted td { color: var(--color-muted); }
.table-card tr.fees-row-due td {
    background: color-mix(in srgb, #ef4444 14%, var(--color-surface));
    color: #991b1b;
}
.table-card tr.fees-row-paid td {
    background: color-mix(in srgb, #22c55e 14%, var(--color-surface));
    color: #166534;
}
.field input.is-readonly,
.field input[readonly] {
    background: color-mix(in srgb, var(--color-border) 22%, var(--color-surface));
    color: var(--color-muted);
    cursor: default;
}
@media (min-width: 768px) {
    .fees-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .fees-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
        margin-bottom: 0.85rem;
    }
    .fees-stat-card { padding: 0.8rem 0.75rem; border-radius: 14px; }
    .fees-stat-label { font-size: 0.62rem; letter-spacing: 0.04em; }
    .fees-stat-value { margin-top: 0.25rem; font-size: 1.05rem; }
    .fees-collect-input { width: 6.25rem; }
    body:has(.fees-mobile-actions) .page-header .page-actions { display: none !important; }
}
@media (min-width: 1024px) {
    .fees-mobile-actions,
    .fees-invoice-lookup-note { display: none !important; }
    .fees-desktop-actions { display: flex; }
}

.receipt-settings { display: grid; gap: var(--space-lg); }
.receipt-printer-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.receipt-printer-option {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.95rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    cursor: pointer;
}
.receipt-printer-option:has(input:checked) {
    border-color: color-mix(in srgb, #4f46e5 55%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #4f46e5 35%, transparent);
}
.receipt-printer-option strong { display: block; }
.receipt-printer-option small { display: block; color: var(--color-muted); margin-top: 0.2rem; }
.receipt-design-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 0.9rem;
}
.receipt-design-card {
    display: grid;
    gap: 0.45rem;
    padding: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    cursor: pointer;
}
.receipt-design-card.is-selected {
    border-color: color-mix(in srgb, #4f46e5 60%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, #4f46e5 30%, transparent);
}
.receipt-design-card span { color: var(--color-muted); font-size: 0.88rem; line-height: 1.4; }
.receipt-design-preview {
    height: 88px;
    border-radius: 12px;
    border: 1px dashed color-mix(in srgb, var(--color-border) 80%, #94a3b8);
    background:
        linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,252,.95)),
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(148,163,184,.12) 10px, rgba(148,163,184,.12) 11px);
}
.receipt-design-preview.is-pos {
    width: 42%;
    margin: 0 auto;
    background:
        linear-gradient(180deg, #fff, #f8fafc),
        repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(15,23,42,.08) 8px, rgba(15,23,42,.08) 9px);
}
.receipt-design-preview[data-design="regular_modern"] {
    background:
        linear-gradient(90deg, #dbeafe 0 46%, transparent 46% 54%, #dbeafe 54% 100%),
        linear-gradient(180deg, #1d4ed8 0 18%, #fefce8 18% 22%, #eff6ff 22% 100%);
    border-style: solid;
    border-color: #93c5fd;
}
.receipt-design-preview[data-design="pos_standard"] { width: 58%; }
@media (max-width: 800px) {
    .receipt-printer-toggle,
    .receipt-design-grid { grid-template-columns: 1fr; }
}

/* Frontend theme activator */
.theme-activate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.theme-activate-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}
.theme-activate-card.is-active {
    border-color: color-mix(in oklab, #16a34a 55%, var(--color-border));
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.16);
}
.theme-activate-preview {
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}
.theme-activate-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.theme-activate-preview:has(img) .theme-activate-wire { display: none; }
.theme-activate-wire {
    position: absolute;
    inset: 10px;
    border-radius: 8px;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
    background:
        linear-gradient(90deg, rgba(255,255,255,0.18) 0 28%, transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.22) 0 16%, transparent 16% 22%, rgba(255,255,255,0.12) 22% 48%, transparent 48%);
}
.theme-preview-design-3 .theme-activate-wire {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.2) 0 12%, transparent 12% 18%, rgba(255,255,255,0.14) 18% 34%, transparent 34% 40%, rgba(255,255,255,0.12) 40% 56%, transparent 56%);
}
.theme-activate-body {
    display: grid;
    gap: 0.55rem;
    padding: 0.95rem 1rem 1.05rem;
}
.theme-activate-body h2 {
    margin: 0;
    font-size: 1.05rem;
}
.theme-activate-body p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    min-height: 3.2em;
}
.theme-activate-body .btn { width: 100%; justify-content: center; }
.btn.theme-activated {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    cursor: default;
}
.muted { color: var(--color-muted); }
@media (max-width: 980px) {
    .theme-activate-grid { grid-template-columns: 1fr; }
}

/* Website settings (Frontend) */
.ws-settings-card { padding: 1rem 1.1rem 1.25rem; }
.ws-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: color-mix(in oklab, var(--color-surface-2, #f1f5f9) 100%, transparent);
    border: 1px solid var(--color-border);
}
.ws-tab {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 650;
    cursor: pointer;
}
.ws-tab.is-on {
    background: #0e4c57;
    color: #fff;
    box-shadow: 0 6px 14px rgba(14, 76, 87, 0.28);
}
.ws-panel { display: none; }
.ws-panel.is-on { display: block; }
.ws-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.ws-grid .span-2 { grid-column: 1 / -1; }
.ws-color {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
}
.ws-color input[type="color"] {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}
.ws-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.7rem;
    min-height: 42px;
    padding: 0.35rem 0;
    font-weight: 650;
}
.ws-toggle input[type="checkbox"] {
    appearance: none;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    cursor: pointer;
    transition: background .15s ease;
}
.ws-toggle input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,.25);
    transition: transform .15s ease;
}
.ws-toggle input[type="checkbox"]:checked { background: #16a34a; }
.ws-toggle input[type="checkbox"]:checked::after { transform: translateX(20px); }
.ws-toggle .field-hint,
.field-hint {
    display: block;
    width: 100%;
    color: var(--color-muted);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
}
.ws-thumb {
    display: block;
    max-width: min(100%, 280px);
    max-height: 88px;
    margin: 0 0 0.45rem;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    object-fit: cover;
}
.ws-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--color-border);
}
@media (max-width: 820px) {
    .ws-tabs { border-radius: 16px; }
    .ws-grid { grid-template-columns: 1fr; }
}

/* Live support chat */
.support-compose { display: grid; gap: 0.85rem; }
.support-compose select[multiple] {
    min-height: 10rem;
    width: 100%;
    padding: 0.55rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}
.support-thread-list { display: grid; gap: 0.55rem; }
.support-thread-row {
    display: grid;
    gap: 0.15rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: var(--color-surface-2, #f8fafc);
    text-decoration: none;
    color: inherit;
}
.support-thread-row:hover { border-color: #6366f1; }
.support-thread-row strong { font-size: 0.95rem; }
.support-thread-row span { color: var(--color-muted); font-size: 0.84rem; }
.support-thread-row small { color: var(--color-muted); font-size: 0.75rem; }
.support-chat-shell { display: grid; gap: 0.85rem; }
.support-chat-log {
    display: grid;
    gap: 0.65rem;
    max-height: min(58vh, 520px);
    overflow: auto;
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: var(--color-surface-2, #f8fafc);
    border: 1px solid var(--color-border);
}
.support-chat-empty { margin: 0; color: var(--color-muted); }
.support-chat-bubble {
    max-width: min(92%, 36rem);
    padding: 0.7rem 0.85rem;
    border-radius: 0.9rem;
    background: #fff;
    border: 1px solid var(--color-border);
}
.support-chat-bubble header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.support-chat-bubble header strong { font-size: 0.82rem; }
.support-chat-bubble header time { color: var(--color-muted); font-size: 0.72rem; }
.support-chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.45;
}
.support-chat-bubble.is-mine {
    justify-self: end;
    background: #eef2ff;
    border-color: #c7d2fe;
}
.support-chat-bubble.is-support:not(.is-mine) {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.support-chat-compose textarea {
    width: 100%;
    min-height: 5rem;
    resize: vertical;
}
html[data-theme="dark"] .support-chat-bubble { background: rgba(15, 23, 42, 0.55); }
html[data-theme="dark"] .support-chat-bubble.is-mine { background: rgba(79, 70, 229, 0.22); }
html[data-theme="dark"] .support-chat-bubble.is-support:not(.is-mine) { background: rgba(16, 185, 129, 0.16); }

/* Subscription payment + invoice */
.sub-pay-banner {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff1f2, #fff);
}
.sub-pay-banner h2 { margin: 0 0 0.4rem; color: #b91c1c; }
.sub-info-table th {
    width: 9.5rem;
    white-space: nowrap;
}
.sub-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.sub-renew-toolbar { margin: 0; }
.sub-renew-panel[hidden] { display: none !important; }
.sub-renew-panel h2 { margin-top: 0.35rem; }
.sub-txn-list {
    display: grid;
    gap: 0.75rem;
}
.sub-txn-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 0.9rem;
    background: var(--color-surface-2, #f8fafc);
}
.sub-txn-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}
.sub-txn-top strong { display: block; font-size: 0.95rem; }
.sub-txn-plan {
    display: block;
    margin-top: 0.2rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}
.sub-txn-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.75rem;
    margin: 0;
}
.sub-txn-meta dt {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sub-txn-meta dd {
    margin: 0.15rem 0 0;
    font-size: 0.88rem;
    font-weight: 650;
}
.sub-txn-wide { grid-column: 1 / -1; }
.sub-pay-note {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    color: var(--color-muted);
}
.sub-method-grid {
    border: 0;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}
.sub-method-grid legend {
    margin-bottom: 0.45rem;
    font-weight: 700;
}
.sub-method-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 0.9rem 0.85rem 2.4rem;
    border: 1px solid var(--color-border);
    border-radius: 0.85rem;
    background: var(--color-surface-2, #f8fafc);
    position: relative;
    cursor: pointer;
}
.sub-method-card input {
    position: absolute;
    left: 0.85rem;
    top: 1rem;
}
.sub-method-logo {
    display: block;
    max-height: 28px;
    max-width: 96px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.sub-method-card strong { font-size: 0.95rem; }
.sub-method-card span { color: var(--color-muted); font-size: 0.82rem; line-height: 1.35; }
.sub-pay-howto {
    margin: 0 0 1rem;
    padding-left: 1.15rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}
.form-success {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-weight: 600;
}
.btn-sm {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 0.55rem;
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}
.invoice-sheet { max-width: 920px; }
.invoice-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}
.invoice-brand {
    margin: 0;
    color: var(--color-primary);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.75rem;
}
.invoice-head h2 { margin: 0.15rem 0 0; }
.invoice-meta { display: grid; gap: 0.3rem; text-align: right; font-size: 0.9rem; }
.invoice-meta span { display: block; color: var(--color-muted); font-size: 0.75rem; }
.invoice-parties {
    display: grid;
    gap: 1rem;
    margin: 0 0 1rem;
}
.invoice-parties h3 {
    margin: 0 0 0.3rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.invoice-parties p { margin: 0.12rem 0; }
.invoice-footnote { margin: 0.85rem 0 0; color: var(--color-muted); font-size: 0.88rem; }
@media (min-width: 760px) {
    .sub-method-grid { grid-template-columns: 1fr 1fr; }
    .invoice-parties { grid-template-columns: 1fr 1fr; }
}
@media print {
    .no-print { display: none !important; }
    body:has(.invoice-print-root) * { visibility: hidden !important; }
    body:has(.invoice-print-root) .invoice-print-root,
    body:has(.invoice-print-root) .invoice-print-root * { visibility: visible !important; }
    body:has(.invoice-print-root) .invoice-print-root {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
        background: #fff !important;
    }
    body:has(.invoice-print-root) .sidebar,
    body:has(.invoice-print-root) .topbar,
    body:has(.invoice-print-root) .page-strip,
    body:has(.invoice-print-root) .tabbar,
    body:has(.invoice-print-root) .mobile-header,
    body:has(.invoice-print-root) .page-header,
    body:has(.invoice-print-root) .page-actions {
        display: none !important;
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
    margin: 0;
}
.detail-grid > div { margin: 0; }
.detail-grid dt {
    font-size: 0.78rem;
    opacity: 0.7;
    margin: 0 0 0.2rem;
}
.detail-grid dd { margin: 0; font-weight: 600; }
.detail-grid .span-2 { grid-column: 1 / -1; }
.profile-split {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: start;
}
.photo-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #f5f7f8;
}
.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}
.link-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
@media (max-width: 760px) {
    .detail-grid, .profile-split { grid-template-columns: 1fr; }
}
