:root {
  --paper: #f1f3f6;
  --card: #ffffff;
  --card2: #e9edf3;
  --ink: #17202e;
  --muted: #536176;
  --teal: #235bd5;
  --teal-h: #1748b1;
  --teal-soft: #e6edff;
  --rose: #be3045;
  --rose-soft: #ffe8ec;
  --line: #d5dce6;
  --line-dark: #b5c1d1;
  --lift: none;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: var(--font);
  --mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0d1015;
  --card: #131820;
  --card2: #1b2330;
  --ink: #e6ebf2;
  --muted: #9caabc;
  --teal: #80aaff;
  --teal-h: #adc7ff;
  --teal-soft: #1c2d49;
  --rose: #ff8a99;
  --rose-soft: #3b222b;
  --line: #2a3442;
  --line-dark: #48566b;
  --lift: none;
  color-scheme: dark;
}

html { font-size: 14px; }
body { line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.container { max-width: 1240px; padding-inline: 28px; }
main { padding: 30px 0 48px; }
.navbar { background: var(--paper); backdrop-filter: none; min-height: 62px; }
.navbar .container { min-height: 62px; padding-block: 10px; gap: 12px 24px; }
.logo { font-size: 14px; gap: 10px; }
.logo-mark { width: 35px; height: 35px; border: 1px solid var(--line-dark); background: var(--card); color: var(--ink); border-radius: 3px; font: 700 10px var(--mono); }
[data-theme="dark"] .logo-mark { color: var(--ink); }
.logo small { font-size: 10px; line-height: 1.5; font-weight: 400; }
.nav-links { gap: 4px; flex-wrap: nowrap; order: 0; width: auto; }
.nav-links a { padding: 7px 10px; border-radius: 3px; white-space: nowrap; font-size: 12px; font-weight: 500; }
.nav-links a.active { background: var(--card2); color: var(--ink); box-shadow: inset 0 -2px var(--teal); }
.nav-links .btn-nav-register { background: transparent; color: var(--ink) !important; border: 1px solid var(--line-dark); }
.theme-switch { order: 0; }
.theme-btn { border-color: var(--line); background: transparent; padding: 6px 10px; border-radius: 3px; font-size: 12px; }
.theme-menu { border-radius: 4px; padding: 4px; box-shadow: none; }
.theme-menu button { border-radius: 2px; font-size: 12px; }
.nav-user { font-size: 12px; }
.schedule-intro { margin: 0 0 26px; }
.intro-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); font: 11px var(--mono); letter-spacing: .04em; }
.intro-meta time { white-space: nowrap; }
.schedule-intro h1, .page-header h1 { font-size: clamp(25px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.schedule-intro p { max-width: none; margin-top: 8px; font-size: 13px; }
.schedule-directory { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.card, .auth-card, .login-card, .upload-card, .file-card, .qr-card { border-radius: 4px; box-shadow: none; }
.card { padding: 20px; }
.directory-section { padding: 0; overflow: hidden; transition: none; min-width: 0; }
.directory-section:hover { transform: none; box-shadow: none; }
.directory-heading { margin: 0; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--card); gap: 12px; }
.directory-heading h2 { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.section-index { color: var(--muted); font: 11px var(--mono); font-weight: 400; }
.count-pill, .date-row__count, .file-group-badge, .file-type-badge, .group-pill-sm { border-radius: 3px; font-family: var(--mono); font-weight: 500; }
.count-pill { padding: 2px 7px; font-size: 11px; background: var(--card2); color: var(--muted); }
.head-link a { font-size: 11px; font-weight: 500; }
.directory-section > .search-box { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-box label { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.search-box input { width: 100%; max-width: none; padding: 9px 11px; border-radius: 3px; background: var(--paper); font-size: 13px; min-height: 38px; }
.schedule-links, .group-grid { gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.schedule-links { max-height: 530px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent; }
.schedule-links a, .group-grid a { min-height: 39px; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; justify-content: flex-start; text-align: left; font: 12px var(--mono); transition: background .12s; box-shadow: none; overflow-wrap: anywhere; }
.schedule-links a:hover, .group-grid a:hover { transform: none; box-shadow: none; background: var(--card2); color: var(--teal); }
.schedule-links a.fav, .group-grid a.fav { background: var(--teal-soft); box-shadow: inset 3px 0 var(--teal); }
.schedule-links a[hidden] { display: none; }
#teacher-list { grid-template-columns: 1fr; }
#teacher-list a { font-family: var(--font); font-size: 13px; border-right: 0; }
.directory-section > .empty, .directory-section > .search-no-results { border: 0; border-radius: 0; padding: 22px 18px; }
.search-no-results { font-size: 13px; }
.directory-caption { color: var(--muted); margin-top: 14px; font-size: 11px; }
.page-header { margin-bottom: 24px; }
.page-header p, .page-header .subtitle { font-size: 13px; }
.breadcrumb { font: 11px var(--mono); margin-bottom: 16px; overflow-wrap: anywhere; }
.header-actions { gap: 8px; margin-top: 14px; }
.btn, .btn-submit, button.btn-submit, .btn-download, .btn-delete, .btn-delete-mod, .btn-print { border-radius: 3px; font-size: 12px; padding: 8px 12px; font-weight: 550; transition: background .12s, border-color .12s; min-height: 34px; }
.btn:hover, .btn-submit:hover, button.btn-submit:hover, .subject-card:hover, .date-row:hover { transform: none; box-shadow: none; }
.btn-primary, .btn-submit, button.btn-submit { background: #255fdd; border: 1px solid #4278e7; color: #fff; }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-submit, [data-theme="dark"] button.btn-submit { color: #fff; }
.btn-primary:hover, .btn-submit:hover, button.btn-submit:hover { background: #1d50bd; }
.btn-ghost, .btn-secondary, .btn-print { background: transparent; border-color: var(--line-dark); color: var(--ink); }
.btn-fav { margin-top: 0; }
.page-header > .btn-fav { margin-top: 12px; }
.btn-fav.is-fav { border-color: var(--teal); }
.chip, .date-go input[type="date"], .date-form select { border-radius: 3px; font-size: 12px; padding: 7px 10px; min-height: 34px; }
.chip.on { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
[data-theme="dark"] .chip.on { color: var(--teal); }
.datebar { gap: 6px; margin-bottom: 14px; align-items: center; }
.date-go { gap: 6px; }
.date-go input[type="date"] { font-family: var(--mono); }
.tl-card { padding: 0; }
.tl-head { padding: 13px 18px; font: 13px var(--mono); background: var(--card2); }
.tl-head-actions { gap: 10px; }
.timeline { padding: 0; }
.tl-row { grid-template-columns: 140px minmax(0, 1fr) auto; column-gap: 20px; padding: 18px; }
.tl-rail { display: none; }
.tl-time b { font: 600 13px var(--mono); }
.tl-time span { display: block; margin-top: 5px; font-size: 11px; font-weight: 400; }
.tl-body { padding-right: 0; }
.tl-body h3 { font-size: 14px; font-weight: 550; line-height: 1.45; }
.tl-meta { font-size: 12px; margin-top: 5px; }
.tl-meta a { font-weight: 400; }
.tl-room { border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; font: 12px var(--mono); color: var(--ink); }
.tl-done { opacity: .68; }
.tl-progress { height: 3px; border-radius: 0; }
.tl-progress i { border-radius: 0; }
.tl-note { font: 11px var(--mono); }
.conspect-toolbar { flex-wrap: wrap; align-items: center; }
.upload-hint { font-size: 12px; color: var(--muted); }
.subject-grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.subject-card, .date-row { border-radius: 3px; padding: 14px 16px; box-shadow: none; }
.subject-card__name { font-size: 13px; }
.subject-card__meta, .file-date, .file-card__desc { font-size: 12px; }
.dates-list { gap: 6px; max-width: 760px; }
.date-row__date { font: 13px var(--mono); }
.date-row__icon:empty, .author-icon:empty, .auth-icon:empty, .upload-icon:empty, .file-drop__icon:empty { display: none; }
.file-card__header, .file-card__body, .file-card__footer { padding: 13px 16px; }
.file-card__footer { flex-wrap: wrap; gap: 10px; }
.files-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.materials-empty, .empty { padding: 38px 20px; border-radius: 4px; border-style: solid; color: var(--muted); }
.empty-text { font-size: 13px; font-weight: 400; }
.auth-page, .login-wrap { padding: 28px 0; }
.auth-card { max-width: 420px; padding: 28px; }
.auth-header { text-align: left; margin-bottom: 22px; }
.auth-header h1, .login-card h1, .feedback-page h1 { font-size: 25px; letter-spacing: -.025em; }
.auth-subtitle, .auth-footer { font-size: 12px; }
.auth-footer { text-align: left; border-top: 1px solid var(--line); padding-top: 16px; }
.form-group { gap: 6px; }
.form-group label, .login-card .field label { font-size: 12px; }
.form-group input, .form-group select, .form-group textarea, .login-card .field input, .feedback-form textarea, .mod-filters input { border-radius: 3px; background: var(--paper); padding: 9px 11px; font-size: 13px; min-height: 38px; }
.form-hint { font-size: 11px; }
.feedback-page { margin-block: 20px; }
.feedback-sub, .feedback-footer { font-size: 13px; }
.cat-btn span { border-radius: 3px; padding: 7px 12px; font-size: 12px; }
.cat-btn input:checked + span { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
[data-theme="dark"] .cat-btn input:checked + span { color: var(--teal); }
.file-drop, .upload-no-subjects, .terms-notice { border-radius: 3px; }
.stat-card, .msg, .table-wrap, .mod-table-wrap { border-radius: 3px; }
.stat-card { text-align: left; padding: 14px; }
.stat-card .num { font: 24px var(--mono); }
.terms-page h2, .qr-page h1 { font-size: 20px; }
.footer { padding: 18px 28px; background: var(--paper); text-align: left; font-size: 11px; }
.footer-inner { max-width: 1184px; margin-inline: auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.fav-chip { border-radius: 3px; font: 11px var(--mono); }

@media (max-width: 1100px) {
  .navbar .container { gap: 8px 16px; }
  .nav-links a { padding-inline: 8px; }
  .logo small { max-width: 180px; }
}

@media (max-width: 900px) {
  .container { padding-inline: 20px; }
  .navbar .container { position: relative; padding-block: 10px 0; }
  .nav-links { order: 2; width: 100%; overflow-x: auto; padding-bottom: 9px; scrollbar-width: thin; }
  .nav-links > * { flex-shrink: 0; }
  .theme-switch { position: static; }
  .theme-menu { top: 100%; right: 20px; }
  .schedule-directory { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; }
  #group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .container { padding-inline: 14px; }
  main { padding-top: 22px; }
  .logo small { max-width: none; }
  .nav-links { gap: 2px; }
  .nav-links a, .theme-btn { min-height: 36px; }
  .nav-links a { padding-inline: 9px; }
  .theme-menu { position: absolute; top: 100%; right: 14px; }
  .schedule-intro { margin-bottom: 20px; }
  .schedule-intro h1 { font-size: 28px; }
  .intro-meta { font-size: 10px; letter-spacing: 0; }
  .schedule-directory { grid-template-columns: 1fr; gap: 18px; }
  .directory-heading { padding: 13px 14px; }
  .directory-section > .search-box { padding: 12px 14px; }
  .schedule-links { max-height: 370px; }
  #group-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow-y: visible;
  }
  .schedule-links a { min-height: 44px; padding: 11px 14px; }
  .search-box input, .form-group input, .form-group select, .form-group textarea, .date-go input[type="date"] { font-size: 16px; }
  .datebar { align-items: stretch; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; }
  .date-go { flex-shrink: 0; }
  .date-go input[type="date"] { min-width: 142px; max-width: 160px; }
  .tl-head { padding: 12px; font-size: 11px; flex-wrap: wrap; gap: 10px; }
  .tl-row { grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; padding: 16px 12px; }
  .tl-time b { font-size: 11px; }
  .tl-time span { font-size: 10px; }
  .tl-body h3 { font-size: 13px; }
  .tl-room { grid-column: 2; justify-self: start; margin-top: 9px; font-size: 11px; }
  .tl-meta { font-size: 11px; }
  .card { padding: 16px; }
  .card.directory-section, .card.tl-card { padding: 0; }
  .auth-card { padding: 22px 18px; }
  .footer { padding-inline: 14px; }
  .btn, .btn-submit, .btn-print { min-height: 38px; }
  .conspect-toolbar { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  :root, [data-theme="dark"] { --ink: #000; --paper: #fff; --card: #fff; --card2: #f0f0f0; --muted: #333; --line: #ccc; --line-dark: #888; color-scheme: light; }
  main { padding: 0; }
  .tl-row { grid-template-columns: 140px minmax(0, 1fr) auto; }
  .tl-room { grid-column: auto; }
}

.datebar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.datebar > * { flex-shrink: 0; }
