@import url("icons.css?v=21");
/* Supervisi Akademik SMK — v14 */

/* ══ LIGHT THEME (default) ══ */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --text: #0f172a;
  --text2: #334155;
  --text3: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #7c3aed;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
}

/* ══ DARK THEME ══ */
[data-theme="dark"],
html.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #1a2540;
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --text3: #94a3b8;
  --border: #2d3f55;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #1e3a5e;
  --accent: #a78bfa;
  --danger: #f87171;
  --success: #4ade80;
  --warning: #fbbf24;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}

/* ══ RESET ══ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1,h2,h3,h4 { color: var(--text); line-height: 1.3; }

/* ══ APP SHELL ══ */
.app-shell { display: flex; min-height: 100vh; }

/* ══ SIDEBAR ══ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 256px; background: #0f172a; color: #e2e8f0;
  display: flex; flex-direction: column;
  z-index: 1000; overflow-y: auto;
  transition: transform .25s ease;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}
body.sidebar-open .sidebar-overlay { display: block; }

.sidebar-header {
  padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; color: #f1f5f9; text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo {
  width: 38px; height: 38px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo .logo-text { font-weight: 700; font-size: 14px; color: #fff; }
.logo .app-logo-box { display: flex; }
.logo .app-logo-img, .logo img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong, .brand-text b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; display: block; }
.brand-text span { font-size: 11px; color: #94a3b8; }
.sidebar-close { display: none; background: none; border: none; color: #94a3b8; font-size: 20px; cursor: pointer; padding: 4px 8px; }

.sidebar-nav, .sidebar nav { padding: 12px 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-link, .sidebar nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  color: #cbd5e1; font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background .15s;
}
.nav-link:hover, .sidebar nav a:hover { background: rgba(255,255,255,.06); color: #f1f5f9; text-decoration: none; }
.nav-link.active, .sidebar nav a.active { background: rgba(59,130,246,.2); color: #60a5fa; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ MAIN ══ */
.main { flex: 1; margin-left: 256px; display: flex; flex-direction: column; min-height: 100vh; }

/* ══ TOPBAR ══ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  transition: background-color .2s, border-color .2s;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { font-size: 18px; font-weight: 700; margin: 0; }
.topbar-title p { font-size: 12px; color: var(--text3); margin: 0; }

.hamburger {
  display: none; background: none; border: 1px solid var(--border); cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hamburger span { display: block; width: 18px; height: 2px; background: var(--text2); border-radius: 2px; }

/* ══ THEME TOGGLE ══ */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background-color: var(--surface2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background-color .2s, border-color .2s, transform .2s;
}
.theme-toggle:hover { transform: scale(1.1); border-color: var(--primary); }
.theme-icon { line-height: 1; }

