/* Hatıra visual system v2 — loaded after the structural stylesheet. */
:root,
html[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef2f8;
    --surface-muted: #fafbfe;
    --surface-strong: #17213b;
    --text: #172033;
    --text-soft: #5d687d;
    --text-on-strong: #f8faff;
    --accent: #4f5fd7;
    --accent-2: #3478d4;
    --accent-hover: #3f4fc5;
    --accent-soft: #e8ebff;
    --accent-text: #ffffff;
    --highlight: #c77a13;
    --highlight-soft: #fff1d8;
    --border: #dfe4ee;
    --border-strong: #c9d1df;
    --success: #13795b;
    --success-soft: #e2f4ed;
    --warning: #995d0b;
    --warning-soft: #fff0d0;
    --danger: #b33a43;
    --danger-soft: #fde8ea;
    --page-glow: rgba(79, 95, 215, .14);
    --header-bg: rgba(250, 251, 254, .84);
    --shadow: 0 22px 65px rgba(30, 43, 72, .11);
    --shadow-soft: 0 8px 30px rgba(30, 43, 72, .07);
    --radius: 18px;
    --radius-lg: 26px;
    --shell: 1280px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #090f1c;
    --surface: #111a2b;
    --surface-soft: #19243a;
    --surface-muted: #0e1727;
    --surface-strong: #f1f4fb;
    --text: #f1f4fb;
    --text-soft: #aab5c9;
    --text-on-strong: #121a2a;
    --accent: #8d98ff;
    --accent-2: #65a3f5;
    --accent-hover: #a4adff;
    --accent-soft: #242e5c;
    --accent-text: #0b1120;
    --highlight: #f5bd68;
    --highlight-soft: #3b2c18;
    --border: #26344f;
    --border-strong: #3a4a68;
    --success: #74d3ad;
    --success-soft: #15372d;
    --warning: #f5c276;
    --warning-soft: #3b2d18;
    --danger: #ff9ba2;
    --danger-soft: #43232b;
    --page-glow: rgba(98, 115, 255, .2);
    --header-bg: rgba(9, 15, 28, .84);
    --shadow: 0 24px 70px rgba(0, 0, 0, .34);
    --shadow-soft: 0 10px 34px rgba(0, 0, 0, .22);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="dark"]) {
        color-scheme: dark;
        --bg: #090f1c;
        --surface: #111a2b;
        --surface-soft: #19243a;
        --surface-muted: #0e1727;
        --surface-strong: #f1f4fb;
        --text: #f1f4fb;
        --text-soft: #aab5c9;
        --text-on-strong: #121a2a;
        --accent: #8d98ff;
        --accent-2: #65a3f5;
        --accent-hover: #a4adff;
        --accent-soft: #242e5c;
        --accent-text: #0b1120;
        --highlight: #f5bd68;
        --highlight-soft: #3b2c18;
        --border: #26344f;
        --border-strong: #3a4a68;
        --success: #74d3ad;
        --success-soft: #15372d;
        --warning: #f5c276;
        --warning-soft: #3b2d18;
        --danger: #ff9ba2;
        --danger-soft: #43232b;
        --page-glow: rgba(98, 115, 255, .2);
        --header-bg: rgba(9, 15, 28, .84);
        --shadow: 0 24px 70px rgba(0, 0, 0, .34);
        --shadow-soft: 0 10px 34px rgba(0, 0, 0, .22);
    }
}

html {
    background: var(--bg);
}

body {
    background:
        radial-gradient(circle at 88% -8%, var(--page-glow), transparent 33rem),
        radial-gradient(circle at -10% 28%, color-mix(in srgb, var(--highlight) 7%, transparent), transparent 30rem),
        var(--bg);
    font-family: Inter, Aptos, "Segoe UI Variable", "Segoe UI", sans-serif;
    letter-spacing: -.008em;
}

::selection {
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    color: var(--text);
}

h1,
h2,
h3,
strong {
    letter-spacing: -.038em;
}

h1 {
    font-family: "Segoe UI Variable Display", Aptos Display, "Segoe UI", sans-serif;
    font-weight: 760;
}

