/* Shared finishing details for the STI portal and its report workspaces. */
:root {
  --surface: #fff;
  --surface-soft: #f2f6fc;
  --surface-hover: #eaf1fb;
  --line-strong: #a9bcd5;
  --timeline-line: #bdcadc;
  --focus-ring: #215fca;
  --control-radius: 7px;
  --panel-radius: 10px;
  --panel-shadow: 0 2px 5px #142c5004, 0 14px 36px #142c5008;
  --control-shadow: 0 1px 2px #142c5010;
  font-family: "Segoe UI", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --surface: #172336;
  --surface-soft: #1b2a40;
  --surface-hover: #243852;
  --line-strong: #7186a4;
  --timeline-line: #5a7090;
  --focus-ring: #a9caff;
  --panel-shadow: 0 2px 5px #00000012, 0 14px 36px #00000018;
  --control-shadow: 0 1px 2px #00000020;
}

body { -webkit-font-smoothing: antialiased; }
button:hover:not(:disabled) { filter: none; }
button, a, summary { -webkit-tap-highlight-color: #5786cd20; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
.site-header :is(button, a):focus-visible { outline-color: #ffe384; }
.icon {
  display: inline-block;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}
.icon, .button-spinner { vertical-align: middle; }

/* One comfortable control size, with distinct hover, press, and busy states. */
.button,
.reports-heading .button,
#reportFilters .button,
.moderation-box .moderation-actions .button,
.evidence-source .button,
.evidence-viewer-footer .button {
  min-height: 44px;
  border-radius: var(--control-radius);
  gap: 9px;
  line-height: 1.45;
  transition: background-color .16s, border-color .16s, box-shadow .16s, transform .16s;
}
.button { min-height: 46px; }
.button.small { min-height: 40px; }
.button.primary { box-shadow: inset 0 1px 0 #ffffff16, var(--control-shadow); }
.button.secondary { box-shadow: var(--control-shadow); }
.button.danger:hover:not(:disabled) { background: #ffe5e2; border-color: #d98a83; }
:root[data-theme="dark"] .button.danger:hover:not(:disabled) { background: #4a2a37; border-color: #b67a88; }
.button:active:not(:disabled), .icon-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}
.button:disabled, .icon-button:disabled { box-shadow: none; transform: none; }
button[aria-busy="true"] {
  cursor: progress;
  opacity: 1;
  transform: none;
}
.button-spinner {
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.button[aria-busy="true"], .login-card .button.primary[aria-busy="true"] { justify-content: center; }
.button-status { min-width: 0; }
.icon-button,
.detail-head .detail-actions .icon-button,
.evidence-viewer-head .icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--control-radius);
  color: var(--muted);
  box-shadow: var(--control-shadow);
}
.icon-button .icon { width: 18px; height: 18px; }
.icon-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border-radius: 4px;
  line-height: 1.5;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { text-decoration: none; }
.is-copied, :root[data-theme="dark"] .is-copied {
  color: var(--green);
  border-color: var(--green);
  background: var(--surface-soft);
}

/* Keep header actions legible and give every icon a real touch target. */
.site-header { box-shadow: 0 3px 12px #142c500a; }
.brand img { border-radius: 2px; }
.brand strong { letter-spacing: -.025em; }
.header-controls { gap: 14px; }
.theme-toggle, .header-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.35;
  transition: background-color .16s, border-color .16s;
}
.theme-toggle .icon { width: 17px; height: 17px; }
.header-signout { gap: 7px; }
.header-signout .icon { width: 16px; height: 16px; }
.header-help { min-height: 44px; padding: 10px 6px; border-radius: 5px; gap: 9px; }
.header-help:hover, .header-signout:hover:not(:disabled) { background: #ffffff14; }
.avatar { border-radius: 6px; }

/* Preserve the two-column school poster, with softer edges and clearer type. */
.welcome-page .welcome {
  border-radius: var(--panel-radius);
  border-color: var(--line);
  box-shadow: var(--panel-shadow);
}
.welcome-copy {
  border-radius: var(--panel-radius) 0 0 0;
  background: linear-gradient(145deg, #f1f6ff, #eaf1fc);
}
.welcome-auth { border-radius: 0 var(--panel-radius) 0 0; padding: 34px 36px 26px; }
.welcome-copy h1 { text-wrap: balance; }
.welcome-copy > .lead { line-height: 1.9; }
.campus-mark picture, .mascot-help img { animation: none; }
.poster-top { letter-spacing: .085em; }
.poster-bottom { letter-spacing: .1em; }
.auth-overline { margin-bottom: 22px; letter-spacing: .12em; }
.auth-overline::before { width: 21px; height: 3px; border-radius: 2px; }
.login-card h2 { font-size: 26px; line-height: 1.3; letter-spacing: -.035em; }
.login-card > .muted { font-size: 13px; }
.auth-tabs { gap: 24px; margin: 19px 0 23px; }
.auth-tabs button, .auth-tabs button[aria-selected="true"] {
  min-height: 44px;
  padding: 10px 3px 12px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px 3px 0 0;
  transition: color .16s, background-color .16s, border-color .16s;
}
.auth-tabs button:hover { background: var(--surface-soft); color: var(--blue); }
.auth-tabs button:focus-visible { outline-offset: -3px; }
.login-card .stack { gap: 20px; }
.login-card .button.primary { min-height: 48px; padding: 13px 17px; }
.login-card .button.primary > .icon { width: 18px; height: 18px; }
.login-footnote { line-height: 1.8; }
.staff-access { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.staff-access .text-button { padding: 7px 6px; margin-left: 0; min-height: 40px; }
.demo-access { border-radius: 6px; padding: 12px 14px; }
.demo-access button { min-height: 40px; }
.welcome .journey {
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
  padding: 25px 30px;
  gap: 25px;
}
.journey-step { align-items: center; gap: 13px; }
.step-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 11px;
}
.journey-step h3 { font-size: 13px; margin-bottom: 4px; }
.journey-step p { line-height: 1.7; }
.welcome-guide {
  border-radius: var(--panel-radius);
  padding: 34px 32px;
  box-shadow: var(--panel-shadow);
}
.guide-heading > p { font-size: 13px; }
.welcome-faq summary {
  min-height: 54px;
  padding: 13px 0;
  font-size: 13px;
  line-height: 1.65;
}
.welcome-faq summary .icon {
  width: 27px;
  height: 27px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  transition: transform .18s, background-color .18s, border-color .18s;
}
.welcome-faq summary:hover { color: var(--blue); }
.welcome-faq summary:hover .icon { border-color: var(--line-strong); background: var(--surface-hover); }
.welcome-faq details[open] summary { color: var(--blue); }
.welcome-faq details[open] summary .icon { border-color: var(--line-strong); }
.welcome-faq details > p { padding-right: 36px; line-height: 1.9; }

/* Inputs and password controls share borders, rhythm, and focused feedback. */
.field input, .field textarea, .field select,
.report-form-card .field input, .report-form-card .field textarea, .report-form-card .field select,
#reportFilters input, #reportFilters select, .moderation-box .field textarea {
  border-radius: var(--control-radius);
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
.field input, .field select, .login-card .field input { min-height: 48px; }
.field label, .field-label { line-height: 1.5; }
.field :is(input, textarea, select):not(:disabled):not(:focus):hover { border-color: var(--line-strong); }
.field :is(input, textarea, select):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.field input::placeholder, .field textarea::placeholder { opacity: 1; }
.field .password-wrap input { padding-right: 88px; }
.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  min-height: 40px;
  right: 4px;
  padding: 8px;
  border-radius: 5px;
  line-height: 1.4;
}
.password-toggle .icon { width: 16px; height: 16px; }
.password-toggle:focus-visible { outline-offset: -2px; }
.password-toggle:disabled { pointer-events: none; }
.verification-digit { border-radius: var(--control-radius); }
.verification-card .verification-method { min-height: 40px; }
.form-message { border-radius: var(--control-radius); padding: 12px 14px; }

/* Workspace cards retain their blue document rules and quieter supporting UI. */
.portal-intro { padding-bottom: 25px; }
.portal-intro h1 { line-height: 1.2; }
.workspace-date { font-variant-numeric: tabular-nums; gap: 7px; }
.portal-nav { gap: 12px; padding-top: 4px; }
.portal-nav button { border-radius: 5px 5px 0 0; }
.portal-nav button:focus-visible { outline-offset: -4px; }
.portal-nav button[aria-selected="true"] { background: var(--surface-soft); }
.card, .account-card, .report-form-card, .success-card, .reports-empty {
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
}
.report-sidebar .guide-card { box-shadow: none; }
.account-heading-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
}
.account-card > h3 { gap: 11px; }
.account-card > .help { margin-top: 13px; }
.security-state, .security-actions details { border-radius: 7px; }
.session-item { gap: 16px; }
.report-form-card .identity-card { border-radius: 6px; }
.report-form-card .upload-zone { border-radius: 8px; }
.report-form-card .upload-zone:hover { background: var(--surface-soft); border-color: var(--blue); }
.report-form-card .file-item { gap: 9px; padding: 7px 9px 7px 12px; border-radius: 6px; }
.report-form-card .file-item .file-name { min-width: 0; flex: 1; }
.report-form-card .file-item button {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 5px;
}
.report-form-card .file-item button:hover { background: var(--surface-hover); color: var(--blue); }
.report-form-card .file-item button .icon { width: 17px; height: 17px; }
.queue-stats { border-radius: 8px; box-shadow: var(--control-shadow); }
.queue-stat:first-child { border-radius: 7px 0 0 7px; }
.queue-stat:last-child { border-radius: 0 7px 7px 0; }
.queue-stat:focus-visible { position: relative; z-index: 1; outline-offset: -4px; }
.queue-stat strong { font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.queue-stat-icon { color: var(--muted); }
#reportFilters :is(input, select) { min-height: 44px; }
#clearFilters { min-height: 44px; height: auto; padding: 9px 5px; }
.reports-list { border-radius: 8px; box-shadow: var(--control-shadow); }
.report-item:first-child { border-radius: 6px 6px 0 0; }
.report-item:last-child { border-radius: 0 0 6px 6px; }
.report-item:only-child { border-radius: 6px; }
.report-item:focus-visible { outline-offset: -4px; }
.report-item h3 { line-height: 1.45; }
.report-item-bottom { gap: 12px; }
.pagination .button { min-height: 44px; }
.status-badge { font-variant-numeric: tabular-nums; }

/* Dialog actions stay aligned and reachable on the smallest screens. */
.detail-dialog, .evidence-dialog {
  border-radius: var(--panel-radius);
  box-shadow: 0 24px 90px #071a3b40;
}
.detail-dialog::backdrop { background: #0c1d36a6; }
.detail-head { border-radius: 9px 9px 0 0; }
.detail-actions { gap: 8px; }
.detail-progress-card, .detail-facts, .moderation-box, .evidence-stage { border-radius: 7px; }
.timeline { margin-top: 18px; }
.timeline > li {
  position: relative;
  margin-left: 0;
  padding: 0 0 24px 30px;
  border: 0;
}
.timeline > li::before {
  content: "";
  box-sizing: border-box;
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 0;
  width: 12px;
  height: 12px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--timeline-line);
}
/* Both markers and connectors share a 6px center; the line joins their centers. */
.timeline > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -10px;
  left: 5px;
  width: 2px;
  background: var(--timeline-line);
}
.timeline > li:last-child { padding-bottom: 0; }
.timeline strong { display: block; line-height: 20px; overflow-wrap: anywhere; }
.timeline time { line-height: 18px; overflow-wrap: anywhere; }
:root[data-theme="dark"] .timeline > li::before {
  border-color: var(--surface);
  box-shadow: 0 0 0 1px var(--timeline-line);
}
.evidence-link { border-radius: 6px; min-height: 48px; }
.evidence-link:hover { border-color: var(--line-strong); }
.help-dialog .detail-body > p { font-size: 13px; line-height: 1.85; }
.mascot-help {
  border-radius: 12px;
  box-shadow: 0 3px 8px #142c5010, 0 10px 24px #142c5012;
}
.mascot-help picture { display: block; width: 100%; height: 100%; }
.mascot-help-label { display: none; }
.toast { border-radius: 8px; box-shadow: 0 5px 24px #142c5026; line-height: 1.6; }
.site-footer, .welcome-page .site-footer { line-height: 1.8; }
.site-footer span + span { padding-right: 76px; }
.error-page .empty-state { border-radius: var(--panel-radius); box-shadow: var(--panel-shadow); }

:root[data-theme="dark"] .welcome-copy { background: linear-gradient(145deg, #1a2e4a, #15273f); }
:root[data-theme="dark"] .welcome-page .welcome { border-color: var(--line); }
:root[data-theme="dark"] .auth-tabs button:hover { background: var(--surface-soft); }
:root[data-theme="dark"] .portal-nav button[aria-selected="true"] { background: var(--surface-soft); }
:root[data-theme="dark"] .welcome-faq summary .icon { border-color: var(--line); }
:root[data-theme="dark"] .report-form-card .upload-zone:hover { background: var(--surface-hover); border-color: var(--blue); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button.primary:hover:not(:disabled):not([aria-busy="true"]) { box-shadow: 0 3px 9px #003da520; }
  .login-card .button.primary > .icon { transition: transform .16s; }
  .login-card .button.primary:hover:not(:disabled) > .icon { transform: translateX(2px); }
  .header-help .icon { transition: transform .16s; }
  .header-help:hover .icon { transform: translateX(2px); }
}

@media (max-width: 1080px) {
  .welcome-auth { padding: 30px 27px 23px; }
}
@media (max-width: 780px) {
  .welcome-copy { border-radius: 9px 9px 0 0; }
  .welcome-auth { border-radius: 0; padding: 28px 29px 23px; }
  .welcome-copy > .lead { margin-bottom: 0; }
  .poster-bottom { margin-top: 22px; }
  .mobile-start { min-height: 44px; margin-top: 16px; }
  .welcome .journey { padding: 24px 29px; gap: 20px; }
  .welcome-guide { padding: 28px 29px; }
  .site-footer .mascot-help {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    height: auto;
    min-height: 44px;
    margin-top: 8px;
    padding: 5px 12px 5px 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--blue);
    box-shadow: none;
  }
  .site-footer .mascot-help picture { width: 30px; height: 30px; }
  .site-footer .mascot-help-label { display: inline; font-size: 12px; font-weight: 600; }
  .site-footer span + span { padding-right: 0; }
  .portal-nav { gap: 8px; }
}
@media (max-width: 520px) {
  .site-header { padding-inline: 16px; gap: 10px; }
  .header-controls { gap: 7px; }
  .theme-toggle { min-width: 44px; width: 44px; height: 44px; padding: 10px; }
  .theme-label { display: none; }
  .header-signout { min-height: 44px; padding: 8px 10px; }
  .header-help { padding: 10px 2px; }
  .welcome-auth { padding: 26px 22px 20px; }
  .welcome-copy > .lead { font-size: 13px; line-height: 1.85; }
  .welcome-copy h1 { line-height: 1.15; }
  .poster-bottom { margin-top: 20px; }
  .login-card h2 { font-size: 24px; }
  .login-card .stack { gap: 18px; }
  .login-footnote { font-size: 11px; }
  .login-card .field small { font-size: 11px; }
  .auth-tabs { gap: 22px; margin-block: 17px 21px; }
  .welcome .journey { padding: 23px 22px; }
  .welcome-guide { padding: 26px 22px; gap: 25px; }
  .step-number { width: 30px; height: 30px; }
  .journey-step p { font-size: 12px; }
  .guide-heading > p { font-size: 12px; }
  .welcome-faq summary { font-size: 12px; gap: 12px; }
  .welcome-faq details > p { padding-right: 8px; }
  .portal-nav { gap: 0; }
  .portal-intro p { font-size: 12px; }
  .portal-intro { padding-bottom: 21px; }
  .reports-heading > .button { width: 44px; min-height: 44px; padding: 11px; gap: 0; }
  .reports-heading > .button .icon { width: 19px; height: 19px; }
  .reports-heading > .button .button-status { display: none; }
  .report-form-card { border-radius: 8px; }
  .report-form-card .upload-zone { min-height: 100px; }
  .queue-stat:first-child { border-radius: 7px 0 0 0; }
  .queue-stat:nth-child(2) { border-radius: 0 7px 0 0; }
  .queue-stat:nth-child(3) { border-radius: 0 0 0 7px; }
  .queue-stat:last-child { border-radius: 0 0 7px 0; }
  .detail-head { padding: 20px 17px; }
  .detail-actions { gap: 8px; }
  .detail-head h2 { font-size: 20px; }
  .detail-body { padding: 22px 17px; }
  .evidence-viewer-footer .button { min-height: 44px; }
  .mascot-help { width: 48px; height: 48px; right: 10px; bottom: 10px; }
  .site-footer, .welcome-page .site-footer { padding-bottom: 30px; }
}
@media (max-width: 350px) {
  .site-header { padding-inline: 12px; gap: 6px; }
  .header-controls { gap: 5px; }
  .brand { gap: 7px; }
  .brand small { max-width: 103px; }
  .header-help { font-size: 9px; }
  .welcome-copy, .welcome-auth { padding-inline: 18px; }
  .welcome-copy h1 { font-size: 28px; }
  .welcome .journey, .welcome-guide { padding-inline: 18px; }
  .welcome-faq summary { gap: 9px; }
  .welcome-faq summary .icon { width: 25px; height: 25px; padding: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .button-spinner { animation: none; }
}
@media (forced-colors: active) {
  .button, .icon-button, .theme-toggle, .header-signout { border: 1px solid ButtonText; }
  .button-spinner { border-color: ButtonText; border-right-color: transparent; }
  button[aria-selected="true"], button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
}