/* ══ USERBOX ══ */
.userbox { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role { font-size: 11px; color: var(--text3); text-transform: capitalize; }

/* ══ CONTENT ══ */
.content { padding: 24px; flex: 1; }

/* ══ ALERTS ══ */
.alert {
  padding: 14px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  margin-bottom: 16px; border: 1px solid; transition: background-color .2s, color .2s, border-color .2s;
}
.alert.success { background-color: #ecfdf5; border-color: #86efac; color: #166534; }
.alert.error { background-color: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert.warning { background-color: #fffbeb; border-color: #fde68a; color: #92400e; }
[data-theme="dark"] .alert.success, html.dark .alert.success { background-color: #064e3b; border-color: #065f46; color: #a7f3d0; }
[data-theme="dark"] .alert.error, html.dark .alert.error { background-color: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert.warning, html.dark .alert.warning { background-color: #451a03; border-color: #78350f; color: #fde68a; }

/* ══ GRID ══ */
.grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2,1fr); }
.grid.three { grid-template-columns: repeat(3,1fr); }

/* ══ CARDS ══ */
.card {
  background-color: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: background-color .2s, border-color .2s;
}
.stat { text-align: center; padding: 24px 16px; }
.stat span { font-size: 13px; color: var(--text3); display: block; margin-bottom: 4px; }
.stat b { font-size: 28px; color: var(--primary); }

.hero {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: var(--radius); padding: 32px; margin-bottom: 24px;
}
.hero h1, .hero h2, .hero p { color: #fff; }

/* ══ TOOLBAR ══ */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }

/* ══ BUTTONS ══ */
.btn, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item) {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none;
  background-color: var(--primary); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background-color .15s, transform .1s; white-space: nowrap;
}
.btn:hover, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item):hover { background-color: var(--primary-dark); text-decoration: none; transform: translateY(-1px); }
.btn.secondary { background-color: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background-color: var(--primary-light); border-color: var(--primary); }
.btn.danger { background-color: var(--danger); }
.btn.danger:hover { background-color: #dc2626; }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn.ok { background-color: var(--success); }
.btn.large { padding: 14px 28px; font-size: 16px; }

/* ══ FORMS ══ */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-size: 13px; font-weight: 600; color: var(--text2); display: block; margin-bottom: 6px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background-color: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .2s, background-color .2s, color .2s;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { min-height: 100px; resize: vertical; }

/* ══ TABLES ══ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; background-color: var(--surface); transition: background-color .2s; }
th { text-align: left; padding: 12px 16px; background-color: var(--surface2); color: var(--text2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); transition: background-color .2s, color .2s; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); transition: color .2s, background-color .2s; }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--primary-light); }

/* ══ BADGES ══ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background-color: var(--primary-light); color: var(--primary); }
.badge.green { background-color: #dcfce7; color: #166534; }
.badge.red { background-color: #fee2e2; color: #991b1b; }
[data-theme="dark"] .badge.green, html.dark .badge.green { background-color: #064e3b; color: #86efac; }
[data-theme="dark"] .badge.red, html.dark .badge.red { background-color: #450a0a; color: #fca5a5; }

/* ══ UTILITIES ══ */
.muted { color: var(--text3); }
.eyebrow { font-size: 13px; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.compact th { width: 180px; }
.no-print {}
.print-only { display: none; }

/* ══ LOGIN ══ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: var(--bg); padding: 24px; transition: background-color .2s; }
.login-card { width: 100%; max-width: 420px; background-color: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px; box-shadow: var(--shadow-lg); position: relative; transition: background-color .2s, border-color .2s; }
.login-logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.login-card h2 { text-align: center; font-size: 22px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text3); font-size: 14px; margin-bottom: 20px; }

/* ══ LETTERHEAD / REPORT ══ */
.letterhead { text-align: center; margin-bottom: 24px; }
.kop-line { border-top: 3px double var(--text); margin-top: 8px; }
.report-title { text-align: center; font-size: 18px; font-weight: 700; margin: 16px 0; color: var(--text); }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; text-align: center; }
.sign-box { padding-top: 80px; }
.sign-img { max-height: 60px; margin: 0 auto 4px; display: block; }
.school-logo-preview-box img, .school-logo-current { max-width: 90px; max-height: 90px; object-fit: contain; }

/* ══ LANDING ══ */
.landing-body { background-color: var(--bg); color: var(--text); transition: background-color .2s, color .2s; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background-color: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; transition: background-color .2s, border-color .2s; }
.landing-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none; }
.landing-brand:hover { text-decoration: none; }
.landing-brand img { height: 36px; width: 36px; border-radius: 8px; object-fit: cover; }
.landing-hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding: 60px 32px; max-width: 1100px; margin: 0 auto; }
.landing-hero h1 { font-size: 32px; margin-top: 8px; line-height: 1.3; }
.landing-hero p { color: var(--text2); }
.landing-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.landing-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; padding: 32px; max-width: 1100px; margin: 0 auto; }
.landing-stats > div { text-align: center; padding: 24px; background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: background-color .2s, border-color .2s; }
.landing-stats b { font-size: 28px; color: var(--primary); display: block; }
.landing-stats span { font-size: 13px; color: var(--text3); }
.landing-section { padding: 40px 32px; max-width: 1100px; margin: 0 auto; }
.landing-section h2 { font-size: 22px; margin-bottom: 20px; }

/* ══ PROGRESS ══ */
.progress-card { background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; min-width: 200px; transition: background-color .2s, border-color .2s; }
.progress-card b { display: block; margin-top: 12px; color: var(--text); }
.progress-card small { color: var(--text3); }
.progress-ring { width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--pct)*3.6deg), var(--border) 0); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.progress-ring span { width: 76px; height: 76px; border-radius: 50%; background-color: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--primary); transition: background-color .2s; }

/* ══ DOWNLOADS ══ */
.download-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.download-tile { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background-color: var(--surface); border: 1px solid var(--border); text-decoration: none; transition: border-color .2s, transform .2s, background-color .2s; }
.download-tile:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.download-tile b { color: var(--text); font-size: 15px; }
.download-tile span { color: var(--text3); font-size: 13px; }
.file-card {}
.empty-download { text-align: center; padding: 40px; color: var(--text3); grid-column: 1/-1; }
.empty-download b { display: block; color: var(--text2); margin-bottom: 4px; }