h2,
h3 {
    font-weight: 720;
}

p {
    line-height: 1.68;
}

.shell {
    width: min(calc(100% - 48px), var(--shell));
}

.content-shell {
    max-width: 1120px;
}

.narrow-shell {
    max-width: 960px;
}

.site-header {
    height: 78px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    background: var(--header-bg);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.nav-shell {
    min-height: 78px;
    gap: 24px;
}

.brand {
    gap: 11px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

.brand-mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.brand-copy {
    display: grid;
    gap: 0;
}

.brand-copy strong {
    font-size: 16px;
    line-height: 1.2;
}

.brand-copy small {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.desktop-nav {
    gap: 3px;
}

.nav-link {
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 670;
    transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}

.nav-link:hover {
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.nav-link.active {
    border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-account {
    gap: 8px;
}

.avatar-link {
    min-height: 44px;
    padding: 4px 7px 4px 4px;
    border-radius: 13px;
    transition: background-color 180ms var(--ease);
}

.avatar-link:hover {
    background: var(--surface-soft);
}

.theme-toggle {
    display: inline-flex;
    min-width: 104px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text-soft);
    box-shadow: 0 3px 12px color-mix(in srgb, var(--text) 5%, transparent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    touch-action: manipulation;
    transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
    color: var(--text);
}

.theme-toggle:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
    outline-offset: 2px;
}

.theme-icon-wrap,
.theme-icon {
    width: 18px;
    height: 18px;
}

.theme-icon {
    display: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.theme-toggle[data-theme-state="system"] .theme-icon-system,
.theme-toggle[data-theme-state="light"] .theme-icon-light,
.theme-toggle[data-theme-state="dark"] .theme-icon-dark {
    display: block;
}

.mobile-menu summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    touch-action: manipulation;
}

.mobile-menu summary svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.mobile-menu-panel {
    top: 54px;
    width: min(310px, calc(100vw - 28px));
    gap: 3px;
    padding: 14px;
    border-color: var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.mobile-menu-panel > a {
    min-height: 44px;
    padding: 10px 12px;
}

.mobile-theme-row {
    margin: 7px 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.mobile-theme-toggle {
    min-width: 108px;
}

.btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 720;
    touch-action: manipulation;
    transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease), transform 120ms ease-out;
}

.btn:active {
    transform: scale(.975);
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--accent-text);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-2));
    box-shadow: 0 13px 30px color-mix(in srgb, var(--accent) 31%, transparent);
}

.btn-secondary {
    border-color: var(--border);
    background: var(--surface);
    box-shadow: 0 3px 12px color-mix(in srgb, var(--text) 5%, transparent);
}

.btn-secondary:hover,
.btn-quiet:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
}

