/* Schanic theme A: Signature light. Change brand colors here only. */
:root {
  --brand: #F04A23;
  --brand-dark: #C93513;
  --brand-tint: #FDECEA;
  --ink: #111111;
  --muted: #6b7280;
  --line: #eeeeee;
  --surface: #F7F7F7;
  --bg: #ffffff;
  --ok: #1E6B3A;
  --ok-bg: #E6F4EA;
  --bad: #B42318;
  --bad-bg: #FEE4E2;
  /* Radius scale */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius: var(--radius-md);
  --sidebar-w: 240px;
  --font: 'Montserrat', 'Inter', system-ui, sans-serif;
  /* Motion tokens: micro 100-200ms, panels 200-300ms, never over 400ms */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 300ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  /* Elevation tokens: one light source, top-left */
  --elev-flat: none;
  --elev-raised: 0 1px 2px rgba(17, 17, 17, .06), 0 2px 8px rgba(17, 17, 17, .05);
  --elev-overlay: 0 8px 28px rgba(17, 17, 17, .14), 0 2px 6px rgba(17, 17, 17, .08);
  --skel: #ececec;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 24px; font-weight: 800; margin: 0; }
h2 { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--brand-tint); outline-offset: 1px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); border-right: 1px solid var(--line); padding: 20px 14px; position: fixed; inset: 0 auto 0 0; background: #fff; z-index: 30; transition: transform var(--dur-base) var(--ease-in-out); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; padding: 0 6px; }
.brand img { width: 34px; height: 34px; }
.brand b { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.brand small { display: block; font-size: 9px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 10px 12px; border-radius: var(--radius); color: #444; font-weight: 500; margin-bottom: 4px; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.nav a:hover { background: var(--surface); }
.nav a:focus-visible, .bottom-nav a:focus-visible, .section-nav a:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.nav a.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; }
.nav i { font-size: 20px; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.menu-btn { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; padding: 0; color: var(--ink); min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.topbar-title { font-weight: 700; }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.role-tag { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.content { padding: 24px; max-width: 1100px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.backdrop, .bottom-nav { display: none; }

/* Components */
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; background: #fff; box-shadow: var(--elev-raised); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid #ddd; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.btn i { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover { background: var(--surface); box-shadow: var(--elev-raised); transform: translateY(-1px); }
.btn:hover i { transform: translateX(1px) scale(1.08); }
.btn:active { transform: scale(.97); box-shadow: var(--elev-flat); }
.btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--bad); border-color: #F3C4BE; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-quiet { background: transparent; border-color: transparent; color: #555; font-weight: 600; }
.btn-quiet:hover { background: var(--surface); box-shadow: var(--elev-flat); }
.btn.is-active:not(.btn-primary) { border-color: var(--brand); color: var(--brand-dark); }
.btn.is-loading, .btn.is-loading:disabled { opacity: .85; cursor: progress; transform: none; box-shadow: var(--elev-flat); }
.btn .spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; display: inline-block; }
.badge-pending { background: var(--brand-tint); color: #B8300F; }
.badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-rejected { background: var(--bad-bg); color: var(--bad); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert-info { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.alert-info a { color: var(--brand-dark); font-weight: 700; text-decoration: underline; }
.badge-muted { background: #e9e9e9; color: #555; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; display: block; color: #555; font-size: 13px; box-shadow: var(--elev-raised);
  animation: rise var(--dur-slow) var(--ease-out) both; }
.stats > .stat:nth-child(2) { animation-delay: 40ms; }
.stats > .stat:nth-child(3) { animation-delay: 80ms; }
.stats > .stat:nth-child(4) { animation-delay: 120ms; }
.stats > .stat:nth-child(5) { animation-delay: 160ms; }
.stats > .stat:nth-child(6) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stat b { display: block; font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat.hl { background: var(--brand-tint); }
.stat.active { outline: 2px solid var(--brand); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid #f5f5f5; }
.tbl .link { color: var(--brand); font-weight: 700; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.tbl tbody tr:hover { background: #fafafa; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }
.empty p { margin: 0 0 6px; }
.empty .empty-icon { display: flex; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: var(--surface); color: var(--muted); align-items: center; justify-content: center; font-size: 28px; }
.empty .hint { margin: 0 0 14px; }
.empty .btn { margin-top: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; line-height: 20px; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: var(--radius); font: inherit; background: #fff; color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint); }
.field .error { display: block; color: var(--bad); font-size: 12px; margin-top: 4px; }
.field .error[hidden] { display: none; }
/* Invalid feedback: red border plus helper text plus a short shake; the user's input is kept */
.field:has(> .error:not([hidden])) :is(input, select, textarea), .field.is-invalid :is(input, select, textarea) { border-color: var(--bad); }
.field.is-invalid :is(input, select, textarea) { animation: shake 280ms var(--ease-in-out); }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.money, .field input[data-money] { font-variant-numeric: tabular-nums; }

.dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }

/* Accounts / settings */
.school-tag { font-size: 12px; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tbl .actions form { margin: 0; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.badge-active { background: var(--ok-bg); color: var(--ok); }
.badge-disabled { background: var(--bad-bg); color: var(--bad); }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .hint { flex: 0 0 100%; margin-top: 0; }
.inline-form input { padding: 6px 10px; border: 1px solid #ddd; border-radius: var(--radius); font: inherit; }
.filter-bar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .field { min-width: 220px; }
.readonly-text { padding: 10px 0; font-weight: 500; }
details.rename summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; }
details > summary { display: list-item; min-height: 32px; line-height: 32px; }
.card.narrow { max-width: 560px; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand-tint); padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px; }
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 20px; }
.login-card .field { margin-bottom: 14px; }
.demo-hint { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Mobile */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .user .name, .user .school-tag { display: none; }
  .content { padding: 16px 16px 90px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 20; overflow-x: auto; }
  .bottom-nav a { flex: 1 0 auto; min-width: 64px; min-height: 48px; text-align: center; padding: 8px 6px; font-size: 11px; color: #777; }
  .bottom-nav a i { display: block; font-size: 22px; }
  .bottom-nav a.active { color: var(--brand); font-weight: 700; }

  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
  .tbl td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
}

/* Home feature cards */
.home-sub { margin: 4px 0 0; }
.feature-section { margin: 28px 0 14px; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--elev-raised); transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
a.feature-card:hover { border-color: var(--brand); box-shadow: var(--elev-overlay); transform: translateY(-2px); }
a.feature-card:active { transform: scale(.98); }
a.feature-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--brand-tint); color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 6px; }
.feature-title { font-size: 17px; font-weight: 700; }
.feature-desc { color: var(--muted); font-size: 14px; flex: 1; }
.feature-count { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.feature-count b { font-size: 30px; font-weight: 800; line-height: 1.1; }
.feature-count small { color: var(--muted); font-size: 13px; }
.feature-open { margin-top: 10px; color: var(--brand); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.feature-card.is-disabled { background: var(--surface); cursor: not-allowed; }
.feature-card.is-disabled .feature-icon { background: #e9e9e9; color: #888; }
.feature-card.is-disabled .feature-title { color: #666; }
.badge-soon { align-self: flex-start; background: #e9e9e9; color: #555; margin-top: 10px; }
@media (max-width: 1100px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }

/* Application form + record (Slice 2) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.req { color: var(--brand); font-weight: 700; }
.form-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: start; }
.section-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.section-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 7px 12px; border-radius: var(--radius); font-size: 13px; font-weight: 600; color: #444; }
.section-nav a:hover { background: var(--surface); }
.err-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; flex: none; }
.form-sections section.card { scroll-margin-top: 80px; }
.card[id] { scroll-margin-top: 80px; }
.section-nav-static { display: none; }
.age-row { display: flex; align-items: center; gap: 10px; }
.age-out { white-space: nowrap; font-weight: 700; color: var(--brand-dark); font-size: 13px; }
.check-label { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 600; }
.field .check-label input { width: auto; margin-top: 4px; }
details.second-guardian { margin-top: 16px; }
details.second-guardian summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.sub-h { font-size: 14px; margin: 18px 0 10px; color: var(--muted); }
.pre { white-space: pre-line; }

.badge-uploaded { background: var(--ok-bg); color: var(--ok); }
.badge-missing { background: #e9e9e9; color: var(--bad); }
.badge-needs-replacement { background: #FEF3C7; color: #92400E; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:first-child { border-top: 0; padding-top: 0; }
.doc-main { flex: 1 1 280px; min-width: 0; }
.doc-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.doc-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.doc-meta .link { color: var(--brand); font-weight: 700; }
.doc-note { margin-top: 6px; font-size: 13px; color: #92400E; }
.doc-actions { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc-upload input[type=file] { max-width: 100%; font: inherit; font-size: 13px; }
.doc-upload .file-error { flex-basis: 100%; color: var(--bad); font-size: 12px; }
.doc-actions details.rename .inline-form { margin-top: 8px; }
.doc-actions .inline-form input { flex: 1 1 160px; min-width: 0; }

@media (max-width: 900px) {
  .form-layout { grid-template-columns: 1fr; gap: 12px; }
  .section-nav, .section-nav-static { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; position: sticky; top: 53px; z-index: 10; background: #fff; padding: 8px 0; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
  .section-nav a { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
}

/* Document file picker (progressive enhancement: native input hidden only when JS enhances) */
.doc-upload.js-enhanced .file-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; opacity: 0; }
.doc-upload.js-enhanced { position: relative; }
.doc-upload.js-enhanced:focus-within .file-choose { outline: 3px solid var(--brand-tint); outline-offset: 1px; border-color: var(--brand); }
.file-ui { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; min-width: 0; }
.file-ui[hidden], .file-ui [hidden] { display: none !important; }
.file-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.file-info { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.file-name { overflow-wrap: anywhere; }
.file-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.file-thumb.skel-img { background: var(--skel); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: inherit; transform: none; box-shadow: var(--elev-flat); }
.btn-primary:disabled:hover { background: var(--brand); }
@media (max-width: 600px) {
  .doc-upload { flex-direction: column; align-items: stretch; }
  .doc-upload .file-ui { flex-direction: column; align-items: stretch; }
  .doc-upload .file-buttons .btn { flex: 1 1 0; }
  .doc-upload .btn, .doc-actions details.rename summary { min-height: 44px; }
  .doc-actions details.rename summary { display: flex; align-items: center; }
  .doc-actions .inline-form { flex-direction: column; align-items: stretch; }
  .doc-actions .inline-form input { flex: none; width: 100%; min-height: 44px; }
}

/* Slice 3: payments + admission decisions */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge-pay-nofee { background: #e9e9e9; color: #555; }
.badge-pay-unpaid { background: var(--bad-bg); color: var(--bad); }
.badge-pay-partial { background: #FEF3C7; color: #92400E; }
.badge-pay-paid { background: var(--ok-bg); color: var(--ok); }
.badge-enrolled { background: var(--ink); color: #fff; }
.badge-flag { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: #FEF3C7; color: #92400E; }
.badge-st { background: #e9e9e9; color: #555; }
.badge-st-requested { background: #FEF3C7; color: #92400E; }
.badge-st-denied { background: var(--bad-bg); color: var(--bad); }
.nowrap { white-space: nowrap; }
.text-bad { color: var(--bad); font-weight: 700; }
.text-ok { color: var(--ok); font-weight: 700; }
.mt { margin-top: 14px; }
.stat.bad { background: var(--bad-bg); }
.stat.bad b { color: var(--bad); }
.stat.ok { background: var(--ok-bg); }
.stat.ok b { color: var(--ok); }
.stat b.small { font-size: 20px; }
.stat small { display: block; font-size: 12px; margin-top: 2px; }

/* Decision card + timeline */
.decision-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.decision-head h2 { margin: 0; }
.reversal-strip { border: 1px solid #F5D98B; background: #FFFBEB; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.reversal-strip p { margin: 0 0 8px; }
.reversal-strip .inline-form { margin-top: 8px; }
.decision-actions { margin-top: 14px; }
.decision-actions details { margin-top: 12px; }
.decision-actions details summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; }
.decision-actions details .field { margin-top: 10px; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #ccc; border: 2px solid #fff; }
.timeline li.t-approved::before { background: var(--ok); }
.timeline li.t-rejected::before, .timeline li.t-denied::before { background: var(--bad); }
.timeline li.t-pending::before { background: var(--brand); }
.timeline .t-title { font-weight: 700; }
.timeline .t-meta { font-size: 13px; color: var(--muted); }
.timeline .t-note { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }

/* Finance */
.fin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.fin-form .form-grid { align-items: start; }
.fin-form .field input:not([type=file]), .fin-form .field select { min-height: 44px; }
.fin-form .btn-row { margin-top: 14px; }
.js-fin .fin-form { display: none; }
.js-fin .fin-form.open { display: block; animation: panel-in var(--dur-base) var(--ease-out) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.fin-form .btn-row { align-items: center; }
.kbd-hint { display: none; color: var(--muted); font-size: 12px; }
.js-fin .kbd-hint { display: inline; }
@media (pointer: coarse) { .js-fin .kbd-hint { display: none; } }
.kbd { font-size: 11px; border: 1px solid #ddd; border-radius: 4px; padding: 0 5px; background: #fff; }
.form-grid.doc-upload { display: grid; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.row-muted td { color: var(--muted); }
.tbl tr.row-muted .strike { text-decoration: line-through; }
.entry-title { font-weight: 700; }
.entry-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.row-actions details summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; }
.row-actions details form { margin-top: 8px; }
.row-actions .link { color: var(--brand); font-weight: 700; font-size: 13px; }
.row-actions .inline-form input { flex: 1 1 160px; min-width: 0; }
.statement { display: none; }
.statement h2 { font-size: 22px; }
.statement table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.statement td { padding: 5px 0; vertical-align: top; }
.statement td.num { text-align: right; white-space: nowrap; }
.statement tr.total td { border-top: 1px solid #000; font-weight: 800; }
.stmt-meta { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 2px 12px; font-size: 14px; }
.stmt-meta dd { margin: 0; }
.stmt-note { font-size: 12px; margin-top: 20px; }

@media (max-width: 600px) {
  .fin-actions .btn { flex: 1 1 100%; min-height: 44px; }
  .fin-form .btn-row .btn, .decision-actions .btn { min-height: 44px; }
  .tbl .num { text-align: right; }
  .row-actions { align-items: flex-end; }
  .tbl td[data-label="Actions"] { align-items: flex-start; }
  .stmt-meta { grid-template-columns: 1fr; }
}

/* Utilities (replace former inline styles) */
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-14 { margin-bottom: 14px; }
.fs-12 { font-size: 12px; }
.text-left { text-align: left; }
.hint-lead { margin: -6px 0 14px; }
.err-block { display: block; margin-bottom: 10px; }
.filter-flush { margin: 14px 0 0; }

/* Toasts: icon + text + colour; success auto-dismisses, errors stay */
.toasts { position: fixed; right: 16px; top: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 6px 12px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 600; border: 1px solid #bfe3c9; box-shadow: var(--elev-overlay);
  animation: toast-in var(--dur-slow) var(--ease-out) both; }
.toast.toast-error { background: var(--bad-bg); color: var(--bad); border-color: #F3C4BE; }
.toast .toast-icon { font-size: 22px; flex: none; margin-top: 1px; animation: pop var(--dur-base) var(--ease-out) 120ms both; }
.toast .toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 2px; }
.toast .toast-close { flex: none; background: none; border: 0; min-width: 44px; min-height: 44px; margin: -12px 0 -12px 0; cursor: pointer; color: inherit; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.toast .toast-close:hover { background: rgba(0, 0, 0, .06); }
.toast .toast-close:focus-visible { outline: 3px solid currentColor; outline-offset: -3px; }
.toast.leaving { animation: toast-out var(--dur-base) var(--ease-in) forwards; }
/* Info toast (neutral): used for "No changes were made." */
.toast.toast-info { background: var(--surface); color: var(--ink); border-color: #ddd; }
@keyframes toast-in { from { opacity: 0; transform: translate(16px, -8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translate(16px, -4px) scale(.98); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* Highlight of a changed row or metric (server flag, or location.hash fallback) */
.stat[id], tr[id], .card[id] { scroll-margin-top: 80px; }
tr.hl-flash { animation: hl-bg 1200ms var(--ease-out); }
@keyframes hl-bg { 0% { background-color: var(--brand-tint); } 100% { background-color: transparent; } }
.hl-flash:not(tr) { position: relative; }
.hl-flash:not(tr)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: rgba(240, 74, 35, .12); box-shadow: 0 0 0 3px rgba(240, 74, 35, .4); animation: hl-fade 1200ms var(--ease-out) forwards; }
@keyframes hl-fade { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Suggestions (OR number, student ID): label row has a fixed height so inputs line up across columns */
.label-row { display: flex; align-items: center; gap: 6px; height: 20px; margin-bottom: 6px; }
.label-row label { margin: 0; }
.field.has-tip { position: relative; }
.tip-btn { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 18px; cursor: pointer; transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.tip-btn::after { content: ""; position: absolute; inset: -12px; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--brand-dark); }
.tip-btn:active { transform: scale(.92); }
.tip-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tip { position: absolute; left: 0; right: 0; top: 26px; z-index: 12; display: none; padding: 10px 12px; border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.45; box-shadow: var(--elev-overlay); }
.field.has-tip.tip-open .tip { display: block; animation: panel-in var(--dur-fast) var(--ease-out) both; }
.has-tip:has(.tip-btn:hover) .tip, .has-tip:has(.tip-btn:focus-visible) .tip { display: block; }
.tip[hidden], .tip-btn[hidden], .suggest-row[hidden] { display: none !important; }
.suggest-row { margin-top: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px dashed var(--brand); border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.chip::after { content: ""; position: absolute; inset: -6px -4px; }
.chip:hover { background: #fbd9d3; }
.chip:active { transform: scale(.97); }
.chip:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.chip .chip-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* Skeleton loading: shimmer is a transform sweep; images pulse with opacity */
.skel-block { position: relative; overflow: hidden; background: var(--skel); border-radius: var(--radius-sm); }
.skel-block::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); transform: translateX(-100%); animation: shimmer 1.2s var(--ease-in-out) infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
img.skel-img { background: var(--skel); animation: skel-pulse 1.2s var(--ease-in-out) infinite; }
@keyframes skel-pulse { 50% { opacity: .55; } }
.content { position: relative; }
.skel-overlay { position: absolute; inset: 0; z-index: 15; overflow: hidden; background: #fff; padding: 24px; animation: fade-in var(--dur-base) var(--ease-out) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.skel-title { height: 28px; width: 40%; margin-bottom: 10px; }
.skel-sub { height: 14px; width: 25%; margin-bottom: 24px; }
.skel-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.skel-card { height: 76px; border-radius: var(--radius); }
.skel-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.skel-row { height: 18px; margin-bottom: 16px; }
.skel-row:last-child { margin-bottom: 0; }
.skel-row:nth-child(odd) { width: 100%; }
.skel-row:nth-child(even) { width: 82%; }
@media (max-width: 900px) { .skel-overlay { padding: 16px; } .skel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .skel-title { width: 70%; } }

/* ================= Slice 4: edit, delete, recycle bin, activity log ================= */

/* Notices (inline banners inside cards and dialogs) */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; }
.notice > i { font-size: 20px; flex: none; }
.notice p { margin: 0 0 4px; }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: #FFFBEB; border: 1px solid #F5D98B; color: #92400E; }
.notice-bad { background: var(--bad-bg); color: var(--bad); border: 1px solid #F3C4BE; }
.notice-info { background: var(--surface); border: 1px solid var(--line); }
.notice-stale { border-left: 4px solid var(--bad); }
.notice a.link { color: var(--brand-dark); font-weight: 700; text-decoration: underline; }

/* Modal: role=dialog, focus trapped and returned by app.js, Esc closes, backdrop click closes */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; background: rgba(17, 17, 17, .45); z-index: 70; display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-back.on { display: flex; animation: fade-in var(--dur-base) var(--ease-out) both; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 600px; box-shadow: var(--elev-overlay); padding: 22px; max-height: calc(100vh - 32px); overflow-y: auto; margin: auto; animation: panel-in var(--dur-slow) var(--ease-out) both; }
.modal h2 { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; overflow-wrap: anywhere; }
.modal .btn-row { margin-top: 16px; justify-content: flex-end; }
.modal .btn { min-height: 44px; }
.modal.danger { border-top: 4px solid var(--bad); }
.modal .field + .field { margin-top: 12px; }
.modal .field textarea { min-height: 64px; resize: vertical; }
.steps { display: flex; gap: 6px; margin: 0 0 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.steps span { padding: 3px 10px; border-radius: 12px; background: var(--surface); }
.steps span.on { background: var(--brand-tint); color: var(--brand-dark); }

/* Password field with show/hide toggle */
.pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 52px; min-height: 44px; }
.pw-toggle { position: absolute; right: 0; top: 0; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: var(--radius); cursor: pointer; font-size: 18px; color: var(--muted); }
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }

/* Diff list (before and after) */
.diff { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.diff li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.diff li:first-child { border-top: 0; }
.diff .k { color: var(--muted); font-size: 13px; }
.diff .k .badge { margin-left: 6px; font-size: 11px; padding: 1px 8px; }
.diff del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; white-space: pre-line; }
.diff ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; border-radius: 4px; padding: 0 4px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.diff .arrow { color: var(--muted); margin: 0 6px; }
.diff .diff-hidden { color: var(--muted); font-style: italic; }
@media (max-width: 600px) { .diff li { grid-template-columns: 1fr; } }

/* Edit form: change tracking */
.field.is-changed input, .field.is-changed select, .field.is-changed textarea { border-color: #E0A100; background: #FFFBEB; }
.field .was { display: none; font-size: 12px; color: #92400E; margin-top: 4px; gap: 6px; align-items: center; flex-wrap: wrap; }
.field.is-changed .was { display: flex; }
.field .was b { overflow-wrap: anywhere; white-space: pre-line; }
.field .was .was-undo { background: none; border: 0; color: var(--brand-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; min-height: 32px; padding: 0 6px; border-radius: var(--radius-sm); }
.field .was .was-undo:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.chg-dot { display: none; min-width: 20px; height: 20px; border-radius: 10px; background: #E0A100; color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; padding: 0 6px; }
.chg-dot.on { display: inline-flex; animation: pop var(--dur-base) var(--ease-out); }

/* Sticky review bar */
.review-bar { position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 10px 14px; margin-top: 8px; box-shadow: var(--elev-overlay);
  visibility: hidden; transform: translateY(90px); opacity: 0; pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-slow); }
.review-bar.on { visibility: visible; transform: none; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.review-bar > i { font-size: 20px; }
.review-bar .msg { flex: 1; min-width: 160px; font-weight: 600; }
.review-bar .btn { min-height: 44px; }
.review-bar .btn-quiet { color: #ddd; }
.review-bar .btn-quiet:hover { background: #333; }
@media (max-width: 900px) { .review-bar { bottom: 64px; } }

/* Medical gate (view page) */
.gate { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px dashed #ccc; border-radius: var(--radius); padding: 16px; }
.gate[hidden], .med-reveal[hidden] { display: none; }
.gate .gi { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); flex: none; }
.gate .gt { flex: 1; min-width: 200px; }
.gate .btn { min-height: 44px; }
.med-reveal { animation: panel-in var(--dur-base) var(--ease-out) both; }
.med-reveal:focus { outline: none; }

/* "More" menu */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--elev-overlay); min-width: 240px; padding: 6px; z-index: 25; display: none; }
.menu-list.on { display: block; animation: panel-in var(--dur-fast) var(--ease-out); }
.menu-list button { display: flex; width: 100%; gap: 10px; align-items: center; min-height: 44px; background: none; border: 0; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 10px; text-align: left; color: var(--ink); }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--surface); }
.menu-list button:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.menu-list .bad { color: var(--bad); }
.menu-list .sub-note { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }

/* Record history (view page) */
.hist-mini { list-style: none; margin: 0; padding: 0; }
.hist-mini li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; align-items: flex-start; }
.hist-mini li:last-child { border-bottom: 0; }
.hist-mini .log-ic { width: 30px; height: 30px; font-size: 16px; }
.hist-mini .hist-body { min-width: 0; overflow-wrap: anywhere; }
.hist-mini .hist-sub { font-size: 12px; color: var(--muted); }
.link-brand { color: var(--brand); font-weight: 700; }

/* Activity icons and rows */
.log-ic-wrap { display: contents; }
.log-ic { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--surface); color: #555; flex: none; }
.log-ic.edit { background: #FEF3C7; color: #92400E; }
.log-ic.del { background: var(--bad-bg); color: var(--bad); }
.log-ic.rest { background: var(--ok-bg); color: var(--ok); }
.log-ic.pay { background: var(--brand-tint); color: var(--brand-dark); }
.log-ic.view { background: #eef2ff; color: #3730A3; }
.log-ic.purge { background: var(--ink); color: #fff; }
.log-day { position: sticky; top: 62px; z-index: 5; background: #fff; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.log-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; align-items: start; }
.log-text { min-width: 0; overflow-wrap: anywhere; }
.log-text b { font-weight: 700; }
.log-text .rec { color: var(--brand-dark); font-weight: 700; text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--dur-fast) var(--ease-out); }
.log-text a.rec:hover { text-decoration-color: currentColor; }
.log-text .log-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.log-text details summary { cursor: pointer; color: var(--brand-dark); font-weight: 700; font-size: 13px; min-height: 32px; line-height: 32px; }
.log-text .diff { margin-top: 6px; }
.log-meta { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
@media (max-width: 600px) { .log-row { grid-template-columns: 36px minmax(0, 1fr); } .log-meta { grid-column: 2; text-align: left; white-space: normal; } }

/* Activity filters */
.log-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: start; margin-bottom: 6px; }
.log-filters .field input, .log-filters .field select { min-height: 44px; }
.log-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.chip-f { position: relative; border: 1px solid #ddd; background: #fff; border-radius: 999px; min-height: 36px; padding: 4px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--ink); transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.chip-f::after { content: ""; position: absolute; inset: -4px -2px; }
.chip-f:hover { background: var(--surface); }
.chip-f.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-dark); }
.chip-f:active { transform: scale(.97); }
.chip-f:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Pager */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pager .pg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pg-btn { min-width: 44px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ddd; background: #fff; border-radius: var(--radius); font-weight: 700; color: var(--ink); transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
a.pg-btn:hover { background: var(--surface); }
a.pg-btn:active { transform: scale(.97); }
a.pg-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.pg-btn.cur { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-btn.is-disabled { opacity: .45; }
.pg-gap { min-width: 20px; text-align: center; color: var(--muted); }

/* Recycle bin cards with a countdown ring */
.bin-grid { display: grid; gap: 12px; }
.bin-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elev-raised); background: #fff; animation: rise var(--dur-slow) var(--ease-out) both; }
.bin-grid > .bin-card:nth-child(2) { animation-delay: 40ms; }
.bin-grid > .bin-card:nth-child(3) { animation-delay: 80ms; }
.bin-grid > .bin-card:nth-child(4) { animation-delay: 120ms; }
.bin-grid > .bin-card:nth-child(5) { animation-delay: 160ms; }
.bin-grid > .bin-card:nth-child(6) { animation-delay: 200ms; }
.ring { --p: 50; --c: var(--ok); width: 60px; height: 60px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ececec 0); display: flex; align-items: center; justify-content: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 17px; font-weight: 800; line-height: 1; text-align: center; }
.ring b small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.ring.warn { --c: #E0A100; }
.ring.bad { --c: var(--bad); }
.bin-main { min-width: 0; }
.bin-main .nm { font-weight: 700; overflow-wrap: anywhere; }
.bin-main .meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.bin-main .why { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.bin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.bin-actions .btn { min-height: 44px; }
.expiry-tag { font-size: 12px; font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; margin: 0 0 12px; }
.legend i { font-size: 14px; vertical-align: -2px; }
.legend .dot-ok { color: var(--ok); }
.legend .dot-warn { color: #E0A100; }
.legend .dot-bad { color: var(--bad); }
.confirm-type { font-family: ui-monospace, Consolas, monospace; background: var(--surface); padding: 1px 6px; border-radius: 4px; font-weight: 700; overflow-wrap: anywhere; }
.bin-grid.no-countdown .bin-card { grid-template-columns: minmax(0, 1fr) auto; }
/* On/off switch (recycle bin auto-purge). Knob moves with transform only. */
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-text { display: flex; flex-direction: column; text-align: right; font-size: 13px; max-width: 320px; }
.switch-text small { color: var(--muted); }
.switch { position: relative; flex: none; width: 52px; height: 30px; padding: 0; border: 0; border-radius: 15px; background: #c9c9c9; cursor: pointer; transition: background-color var(--dur-base) var(--ease-in-out); }
.switch::before { content: ""; position: absolute; inset: -7px -4px; } /* 44px hit area */
.switch:focus-visible { outline: 3px solid var(--brand-tint); outline-offset: 2px; }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--elev-raised); transition: transform var(--dur-base) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(22px); }
.switch:active .switch-knob { transform: scale(0.95); }
.switch[aria-checked="true"]:active .switch-knob { transform: translateX(22px) scale(0.95); }
.switch:disabled, .switch[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.switch:disabled:active .switch-knob { transform: none; }
.switch[aria-checked="true"]:disabled:active .switch-knob { transform: translateX(22px); }
/* Wrapper for disabled controls: carries the tooltip and is keyboard-focusable (tabindex=0). */
.locked-action { display: inline-flex; align-items: center; cursor: not-allowed; border-radius: 8px; }
.locked-action:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-width: 700px) {
  .switch-row { width: 100%; justify-content: space-between; }
  .switch-text { text-align: left; max-width: none; }
  .bin-grid.no-countdown .bin-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .bin-card { grid-template-columns: 60px minmax(0, 1fr); }
  .bin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .bin-actions .btn { flex: 1; }
}

@media print { .modal-back, .review-bar, .menu, .pager .pg { display: none !important; } }

/* Reduced motion: no movement, shake, spin, stagger or shimmer. State changes are instant. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover, .btn:active, a.feature-card:hover, a.feature-card:active, .chip:active, .tip-btn:active { transform: none; }
  .btn .spin { border-right-color: currentColor; border-top-color: transparent; }
  .skel-block::after { display: none; }
  .hl-flash { outline: 2px solid var(--brand); outline-offset: -2px; }
  .hl-flash:not(tr)::after { display: none; }
}

@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; }
  .toasts, .skel-overlay { display: none !important; }
  .sidebar, .topbar, .bottom-nav, .backdrop, .no-print, .alert, .fin-screen { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  body { font-size: 13px; }
  .statement { display: block; }
}

/* Touch targets: 44px minimum only on coarse pointers; compact sizes on desktop. */
@media (pointer: coarse) {
  .btn, .btn-sm, .nav a, .section-nav a { min-height: 44px; }
  details > summary { min-height: 44px; line-height: 44px; }
}

/* Inline checkbox + label row (account form Developer flag). */
.check-row { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 500; cursor: pointer; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