/* ══ DASHBOARD ══ */
.dashboard-progress { display: flex; flex-direction: column; gap: 12px; }
.progress-bar { height: 12px; background-color: var(--border); border-radius: 6px; overflow: hidden; transition: background-color .2s; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 6px; }
.stage-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 12px; }
.stage-grid a { display: block; padding: 14px; text-align: center; background-color: var(--primary-light); color: var(--primary); border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background-color .2s, color .2s; }
.stage-grid a:hover { background-color: var(--primary); color: #fff; text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   MOBILE APP OVERHAUL — Native-like experience
   ══════════════════════════════════════════════════════════ */

/* ── Bottom Navigation (hidden on desktop) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 1100;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2px 0 env(safe-area-inset-bottom, 4px);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  transition: background-color .2s, border-color .2s;
}
.bottom-nav-inner {
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bnav-item {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 6px 0 4px !important; min-height: 52px;
  text-decoration: none !important; color: var(--text3) !important;
  font-size: 10px !important; font-weight: 500 !important;
  background: none !important; border: none !important;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s !important;
  cursor: pointer; position: relative;
  border-radius: 0 !important; box-shadow: none !important;
  width: 100% !important; margin: 0 !important;
  transform: none !important;
}
.bnav-item:hover, .bnav-item:active { transform: none !important; opacity: 1 !important; }
.bottom-nav .bnav-icon { font-size: 22px; line-height: 1; display: block; }
.bottom-nav .bnav-label { font-size: 10px; line-height: 1.2; display: block; }
.bnav-item.active {
  color: var(--primary) !important; font-weight: 700 !important;
}
.bnav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%) !important;
  width: 32px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--primary);
}

/* ── Mobile sidebar full-screen overlay ── */
@media(max-width:768px) {
  .sidebar {
    width: 85vw !important; max-width: 320px;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,.3);
  }
  .sidebar-overlay {
    opacity: 0; transition: opacity .3s ease;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  }
  body.sidebar-open .sidebar-overlay { display: block; opacity: 1; }
  .sidebar-close {
    display: flex !important; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.1) !important;
    font-size: 18px;
  }
  .sidebar-nav, .sidebar nav { padding: 8px 6px; gap: 1px; }
  .nav-link, .sidebar nav a {
    padding: 14px 16px; border-radius: 12px;
    font-size: 15px; min-height: 48px;
  }
  .nav-icon { font-size: 20px; }
}

/* ══ RESPONSIVE — TABLET ══ */
@media(max-width:1024px) {
  .grid { grid-template-columns: repeat(2,1fr); }
  .grid.three { grid-template-columns: repeat(2,1fr); }
  .landing-hero { grid-template-columns: 1fr; text-align: center; }
  .landing-stats { grid-template-columns: repeat(2,1fr); }
  .stage-grid { grid-template-columns: repeat(2,1fr); }
}