.btn-danger {
    border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-large {
    min-height: 50px;
    padding: 13px 21px;
}

.hero-section {
    position: relative;
    min-height: 690px;
    overflow: clip;
    padding: 92px 0 104px;
}

.hero-section::before {
    position: absolute;
    top: 7%;
    right: -9rem;
    width: 31rem;
    height: 31rem;
    border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 4rem color-mix(in srgb, var(--accent) 4%, transparent), 0 0 0 8rem color-mix(in srgb, var(--accent) 2%, transparent);
    content: "";
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(0, 1.02fr) minmax(420px, .92fr);
    gap: clamp(48px, 7vw, 104px);
}

.hero-copy {
    max-width: 680px;
}

.hero-copy .context-label {
    margin-bottom: 20px;
}

.hero-copy h1 {
    max-width: 11ch;
    margin-bottom: 24px;
    font-size: clamp(3.8rem, 6.4vw, 6.2rem);
    font-weight: 780;
    letter-spacing: -.068em;
    line-height: .96;
}

.hero-copy p {
    max-width: 580px;
    margin-bottom: 32px;
    color: var(--text-soft);
    font-size: clamp(1.05rem, 1.6vw, 1.24rem);
}

.context-label {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 780;
    letter-spacing: .1em;
}

.context-label::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.hero-visual {
    position: relative;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    border-radius: 32px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    box-shadow: var(--shadow);
    transform: rotate(1.1deg);
}

.hero-visual img {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 23px;
    object-fit: cover;
}

.hero-badge {
    position: absolute;
    right: 34px;
    bottom: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 12px;
    background: rgba(255, 255, 255, .9);
    color: #1b2440;
    box-shadow: 0 12px 32px rgba(27, 36, 64, .17);
    font-size: 12px;
    font-weight: 760;
    backdrop-filter: blur(12px);
}

.section,
.page-section,
.auth-section {
    padding: 72px 0 96px;
}

.compact-section {
    padding-top: 24px;
}

.section-heading {
    margin-bottom: 26px;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.school-directory {
    gap: 12px;
}

.school-row {
    min-height: 86px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.school-row:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.row-action {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
}

.auth-section {
    min-height: calc(100dvh - 154px);
}

.auth-grid,
.install-grid {
    gap: clamp(44px, 8vw, 112px);
}

.auth-intro h1,
.page-heading h1,
.dashboard-welcome h1 {
    max-width: 15ch;
    margin: 14px 0 16px;
    font-size: clamp(2.7rem, 5vw, 4.8rem);
    letter-spacing: -.062em;
    line-height: 1;
}

.auth-intro p,
.page-heading p,
.dashboard-welcome p {
    max-width: 680px;
    font-size: 1.05rem;
}

.form-card,
.main-panel,
.side-panel,
.filter-bar,
.disclosure-card,
.table-wrap,
.entry-admin-row,
.school-admin-card,
.writing-form,
.empty-state,
.export-preview,
.deadline-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.form-card {
    padding: clamp(24px, 4vw, 38px);
}

.form-card-heading {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.field {
    gap: 8px;
}

.field label {
    color: var(--text);
    font-size: 13px;
    font-weight: 720;
}

.field small,
.form-footnote,
.field-meta {
    color: var(--text-soft);
    font-size: 12px;
}

.field input,
.field select,
.field textarea,
.search-form input,
.compact-input {
    min-height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: var(--surface-muted);
    color: var(--text);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
    transition: border-color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field textarea {
    min-height: 260px;
    padding: 16px;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-form input:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border-strong));
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-form input:focus,
.compact-input:focus {
    border-color: var(--accent);
    outline: 0;
    background: var(--surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.form-footnote a,
.text-link,
.back-link {
    color: var(--accent);
    font-weight: 720;
}

.page-heading,
.dashboard-welcome {
    margin-bottom: 34px;
}

.page-heading {
    min-height: 118px;
}

.metric-strip {
    gap: 14px;
    margin-bottom: 24px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.metric {
    min-height: 128px;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 22px;
    border: 1px solid var(--border) !important;
    border-radius: 18px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 46%, var(--surface)), var(--surface) 68%),
        var(--surface);
    box-shadow: var(--shadow-soft);
}

.metric strong {
    color: var(--accent);
    font-size: clamp(2rem, 4vw, 3rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.metric span {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
    gap: 20px;
}

.main-panel,
.side-panel {
    padding: clamp(22px, 3vw, 32px);
}

.side-panel {
    align-self: start;
    background: linear-gradient(160deg, var(--surface), color-mix(in srgb, var(--accent-soft) 46%, var(--surface)));
}

.panel-heading {
    margin-bottom: 20px;
}

.action-stack {
    gap: 9px;
}

.action-stack a {
    position: relative;
    min-height: 74px;
    align-content: center;
    padding: 14px 44px 14px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    transition: border-color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease);
}

.action-stack a::after {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--accent);
    content: "→";
    font-size: 18px;
    transform: translateY(-50%);
}

.action-stack a:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: var(--surface);
    transform: translateX(3px);
}

.recent-row,
.admin-list-row {
    min-height: 76px;
    padding: 13px 10px;
    border-radius: 14px;
    transition: background-color 160ms var(--ease);
}

.recent-row:hover,
.admin-list-row:hover {
    background: var(--surface-soft);
}

.avatar,
.school-monogram {
    background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 54%, var(--surface)));
    color: var(--accent);
    font-weight: 780;
}

.deadline-panel {
    min-width: 230px;
    padding: 18px 20px;
    border-color: color-mix(in srgb, var(--highlight) 28%, var(--border));
    background: var(--highlight-soft);
}

.deadline-panel span,
.deadline-panel strong {
    color: var(--highlight);
}

.deadline-panel.closed {
    border-color: color-mix(in srgb, var(--danger) 25%, var(--border));
    background: var(--danger-soft);
}

.deadline-panel.closed span,
.deadline-panel.closed strong {
    color: var(--danger);
}

.filter-bar {
    padding: 18px;
}

.people-grid {
    gap: 18px;
}

.person-card {
    min-height: 270px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.person-card:hover {
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.status-badge {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}

.status-badge.success {
    border-color: color-mix(in srgb, var(--success) 28%, var(--border));
    background: var(--success-soft);
    color: var(--success);
}

.status-badge.neutral {
    background: var(--surface-soft);
    color: var(--text-soft);
}

.message-masonry {
    columns: 2 360px;
    column-gap: 20px;
}

.message-card {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    border-top: 4px solid color-mix(in srgb, var(--accent) 70%, var(--accent-2));
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.message-card > p {
    color: var(--text);
}

.writing-header {
    margin: 28px 0 30px;
}

.writing-form {
    padding: clamp(24px, 4vw, 38px);
}

.rich-editor {
    overflow: clip;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: var(--surface-muted);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
    transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.rich-editor:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-soft);
}

.editor-tool-group {
    display: flex;
    align-items: center;
    gap: 3px;
    padding-right: 7px;
    border-right: 1px solid var(--border);
}

.editor-tool-group:last-child {
    padding-right: 0;
    border-right: 0;
}

.editor-history-group {
    margin-left: auto;
}

.editor-tool {
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.editor-tool:hover {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.editor-tool[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: var(--accent-soft);
    color: var(--accent);
}

.editor-tool:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
    outline-offset: 1px;
}

.editor-tool svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.rich-editor-area {
    min-height: 320px;
    padding: 20px;
    outline: 0;
    background: var(--surface);
    color: var(--text);
    font-size: 17px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.rich-editor-area:empty::before {
    color: var(--text-soft);
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-editor-area p,
.rich-content p {
    margin: 0 0 .9em;
}

.rich-editor-area p:last-child,
.rich-content p:last-child {
    margin-bottom: 0;
}

.rich-editor-area ul,
.rich-editor-area ol,
.rich-content ul,
.rich-content ol {
    margin: .7em 0 1em;
    padding-left: 1.6em;
}

.rich-editor-area li,
.rich-content li {
    margin: .3em 0;
}

.rich-editor-area blockquote,
.rich-content blockquote {
    margin: .9em 0;
    padding: 10px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: var(--accent-soft);
    color: var(--text);
}

.rich-content {
    color: var(--text);
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.message-card > .rich-content {
    margin-top: 18px;
}

.entry-admin-row > .rich-content {
    margin: 18px 0;
}

.editor-error {
    margin: 9px 2px 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 680;
}

.entry-admin-list,
.admin-list,
.recent-list {
    gap: 8px;
}

.entry-admin-row {
    padding: 24px;
}

.entry-admin-row > p {
    color: var(--text);
}

.entry-route span:not(.route-arrow) {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.route-arrow {
    color: var(--accent);
}

.table-wrap {
    overflow: auto;
    border-radius: 20px;
}

table {
    background: var(--surface);
}

th {
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

th,
td {
    padding: 15px 16px;
    border-color: var(--border);
}

tbody tr:hover {
    background: color-mix(in srgb, var(--accent-soft) 38%, transparent);
}

.disclosure-card {
    overflow: clip;
}

.disclosure-card > summary {
    min-height: 58px;
    padding: 18px 22px;
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 35%, var(--surface)));
}

.disclosure-card[open] > summary {
    color: var(--accent);
}

.notice {
    border-radius: 15px;
}

.notice-info {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
    background: var(--accent-soft);
}

.notice-warning {
    border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
}

.school-admin-grid {
    gap: 18px;
}

.school-admin-card {
    padding: 24px;
}

.school-admin-card:hover {
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.branch-row {
    padding: 12px;
    border-radius: 13px;
    background: var(--surface-soft);
}

.paper-preview {
    border: 1px solid #e5dccb;
    border-radius: 3px;
    background: #fffdf7;
    box-shadow: 0 20px 55px rgba(49, 40, 29, .16);
    color: #28241f;
    transform: rotate(-1deg);
}

.flash-stack {
    top: 90px;
}

.flash {
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.empty-state {
    border-style: dashed;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.site-footer {
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface) 45%, transparent);
}

.site-footer a {
    color: var(--accent);
}

@media (max-width: 1180px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .admin-shell {
        max-width: 1040px;
    }
}

@media (max-width: 980px) {
    .hero-section {
        min-height: auto;
        padding-top: 64px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 54px;
    }

    .hero-copy h1 {
        max-width: 13ch;
    }

    .hero-visual {
        width: min(100%, 760px);
        transform: none;
    }

    .dashboard-grid,
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .side-panel {
        align-self: stretch;
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(calc(100% - 32px), var(--shell));
    }

    .site-header,
    .nav-shell {
        min-height: 70px;
        height: 70px;
    }

    .hero-section,
    .auth-section,
    .section,
    .page-section {
        padding: 48px 0 72px;
    }

    .hero-copy h1,
    .auth-intro h1,
    .page-heading h1,
    .dashboard-welcome h1 {
        font-size: clamp(2.55rem, 12vw, 4rem);
    }

    .hero-copy p {
        font-size: 1.03rem;
    }

    .hero-visual {
        padding: 7px;
        border-radius: 22px;
    }

    .hero-visual img {
        border-radius: 16px;
    }

    .hero-badge {
        right: 20px;
        bottom: 18px;
    }

    .page-heading,
    .dashboard-welcome {
        min-height: 0;
        margin-bottom: 28px;
    }

    .metric-strip,
    .admin-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric {
        min-height: 116px;
    }

    .main-panel,
    .side-panel,
    .entry-admin-row,
    .writing-form {
        padding: 20px;
    }

    .filter-bar {
        padding: 16px;
    }
}

@media (max-width: 520px) {
    .brand-copy {
        display: none;
    }

    .public-nav {
        gap: 6px;
    }

    .public-nav .theme-toggle {
        min-width: 44px;
        width: 44px;
        padding: 0;
    }

    .public-nav .theme-toggle [data-theme-label] {
        display: none;
    }

    .public-nav .btn-primary {
        padding-inline: 13px;
    }

    .hero-copy h1,
    .auth-intro h1,
    .page-heading h1,
    .dashboard-welcome h1 {
        font-size: clamp(2.35rem, 13vw, 3.4rem);
    }

    .hero-section::before {
        right: -20rem;
    }

    .hero-badge {
        display: none;
    }

    .button-row .btn {
        width: 100%;
    }

    .metric-strip,
    .admin-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .metric {
        min-height: 108px;
        padding: 18px;
    }

    .metric:nth-child(even),
    .metric + .metric {
        border: 1px solid var(--border) !important;
    }

    .admin-metrics .metric:last-child:nth-child(odd),
    .metric-strip:not(.admin-metrics) .metric:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .form-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .mobile-menu-panel {
        right: -2px;
    }

    .message-card,
    .school-admin-card {
        padding: 20px;
    }

    .rich-toolbar {
        gap: 5px;
        padding: 7px;
    }

    .editor-tool-group {
        padding-right: 5px;
    }

    .editor-history-group {
        width: 100%;
        margin-left: 0;
        padding-top: 5px;
        border-top: 1px solid var(--border);
        border-right: 0;
    }

    .rich-editor-area {
        min-height: 280px;
        padding: 16px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .school-row:hover,
    .person-card:hover,
    .action-stack a:hover {
        transform: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header {
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
