:root {
  color-scheme: light;
  --page: #f6f7f3;
  --surface: #fff;
  --surface-muted: #f7f9f7;
  --navy: #142b36;
  --navy-light: #203e48;
  --text: #21343b;
  --muted: #65767b;
  --line: #e2e8e4;
  --green: #267969;
  --green-dark: #1a5d50;
  --green-wash: #edf5f1;
  --amber: #956319;
  --amber-wash: #fcf4e4;
  --red: #ab4d49;
  --red-wash: #fbefed;
  --blue: #456c87;
  --blue-wash: #edf3f7;
  --radius: 10px;
  --shadow: 0 15px 50px rgba(21, 43, 42, .11);
  --sidebar-width: 248px;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; color: var(--text); font-size: 16px; line-height: 1.65; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
input, select, textarea { min-width: 0; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .52; }
button, a { touch-action: manipulation; }
a { color: var(--green); text-underline-offset: 4px; }
a:hover { color: var(--green-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #84b6a7; outline-offset: 3px; }
button { border: 0; background: none; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--text); }
p:last-child { margin-bottom: 0; }
svg { flex-shrink: 0; vertical-align: middle; }
img { max-width: 100%; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
::selection { background: #cfe4da; color: #173d33; }
[hidden] { display: none !important; }

/* The login is deliberately editorial and quiet: identity on the left, form on the right. */
.login-screen { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr); padding: 24px; gap: 24px; background: #f6f7f3; }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-radius: 14px; padding: clamp(36px, 5vw, 76px); background: var(--navy); color: #dce8e7; min-height: 720px; }
.login-art::before { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(171, 211, 198, .16); border-radius: 50%; right: -160px; bottom: -115px; pointer-events: none; }
.login-art::after { content: ""; position: absolute; width: 300px; height: 300px; border: 1px solid rgba(171, 211, 198, .16); border-radius: 50%; right: -100px; bottom: -55px; pointer-events: none; }
.login-art h1, .login-art h2 { color: #fff; font-size: clamp(32px, 3.4vw, 52px); font-weight: 500; line-height: 1.42; letter-spacing: -.025em; margin: 26px 0 22px; max-width: 580px; }
.login-art p { color: #a9bfbe; max-width: 450px; line-height: 1.95; }
.login-art .brand, .login-art .login-brand { color: #fff; position: relative; z-index: 1; }
.login-art .brand-mark { background: #2a6d60; border-color: #448373; }
.login-art > * { position: relative; z-index: 1; }
.login-art .eyebrow, .login-art .page-kicker { color: #9fbdaf; }
.login-art footer, .login-art .login-foot { color: #9ab2b3; border-top: 1px solid #36505a; padding-top: 22px; }
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: stretch; width: min(100%, 470px); margin: auto; padding: 40px 26px; }
.login-panel h1, .login-panel h2 { font-size: 32px; font-weight: 600; letter-spacing: -.02em; margin: 12px 0; }
.login-panel > p { color: var(--muted); }
.login-panel .page-kicker { color: var(--green); }
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.login-form { display: grid; gap: 20px; margin-top: 30px; }
.login-form > .button { width: 100%; min-height: 50px; margin-top: 3px; }
.login-form label { display: block; margin-bottom: 8px; font-weight: 500; }
.login-form input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #d4dfd9; border-radius: 7px; background: #fff; color: var(--text); }
.login-form input::placeholder { color: #8a9696; }
.login-error, .form-error { padding: 11px 14px; border: 1px solid #f0d2ce; background: var(--red-wash); color: #963f3b; border-radius: 7px; }
.login-error:empty, .form-error:empty { display: none; }
.demo-accounts { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.demo-accounts > p, .demo-accounts > h3 { margin-bottom: 12px; font-size: 16px; font-weight: 500; color: var(--muted); }
.demo-accounts > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.demo-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 13px; border: 1px solid #dfe6e0; border-radius: 7px; background: #fff; text-align: left; transition: border-color .16s, background .16s; }
.demo-account:hover { background: var(--green-wash); border-color: #b6cfc2; }
.demo-account span:last-child { color: var(--muted); }
.demo-account small { color: var(--muted); font-size: 16px; }

/* Navigation and overall frame. */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { width: var(--sidebar-width); height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 30px 18px 18px; background: var(--navy); color: #d5e1e2; z-index: 30; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4b646b transparent; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; padding: 0 10px 32px; font-weight: 600; line-height: 1.45; text-decoration: none; }
.brand > div:last-child { min-width: 0; }
.brand small, .brand-subtitle { display: block; margin-top: 4px; color: #8da6ad; font-size: 16px; font-weight: 400; letter-spacing: .02em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 39px; height: 42px; border-radius: 9px; color: #e7f2eb; background: #275348; border: 1px solid #49776a; font-size: 21px; font-weight: 600; }
.brand-mark svg { width: 23px; height: 23px; }
.nav-group { padding: 14px 13px 8px; margin-top: 4px; color: #829ea7; font-size: 16px; font-weight: 400; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 47px; padding: 11px 13px; margin: 4px 0; color: #b8ccd0; border-radius: 7px; text-align: left; text-decoration: none; line-height: 1.5; transition: color .15s, background .15s; }
.nav-item:hover { color: #fff; background: #1e3b45; }
.nav-item.active, .nav-item[aria-current="page"] { color: #fff; background: #2b504e; box-shadow: inset 3px 0 #95c5ac; }
.nav-item .badge { min-width: 24px; padding: 0 7px; margin-left: auto; background: #43645e; color: #edf6ed; border: 0; }
.nav-icon { display: inline-flex; color: #92adb2; }
.nav-icon svg, .nav-item > svg { width: 20px; height: 20px; }
.nav-item.active .nav-icon { color: #b0d4c5; }
.nav-label { min-width: 0; }
.sidebar-footer { margin-top: auto; padding: 22px 10px 5px; }
.sidebar-footer > .user-meta, .sidebar-footer .user-row { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid #314852; }
.sidebar-footer .user-meta { color: #dbe7e8; }
.sidebar-footer .user-meta small, .sidebar-footer .meta { color: #92abb1; }
.sidebar-footer .button { color: #adc1c5; margin-top: 12px; width: 100%; justify-content: flex-start; padding-left: 0; }
.sidebar-footer .button:hover { color: #fff; background: transparent; }
.user-avatar, .avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: #eaf0e9; color: #536e60; font-size: 16px; font-weight: 600; line-height: 1; }
.sidebar .user-avatar { background: #31534f; color: #dceee5; }
.user-meta { min-width: 0; line-height: 1.45; }
.user-meta > span, .user-meta small { display: block; }
.user-meta small { font-size: 16px; color: var(--muted); margin-top: 4px; }
.workspace { min-width: 0; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; gap: 9px; align-items: center; color: #7e8a8b; min-width: 0; }
.breadcrumb strong, .breadcrumb span:last-child { color: var(--text); font-weight: 500; }
.breadcrumb svg { width: 16px; height: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.topbar-actions .user-avatar { width: 34px; height: 34px; }
.mobile-menu { display: none !important; }
.main { padding: 32px 36px 48px; max-width: 1640px; margin: 0 auto; min-width: 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading > div:first-child { min-width: 0; }
.page-kicker { margin: 0 0 7px; color: var(--green); font-size: 16px; font-weight: 500; letter-spacing: .04em; }
.page-title { font-size: 29px; line-height: 1.45; font-weight: 600; letter-spacing: -.025em; margin: 0 0 8px; }
.page-description { margin: 0; color: var(--muted); line-height: 1.75; max-width: 850px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.month-picker { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.month-picker select, .month-picker input { min-height: 42px; background: #fff; border: 1px solid #d7e0da; border-radius: 7px; padding: 9px 12px; color: var(--text); }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 17px; background: #edf3ee; border: 1px solid #dce8dd; border-radius: 7px; color: #50695a; margin-bottom: 26px; }
.demo-banner > div { display: flex; align-items: center; gap: 9px; }
.demo-banner svg { width: 18px; height: 18px; }
.demo-banner .action-link { white-space: nowrap; }
.role-pill { display: inline-flex; align-items: center; min-height: 28px; gap: 5px; padding: 1px 9px; border-radius: 5px; color: #456858; background: #edf3ed; white-space: nowrap; }

/* Shared controls. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 17px; border: 1px solid transparent; border-radius: 7px; line-height: 1.4; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.button svg { width: 18px; height: 18px; }
.button.primary, button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover, button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.button.secondary, button.secondary { background: #fff; color: var(--text); border-color: #d5dfd8; }
.button.secondary:hover, button.secondary:hover { background: #f0f4ef; border-color: #aebfb2; }
.button.ghost, button.ghost { color: var(--muted); border-color: transparent; background: transparent; }
.button.ghost:hover, button.ghost:hover { background: #eaf0e9; color: var(--text); }
.button.danger, button.danger { color: var(--red); background: #fff; border-color: #e8c8c4; }
.button.danger:hover, button.danger:hover { background: var(--red-wash); border-color: #d29b93; }
.button.small { min-height: 34px; padding: 6px 11px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--muted); border: 1px solid transparent; border-radius: 7px; flex-shrink: 0; }
.icon-button svg { width: 20px; height: 20px; }
.icon-button:hover { background: #edf2eb; color: var(--text); }
.action-link { border: 0; padding: 3px 0; background: none; color: var(--green); font-weight: 500; text-decoration: none; white-space: nowrap; }
.action-link:hover { color: var(--green-dark); text-decoration: underline; }
.action-link.danger { color: var(--red); }
.inline-actions { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.toolbar > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input, .filter-select { min-height: 42px; padding: 9px 12px; border: 1px solid #d9e1db; border-radius: 7px; background-color: #fff; color: var(--text); }
.search-input { width: 260px; max-width: 100%; }
.search-input::placeholder { color: #87938e; }
.search-input:focus, .filter-select:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #76a58e; }
.filter-select { padding-right: 30px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 5px; font-size: 16px; font-weight: 400; line-height: 1.5; white-space: nowrap; }
.badge.success { color: #34745c; background: #eaf4ec; }
.badge.warning { color: #926424; background: #fbf2df; }
.badge.danger { color: #a34f46; background: #fbefec; }
.badge.neutral { color: #667575; background: #eff2ee; }
.badge.blue { color: #4b718b; background: #edf3f7; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; background: #f1f4ef; border: 1px solid #e4e9e0; color: #65755e; border-radius: 4px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #78a98d; margin-right: 7px; }
.status-dot.warning { background: #d4a65b; }
.status-dot.danger { background: #be817b; }

/* Information architecture is built around tables and narrow, useful summaries. */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 25px; }
.stat-card { min-width: 0; padding: 20px 22px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.stat-card > svg { position: absolute; top: 21px; right: 20px; width: 21px; height: 21px; color: #84a094; }
.stat-label { color: var(--muted); margin-bottom: 12px; }
.stat-value { font-size: 34px; line-height: 1.3; font-weight: 600; color: #243c3c; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 16px; color: #829087; font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.stat-foot { color: #7c8982; margin-top: 10px; font-size: 16px; }
.stat-foot .positive { color: #588a66; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.content-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel + .panel { margin-top: 22px; }
.content-grid > .panel + .panel { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.panel-heading > div { min-width: 0; }
.panel-heading .meta { margin-top: 4px; }
.panel-title { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.5; }
.panel-title + p { color: var(--muted); margin: 6px 0 0; }
.panel-body { padding: 22px; min-width: 0; }
.panel-body > .table-wrap { margin: -22px; width: calc(100% + 44px); max-width: none; }
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #bfcfc0 #f3f6f0; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table th { height: 49px; padding: 12px 20px; color: #738078; font-weight: 400; background: #fafbf8; border-bottom: 1px solid var(--line); }
.data-table td { padding: 17px 20px; border-bottom: 1px solid #edf0ea; vertical-align: middle; color: #34473f; }
.data-table th:first-child, .data-table td:first-child { padding-left: 22px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 22px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcf8; }
.data-table tbody tr.is-self { background: #f1f7ef; }
.data-table .wrap { white-space: normal; min-width: 230px; max-width: 350px; }
.data-table .meta { font-size: 16px; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.person-name { font-weight: 500; color: var(--text); }
.person-sub { color: #839087; font-size: 16px; margin-top: 3px; }
.avatar { width: 36px; height: 36px; }
.count-cell { font-variant-numeric: tabular-nums; text-align: center; }
.data-table th.count-cell { text-align: center; }
.rank-num { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 29px; color: #859087; font-weight: 500; font-variant-numeric: tabular-nums; }
.rank-top { color: #497b62; border-radius: 5px; background: #edf4e9; }
.empty-state { padding: 55px 24px; text-align: center; color: var(--muted); }
.empty-state svg { width: 32px; height: 32px; color: #9aafa0; margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 7px; font-size: 18px; font-weight: 500; }
.empty-state p { margin: 0 auto; max-width: 380px; }
.empty-state .button { margin-top: 20px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border-bottom: 1px solid #edf0ea; }
.list-row:last-child { border-bottom: 0; }
.list-row > div { min-width: 0; }
.list-row .badge { flex-shrink: 0; }
.record-title { font-weight: 500; margin: 0 0 5px; }
.meta { font-size: 16px; color: #7a8880; line-height: 1.65; }
.meta + .meta { margin-top: 3px; }
.section-space { margin-top: 24px; }

/* Rules, monthly controls, and small comparison views. */
.rule-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 16px 20px; background: #f1f5ed; border: 1px solid #e0e8d8; border-radius: 8px; margin-bottom: 22px; color: #6a7a5d; }
.rule-strip > strong { font-weight: 500; margin-right: 7px; color: #506d48; }
.rule-step { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rule-step > span:first-child, .rule-step > b { font-weight: 500; color: #496c46; }
.rule-step svg { width: 16px; height: 16px; color: #9aab91; }
.pause-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #ead8b2; background: #fbf5e9; color: #8c6a32; padding: 16px 20px; border-radius: 8px; margin-bottom: 22px; }
.pause-banner strong { color: #856126; font-weight: 500; }
.pause-banner p { margin: 4px 0 0; }
.pause-banner .button { flex-shrink: 0; background: #fffaf2; border-color: #dfcc9e; color: #8c6a32; }
.tabs { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 24px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); padding: 13px 1px 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--green); }
.tab.active, .tab[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }
.tab .badge { padding: 0 7px; }
.progress-bars { display: grid; gap: 18px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(30px, 1fr) 32px; align-items: center; gap: 14px; color: var(--muted); }
.bar-track { height: 7px; background: #eef2e9; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: #6f9e7d; border-radius: inherit; min-width: 3px; }
.bar-row:nth-child(2) .bar-fill { background: #91af8e; }
.bar-row:nth-child(3) .bar-fill { background: #abc0a0; }
.bar-row:nth-child(4) .bar-fill { background: #c7d1b2; }
.bar-row > span:last-child, .bar-row > strong:last-child { text-align: right; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.compact-stats { display: flex; gap: 0; padding: 20px 0; flex-wrap: wrap; }
.compact-stats > div { padding: 0 24px; border-right: 1px solid var(--line); flex: 1; min-width: 120px; }
.compact-stats > div:last-child { border-right: 0; }
.compact-stats strong { display: block; font-size: 26px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.compact-stats span { display: block; color: var(--muted); margin-top: 4px; }
.notice-row { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #edf0ea; }
.notice-row:last-child { border-bottom: 0; }
.notice-icon { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; border-radius: 7px; background: #eff4e9; color: #79916a; flex-shrink: 0; margin-top: 2px; }
.notice-icon svg { width: 18px; height: 18px; }
.notice-row .record-title { margin-bottom: 5px; }
.notice-row time { display: block; color: #8b958b; margin-top: 7px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px; border: 1px solid #ead7d2; background: #fffaf8; border-radius: var(--radius); margin-top: 24px; }
.danger-zone h3 { font-size: 18px; color: #99564a; margin-bottom: 5px; }
.danger-zone .meta { color: #997b72; }

/* Profiles and the audit trail. */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 35px; }
.profile-field { min-width: 0; }
.profile-label { color: #829087; font-size: 16px; margin-bottom: 6px; }
.profile-value { color: #34493e; font-weight: 400; overflow-wrap: anywhere; }
.profile-field.full-width, .full-width { grid-column: 1 / -1; }
.profile-header { display: flex; align-items: center; gap: 16px; padding: 2px 0 26px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.profile-header .avatar { width: 64px; height: 64px; font-size: 24px; border-radius: 14px; }
.profile-header h2 { margin: 0 0 4px; font-size: 22px; }
.history-timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 25px 29px; border-left: 1px solid #dce7da; margin-left: 6px; }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; width: 11px; height: 11px; border: 2px solid #fff; background: #81a58a; box-shadow: 0 0 0 1px #a8c0a7; border-radius: 50%; left: -6px; top: 6px; }
.timeline-item.warning .timeline-dot { background: #c1a06b; box-shadow: 0 0 0 1px #dbc49f; }
.timeline-item.danger .timeline-dot { background: #b7796e; box-shadow: 0 0 0 1px #d9b5ac; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 13px; color: var(--text); font-weight: 500; }
.timeline-head > time, .timeline-head .meta { font-weight: 400; }
.timeline-meta { color: #7c8c7c; margin-top: 6px; font-size: 16px; line-height: 1.75; }
.timeline-item p { margin-top: 8px; margin-bottom: 0; }
.change-row { display: grid; grid-template-columns: minmax(90px, .6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.change-row:last-child { border-bottom: 0; }
.diff-old { background: #f8f1ee; color: #a17568; padding: 8px 11px; border-radius: 5px; overflow-wrap: anywhere; }
.diff-new { background: #edf5eb; color: #5b8052; padding: 8px 11px; border-radius: 5px; overflow-wrap: anywhere; }
.permission-grid { display: grid; grid-template-columns: minmax(160px, 1.3fr) repeat(4, minmax(90px, 1fr)); overflow-x: auto; }
.permission-cell { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: center; min-width: 90px; }
.permission-cell:nth-child(5n+1) { text-align: left; min-width: 160px; }
.permission-cell.heading { background: #fafbf7; color: var(--muted); }
.permission-cell.yes { color: #588a5b; }
.permission-cell.no { color: #a3aaa0; }
.step-list { margin: 0; padding-left: 24px; }
.step-list li { padding-left: 7px; margin: 0 0 14px; color: var(--muted); }
.step-list li::marker { color: #7a9a73; font-weight: 500; }
.step-list li:last-child { margin-bottom: 0; }
.step-list strong { color: var(--text); font-weight: 500; }

/* Native dialogs keep focus management and keyboard dismissal predictable. */
dialog.modal { width: min(680px, calc(100vw - 40px)); max-height: calc(100dvh - 64px); padding: 0; border: 1px solid #d9e3d5; border-radius: 12px; box-shadow: var(--shadow); color: var(--text); background: #fff; overflow: auto; }
dialog.modal.wide { width: min(900px, calc(100vw - 40px)); }
dialog.modal::backdrop { background: rgba(14, 32, 36, .42); backdrop-filter: blur(2px); }
.modal-header { position: sticky; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 26px 20px; border-bottom: 1px solid var(--line); background: #fff; z-index: 2; }
.modal-header h2, .modal-header h3 { margin: 0; font-size: 22px; font-weight: 600; }
.modal-header p { margin: 6px 0 0; color: var(--muted); }
.modal-header .icon-button { margin-top: -5px; margin-right: -8px; }
.modal-body { padding: 25px 26px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--line); background: #fafbf8; position: sticky; bottom: 0; z-index: 2; }
.modal-footer .meta { margin-right: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 20px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field label, .form-field > span:first-child { color: var(--text); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea { display: block; width: 100%; min-height: 44px; padding: 10px 12px; color: var(--text); background: #fff; border: 1px solid #d7e1d4; border-radius: 6px; line-height: 1.5; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #97a08e; }
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field input[readonly] { background: #f5f7f1; color: #7e8c75; }
.form-help { color: #819078; font-size: 16px; font-weight: 400; margin: 2px 0 0; line-height: 1.65; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--muted); }
.checkbox-field input { accent-color: var(--green); width: 18px; height: 18px; margin-top: 4px; flex-shrink: 0; }
.file-field { border: 1px dashed #bfd0b8; padding: 19px; border-radius: 7px; background: #fafcf7; color: #7e9475; }
.file-field input { border: 0; padding: 0; background: transparent; }
.detail-grid { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px 20px; }
.detail-grid > dt, .detail-grid .label { color: var(--muted); }
.detail-grid > dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.toast-container { position: fixed; right: 26px; bottom: 26px; z-index: 100; display: grid; gap: 10px; width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 11px; background: var(--navy); color: #edf5ef; border: 1px solid #385847; border-radius: 8px; box-shadow: 0 8px 28px rgba(22, 46, 31, .16); padding: 15px 18px; pointer-events: auto; animation: toast-enter .2s ease-out both; }
.toast svg { width: 19px; height: 19px; margin-top: 3px; color: #b5d5aa; }
.toast.error { border-color: #c19a8c; background: #71483f; }
.toast .icon-button { color: #c3d3be; width: 26px; height: 26px; margin-left: auto; }
.toast .icon-button:hover { background: rgba(255,255,255,.08); }
.sidebar-backdrop { display: none; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 1800px) {
  :root { --sidebar-width: 268px; }
  .sidebar { padding-left: 22px; padding-right: 22px; }
  .main { padding-top: 38px; }
}

@media (max-width: 1250px) {
  .main { padding: 27px 26px 40px; }
  .topbar { padding: 0 26px; }
  .page-heading { align-items: flex-start; }
  .page-actions { max-width: 340px; justify-content: flex-end; }
  .content-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 18px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 19px 18px; }
  .data-table th, .data-table td { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 222px; }
  .sidebar { padding: 24px 13px 16px; }
  .brand { padding-left: 7px; gap: 9px; }
  .brand small { font-size: 16px; }
  .nav-item { padding-left: 12px; gap: 10px; }
  .topbar { height: 76px; }
  .main { padding: 25px 22px 36px; }
  .topbar { padding: 0 22px; }
  .page-heading { display: block; }
  .page-actions { max-width: none; justify-content: flex-start; margin-top: 18px; }
  .content-grid, .content-grid.equal { grid-template-columns: minmax(0, 1fr); }
  .content-grid > .panel + .panel { margin-top: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-screen { grid-template-columns: minmax(0, .95fr) minmax(400px, 1fr); gap: 15px; padding: 15px; }
  .login-art { padding: 38px 30px; }
  .login-panel { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 258px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100dvh; transform: translateX(-100%); transition: transform .2s ease; padding: 28px 17px 17px; z-index: 60; }
  .sidebar.open, .app-shell.sidebar-open .sidebar, body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(12, 31, 36, .42); }
  .sidebar-backdrop.open, .app-shell.sidebar-open .sidebar-backdrop, body.sidebar-open .sidebar-backdrop, .sidebar.open ~ .sidebar-backdrop { display: block; }
  .mobile-menu { display: inline-flex !important; }
  .topbar { height: 68px; padding: 0 17px; gap: 12px; }
  .breadcrumb { gap: 6px; flex: 1; }
  .breadcrumb .muted, .breadcrumb > span:first-child:not(:last-child), .breadcrumb > svg { display: none; }
  .topbar-actions { gap: 9px; }
  .topbar-actions > .meta, .topbar-actions > .user-meta { display: none; }
  .topbar-actions .role-pill { padding: 2px 7px; }
  .main { padding: 24px 17px 32px; }
  .page-heading { margin-bottom: 21px; }
  .page-title { font-size: 26px; margin-bottom: 7px; }
  .page-kicker { margin-bottom: 5px; }
  .page-description { line-height: 1.7; }
  .page-actions { gap: 8px; margin-top: 17px; }
  .demo-banner { margin-bottom: 22px; align-items: flex-start; gap: 10px; padding: 12px 14px; }
  .demo-banner > div { align-items: flex-start; }
  .demo-banner svg { margin-top: 4px; }
  .demo-banner .action-link { white-space: normal; }
  .stats-grid { gap: 11px; margin-bottom: 21px; }
  .stat-card { padding: 16px 15px; }
  .stat-label { margin-bottom: 8px; }
  .stat-value { font-size: 30px; }
  .stat-foot { margin-top: 8px; }
  .stat-card > svg { display: none; }
  .panel { border-radius: 8px; }
  .panel-heading { padding: 17px 17px; align-items: center; }
  .panel-title { font-size: 18px; }
  .panel-body { padding: 18px 17px; }
  .panel-body > .table-wrap { margin: -18px -17px; width: calc(100% + 34px); }
  .panel + .panel { margin-top: 19px; }
  .data-table th, .data-table td { padding: 14px 15px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 17px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 17px; }
  .toolbar { padding: 15px 17px; gap: 10px; }
  .toolbar .search-input { width: 100%; flex: 1 1 180px; }
  .toolbar > div { width: 100%; }
  .toolbar .filter-select { flex: 1 1 130px; }
  .toolbar > .button { flex: 1; }
  .list-row { padding: 17px; gap: 12px; }
  .list-row > .button { padding: 6px 9px; }
  .notice-row { padding: 17px; }
  .tabs { gap: 23px; margin-bottom: 20px; }
  .rule-strip { gap: 7px; padding: 14px; line-height: 1.8; }
  .rule-strip > strong { width: 100%; }
  .pause-banner { display: block; padding: 15px; }
  .pause-banner .button { margin-top: 12px; }
  .profile-grid { gap: 21px 20px; }
  .profile-header { margin-bottom: 20px; padding-bottom: 21px; }
  .timeline-head { display: block; }
  .timeline-head > time, .timeline-head .meta { display: block; margin-top: 3px; }
  .compact-stats > div { min-width: 50%; margin: 8px 0; padding: 0 17px; }
  .compact-stats > div:nth-child(2n) { border-right: 0; }
  .danger-zone { display: block; padding: 18px; }
  .danger-zone .button { margin-top: 13px; }
  .login-screen { display: block; min-height: 100dvh; padding: 0; }
  .login-art { min-height: 0; border-radius: 0; padding: 27px 24px 30px; }
  .login-art h1, .login-art h2 { font-size: 29px; margin: 22px 0 13px; }
  .login-art p { margin-bottom: 0; max-width: none; line-height: 1.8; }
  .login-art footer, .login-art .login-foot { display: none; }
  .login-art .brand, .login-art .login-brand { padding-bottom: 0; }
  .login-art::before, .login-art::after { width: 240px; height: 240px; right: -130px; bottom: -160px; }
  .login-panel { padding: 30px 24px 38px; width: min(100%, 520px); }
  .login-panel h1, .login-panel h2 { font-size: 27px; }
  .login-form { margin-top: 23px; gap: 18px; }
  .demo-accounts { margin-top: 24px; }
  dialog.modal, dialog.modal.wide { width: calc(100vw - 24px); max-height: calc(100dvh - 28px); border-radius: 10px; }
  .modal-header { padding: 20px 19px 17px; }
  .modal-header h2, .modal-header h3 { font-size: 21px; }
  .modal-body { padding: 21px 19px; }
  .modal-footer { padding: 15px 19px; flex-wrap: wrap; }
  .modal-footer .meta { width: 100%; margin-right: 0; }
  .form-grid { gap: 17px; }
  .detail-grid { grid-template-columns: 92px minmax(0, 1fr); gap: 13px; }
  .change-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
  .change-row > :first-child { grid-column: 1 / -1; }
  .toast-container { right: 16px; bottom: 16px; width: calc(100vw - 32px); }
}

@media (max-width: 430px) {
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .user-avatar { display: none; }
  .topbar-actions > .button { padding: 7px 10px; }
  .main { padding-left: 13px; padding-right: 13px; }
  .page-title { font-size: 24px; }
  .page-actions > .button { flex: 1 1 auto; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 28px; }
  .stat-foot { overflow-wrap: anywhere; }
  .profile-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full-width, .profile-grid .full-width { grid-column: auto; }
  .panel-heading { padding: 16px 14px; gap: 8px; }
  .panel-heading > .button { padding: 6px 8px; }
  .login-panel { padding-left: 21px; padding-right: 21px; }
  .demo-accounts > div { gap: 8px; }
  .demo-account { padding: 11px 9px; gap: 5px; }
  .demo-account span:last-child { display: none; }
  .bar-row { grid-template-columns: 82px minmax(30px, 1fr) 24px; gap: 10px; }
}

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

@media print {
  .sidebar, .topbar, .demo-banner, .page-actions, .toolbar, .toast-container, .modal, .sidebar-backdrop, .inline-actions, .action-link { display: none !important; }
  .app-shell { display: block; }
  body, .workspace { background: #fff; }
  .main { padding: 0; max-width: none; }
  .panel, .stat-card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .data-table { white-space: normal; }
}

/* The application renders these concrete structures; keep their layout explicit. */
.login-panel-inner { width: 100%; }
.login-brand > div > span { display: block; margin-top: 4px; color: #9bb4b7; font-weight: 400; }
.login-intro { padding: 50px 0; }
.login-feature-list { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 36px; color: #a9c4bc; }
.login-feature-list > span { display: inline-flex; align-items: center; gap: 9px; }
.login-feature-list svg { width: 19px; height: 19px; }
.login-art-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 23px; color: #93adb2; border-top: 1px solid #36505a; }
.login-footnote { margin: 23px 0 0; color: #8a978f; font-size: 16px; line-height: 1.75; }
.demo-accounts > .panel-heading { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 13px; border: 0; }
.demo-accounts > .panel-heading strong { font-size: 16px; font-weight: 500; }
.demo-accounts > .demo-account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.demo-account { display: grid; grid-template-columns: 1fr auto; gap: 3px 9px; padding: 12px 13px; }
.demo-account > span { font-size: 16px; color: var(--muted); }
.demo-account > strong { font-size: 16px; font-weight: 500; color: var(--text); }
.demo-account > small { grid-column: 1 / -1; font-size: 16px; color: #8a978d; font-variant-numeric: tabular-nums; }
.demo-accounts .form-help { margin-top: 14px; }
.demo-accounts code { padding: 1px 4px; color: #4b7058; background: #ecf2e9; border-radius: 3px; font-size: 16px; }
.nav-group { margin: 0 0 17px; padding: 0; }
.nav-group > span { display: block; padding: 0 13px 6px; font-size: 16px; color: #7e9ba4; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; min-width: 25px; height: 24px; border-radius: 4px; background: #385b54; color: #cce3d1; font-size: 16px; line-height: 1; }
.semester-label { padding: 0 13px 20px; color: #87a1a7; }
.user-profile { display: flex; align-items: center; gap: 10px; width: 100%; border-top: 1px solid #314852; padding: 19px 0 0; text-align: left; }
.user-profile .user-meta { flex: 1; min-width: 0; }
.user-profile .user-meta strong { display: block; font-weight: 500; }
.user-profile > svg { width: 16px; height: 16px; color: #7e9ba4; }
.sidebar-logout { display: flex; align-items: center; gap: 9px; width: 100%; padding: 16px 0 0; color: #8ca6ad; text-align: left; line-height: 1.6; }
.sidebar-logout:hover { color: #e8f3ef; }
.sidebar-logout svg { width: 17px; height: 17px; }
.user-avatar.small { width: 34px; height: 34px; }
.avatar.large { width: 52px; height: 52px; font-size: 21px; border-radius: 12px; }
.welcome-line { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 19px; color: #7a897e; }
.welcome-line > span:first-child { color: #4f6757; }
.stat-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-label > span { display: inline-flex; color: #89a183; }
.stat-label svg { width: 20px; height: 20px; }
.stat-word { display: inline-block; font-size: 27px; letter-spacing: -.025em; padding-top: 5px; }
.progress-bars { gap: 22px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.bar-row strong { color: #40553f; font-size: 18px; font-weight: 500; }
.bar-row small { font-size: 16px; color: #8b9883; font-weight: 400; }
.bar-track { width: 100%; height: 7px; }
.bar-fill { display: block; }
.panel-note { padding: 14px 22px; border-top: 1px solid var(--line); color: #83907a; background: #fafbf7; font-size: 16px; line-height: 1.75; }
.toolbar-spacer { flex: 1; }
.toolbar > label.search-input { display: flex; align-items: center; gap: 8px; width: 280px; padding: 0 11px; min-height: 42px; }
.search-input > svg { width: 18px; height: 18px; color: #8b9b88; }
.search-input > input { width: 100%; min-width: 0; height: 40px; padding: 8px 0; border: 0; outline: none; color: var(--text); background: transparent; font-size: 16px; }
.search-input > input::placeholder { color: #95a08e; }
.search-input:focus-within { outline: 3px solid #84b6a7; outline-offset: 2px; border-color: #79a487; }
.search-input > input:focus-visible { outline: 0; }
.table-footer { padding: 15px 22px; background: #fcfdf9; color: #83907c; border-top: 1px solid var(--line); line-height: 1.7; }
.workspace { display: flex; flex-direction: column; min-height: 100dvh; }
.main { width: 100%; flex: 1; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 19px 36px 23px; color: #9aa392; font-size: 16px; }
.person-name, .person-sub { display: block; }
.person-sub { white-space: normal; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); align-items: start; gap: 22px; }
.profile-layout > .panel + .panel { margin-top: 0; }
.profile-field .profile-label { display: block; }
.profile-field .profile-value { display: block; margin: 0; }
.profile-request { padding-bottom: 23px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.profile-request:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.profile-request > .meta { margin: 10px 0 17px; }
.profile-request .history-timeline { margin-top: 18px; }
.list-row { width: 100%; text-align: left; }
button.list-row:hover { background: #f8fbf3; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main > strong { display: block; color: var(--text); font-weight: 500; line-height: 1.75; overflow-wrap: anywhere; }
.list-row-main > .meta { display: block; margin-top: 4px; }
.list-row > svg:last-child { color: #a1ac99; width: 17px; height: 17px; }
.notice-row { text-align: left; width: 100%; }
.notice-row > span:not(.notice-icon) { display: block; min-width: 0; flex: 1; }
.notice-row strong { display: block; color: #53694b; font-weight: 500; }
.notice-row .meta { display: block; margin-top: 5px; }
.notice-row > svg:last-child { width: 17px; height: 17px; margin-top: 9px; color: #a1ac99; }
button.notice-row:hover { background: #f9fbf6; }
.panel-body > .notice-row { padding: 16px 0; }
.panel-body > .notice-row:first-child { padding-top: 0; }
.panel-body > .notice-row:last-child { padding-bottom: 0; }
.history-month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.history-month-grid > .panel + .panel { margin-top: 0; }
.history-month.selected { border-color: #9cb998; box-shadow: 0 0 0 1px #c5d7ba; }
.history-month .compact-stats { padding: 0 0 17px; }
.history-month .compact-stats > div { padding-left: 0; padding-right: 15px; min-width: 0; }
.history-month .compact-stats > div + div { padding-left: 17px; padding-right: 0; }
.history-month .inline-actions { margin-top: 18px; gap: 9px; }
.history-month .inline-actions > .button { padding-left: 11px; padding-right: 11px; flex: 1; }
.ranking-rules { gap: 10px; }
.ranking-rules > span:last-child { margin-left: auto; color: #8a9a7e; }
.ranking-rules .rule-step b { display: inline-flex; justify-content: center; align-items: center; width: 22px; height: 22px; border: 1px solid #c6d7ba; background: #f9fcf5; border-radius: 4px; color: #7a9667; }
.toolbar > .tabs { border: 0; margin: -18px 0; gap: 23px; }
.toolbar > .tabs .tab { padding-top: 22px; padding-bottom: 22px; }
.tab > span { display: inline-flex; align-items: center; justify-content: center; min-width: 23px; height: 23px; background: #f0f3eb; color: #8b9d7c; border-radius: 4px; }
.tab.active > span { background: #e8f1df; color: #6b8858; }
.pause-banner > svg { color: #ac8753; }
.pause-banner > div { flex: 1; }
.pause-banner > div > span { display: block; margin-top: 3px; line-height: 1.75; }
.empty-state > strong { display: block; font-size: 18px; font-weight: 500; color: #6a7d60; margin-bottom: 7px; }
.empty-state > svg { display: block; margin-left: auto; margin-right: auto; }
.panel-heading > .inline-actions { justify-content: flex-end; }

@media (max-width: 1250px) {
  .workspace-footer { padding-left: 26px; padding-right: 26px; }
  .history-month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-layout { grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 18px; }
  .toolbar > label.search-input { width: 240px; }
  .ranking-rules > span:last-child { width: 100%; margin-left: 0; }
}

@media (max-width: 1100px) {
  .brand { padding-bottom: 22px; }
  .semester-label { padding-bottom: 17px; }
  .nav-group { margin-bottom: 14px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
  .workspace-footer { padding-left: 22px; padding-right: 22px; }
  .login-feature-list { gap: 13px; }
  .login-art-footer { display: block; }
  .login-art-footer > span { display: block; margin-top: 5px; }
  .panel-heading > .inline-actions { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .login-intro { padding: 0; }
  .login-feature-list { margin-top: 23px; gap: 17px; }
  .login-art-footer { display: none; }
  .login-footnote { margin-top: 23px; }
  .welcome-line { display: block; }
  .welcome-line > span { display: block; }
  .welcome-line > span + span { margin-top: 8px; }
  .stat-label { gap: 5px; }
  .stat-label > span { display: none; }
  .stat-word { font-size: 25px; }
  .toolbar > label.search-input { width: 100%; flex: 1 1 200px; }
  .toolbar-spacer { display: none; }
  .toolbar > .tabs { margin: -15px 0 0; width: 100%; gap: 19px; }
  .toolbar > .tabs .tab { padding-top: 18px; padding-bottom: 17px; }
  .toolbar > .filter-select { flex: 1 1 130px; }
  .workspace-footer { display: block; padding: 10px 17px 24px; }
  .workspace-footer > span { display: block; }
  .workspace-footer > span + span { margin-top: 4px; }
  .table-footer { padding: 13px 17px; }
  .panel-note { padding: 13px 17px; }
  .profile-layout { gap: 19px; }
  .history-month-grid { grid-template-columns: minmax(0, 1fr); }
  .history-month .compact-stats > div { min-width: 0; }
  .history-month .compact-stats > div:nth-child(2) { border-right: 0; }
  .history-month .compact-stats > div:first-child { border-right: 1px solid var(--line); }
  .list-row { flex-wrap: wrap; align-items: flex-start; }
  .list-row > .notice-icon { margin-top: 3px; }
  .list-row-main { flex-basis: calc(100% - 55px); }
  .list-row > .badge { margin-left: 45px; }
  .list-row > svg:last-child { margin-left: auto; margin-top: 5px; }
  .ranking-rules { gap: 7px; }
  .ranking-rules > strong { width: 100%; }
  .ranking-rules > svg { width: 14px; height: 14px; }
  .panel-heading:has(> .inline-actions) { flex-wrap: wrap; }
  .panel-heading > .inline-actions { justify-content: flex-start; width: 100%; }
  .pause-banner > svg { display: none; }
  .rule-strip:not(.ranking-rules) > strong { width: auto; }
}

@media (max-width: 430px) {
  .demo-accounts > .demo-account-grid { gap: 8px; }
  .demo-account { padding: 11px 10px; }
  .demo-account > span { display: block !important; }
  .demo-account > strong { font-size: 16px; }
  .demo-account > small { font-size: 16px; }
  .login-feature-list { gap: 12px; }
  .login-feature-list > span { gap: 6px; }
  .login-feature-list svg { width: 17px; height: 17px; }
  .avatar.large { width: 44px; height: 44px; font-size: 18px; }
  .profile-layout .panel-heading { flex-wrap: wrap; }
  .profile-layout .panel-heading > .button { margin-top: 6px; width: 100%; }
  .ranking-rules .rule-step { gap: 5px; }
  .ranking-rules > svg { display: none; }
  .rule-step { white-space: normal; }
  .bar-row { grid-template-columns: minmax(0, 1fr); }
  .panel-heading .action-link { white-space: normal; }
}

/* Record details, accountable reviews, attendance, and tie decisions. */
.detail-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 23px; }
.detail-title > h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.detail-title > .badge { margin-top: 3px; flex-shrink: 0; }
.detail-grid:has(> div) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.detail-grid > div { min-width: 0; }
.detail-grid > div > .profile-label { display: block; margin-bottom: 5px; }
.detail-grid > div > strong { display: block; font-weight: 500; overflow-wrap: anywhere; }
.detail-section { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-section > .profile-label { display: block; margin-bottom: 7px; }
.detail-section > h3 { margin: 0 0 18px; font-size: 18px; font-weight: 600; }
.detail-section > p { margin: 0 0 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-section > p:last-child { margin-bottom: 0; }
.detail-section a { overflow-wrap: anywhere; }
.review-area { padding-top: 22px; border-top: 1px solid #dce6d6; background: #f8fbf4; }
.review-area > strong { display: block; font-size: 18px; font-weight: 600; color: #476b3f; }
.review-area > .meta { margin: 6px 0 18px; }
.review-area .form-error { margin-top: 15px; }
.profile-diff { margin-top: 18px; }
.profile-diff .change-row { align-items: start; }
.profile-diff .change-row > strong { padding-top: 10px; font-weight: 500; }
.profile-diff .diff-old, .profile-diff .diff-new { padding: 12px 13px; line-height: 1.8; white-space: pre-wrap; }
.profile-diff .diff-old > span, .profile-diff .diff-new > span { display: block; margin-bottom: 6px; font-size: 16px; color: #a68c7d; }
.profile-diff .diff-new > span { color: #819b6e; }
.attendance-roster { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.attendance-roster-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #fcfdf9; }
.attendance-roster-row:last-child { border-bottom: 0; }
.attendance-roster-row > span { min-width: 0; font-weight: 400; }
.attendance-roster-row small { display: inline-block; color: #8c9a80; margin-left: 8px; font-size: 16px; }
.attendance-roster-row select { flex-shrink: 0; width: 130px; min-height: 40px; padding-top: 7px; padding-bottom: 7px; background: #fff; }
.tie-order-row { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); background: #fcfdf9; border-radius: 7px; margin-bottom: 9px; }
.tie-order-row:last-child { margin-bottom: 0; }
.tie-order-row > strong { font-weight: 500; }
.tie-order-row .rank-num { background: #eff4e9; color: #799366; border-radius: 4px; }
.tie-order-row > .icon-button { border-color: #e1e8d9; background: #fff; }
.tie-order-row > .icon-button:hover { background: #f0f6e8; border-color: #bed0aa; }
.modal-footer > .button { gap: 8px; }
.sidebar { overflow: hidden; }
.sidebar > .brand, .sidebar > .semester-label { flex-shrink: 0; }
.sidebar > nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #4b646b transparent; }
.sidebar-footer { flex-shrink: 0; margin-top: 0; }
button.user-avatar { padding: 0; min-width: 38px; white-space: nowrap; word-break: keep-all; }
button.user-avatar.small { min-width: 34px; }
.review-snapshot { margin: 16px 0; padding: 12px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); overflow-wrap: anywhere; }
.review-snapshot summary { color: var(--green); cursor: pointer; font-weight: 500; }
.review-snapshot[open] summary { margin-bottom: 14px; }
.review-snapshot p { white-space: pre-wrap; margin-bottom: 10px; }
.revision-entry + .revision-entry { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.timeline-item .review-snapshot { background: #fff; }
.checkin-panel { max-width: 760px; padding: 32px; }
.checkin-panel > h2 { font-size: 26px; line-height: 1.45; margin: 16px 0 8px; }
.checkin-panel > p { line-height: 1.85; }
.checkin-result { display: flex; align-items: center; gap: 10px; padding: 18px; margin: 22px 0; color: #486f3c; background: #eff7eb; border: 1px solid #cfe2c8; border-radius: 8px; font-weight: 600; }
.qr-modal { text-align: center; }
.qr-modal > .meta { margin: 12px 0 18px; }
.qr-frame { display: inline-flex; align-items: center; justify-content: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(25, 53, 56, .08); }
.qr-frame canvas { display: block; max-width: min(264px, 70vw); height: auto; image-rendering: pixelated; }
.qr-countdown { font-weight: 600; color: var(--green); margin: 15px 0 8px; }
.qr-modal .form-help { line-height: 1.65; max-width: 540px; margin-left: auto; margin-right: auto; }
.qr-link { text-align: left; overflow-wrap: anywhere; padding: 10px 13px; background: var(--surface-muted); border-radius: 6px; font-size: 13px; color: var(--text-muted); }
.scanned-label { color: #547c4d; font-size: 15px; white-space: nowrap; }
.scan-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scan-list span { padding: 6px 10px; background: #f0f6ee; color: #4d6e46; border-radius: 5px; font-size: 14px; }

@media (max-width: 760px) {
  .detail-title { gap: 12px; margin-bottom: 20px; }
  .detail-title > h3 { font-size: 20px; }
  .detail-section { margin-top: 22px; padding-top: 20px; }
  .detail-grid:has(> div) { gap: 18px 20px; }
  .profile-diff .change-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .profile-diff .change-row > strong { grid-column: 1 / -1; padding-top: 0; }
  .profile-diff .diff-old, .profile-diff .diff-new { padding: 10px 11px; }
  .attendance-roster-row { padding: 11px 12px; gap: 12px; }
  .attendance-roster-row small { display: block; margin: 3px 0 0; }
  .attendance-roster-row select { width: 115px; }
  .tie-order-row { gap: 8px; padding: 10px 11px; }
  .tie-order-row > .toolbar-spacer { display: block; }
}

@media (max-width: 430px) {
  .checkin-panel { padding: 22px; }
  .checkin-panel > h2 { font-size: 22px; }
  .detail-title { flex-wrap: wrap; gap: 8px; }
  .detail-title > .badge { margin-top: 0; }
  .detail-grid:has(> div) { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .profile-diff .change-row { grid-template-columns: minmax(0, 1fr); }
  .profile-diff .change-row > strong { grid-column: auto; }
  .attendance-roster-row select { width: 107px; }
  .tie-order-row { gap: 7px; }
  .tie-order-row > .icon-button { width: 33px; height: 35px; }
}