/* ══ RESPONSIVE — MOBILE (≤768px) ══ */
@media(max-width:768px) {

  /* ── show bottom nav, hide desktop elements ── */
  .bottom-nav { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .sidebar-close { display: block; }

  /* ── APP-LIKE TOPBAR ── */
  .topbar {
    padding: 8px 14px; gap: 8px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    background-color: color-mix(in srgb, var(--surface) 85%, transparent) !important;
  }
  .topbar-title h1 { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
  .topbar-title p { font-size: 11px; display: none; }
  .topbar-right { gap: 6px; }
  .theme-toggle { width: 34px; height: 34px; font-size: 16px; }
  .userbox .user-info { display: none; }
  .user-avatar { width: 32px; height: 32px; font-size: 12px; }
  .userbox .btn.small.danger {
    padding: 5px 10px; font-size: 11px; min-height: 30px; border-radius: 6px;
  }

  /* ── CONTENT AREA ── */
  .content {
    padding: 12px 10px;
    padding-bottom: 72px !important;   /* space for bottom nav */
  }

  /* ── CARDS — rounder, elevated, stacked ── */
  .card {
    padding: 16px; border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 10px;
  }
  .card + .card { margin-top: 0; }
  .card h2 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
  .card h3 { font-size: 15px; font-weight: 600; }
  .card p.muted, .card .muted { font-size: 13px; line-height: 1.5; }

  /* ── GRID LAYOUT ── */
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
  .grid.two { grid-template-columns: 1fr; }

  /* ── STAT CARDS — compact app-style ── */
  .stat { padding: 16px 10px; border-radius: 14px; }
  .stat b { font-size: 24px; }
  .stat span { font-size: 11px; letter-spacing: .3px; }

  /* ── HERO ── */
  .hero { padding: 20px 16px; margin-bottom: 12px; border-radius: 14px; }
  .hero h1, .hero h2 { font-size: 18px; }
  .hero p { font-size: 13px; }

  /* ── ALERTS — floating toast-style ── */
  .alert {
    padding: 12px 16px; font-size: 13px; font-weight: 600;
    margin-bottom: 10px; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }

  /* ── BUTTONS — touch-optimized ── */
  .btn, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item) {
    min-height: 46px; padding: 11px 18px;
    font-size: 14px; border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active, button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item):active {
    transform: scale(.97) !important; opacity: .9;
  }
  .btn.small {
    min-height: 36px; padding: 7px 12px;
    font-size: 12px; border-radius: 8px;
  }
  .btn.large { min-height: 52px; font-size: 16px; }

  /* ── FORMS — spacious & touch-friendly ── */
  .form { gap: 14px; }
  .form.two { grid-template-columns: 1fr; gap: 14px; }
  .form.two > div[style*="grid-column"] { grid-column: auto !important; }
  label {
    font-size: 13px; font-weight: 700; margin-bottom: 6px;
    color: var(--text2); letter-spacing: .2px;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    font-size: 16px !important;          /* prevents iOS zoom */
    min-height: 48px; padding: 12px 14px;
    border-radius: 12px !important;
    border: 1.5px solid var(--border) !important;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
  }
  input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37,99,235,.1);
  }
  select {
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%2364748b' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
  }
  textarea { min-height: 100px; }
  input[type="file"] {
    padding: 10px 12px; font-size: 14px !important;
    border-style: dashed !important;
    background-color: var(--surface2) !important;
  }
  input[type="color"] { min-height: 44px; }
  input[type="date"], input[type="datetime-local"] {
    min-height: 48px;
  }
  small.muted, small { font-size: 12px; margin-top: 4px; display: block; }

  /* Simple tables become labelled cards. Complex tables remain scrollable. */
  .card { min-width: 0; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }
  .table-wrap table.compact { min-width: 0; }
  .table-wrap:has(.mobile-cards) { border: 0; border-radius: 0; overflow: visible; }
  table.mobile-cards { display: block; min-width: 0; background: none; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { display: flex; flex-direction: column; gap: 12px; }
  .mobile-cards tbody tr { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .mobile-cards tbody td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; line-height: 1.5; }
  .mobile-cards tbody tr:hover td { background: none; }
  .mobile-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--text3); margin-bottom: 4px; }
  .mobile-cards td.table-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
  .mobile-cards td.table-actions::before { flex-basis: 100%; }
  .mobile-cards td.table-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
  .mobile-cards td.table-actions form { flex: 1; }
  .mobile-cards td.table-actions button { width: 100%; justify-content: center; }
  .mobile-cards td input, .mobile-cards td select, .mobile-cards td textarea { max-width: 100%; }

  /* ── STAGE GRID — pill buttons ── */
  .stage-grid { grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 10px; }
  .stage-grid a {
    padding: 14px 10px; font-size: 13px; font-weight: 700;
    min-height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .stage-grid a.active {
    background-color: var(--primary); color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
  }

  /* ── TOOLBAR ── */
  .toolbar {
    flex-direction: column; align-items: stretch; gap: 10px;
    margin-bottom: 12px;
  }
  .toolbar h2 { font-size: 17px; }

  /* ── BADGES ── */
  .badge { font-size: 12px; padding: 4px 10px; border-radius: 8px; font-weight: 700; }

  /* ── PROGRESS ── */
  .progress-ring { width: 80px; height: 80px; }
  .progress-ring span { width: 60px; height: 60px; font-size: 16px; }
  .progress-card { padding: 20px; border-radius: 14px; }

  /* ── LANDING ── */
  .landing-nav { padding: 10px 16px; }
  .landing-hero { padding: 28px 16px; }
  .landing-hero h1 { font-size: 22px; }
  .landing-section { padding: 20px 16px; }
  .signature-grid { grid-template-columns: 1fr; gap: 20px; }
  .landing-stats { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .landing-stats > div { padding: 16px 12px; border-radius: 12px; }
  .landing-stats b { font-size: 24px; }
  .landing-stats span { font-size: 12px; }
  .landing-actions { flex-direction: column; gap: 8px; }
  .landing-actions .btn { width: 100%; justify-content: center; min-height: 50px; }

  /* ── DOWNLOADS ── */
  .download-grid { grid-template-columns: 1fr; gap: 8px; }
  .download-tile { padding: 16px; border-radius: 12px; }

  /* ── LOGIN ── */
  .login-wrap { padding: 16px; }
  .login-card {
    padding: 28px 20px; border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
  }
  .login-card h2 { font-size: 20px; }
  .login-sub { font-size: 13px; }
  .login-logo { font-size: 44px; }

  /* ── SIGNATURE ── */
  .sign-box { padding-top: 40px; }

  /* ── FORUM — mobile-friendly ── */
  /* category tabs: horizontal scroll */
  .card > .toolbar { flex-direction: column; align-items: stretch; }
  .card > .toolbar > .tabs,
  .tabs {
    overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important; white-space: nowrap;
    padding-bottom: 6px; margin: -4px -4px 0;
    scrollbar-width: none; /* Firefox */
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .btn { flex-shrink: 0; font-size: 12px; padding: 8px 14px; min-height: 38px; white-space: nowrap; }

  /* forum post list */
  .forum-list { gap: 10px !important; }
  .forum-post-card {
    padding: 14px !important; border-radius: 14px !important;
    border-left-width: 3px !important;
  }
  .forum-post-card h3 { margin: 0 0 6px 0 !important; }
  .forum-post-card h3 a { font-size: 15px !important; line-height: 1.4; }
  .forum-post-card p { margin: 10px 0 !important; font-size: 14px !important; }

  /* forum post detail */
  div[style*="max-width:900px"] { max-width: 100% !important; margin: 0 !important; }
  .card[style*="padding:25px"] { padding: 16px !important; }
  .card[style*="padding:20px"] { padding: 14px !important; }
  .card[style*="padding:15px"] { padding: 12px !important; }

  /* post header — stack avatar + text vertically on small screens */
  div[style*="display:flex; gap:15px;"] { gap: 10px !important; }
  div[style*="width:50px; height:50px"] { width: 40px !important; height: 40px !important; font-size: 18px !important; }
  .card h1[style*="font-size:22px"] { font-size: 17px !important; line-height: 1.3 !important; }
  div[style*="display:flex; gap:15px; flex-wrap:wrap; align-items:center"] {
    gap: 6px !important; font-size: 12px !important;
  }

  /* post actions (like, reply buttons) */
  div[style*="border-top:1px solid var(--border); display:flex; gap:10px"] {
    flex-wrap: wrap; gap: 8px !important;
  }

  /* reply cards */
  div[style*="padding-left:48px"] { padding-left: 0 !important; }
  div[style*="display:flex; gap:12px; align-items:flex-start"] { gap: 8px !important; }
  div[style*="width:36px; height:36px"] { width: 30px !important; height: 30px !important; font-size: 12px !important; }
  div[style*="white-space:pre-wrap"] {
    word-break: break-word !important; overflow-wrap: break-word !important;
    font-size: 14px !important;
  }

  /* forum create / edit */
  .card[style*="max-width:800px"] { max-width: 100% !important; }

  /* admin actions row on post — stack on mobile */
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] {
    gap: 10px !important;
  }
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] > div[style*="display:flex; gap:10px"] {
    width: 100%;
  }
  div[style*="display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap"] > div[style*="display:flex; gap:10px"] .btn {
    flex: 1;
  }
}

/* ══ RESPONSIVE — SMALL PHONES (≤480px) ══ */
@media(max-width:480px) {
  .content { padding: 8px 6px; padding-bottom: 72px !important; }
  .card { padding: 14px 12px; border-radius: 12px; }
  .grid, .grid.two, .grid.three { grid-template-columns: 1fr; gap: 8px; }
  .landing-stats { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; gap: 6px; }
  .login-card { padding: 24px 16px; }
  .download-grid { grid-template-columns: 1fr; }

  /* full-width primary buttons */
  .btn:not(.small):not(.secondary), button:not(.hamburger):not(.theme-toggle):not(.sidebar-close):not(.bnav-item):not(.small):not(.secondary):not(.bnav-item) {
    width: 100%; justify-content: center;
  }

  /* topbar ultra-compact */
  .topbar { padding: 6px 10px; }
  .topbar-title h1 { font-size: 15px; }
  .hamburger { width: 34px; height: 34px; }

  /* card-table tweaks */
  tr { padding: 12px; border-radius: 10px; }
  td:first-child { font-size: 14px; }
  td { font-size: 13px; }
  td .btn.small { font-size: 12px; min-height: 36px; }

  /* stat card */
  .stat b { font-size: 20px; }
  .stat span { font-size: 11px; }
}

/* ══ RESPONSIVE — VERY SMALL (≤360px) ══ */
@media(max-width:360px) {
  .topbar-title h1 { font-size: 14px; }
  .bottom-nav .bnav-label { font-size: 9px; }
  .bottom-nav .bnav-icon { font-size: 20px; }
  .card { padding: 12px 10px; }
  tr { padding: 10px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { padding: 10px 12px; }
}

/* ══ TOUCH FEEDBACK — global ══ */
@media(hover: none) and (pointer: coarse) {
  .btn:active, .nav-link:active, .stage-grid a:active,
  .download-tile:active, tr:active {
    transform: scale(.98);
    transition: transform .1s;
  }
  .card:has(form) { /* cards with forms get no transform */ }
  a { -webkit-tap-highlight-color: transparent; }
}

/* ══ SAFE AREA — notched phones ══ */
@supports(padding: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 4px); }
  @media(max-width:768px) {
    .content { padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  }
}

/* ══ PRINT ══ */
@media print {
  .no-print,.sidebar,.sidebar-overlay,.topbar,.hamburger,.theme-toggle,.btn,.alert,.bottom-nav { display: none !important; }
  .print-only { display: block !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  table { display: table !important; }
  thead { display: table-header-group !important; }
  tbody { display: table-row-group !important; }
  tr { display: table-row !important; padding: 0; border: none; box-shadow: none; border-radius: 0; }
  td, th { display: table-cell !important; padding: 8px 12px !important; border-bottom: 1px solid #ddd !important; }
}


/* ══ LANDING HERO — ALWAYS READABLE (white text on gradient/banner) ══ */
/* Without banner: use primary→accent gradient so text is always white */
.landing-hero {
  background: linear-gradient(135deg, var(--primary, #2563eb), var(--accent, #7c3aed)) !important;
  color: #fff !important;
}
.landing-hero .eyebrow { color: rgba(255,255,255,.85) !important; }
.landing-hero h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.landing-hero p { color: rgba(255,255,255,.8) !important; }
.landing-hero .btn.secondary { background-color: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.landing-hero .btn.secondary:hover { background-color: rgba(255,255,255,.25); }
.landing-hero .progress-card { background-color: rgba(255,255,255,.12); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); }
.landing-hero .progress-card b { color: #fff; }
.landing-hero .progress-card small { color: rgba(255,255,255,.75); }
.landing-hero .progress-ring span { background-color: rgba(0,0,0,.5); color: #fff; }

/* With banner image: the inline style already has overlay gradient, just enhance text shadow */
.landing-hero[style*="background-image"] { background: none !important; }
.landing-hero[style*="background-image"] h1 { text-shadow: 0 3px 20px rgba(0,0,0,.5); }


/* Compact choice controls on all devices; the label remains a large touch target. */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-width: 18px; min-height: 18px; padding: 0; margin: 0; flex: 0 0 18px; accent-color: var(--primary); border-radius: 4px; box-shadow: none; vertical-align: middle; }
.choice-label { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; cursor: pointer; }
.choice-label input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.nav-icon, .bnav-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.bottom-nav .bnav-icon { font-size: 20px; height: 22px; }
.theme-icon { display: inline-flex; align-items: center; justify-content: center; }
.main, .content, .form.two > div { min-width: 0; }
@media print {
  table.mobile-cards { display: table !important; background: var(--surface) !important; }
  .mobile-cards thead { display: table-header-group !important; }
  .mobile-cards tbody { display: table-row-group !important; }
  .mobile-cards tbody tr { display: table-row !important; border: 0; }
  .mobile-cards tbody td { display: table-cell !important; padding: 8px !important; border-bottom: 1px solid #ddd !important; }
  .mobile-cards td::before { display: none !important; }
  .table-wrap table { min-width: 0 !important; }
}

@media (min-width: 769px) {
  td.table-actions { white-space: nowrap; }
  td.table-actions .btn + .btn { margin-left: 4px; }
}
.theme-toggle { color: var(--text2); }
@media (max-width: 768px) {
  .sidebar-open .bottom-nav { visibility: hidden; pointer-events: none; }
}

/* v18: shared report layout; scoped so admin forms keep their existing styling. */
.report-card { max-width: 1120px; margin: 16px auto; padding: 28px; }
.report-options { margin-bottom: 16px; }
.report-card .report-letterhead { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 3px double var(--text2); }
.report-card .letter-logo { width: 72px; height: 72px; max-width: 72px; max-height: 72px; flex: 0 0 72px; object-fit: contain; }
.report-card .letterhead-text { flex: 1; min-width: 0; text-align: center; }
.report-card .letterhead h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; text-transform: uppercase; }
.report-card .letterhead p { margin: 3px 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.report-card .report-title { margin: 16px 0 20px; text-align: center; font-size: 19px; line-height: 1.4; }
.report-card .report-title small { display: block; margin: 4px 0 0; font-size: 13px; font-weight: 400; }
.report-card h3 { margin: 20px 0 8px; font-size: 15px; break-after: avoid; }
.report-card p { line-height: 1.6; }
.report-card table { table-layout: auto; }
.report-card th, .report-card td { vertical-align: top; line-height: 1.5; }
.report-card .report-date { white-space: nowrap; }
.report-card .report-signatures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 40px; margin-top: 32px; text-align: center; }
.report-card .signature-person { min-width: 0; break-inside: avoid; page-break-inside: avoid; }
.report-card .signature-person:last-child { grid-column: 2; }
.report-card .signature-caption { min-height: 48px; }
.report-card .signature-caption p { margin: 0; }
.report-card .signature-space { height: 84px; display: flex; align-items: center; justify-content: center; }
.report-card .signature-space .sign-img { display: block; width: auto; max-width: 180px; height: auto; max-height: 76px; margin: 0; object-fit: contain; }
.report-card .signature-name { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .report-card { padding: 16px; }
  .report-card .letterhead h2 { font-size: 18px; }
  .report-card .report-letterhead { gap: 12px; }
  .report-card .letter-logo { width: 52px; height: 52px; max-width: 52px; max-height: 52px; flex-basis: 52px; }
  .report-card .report-signatures { grid-template-columns: 1fr; gap: 24px; }
  .report-card .signature-person:last-child { grid-column: auto; }
  .report-card .signature-caption { min-height: 44px; }
}
@page { size: A4 portrait; margin: 12mm 12mm 14mm; }
@media print {
  html, body, .app-shell, .main, .content { display: block !important; width: auto !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  :root, html[data-theme], html.dark { --surface: #fff; --surface2: #f5f5f5; --text: #111; --text2: #333; --text3: #555; --border: #ccc; --primary-light: #f5f5f5; }
  .report-card { display: block; width: 100%; max-width: none; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; color: #111 !important; background: #fff !important; font: 10pt/1.4 Arial,sans-serif; }
  .report-card .report-letterhead { display: flex !important; gap: 5mm; padding-bottom: 4mm; margin-bottom: 5mm; break-inside: avoid; page-break-inside: avoid; }
  .report-card .letter-logo { width: 20mm; height: 20mm; max-width: 20mm; max-height: 20mm; flex-basis: 20mm; }
  .report-card .letterhead h2 { font-size: 16pt; }
  .report-card .letterhead p { font-size: 9pt; }
  .report-card .report-title { font-size: 13pt; margin: 4mm 0 5mm; break-after: avoid; }
  .report-card .report-title small { font-size: 9pt; }
  .report-card h3 { font-size: 10pt; margin: 4mm 0 2mm; break-after: avoid; page-break-after: avoid; }
  .report-card p { margin: 1mm 0 3mm; }
  .report-card .table-wrap { display: block; overflow: visible !important; width: 100%; max-width: none; border: 0; border-radius: 0; }
  .report-card table, .report-card table.mobile-cards { display: table !important; width: 100% !important; min-width: 0 !important; table-layout: fixed; font-size: 9pt; background: #fff !important; border-collapse: collapse; }
  .report-card thead, .report-card .mobile-cards thead { display: table-header-group !important; }
  .report-card tbody, .report-card .mobile-cards tbody { display: table-row-group !important; }
  .report-card tr, .report-card .mobile-cards tbody tr { display: table-row !important; break-inside: avoid; page-break-inside: avoid; border: 0; border-radius: 0; box-shadow: none; }
  .report-card th, .report-card td, .report-card .mobile-cards tbody td { display: table-cell !important; padding: 2mm !important; border: 1px solid #ccc !important; font-size: 9pt !important; color: #111 !important; line-height: 1.4; overflow-wrap: anywhere; }
  .report-card th { text-transform: none; letter-spacing: 0; background: #f5f5f5 !important; }
  .report-card td::before { display: none !important; }
  .report-card table.compact th { width: 38mm; }
  .report-card .report-instrument-table th:nth-child(1) { width: 23%; }
  .report-card .report-instrument-table th:nth-child(2) { width: 43%; }
  .report-card .report-instrument-table th:nth-child(3), .report-card .report-instrument-table th:nth-child(4) { width: 8%; }
  .report-card .report-instrument-table th:nth-child(5) { width: 18%; }
  .report-card .report-summary-table { font-size: 9pt; }
  .report-card .report-summary-table th, .report-card .report-summary-table td { font-size: 9pt !important; padding: 1.5mm !important; }
  .report-summary-table th:nth-child(1) { width: 5%; }
  .report-summary-table th:nth-child(2) { width: 14%; }
  .report-summary-table th:nth-child(3) { width: 10%; }
  .report-summary-table th:nth-child(4) { width: 20%; }
  .report-summary-table th:nth-child(5) { width: 15%; }
  .report-summary-table th:nth-child(6) { width: 12%; }
  .report-summary-table th:nth-child(7) { width: 6%; }
  .report-summary-table th:nth-child(8) { width: 18%; }
  .report-card .report-signatures { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 7mm 10mm; margin-top: 8mm; }
  .report-card .signature-person:last-child { grid-column: 2; }
  .report-card .signature-caption { min-height: 12mm; }
  .report-card .signature-caption p { margin: 0; }
  .report-card .signature-space { height: 22mm; }
  .report-card .signature-space .sign-img { max-width: 45mm; max-height: 20mm; }
  .report-card .signature-name { font-size: 9pt; margin: 0; }
  .report-card .no-print { display: none !important; }
}

@media print {
  .report-card .no-print,
  .report-card .mobile-cards tbody td.no-print,
  .report-card .mobile-cards thead th.no-print { display: none !important; }
  .report-recap-table th:nth-child(1) { width: 14%; }
  .report-recap-table th:nth-child(2) { width: 17%; }
  .report-recap-table th:nth-child(3) { width: 20%; }
  .report-recap-table th:nth-child(4) { width: 9%; }
  .report-recap-table th:nth-child(5) { width: 12%; }
  .report-recap-table th:nth-child(6) { width: 28%; }
}

@media print {
  .report-card .signature-group-compact { break-inside: avoid; page-break-inside: avoid; }
}

/* v22: configurable three-column letterhead with independent left/right logos. */
.report-card .report-letterhead {
  display: grid; grid-template-columns: 106px minmax(0,1fr) 106px;
  align-items: center; gap: 16px; border-bottom: 3px solid var(--text2);
  padding-bottom: 12px; margin-bottom: 20px; font-family: Arial,sans-serif;
}
.report-card .letterhead-logo-slot { display: flex; align-items: center; justify-content: center; min-width: 0; }
.report-card .letterhead-logo-slot .letter-logo { width: 106px; height: 140px; max-width: 100%; max-height: 140px; flex: none; object-fit: contain; }
.report-card .letterhead-text { min-width: 0; text-align: center; }
.report-card .letterhead p { margin: 0; }
.report-card .letterhead .letterhead-government { font-size: 20px; font-weight: 400; line-height: 1.25; text-transform: uppercase; }
.report-card .letterhead .letterhead-heading, .report-card .letterhead .letterhead-school-name { font-size: 22px; font-weight: 700; line-height: 1.2; text-transform: uppercase; margin: 0; }
.report-card .letterhead .letterhead-contact { font-size: 14px; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.report-card .letterhead .letterhead-school-name + .letterhead-contact { margin-top: 6px; }
.report-card .letterhead-email { text-decoration: underline; }
.report-card.report-header-preview { margin: 16px 0; padding: 0; border: 0; box-shadow: none; background: none; }
.report-card.report-header-preview .report-letterhead { grid-template-columns: 68px minmax(0,1fr) 68px; gap: 10px; }
.report-card.report-header-preview .letterhead-logo-slot .letter-logo { width: 68px; height: 106px; max-height: 106px; }
.report-card.report-header-preview .letterhead-government { font-size: 14px; }
.report-card.report-header-preview .letterhead-heading, .report-card.report-header-preview .letterhead-school-name { font-size: 17px; }
@media (max-width:768px) {
  .report-card .report-letterhead, .report-card.report-header-preview .report-letterhead { grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; }
  .report-card .letterhead-logo-slot .letter-logo, .report-card.report-header-preview .letterhead-logo-slot .letter-logo { width: 44px; height: 72px; max-height: 72px; }
  .report-card .letterhead .letterhead-government { font-size: 14px; }
  .report-card .letterhead .letterhead-heading, .report-card .letterhead .letterhead-school-name, .report-card.report-header-preview .letterhead-heading, .report-card.report-header-preview .letterhead-school-name { font-size: 16px; }
}
@media print {
  .report-card .report-letterhead { display: grid !important; grid-template-columns: 29mm minmax(0,1fr) 29mm !important; gap: 4mm; border-bottom: 2pt solid #111; padding-bottom: 3mm; margin-bottom: 5mm; }
  .report-card .letterhead-logo-slot .letter-logo { width: 29mm; height: 38mm; max-width: 29mm; max-height: 38mm; flex: none; }
  .report-card .letterhead .letterhead-government { font-size: 12.5pt; line-height: 1.15; }
  .report-card .letterhead .letterhead-heading, .report-card .letterhead .letterhead-school-name { font-size: 14pt; line-height: 1.15; margin: 0; }
  .report-card .letterhead .letterhead-contact { font-size: 9pt; line-height: 1.25; margin-top: .5mm; }
  .report-card .letterhead .letterhead-school-name + .letterhead-contact { margin-top: 1.5mm; }
}

.report-card .report-letterhead.letterhead-no-logos { grid-template-columns: minmax(0,1fr) !important; }
.report-card .letterhead-no-logos .letterhead-logo-slot { display: none; }

.settings-preview-card { align-self: start; }

/* v23: contact lines use the full letterhead width, not the narrow title column. */
.report-card .report-letterhead, .report-card.report-header-preview .report-letterhead { row-gap: 4px; }
.report-card .letterhead-details { grid-column: 1 / -1; min-width: 0; text-align: center; }
.report-card .letterhead-contact-part { display: inline-block; max-width: 100%; vertical-align: top; overflow-wrap: anywhere; }
.report-card .letterhead-logo-slot .letter-logo,
.report-card.report-header-preview .letterhead-logo-slot .letter-logo { height: auto; }
@media print {
  .report-card .report-letterhead { row-gap: 1mm; }
}
@media print {
  .report-card .report-letterhead { row-gap: .5mm; padding-bottom: 2mm; margin-bottom: 4mm; }
}
