:root {
  --navy-950: #02070d;
  --navy-900: #06111d;
  --navy-850: #091827;
  --navy-800: #0d2237;
  --navy-700: #163a57;
  --navy-600: #275b7d;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --canvas: #f1f4f7;
  --ink: #0d1b28;
  --muted: #667584;
  --line: #dce3e9;
  --gold: #ddaE4b;
  --gold-light: #f0d78f;
  --red: #9c2b32;
  --green: #2f765c;
  --blue: #2d678e;
  --shadow: 0 22px 60px rgba(6, 17, 29, .09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% -10%, rgba(39, 91, 125, .09), transparent 28rem),
    linear-gradient(180deg, #f7f9fb 0, var(--canvas) 32rem);
  color: var(--ink);
  line-height: 1.55;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
form { margin: 0; }

.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;
}

.muted { color: var(--muted); }

.eyebrow {
  margin: 0 0 6px;
  color: var(--navy-600);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.app-shell { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: 288px;
  flex-direction: column;
  padding: 24px 18px 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 2%, rgba(221, 174, 75, .14), transparent 17rem),
    radial-gradient(circle at -10% 70%, rgba(39, 91, 125, .25), transparent 20rem),
    linear-gradient(180deg, #0a1929 0%, #030910 100%);
  color: #d8e1e8;
  box-shadow: 18px 0 50px rgba(2, 7, 13, .18);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 1px;
  background: linear-gradient(transparent, rgba(221, 174, 75, .38) 18%, rgba(255, 255, 255, .08) 68%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 68px;
  margin: 0 6px 38px;
}

.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { color: #fff; font-size: .94rem; font-weight: 800; letter-spacing: .065em; text-transform: uppercase; }
.brand small { margin-top: 5px; color: #8298aa; font-size: .53rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }

.brand-logo {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 1px solid rgba(240, 215, 143, .66);
  border-radius: 50%;
  background: #030405;
  box-shadow: 0 0 0 4px rgba(221, 174, 75, .09), 0 12px 28px rgba(0, 0, 0, .35);
}

.brand-logo img {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  max-width: none;
  height: 100%;
  transform: translateX(-50%);
}

.sidebar nav { display: grid; gap: 7px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #aebbc7;
  font-size: .9rem;
  font-weight: 650;
  transition: .18s ease;
}

.nav-item span { display: grid; width: 22px; place-items: center; color: #8397a9; font-size: 1.05rem; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.active { border-color: rgba(202, 168, 90, .2); background: linear-gradient(90deg, rgba(202, 168, 90, .18), rgba(202, 168, 90, .05)); color: #f5e6bb; }
.nav-item.active span { color: var(--gold); }

.sidebar-classification {
  margin-top: auto;
  padding: 22px 10px 0;
  color: #647689;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
  letter-spacing: .11em;
  text-align: center;
}

.main-column { grid-column: 2; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 58px);
  border-bottom: 1px solid rgba(20, 32, 44, .09);
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(18px);
}

.classification-banner {
  color: #8f302e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.classification-banner::before { content: "●"; margin-right: 8px; }

.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu img, .avatar-fallback { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: inline-grid; flex: 0 0 auto; place-items: center; background: var(--navy-800); color: #fff; font-size: .72rem; font-weight: 800; }
.avatar-fallback.small { width: 34px; height: 34px; font-size: .62rem; }
.user-menu > span { display: flex; min-width: 105px; flex-direction: column; line-height: 1.25; }
.user-menu strong { font-size: .78rem; }
.user-menu small { color: var(--muted); font-size: .68rem; }
.link-button { padding: 7px 0 7px 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .72rem; }
.link-button:hover { color: var(--red); }

.content { width: min(1480px, 100%); margin: 0 auto; padding: 46px clamp(22px, 4vw, 58px) 70px; }

.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.15rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.07; }
.page-heading > p:last-child, .page-heading div > p:last-child { max-width: 700px; margin: 10px 0 0; color: var(--muted); }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }

.primary-button, .secondary-button, .small-button, .discord-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 750;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.primary-button { border-color: var(--navy-900); background: var(--navy-900); color: #fff; box-shadow: 0 9px 22px rgba(7, 17, 31, .14); }
.primary-button:hover { background: var(--navy-800); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); background: #fff; color: var(--ink); }
.secondary-button:hover { border-color: #aeb8c2; background: #f8f9fa; }
.small-button { min-height: 36px; padding: 0 13px; border-color: #c9d0d7; background: #fff; color: var(--navy-700); font-size: .74rem; }
.small-button:hover { border-color: var(--navy-600); }
.full { width: 100%; }

.notice { margin: 0 0 24px; padding: 13px 16px; border: 1px solid; border-radius: 8px; font-size: .82rem; font-weight: 650; }
.notice.success { border-color: #afd4c2; background: #edf8f2; color: #256249; }
.notice.error { border-color: #e2b8bb; background: #fff1f1; color: #8a2930; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { display: flex; min-height: 112px; align-items: center; gap: 17px; padding: 22px; border: 1px solid rgba(20, 32, 44, .1); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 22px rgba(7, 17, 31, .045); }
.stat-card.accent { border-color: rgba(202, 168, 90, .45); background: linear-gradient(140deg, #fff 60%, #faf4e4); }
.stat-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #edf1f4; color: var(--navy-700); }
.stat-card div { display: flex; flex-direction: column; }
.stat-card small { color: var(--muted); font-size: .7rem; font-weight: 700; }
.stat-card strong { font-family: Georgia, serif; font-size: 2rem; font-weight: 500; line-height: 1.2; }

.panel { padding: 25px; border: 1px solid rgba(20, 32, 44, .1); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel.compact { padding: 20px; box-shadow: 0 8px 25px rgba(7, 17, 31, .06); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.panel-heading a { color: var(--navy-600); font-size: .75rem; font-weight: 700; }

.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.case-grid.list-grid { grid-template-columns: repeat(3, minmax(270px, 1fr)); }
.case-card { display: flex; min-width: 0; min-height: 200px; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; transition: .18s ease; }
.case-card:hover { border-color: #aeb9c3; box-shadow: 0 13px 28px rgba(7, 17, 31, .09); transform: translateY(-2px); }
.case-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.case-card h3 { margin: 16px 0 7px; font-family: Georgia, serif; font-size: 1.18rem; font-weight: 600; line-height: 1.25; }
.case-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: .78rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.case-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 18px; color: #778390; font-size: .65rem; }
.case-meta span:first-child { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-number { color: var(--navy-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.case-number.large { font-size: .82rem; }
.case-number.xl { font-size: 1rem; }

.status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; background: #eef1f4; color: #51606e; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.status-open { background: #eaf4f8; color: #276a8b; }
.status-review { background: #fff5df; color: #9b6b16; }
.status-closed { background: #eaf6ef; color: #2b7555; }
.status-archived { background: #ececef; color: #636573; }
.status-draft { background: #f1f2f4; color: #686f78; }

.empty-state { grid-column: 1 / -1; padding: 44px 20px; border: 1px dashed #c8d0d7; border-radius: 10px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; }
.empty-state p { margin: 6px 0 0; }

.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.filter-bar select { min-width: 170px; }
.search-field { position: relative; display: flex; flex: 1; align-items: center; }
.search-field > span { position: absolute; left: 13px; color: var(--muted); }
.search-field input { width: 100%; padding-left: 37px; }
.result-count { margin: 0 0 14px 3px; color: var(--muted); font-size: .72rem; }

input, textarea, select {
  width: 100%;
  border: 1px solid #cdd4db;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

input, select { min-height: 42px; padding: 0 11px; }
textarea { min-height: 100px; padding: 11px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(40, 80, 111, .11); }
input::placeholder, textarea::placeholder { color: #9aa4ae; }

.field { display: grid; gap: 6px; }
.field > span { color: #53616e; font-size: .69rem; font-weight: 750; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.case-form { display: grid; gap: 18px; }
.form-section { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 7px 22px rgba(7, 17, 31, .04); overflow: hidden; }
.section-number { display: flex; justify-content: center; padding-top: 28px; border-right: 1px solid var(--line); background: #f5f6f7; color: #9aa5ae; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; font-weight: 800; }
.section-content { min-width: 0; padding: 27px 30px 31px; }
.section-content > h2, .form-section-heading h2 { margin: 0 0 20px; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.form-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.form-section-heading h2 { margin-bottom: 0; }
.form-note { color: var(--muted); font-size: .68rem; font-style: italic; }

.collection { display: grid; gap: 10px; }
.collection-item { position: relative; display: grid; grid-template-columns: repeat(var(--columns, 5), minmax(110px, 1fr)) 34px; gap: 9px; align-items: end; padding: 13px; border: 1px solid #dfe3e7; border-radius: 8px; background: #fafbfc; }
.collection-item .field > span { font-size: .61rem; }
.collection-item input, .collection-item textarea { min-height: 38px; font-size: .76rem; }
.collection-item textarea { height: 58px; }
.remove-item { display: grid; width: 32px; height: 38px; place-items: center; border: 1px solid #e1c6c8; border-radius: 6px; background: #fff5f5; color: var(--red); cursor: pointer; }
.collection-empty { padding: 24px; border: 1px dashed #cbd2d9; border-radius: 7px; color: var(--muted); font-size: .76rem; text-align: center; }

.sticky-actions { position: sticky; bottom: 15px; z-index: 15; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding: 13px; border: 1px solid rgba(20, 32, 44, .13); border-radius: 10px; background: rgba(255, 255, 255, .92); box-shadow: 0 12px 35px rgba(7, 17, 31, .13); backdrop-filter: blur(15px); }

.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.case-side-column { display: grid; gap: 14px; position: sticky; top: 92px; }
.case-document { border: 1px solid #d5d1c8; background: var(--paper); box-shadow: 0 18px 50px rgba(20, 28, 36, .12); }
.document-cover { position: relative; min-height: 500px; padding: 54px clamp(34px, 6vw, 70px); overflow: hidden; border-bottom: 6px solid var(--navy-900); background:
  linear-gradient(rgba(247, 245, 239, .93), rgba(247, 245, 239, .93)),
  repeating-linear-gradient(0deg, transparent 0 31px, rgba(20, 32, 44, .08) 32px);
}
.document-cover::after { content: "DETECTIVE BUREAU"; position: absolute; right: -70px; bottom: 120px; color: rgba(7, 17, 31, .035); font-family: Georgia, serif; font-size: 6rem; font-weight: 900; transform: rotate(-90deg); }
.document-brand { display: flex; align-items: center; gap: 14px; }
.document-brand > div { display: flex; flex-direction: column; line-height: 1.25; }
.document-brand small { color: #69737b; font-size: .62rem; font-weight: 800; letter-spacing: .16em; }
.document-brand strong { font-family: Georgia, serif; font-size: 1.2rem; letter-spacing: .06em; }
.document-classification { position: absolute; top: 0; right: 0; padding: 9px 18px; background: var(--navy-900); color: #fff; font-family: ui-monospace, monospace; font-size: .58rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.document-title { margin: 92px 0 65px; }
.document-title p { margin: 0 0 8px; color: var(--red); font-family: ui-monospace, monospace; font-size: .65rem; font-weight: 800; letter-spacing: .19em; }
.document-title h1 { max-width: 750px; margin: 0 0 17px; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4.4rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; }
.cover-facts { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border-top: 1px solid #b9b7b0; border-left: 1px solid #b9b7b0; }
.cover-facts > div { min-height: 76px; padding: 13px 15px; border-right: 1px solid #b9b7b0; border-bottom: 1px solid #b9b7b0; }
.cover-facts dt { color: #737a80; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cover-facts dd { margin: 5px 0 0; font-family: Georgia, serif; font-size: .94rem; font-weight: 600; }

.document-section { padding: 40px clamp(28px, 5vw, 60px); border-bottom: 1px solid #d8d4cb; }
.document-section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.document-section-heading span { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--navy-700); border-radius: 50%; color: var(--navy-700); font-family: ui-monospace, monospace; font-size: .65rem; font-weight: 800; }
.document-section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.52rem; font-weight: 500; }
.prose { margin: 0; color: #2b353e; font-family: Georgia, serif; font-size: .95rem; line-height: 1.85; white-space: normal; }
.empty-line { margin: 0; font-style: italic; }
.document-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px clamp(28px, 5vw, 60px); background: #ece9e1; color: #6e7378; font-family: ui-monospace, monospace; font-size: .55rem; letter-spacing: .04em; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .74rem; }
th { padding: 10px 11px; border-bottom: 2px solid var(--navy-700); color: var(--navy-700); font-size: .58rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 11px; border-bottom: 1px solid #d9d5cc; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }

.action-stack { display: grid; gap: 10px; }
.action-stack form { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.member-list { display: grid; gap: 11px; }
.member { display: flex; align-items: center; gap: 9px; }
.member > div { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.25; }
.member strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.member small { color: var(--muted); font-size: .64rem; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.icon-button.danger { width: 28px; height: 28px; color: var(--red); }
.icon-button.danger:hover { background: #fff0f0; }
.member-form { display: grid; gap: 9px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.member-form select, .member-form input { min-height: 38px; font-size: .75rem; }
.or-separator { display: flex; align-items: center; gap: 8px; color: #98a1aa; font-size: .6rem; }
.or-separator::before, .or-separator::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.revision-list, .activity-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.revision-list li { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid #edf0f2; }
.revision-list li:last-child { border: 0; }
.revision-list strong { font-size: .72rem; }
.revision-list span { color: var(--muted); font-size: .62rem; }
.activity-list li { position: relative; display: flex; gap: 10px; padding: 8px 0; }
.activity-list li:not(:last-child)::after { content: ""; position: absolute; top: 22px; bottom: -8px; left: 4px; border-left: 1px solid #d9dee3; }
.activity-dot { z-index: 1; width: 9px; height: 9px; flex: 0 0 auto; margin-top: 5px; border: 2px solid #fff; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.activity-list div { display: flex; flex-direction: column; }
.activity-list strong { font-size: .7rem; }
.activity-list small { color: var(--muted); font-size: .6rem; }

.audit-table { padding: 0; overflow: hidden; }
.audit-table th { padding: 14px 16px; background: #f5f7f8; }
.audit-table td { padding: 13px 16px; border-color: #e7eaed; }
.audit-table a { color: var(--blue); font-weight: 700; }

.error-page { display: flex; min-height: 70vh; align-items: center; justify-content: center; flex-direction: column; padding: 40px; text-align: center; }
.error-page > span { color: var(--gold); font-family: Georgia, serif; font-size: 6rem; line-height: 1; }
.error-page h1 { margin: 12px 0 5px; font-family: Georgia, serif; font-size: 2rem; }
.error-page p { max-width: 500px; margin: 0 0 23px; color: var(--muted); }

.login-body { background: var(--navy-950); }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(440px, .75fr); min-height: 100vh; }
.login-hero { position: relative; display: flex; min-height: 100vh; align-items: center; overflow: hidden; padding: clamp(45px, 7vw, 110px); background:
  radial-gradient(circle at 75% 20%, rgba(202, 168, 90, .13), transparent 28%),
  radial-gradient(circle at 13% 90%, rgba(41, 91, 126, .24), transparent 35%),
  linear-gradient(145deg, #0d2034, #050b13 75%); color: #fff; }
.hero-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(120deg, #000, transparent 75%); }
.hero-content { position: relative; z-index: 1; max-width: 750px; }
.hero-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 100px; color: #b8c6d1; font-size: .68rem; font-weight: 700; letter-spacing: .12em; line-height: 1.5; }
.hero-brand strong { color: #fff; font-family: Georgia, serif; font-size: .98rem; }
.login-hero .eyebrow { color: var(--gold); }
.login-hero h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(3.2rem, 7vw, 7rem); font-weight: 400; letter-spacing: -.055em; line-height: .92; }
.login-hero h1 span { color: var(--gold-light); }
.hero-copy { max-width: 590px; margin: 28px 0 40px; color: #a9bbc9; font-size: 1rem; }
.security-points { display: flex; flex-wrap: wrap; gap: 20px; color: #7f96a8; font-size: .68rem; font-weight: 700; }
.security-points span::first-letter { color: var(--gold); }

.login-panel { display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 45px; background: #f2f3f3; }
.login-card { width: min(420px, 100%); padding: 44px; border: 1px solid #d6dadd; border-top: 4px solid var(--gold); background: #fff; box-shadow: 0 28px 70px rgba(3, 10, 18, .19); }
.login-card h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.login-card > p:not(.eyebrow) { margin: 13px 0 25px; color: var(--muted); font-size: .82rem; }
.discord-button { width: 100%; min-height: 51px; background: #5865f2; color: #fff; box-shadow: 0 9px 20px rgba(88, 101, 242, .23); }
.discord-button:hover { background: #4854db; transform: translateY(-1px); }
.discord-button span { font-size: 1.3rem; }
.login-footnote { display: flex; gap: 10px; margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); color: #7a858f; font-size: .67rem; }
.login-footnote p { margin: 0; }
.system-id { margin: 25px 0 0; color: #9ba3aa; font-family: ui-monospace, monospace; font-size: .56rem; letter-spacing: .11em; }

/* Modern Detective Bureau visual system */
.sidebar nav { gap: 8px; }

.nav-item {
  position: relative;
  min-height: 50px;
  padding: 0 15px;
  border-radius: 13px;
  color: #9fb0bd;
  font-size: .83rem;
  font-weight: 680;
}

.nav-item::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: -6px;
  width: 3px;
  border-radius: 5px;
  background: var(--gold);
  opacity: 0;
  transform: scaleY(.45);
  transition: .18s ease;
}

.nav-item span {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  color: #8ca0b0;
  font-size: .9rem;
}

.nav-item:hover { background: rgba(255, 255, 255, .055); color: #f5f7f9; }
.nav-item.active { border-color: rgba(221, 174, 75, .18); background: linear-gradient(110deg, rgba(221, 174, 75, .17), rgba(255, 255, 255, .035)); color: #fff2cc; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055); }
.nav-item.active::before { opacity: 1; transform: scaleY(1); }
.nav-item.active span { background: rgba(221, 174, 75, .17); color: var(--gold-light); }

.sidebar-classification {
  margin: auto 8px 0;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  color: #657b8b;
}

.topbar {
  height: 78px;
  padding: 0 clamp(22px, 4vw, 60px);
  border-bottom-color: rgba(13, 27, 40, .07);
  background: rgba(248, 250, 252, .78);
  box-shadow: 0 8px 30px rgba(6, 17, 29, .025);
  backdrop-filter: blur(22px) saturate(145%);
}

.classification-banner {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(156, 43, 50, .14);
  border-radius: 999px;
  background: rgba(156, 43, 50, .055);
  color: #8d3439;
  font-size: .55rem;
  letter-spacing: .13em;
}

.user-menu {
  gap: 11px;
  padding: 6px 7px 6px 8px;
  border: 1px solid rgba(13, 27, 40, .075);
  border-radius: 13px;
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 5px 18px rgba(6, 17, 29, .04);
}

.user-menu img, .avatar-fallback { width: 38px; height: 38px; border: 1px solid rgba(221, 174, 75, .42); box-shadow: 0 4px 12px rgba(6, 17, 29, .12); }
.user-menu strong { font-size: .76rem; }
.user-menu small { color: #788692; font-size: .63rem; }
.link-button { padding-right: 7px; }

.content { width: min(1520px, 100%); padding: 52px clamp(22px, 4vw, 60px) 78px; }
.page-heading { margin-bottom: 34px; }
.page-heading h1 { font-family: inherit; font-size: clamp(2rem, 3.4vw, 3.25rem); font-weight: 780; letter-spacing: -.045em; line-height: 1.02; }
.page-heading > p:last-child, .page-heading div > p:last-child { margin-top: 13px; font-size: .88rem; }
.eyebrow { margin-bottom: 9px; color: #8d6b28; font-size: .61rem; letter-spacing: .2em; }

.primary-button, .secondary-button, .small-button, .discord-button {
  min-height: 46px;
  border-radius: 11px;
  font-size: .78rem;
  font-weight: 750;
}

.primary-button {
  border-color: #0a1a2a;
  background: linear-gradient(135deg, #102b43, #06111d 72%);
  box-shadow: 0 12px 28px rgba(6, 17, 29, .17), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.primary-button:hover { background: linear-gradient(135deg, #183b58, #0a1b2c 72%); box-shadow: 0 15px 32px rgba(6, 17, 29, .21); transform: translateY(-2px); }
.secondary-button { border-color: #d8e0e6; background: rgba(255, 255, 255, .82); box-shadow: 0 5px 15px rgba(6, 17, 29, .035); }
.secondary-button:hover { border-color: #bac6d0; background: #fff; transform: translateY(-1px); }
.small-button { min-height: 38px; border-radius: 9px; border-color: #d3dce3; color: var(--navy-700); }

.notice { padding: 14px 17px; border-radius: 12px; box-shadow: 0 7px 20px rgba(6, 17, 29, .035); }

.stat-grid { gap: 18px; margin-bottom: 28px; }
.stat-card {
  position: relative;
  min-height: 126px;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  border-color: rgba(13, 27, 40, .075);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(250, 252, 253, .86));
  box-shadow: 0 14px 36px rgba(6, 17, 29, .065);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -52px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(39, 91, 125, .12), transparent 67%);
}

.stat-card:hover { border-color: rgba(39, 91, 125, .18); box-shadow: 0 20px 44px rgba(6, 17, 29, .09); transform: translateY(-3px); }
.stat-card.accent { border-color: rgba(221, 174, 75, .34); background: linear-gradient(145deg, #fffdf7, #f7ecd0); }
.stat-card.accent::after { background: radial-gradient(circle, rgba(221, 174, 75, .2), transparent 67%); }
.stat-icon { width: 48px; height: 48px; border: 1px solid rgba(39, 91, 125, .09); border-radius: 14px; background: linear-gradient(145deg, #eef5f8, #e6edf2); color: var(--navy-700); box-shadow: inset 0 1px 0 #fff; }
.stat-card.accent .stat-icon { border-color: rgba(221, 174, 75, .2); background: linear-gradient(145deg, #fff7df, #f3dfaa); color: #85611b; }
.stat-card small { margin-bottom: 2px; font-size: .66rem; letter-spacing: .02em; }
.stat-card strong { font-family: inherit; font-size: 2.12rem; font-weight: 760; letter-spacing: -.05em; }

.panel {
  border-color: rgba(13, 27, 40, .075);
  border-radius: 20px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel.compact { border-radius: 17px; box-shadow: 0 14px 34px rgba(6, 17, 29, .06); }
.panel-heading h2 { font-family: inherit; font-size: 1.28rem; font-weight: 760; letter-spacing: -.025em; }
.panel-heading a { color: #315f7c; }

.case-grid { gap: 18px; }
.case-card {
  position: relative;
  min-height: 218px;
  padding: 22px;
  overflow: hidden;
  border-color: rgba(13, 27, 40, .09);
  border-radius: 17px;
  background: linear-gradient(150deg, #fff 65%, #f8fafb);
  box-shadow: 0 11px 30px rgba(6, 17, 29, .055);
}

.case-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 24px;
  left: 24px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, rgba(221, 174, 75, .85), transparent);
  opacity: .55;
}

.case-card:hover { border-color: rgba(39, 91, 125, .25); box-shadow: 0 22px 48px rgba(6, 17, 29, .11); transform: translateY(-4px); }
.case-card h3 { margin: 19px 0 8px; font-family: inherit; font-size: 1.12rem; font-weight: 760; letter-spacing: -.02em; }
.case-card p { font-size: .76rem; line-height: 1.62; }
.case-meta { padding-top: 21px; font-size: .61rem; }
.case-number { color: #2d5874; font-size: .65rem; letter-spacing: .08em; }
.status { min-height: 26px; padding: 0 10px; border: 1px solid rgba(0, 0, 0, .035); font-size: .58rem; letter-spacing: .025em; }

.filter-bar {
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px;
  border-color: rgba(13, 27, 40, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 30px rgba(6, 17, 29, .045);
  backdrop-filter: blur(10px);
}

input, textarea, select { border-color: #d6dfe6; border-radius: 10px; background: rgba(255, 255, 255, .94); }
input, select { min-height: 45px; padding: 0 13px; }
textarea { padding: 13px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: #4b7895; box-shadow: 0 0 0 4px rgba(39, 91, 125, .1); }
.field > span { color: #526473; font-size: .66rem; letter-spacing: .015em; }

.case-form { gap: 20px; }
.form-section {
  grid-template-columns: 72px minmax(0, 1fr);
  overflow: hidden;
  border-color: rgba(13, 27, 40, .075);
  border-radius: 20px;
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 15px 38px rgba(6, 17, 29, .06);
}

.section-number {
  padding-top: 31px;
  border-right-color: rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, #102a42, #07131f);
  color: rgba(240, 215, 143, .86);
  font-size: .67rem;
}

.section-content { padding: 30px 32px 34px; }
.section-content > h2, .form-section-heading h2 { font-family: inherit; font-size: 1.37rem; font-weight: 760; letter-spacing: -.025em; }
.collection-item { padding: 15px; border-color: #dce4e9; border-radius: 13px; background: linear-gradient(145deg, #fafcfd, #f5f7f9); }
.collection-empty { padding: 28px; border-color: #ccd7df; border-radius: 12px; background: rgba(245, 248, 250, .68); }
.remove-item { border-radius: 9px; }
.sticky-actions { bottom: 16px; padding: 14px; border-radius: 15px; background: rgba(255, 255, 255, .83); box-shadow: 0 18px 48px rgba(6, 17, 29, .14); backdrop-filter: blur(22px) saturate(150%); }

.case-layout { grid-template-columns: minmax(0, 1fr) 342px; gap: 24px; }
.case-side-column { gap: 17px; top: 98px; }
.case-document { overflow: hidden; border-color: rgba(13, 27, 40, .13); border-radius: 22px; background: #fff; box-shadow: 0 26px 65px rgba(6, 17, 29, .13); }
.document-cover {
  min-height: 520px;
  padding: 52px clamp(34px, 6vw, 70px);
  border-bottom: 4px solid var(--gold);
  background:
    radial-gradient(circle at 85% 12%, rgba(221, 174, 75, .19), transparent 17rem),
    radial-gradient(circle at 5% 100%, rgba(39, 91, 125, .35), transparent 25rem),
    linear-gradient(145deg, #0c2236, #030910 76%);
  color: #fff;
}

.document-cover::before {
  content: "";
  position: absolute;
  right: 1%;
  bottom: -4%;
  width: min(45vw, 470px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: url('/branding/detective-bureau-logo.png') center / 133.333% auto no-repeat;
  opacity: .055;
  filter: grayscale(1) contrast(1.5);
}

.document-cover::after { right: -85px; bottom: 145px; color: rgba(255, 255, 255, .035); font-family: inherit; font-size: 5rem; letter-spacing: .04em; }
.document-brand { position: relative; z-index: 2; gap: 16px; }
.document-brand .brand-logo { width: 76px; height: 76px; box-shadow: 0 0 0 5px rgba(221, 174, 75, .1), 0 16px 34px rgba(0, 0, 0, .4); }
.document-brand small { color: #90a7b9; }
.document-brand strong { color: #fff; font-family: inherit; font-size: 1.1rem; font-weight: 790; }
.document-classification { padding: 10px 18px; border-radius: 0 0 0 12px; background: linear-gradient(135deg, #f1d98e, #c99332); color: #111b23; box-shadow: -8px 10px 30px rgba(0, 0, 0, .16); }
.document-title { position: relative; z-index: 2; margin: 82px 0 62px; }
.document-title p { color: var(--gold-light); }
.document-title h1 { color: #fff; font-family: inherit; font-size: clamp(2.2rem, 5vw, 4.2rem); font-weight: 760; letter-spacing: -.055em; }
.document-title .case-number { color: #a8becd; }
.cover-facts { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .035); backdrop-filter: blur(8px); }
.cover-facts > div { border-color: rgba(255, 255, 255, .15); }
.cover-facts dt { color: #8fa5b6; }
.cover-facts dd { color: #fff; font-family: inherit; font-size: .88rem; font-weight: 680; }

.document-section { padding: 43px clamp(28px, 5vw, 60px); border-bottom-color: #e4e9ed; background: #fff; }
.document-section:nth-of-type(even) { background: #fbfcfd; }
.document-section-heading span { width: 36px; height: 36px; border-color: rgba(221, 174, 75, .55); background: #fff8e8; color: #8b671e; }
.document-section-heading h2 { font-family: inherit; font-size: 1.4rem; font-weight: 760; letter-spacing: -.025em; }
.prose { color: #33424f; font-family: inherit; font-size: .88rem; line-height: 1.85; }
.document-footer { background: #07131f; color: #8299aa; }
.document-section th { border-bottom-color: #1c4968; color: #1c4968; }
.document-section td { border-bottom-color: #e3e8ec; }

.login-body { background: #02070d; }
.login-layout { grid-template-columns: minmax(0, 1.35fr) minmax(430px, .65fr); background: #02070d; }
.login-hero {
  isolation: isolate;
  padding: clamp(45px, 7vw, 112px);
  background:
    radial-gradient(circle at 72% 20%, rgba(221, 174, 75, .14), transparent 22rem),
    radial-gradient(circle at 14% 88%, rgba(39, 91, 125, .32), transparent 28rem),
    linear-gradient(140deg, #0d2439, #02070d 72%);
}

.login-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -7%;
  width: min(54vw, 690px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: url('/branding/detective-bureau-logo.png') center / 133.333% auto no-repeat;
  opacity: .12;
  filter: grayscale(.15) contrast(1.18);
  transform: translateY(-48%);
  mask-image: linear-gradient(90deg, transparent 2%, #000 55%);
}

.hero-grid { opacity: .12; background-size: 64px 64px; }
.hero-content { max-width: 790px; }
.hero-brand { margin-bottom: clamp(76px, 10vh, 125px); color: #9fb1bf; }
.hero-brand .brand-logo { width: 86px; height: 86px; box-shadow: 0 0 0 6px rgba(221, 174, 75, .09), 0 18px 42px rgba(0, 0, 0, .45); }
.hero-brand strong { font-family: inherit; font-size: 1rem; font-weight: 800; }
.login-hero h1 { max-width: 780px; font-family: inherit; font-size: clamp(3.35rem, 6.5vw, 6.7rem); font-weight: 740; letter-spacing: -.07em; line-height: .92; }
.login-hero h1 span { color: var(--gold-light); }
.hero-copy { color: #a7bac8; font-size: .98rem; line-height: 1.75; }
.security-points { gap: 11px; }
.security-points span { padding: 8px 11px; border: 1px solid rgba(255, 255, 255, .075); border-radius: 999px; background: rgba(255, 255, 255, .035); color: #91a6b5; }

.login-panel {
  position: relative;
  overflow: hidden;
  padding: 50px;
  border-left: 1px solid rgba(255, 255, 255, .065);
  background:
    radial-gradient(circle at 100% 0, rgba(221, 174, 75, .1), transparent 20rem),
    linear-gradient(180deg, #081522, #030910);
}

.login-card {
  width: min(430px, 100%);
  padding: 43px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-top: 1px solid rgba(240, 215, 143, .55);
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
  color: #fff;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(24px);
}

.login-card h2 { font-family: inherit; font-size: 2rem; font-weight: 760; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow) { color: #91a5b4; line-height: 1.7; }
.login-card .eyebrow { color: var(--gold); }
.login-card-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 34px; padding-bottom: 25px; border-bottom: 1px solid rgba(255, 255, 255, .085); }
.login-card-brand .brand-logo { width: 68px; height: 68px; }
.login-card-brand > span { display: flex; flex-direction: column; line-height: 1.25; }
.login-card-brand strong { font-size: .86rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.login-card-brand small { margin-top: 5px; color: #7f95a5; font-size: .55rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.discord-button { min-height: 54px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; background: linear-gradient(135deg, #6571f4, #4a56dc); box-shadow: 0 14px 30px rgba(51, 63, 209, .3); }
.discord-button:hover { background: linear-gradient(135deg, #727df7, #5360e5); box-shadow: 0 18px 38px rgba(51, 63, 209, .4); }
.login-footnote { border-top-color: rgba(255, 255, 255, .09); color: #758b9b; }
.system-id { color: #536a7a; }

.print-page { padding: 25px; background: #cfd3d6; }
.printable-document { width: min(1000px, 100%); margin: 0 auto; }
.print-button { position: fixed; right: 25px; bottom: 25px; }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid, .case-grid.list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-layout { grid-template-columns: minmax(0, 1fr); }
  .case-side-column { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-item { grid-template-columns: repeat(2, minmax(130px, 1fr)) 34px; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { width: 288px; transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-column { min-width: 0; }
  .topbar { height: 64px; padding: 0 17px; }
  .mobile-only { display: grid; }
  .classification-banner { display: none; }
  .content { padding: 30px 17px 55px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { min-height: 100vh; padding: 24px; }
  .login-card { padding: 34px 27px; }
}

@media (max-width: 680px) {
  .user-menu > span, .user-menu .link-button { display: none; }
  .split-heading { align-items: flex-start; flex-direction: column; }
  .stat-grid, .case-grid, .case-grid.list-grid, .case-side-column { grid-template-columns: 1fr; }
  .stat-card { min-height: 94px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar select { min-width: 0; }
  .form-section { grid-template-columns: 38px minmax(0, 1fr); }
  .section-number { padding-top: 23px; font-size: .62rem; }
  .section-content { padding: 22px 17px 25px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-section-heading { flex-direction: column; }
  .collection-item { grid-template-columns: 1fr 34px; }
  .collection-item .field { grid-column: 1; }
  .collection-item .remove-item { grid-column: 2; grid-row: 1; }
  .sticky-actions { bottom: 6px; }
  .sticky-actions > * { flex: 1; }
  .document-cover { min-height: 0; padding: 35px 22px; }
  .document-title { margin: 65px 0 40px; }
  .document-title h1 { font-size: 2.5rem; }
  .cover-facts { grid-template-columns: 1fr 1fr; }
  .document-section { padding: 30px 21px; }
  .document-footer { align-items: flex-start; flex-direction: column; padding: 18px 21px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body, .print-page { padding: 0; background: #fff; }
  .print-button { display: none !important; }
  .printable-document { width: 100%; border: 0; box-shadow: none; }
  .document-cover { min-height: 245mm; break-after: page; }
  .document-section { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  table { font-size: 7pt; }
  a { color: inherit; }
}

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

/* Case workbook */
.case-workbook { position: relative; }
.case-editor {
  display: block;
  overflow: visible;
  border: 1px solid rgba(13, 27, 40, .1);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(6, 17, 29, .1);
}

.case-sheet-tabs {
  position: sticky;
  top: 77px;
  z-index: 18;
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  overflow-x: auto;
  border-bottom: 1px solid #dce4e9;
  background: rgba(247, 249, 251, .94);
  scrollbar-width: thin;
  backdrop-filter: blur(18px) saturate(150%);
}

.case-sheet-tab {
  position: relative;
  display: inline-flex;
  min-width: max-content;
  min-height: 51px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: #637483;
  font-size: .72rem;
  font-weight: 730;
  cursor: pointer;
  transition: color .18s ease, background .18s ease;
}

.case-sheet-tab span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: #e8edf1;
  color: #7b8994;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
}

.case-sheet-tab:hover { background: rgba(255, 255, 255, .7); color: #17334a; }
.case-sheet-tab::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: -1px;
  left: 11px;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, #c58b2d, var(--gold-light));
  opacity: 0;
  transform: scaleX(.35);
  transition: .18s ease;
}

.case-sheet-tab.active { background: #fff; color: #0c263c; }
.case-sheet-tab.active span { background: #102c43; color: #f2d892; }
.case-sheet-tab.active::after { opacity: 1; transform: scaleX(1); }
.case-sheet-panel[hidden] { display: none; }

.form-sheet-panel { padding: clamp(24px, 4vw, 48px); background: linear-gradient(180deg, #fff, #fbfcfd); }
.sheet-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
  padding-bottom: 23px;
  border-bottom: 1px solid #e1e7eb;
}
.sheet-panel-heading h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.045em; }
.sheet-panel-heading p:last-child { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: .8rem; }

.sheet-card {
  margin-bottom: 18px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #e0e6ea;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(6, 17, 29, .035);
}
.sheet-card h3 { margin: 0 0 19px; color: #17374e; font-size: 1.05rem; letter-spacing: -.018em; }
.sheet-card .form-section-heading { align-items: center; margin-bottom: 18px; }
.sheet-card .form-section-heading h3 { margin: 0; }
.sheet-card .collection { overflow-x: auto; padding-bottom: 3px; }
.sheet-card .collection-item { width: max-content; min-width: 100%; grid-template-columns: repeat(var(--columns, 5), minmax(145px, 1fr)) 34px; }
.sheet-card .collection-item textarea { min-height: 74px; }

.attachment-hint {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border: 1px dashed rgba(39, 91, 125, .3);
  border-radius: 13px;
  background: linear-gradient(135deg, #f3f8fb, #fbfcfd);
  color: #2c516b;
}
.attachment-hint > span { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #dcebf3; font-size: 1rem; }
.attachment-hint strong { font-size: .76rem; }
.attachment-hint p { margin: 2px 0 0; color: #718390; font-size: .68rem; }
.case-editor > .sticky-actions { margin: 0 20px 20px; }

.case-document > .case-sheet-tabs { top: 77px; padding-top: 9px; background: rgba(6, 17, 29, .96); border-color: rgba(255, 255, 255, .09); }
.case-document .case-sheet-tab { color: #98aaba; }
.case-document .case-sheet-tab span { background: rgba(255, 255, 255, .07); color: #899ba9; }
.case-document .case-sheet-tab:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.case-document .case-sheet-tab.active { background: rgba(255, 255, 255, .075); color: #f8e8b9; }
.case-document .case-sheet-tab.active span { background: rgba(221, 174, 75, .2); color: var(--gold-light); }
.document-sheet-panel { min-height: 650px; background: #fff; }
.document-panel-heading {
  padding: 46px clamp(28px, 5vw, 60px) 34px;
  border-bottom: 1px solid #dce4e9;
  background:
    radial-gradient(circle at 88% 0, rgba(221, 174, 75, .15), transparent 17rem),
    linear-gradient(135deg, #f8fafb, #fff);
}
.document-panel-heading h1 { margin: 0; color: #0a2236; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.05em; }
.document-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.document-section-heading h2 { margin: 0; }
.attachment-count { display: inline-grid; min-width: 30px; height: 30px; place-items: center; border-radius: 999px; background: #eaf0f4; color: #39576b; font-size: .66rem; font-weight: 800; }

.attachment-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.attachment-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 108px;
  overflow: hidden;
  border: 1px solid #dce4e9;
  border-radius: 13px;
  background: #fbfcfd;
}
.attachment-preview { display: block; height: 100%; min-height: 108px; overflow: hidden; background: #0a1722; }
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.attachment-preview:hover img { transform: scale(1.04); }
.attachment-file-icon { display: grid; min-height: 108px; place-items: center; background: linear-gradient(145deg, #102f47, #07131f); color: #f1d78b; font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.attachment-info { display: flex; min-width: 0; justify-content: center; flex-direction: column; padding: 14px 40px 14px 14px; }
.attachment-info strong { overflow: hidden; color: #17364d; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.attachment-info p { display: -webkit-box; margin: 4px 0; overflow: hidden; color: #536776; font-size: .68rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.attachment-info small { color: #84929d; font-size: .57rem; }
.attachment-remove { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .9) !important; box-shadow: 0 3px 10px rgba(6, 17, 29, .1); }

.attachment-upload { display: grid; gap: 13px; margin-top: 18px; padding: 17px; border: 1px solid #d9e2e8; border-radius: 14px; background: #f7f9fb; }
.upload-dropzone { position: relative; display: flex; min-height: 92px; align-items: center; justify-content: center; gap: 13px; padding: 16px; border: 1px dashed #8ba6b8; border-radius: 11px; background: #fff; color: #2f566f; cursor: pointer; text-align: left; transition: .18s ease; }
.upload-dropzone:hover { border-color: #315f7c; background: #f7fbfd; }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-dropzone > span:not(.upload-icon) { display: flex; flex-direction: column; }
.upload-dropzone strong { font-size: .76rem; }
.upload-dropzone small { margin-top: 3px; color: #7a8b97; font-size: .61rem; }
.upload-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #e3eef4; font-size: 1.2rem; }
.upload-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.upload-meta .primary-button { min-width: 150px; }

@media (max-width: 1180px) {
  .attachment-gallery { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .case-sheet-tabs, .case-document > .case-sheet-tabs { top: 63px; }
  .form-sheet-panel { padding: 25px 18px; }
  .sheet-card { padding: 18px; }
}

@media (max-width: 680px) {
  .case-sheet-tab { min-height: 47px; padding: 0 11px; }
  .case-sheet-tab span { display: none; }
  .sheet-panel-heading { flex-direction: column; }
  .sheet-card .collection { overflow: visible; }
  .sheet-card .collection-item { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr) 34px; }
  .attachment-card { grid-template-columns: 88px minmax(0, 1fr); }
  .upload-meta { grid-template-columns: 1fr; }
  .upload-meta .primary-button { width: 100%; }
  .case-editor > .sticky-actions { margin: 0 10px 10px; }
}

@media print {
  .case-sheet-tabs, .attachment-upload, .attachment-remove { display: none !important; }
  .case-sheet-panel[hidden], .document-sheet-panel { display: block !important; min-height: 0; }
  .document-panel-heading { break-before: page; }
  .attachment-card { break-inside: avoid; }
  .attachment-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PDF-faithful investigative forms */
.pdf-form-sheet,
.pdf-document-sheet {
  width: 100%;
  padding: clamp(14px, 2.3vw, 30px);
  border: 10px solid #050607;
  background: #fff;
  color: #080a0c;
  font-family: Arial, Helvetica, sans-serif;
}

.pdf-institution-header {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr) 112px;
  align-items: center;
  gap: 24px;
  min-height: 145px;
  padding: 16px clamp(15px, 4vw, 55px);
  border-bottom: 7px solid #050607;
  background: #fff;
  text-align: center;
}
.pdf-institution-header img { width: 96px; height: 96px; margin: auto; border-radius: 50%; object-fit: cover; }
.pdf-institution-header div { display: flex; align-items: center; justify-content: center; flex-direction: column; }
.pdf-institution-header strong { display: inline-block; min-width: 230px; padding: 12px 24px 6px; border: 2px solid #15191c; border-bottom: 0; font-size: .78rem; letter-spacing: .04em; }
.pdf-institution-header span { display: inline-block; min-width: 230px; padding: 0 24px 12px; border: 2px solid #15191c; border-top: 0; font-size: .65rem; line-height: 1.55; }

.pdf-black-title,
.pdf-subtitle {
  display: flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  background: #050607;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-align: center;
}
.pdf-subtitle { min-height: 30px; padding: 5px 10px; font-size: .66rem; }

.pdf-case-input-grid,
.pdf-case-display-grid {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
  gap: 32px;
  padding: 25px;
  border-bottom: 7px solid #050607;
}
.pdf-input-facts { display: grid; gap: 5px; }
.pdf-input-facts label,
.pdf-doj-subject label,
.pdf-two-fields label,
.pdf-request-info label,
.pdf-wide-field {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: stretch;
}
.pdf-input-facts label > span,
.pdf-doj-subject label > span,
.pdf-two-fields label > span,
.pdf-request-info label > span,
.pdf-wide-field > span,
.pdf-large-text > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: #f4f5f5;
  color: #101214;
  font-size: .67rem;
  font-weight: 750;
  text-align: center;
}
.pdf-form-sheet input,
.pdf-form-sheet textarea,
.pdf-form-sheet select {
  border: 1px solid #a8b3bb;
  border-radius: 0;
  background: #d9e7f2;
  color: #0c1720;
  box-shadow: none;
  font-size: .73rem;
  text-align: center;
}
.pdf-form-sheet textarea { resize: vertical; text-align: left; }
.pdf-summary-input { display: grid; grid-template-rows: 30px 1fr; }
.pdf-summary-input > span { display: grid; place-items: center; border: 1px solid #0d1114; background: #d9e7f2; font-size: .68rem; font-weight: 800; }
.pdf-summary-input textarea { min-height: 170px; padding: 14px; background: #e2e4e5; line-height: 1.55; }
.pdf-internal-settings { margin: 15px 0 20px; border: 1px solid #cbd3d9; background: #f7f8f9; }
.pdf-internal-settings summary { padding: 10px 14px; color: #566672; font-size: .7rem; font-weight: 750; cursor: pointer; }
.pdf-internal-settings .form-grid { padding: 0 14px 14px; }

.pdf-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
  padding: 18px 24px;
  border-bottom: 7px solid #050607;
}
.pdf-context-grid > span { display: grid; grid-template-columns: 140px 1fr; align-items: center; min-height: 34px; font-size: .65rem; font-weight: 700; }
.pdf-context-grid strong { min-height: 31px; padding: 8px 12px; background: #d9e7f2; font-size: .67rem; text-align: center; }
.pdf-context-grid .summary { grid-column: 1 / -1; }
.pdf-context-grid .summary strong { max-height: 80px; overflow: auto; text-align: left; }

.pdf-form-sheet .sheet-card { margin: 20px 0; padding: 0; overflow: hidden; border: 2px solid #050607; border-radius: 0; box-shadow: none; }
.pdf-form-sheet .sheet-card > .form-section-heading { min-height: 42px; margin: 0; padding: 6px 10px 6px 15px; background: #050607; color: #fff; }
.pdf-form-sheet .sheet-card > .form-section-heading h3 { color: #fff; font-size: .78rem; }
.pdf-form-sheet .sheet-card > .form-section-heading .small-button { min-height: 30px; border-color: #d9e7f2; border-radius: 3px; background: #d9e7f2; color: #0d273a; font-size: .65rem; }
.pdf-form-sheet .collection { display: grid; gap: 14px; padding: 14px; overflow: visible; background: #eef0f1; }
.pdf-form-sheet .collection-empty { background: #e1e3e4; }
.pdf-form-sheet .collection-item {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid #050607;
  border-radius: 0;
  background: #d9dbdc;
  box-shadow: none;
}
.collection-item-title { grid-column: 1 / -1; min-height: 32px; padding: 7px 44px 7px 12px; background: #050607; color: #fff; font-size: .7rem; font-weight: 800; text-align: center; }
.pdf-form-sheet .collection-item .field { gap: 0; padding: 0; }
.pdf-form-sheet .collection-item .field > span { display: grid; min-height: 30px; place-items: center; padding: 5px 7px; background: #f7f7f7; color: #090b0d; font-size: .59rem; font-weight: 750; text-align: center; }
.pdf-form-sheet .collection-item input,
.pdf-form-sheet .collection-item textarea { min-height: 42px; border: 1px solid #fff; background: #d7d9da; font-size: .68rem; }
.pdf-form-sheet .collection-item textarea { min-height: 90px; }
.pdf-form-sheet .collection-item .remove-item { position: absolute; top: 3px; right: 4px; z-index: 2; border-radius: 3px; background: #fff; }

.collection-suspects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.collection-suspects .field-offenses { grid-column: 3 / 5; grid-row: 2 / 7; }
.collection-suspects .field-offenses textarea { height: 100%; min-height: 220px; }
.collection-suspects .field-name,
.collection-suspects .field-dob,
.collection-suspects .field-address,
.collection-suspects .field-mdt,
.collection-suspects .field-danger { grid-column: 1 / 3; display: grid !important; grid-template-columns: 150px 1fr; }
.collection-suspects .field-note,
.collection-suspects .field-reasoning { grid-column: 1 / -1; }
.collection-suspects .field-note textarea { min-height: 80px; }
.collection-suspects .field-reasoning textarea { min-height: 190px; }
.collection-responders,
.collection-scenePersons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.collection-timeline { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr); }
.collection-evidence { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.collection-evidence .field-description,
.collection-evidence .field-mediaLinks { grid-column: 1 / -1; }
.collection-evidence .field-description textarea { min-height: 180px; }
.collection-interviews { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.collection-interviews .field-transcript,
.collection-interviews .field-recordLink { grid-column: 1 / -1; }
.collection-interviews .field-transcript textarea { min-height: 220px; }
.collection-resolutions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.collection-resolutions .field-legalBasis,
.collection-resolutions .field-charges,
.collection-resolutions .field-reasoning,
.collection-resolutions .field-instruction { grid-column: 1 / -1; }
.collection-resolutions .field-reasoning textarea { min-height: 220px; }

.pdf-large-text { display: grid; margin: 0; }
.pdf-large-text textarea { min-height: 320px; padding: 18px; background: #d7d9da; }
.pdf-two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 18px; }
.pdf-two-fields label { grid-template-columns: 140px 1fr; }
.pdf-two-column-collections { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pdf-two-column-collections .sheet-card { margin: 0; }
.pdf-doj-subject { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; padding: 20px; }
.pdf-doj-subject .span-2 { grid-column: 1 / -1; }
.pdf-request-info { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px; }
.pdf-request-info > div { display: grid; gap: 6px; }
.pdf-request-info label { grid-template-columns: 155px 1fr; }
.pdf-request-info textarea { min-height: 72px; }
.pdf-wide-field { margin: 0 18px 18px; }
.pdf-checklist-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 18px 18px; }
.pdf-checkbox-list { min-width: 0; margin: 0; padding: 0 0 8px; border: 2px solid #050607; }
.pdf-checkbox-list legend { width: 100%; padding: 8px 12px; background: #050607; color: #fff; font-size: .7rem; font-weight: 800; text-align: center; }
.pdf-checkbox-list label { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; min-height: 30px; padding: 3px 9px; border-bottom: 1px solid #c4c8ca; background: #e0e2e3; font-size: .62rem; }
.pdf-checkbox-list label:nth-of-type(even) { background: #d6e3ed; }
.pdf-checkbox-list input { width: 16px; min-height: 16px; margin: 0; }
.pdf-triple-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 18px 18px; }
.pdf-triple-select label { display: grid; grid-template-rows: 52px 1fr; text-align: center; }
.pdf-triple-select span { display: grid; place-items: center; padding: 8px; border: 1px solid #050607; background: #f4f4f4; font-size: .61rem; font-weight: 750; }
.pdf-document-sheet { padding: 24px; }
.pdf-case-display-grid dl { display: grid; grid-template-columns: 145px 1fr; align-content: start; gap: 5px 0; margin: 0; }
.pdf-case-display-grid dt { display: grid; min-height: 34px; place-items: center; padding: 5px; background: #f4f5f5; font-size: .62rem; font-weight: 750; text-align: center; }
.pdf-case-display-grid dd { display: grid; min-height: 34px; place-items: center; margin: 0; padding: 7px 10px; background: #d9e7f2; font-size: .67rem; font-weight: 700; text-align: center; }
.pdf-case-display-grid > div { border: 2px solid #30383e; }
.pdf-case-display-grid > div > span { display: block; padding: 6px; background: #d9e7f2; font-size: .62rem; font-weight: 800; text-align: center; }
.pdf-case-display-grid > div p { min-height: 135px; margin: 0; padding: 13px; background: #d8dadb; font-size: .68rem; line-height: 1.55; }
.pdf-record-stack { display: grid; gap: 22px; margin-top: 20px; }
.pdf-suspect-card,
.pdf-evidence-card,
.pdf-interview-card,
.pdf-resolution-card { border: 7px solid #050607; background: #d6d8d9; break-inside: avoid; }
.pdf-suspect-top { display: grid; grid-template-columns: .95fr 1.05fr; gap: 22px; padding: 16px; }
.pdf-suspect-top dl { display: grid; grid-template-columns: 145px 1fr; margin: 0; }
.pdf-suspect-top dt,
.pdf-request-info.display dt { display: grid; place-items: center; padding: 7px; background: #f5f5f5; font-size: .59rem; font-weight: 750; text-align: center; }
.pdf-suspect-top dd,
.pdf-request-info.display dd { display: grid; min-height: 35px; place-items: center; margin: 0; padding: 7px; border-bottom: 1px solid #fff; background: #d7d9da; font-size: .65rem; text-align: center; }
.pdf-suspect-top > div { border: 1px solid #fff; }
.pdf-suspect-top > div > span { display: block; padding: 8px; background: #fff; font-size: .6rem; font-weight: 750; text-align: center; }
.pdf-suspect-top > div p { min-height: 185px; margin: 0; padding: 13px; font-size: .68rem; line-height: 1.5; text-align: center; }
.pdf-gray-text { min-height: 210px; padding: 22px; background: #d6d8d9; font-size: .72rem; line-height: 1.7; }
.pdf-gray-text.compact { min-height: 90px; }
.pdf-empty { min-height: 170px; margin-top: 20px; padding: 55px 20px; border: 7px solid #050607; background: #d6d8d9; color: #62676b; font-size: .72rem; text-align: center; }
.pdf-fact-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0 0 18px; }
.pdf-fact-pair > div { display: grid; grid-template-columns: 150px 1fr; }
.pdf-fact-pair dt { padding: 9px; background: #f4f4f4; font-size: .61rem; font-weight: 750; text-align: center; }
.pdf-fact-pair dd { margin: 0; padding: 9px; background: #d9e7f2; font-size: .66rem; text-align: center; }
.pdf-table-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pdf-document-sheet .table-wrap { border: 2px solid #050607; }
.pdf-document-sheet table { min-width: 100%; }
.pdf-document-sheet th { padding: 8px; border-color: #050607; background: #fff; color: #050607; font-size: .58rem; text-align: center; }
.pdf-document-sheet td { padding: 9px; border-right: 1px solid #fff; background: #d6d8d9; font-size: .63rem; text-align: center; }
.pdf-evidence-meta,
.pdf-interview-meta { display: grid; grid-template-columns: repeat(5, 1fr); }
.pdf-evidence-meta span,
.pdf-interview-meta span,
.pdf-resolution-facts span,
.pdf-doj-display span,
.pdf-triple-status span { display: flex; min-width: 0; flex-direction: column; padding: 7px; border-right: 1px solid #050607; background: #fff; font-size: .55rem; font-weight: 700; text-align: center; }
.pdf-evidence-meta strong,
.pdf-interview-meta strong,
.pdf-resolution-facts strong,
.pdf-doj-display strong,
.pdf-triple-status strong { margin-top: 5px; padding: 7px; background: #d9e7f2; font-size: .63rem; overflow-wrap: anywhere; }
.pdf-interview-meta { grid-template-columns: .8fr 1.3fr 1fr 1fr 1fr; }
.pdf-resolution-facts { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.pdf-decision-line { margin: 0; padding: 14px; background: #fff; font-size: .66rem; text-align: center; }
.pdf-resolution-law { padding: 18px; border-top: 2px solid #050607; border-bottom: 2px solid #050607; background: #f5f5f5; font-size: .68rem; text-align: center; }
.pdf-accused { display: grid; gap: 10px; padding: 22px 14%; text-align: center; }
.pdf-accused span { font-size: .61rem; }
.pdf-accused strong { padding: 18px; border: 1px solid #30383e; background: #d9e7f2; font-size: .78rem; }
.pdf-instruction { display: flex; gap: 12px; padding: 15px; border-top: 2px solid #050607; background: #fff; font-size: .62rem; line-height: 1.55; }
.pdf-doj-display { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 18px; }
.pdf-doj-display .wide { grid-column: 1 / -1; }
.pdf-request-info.display dl { display: grid; grid-template-columns: 155px 1fr; margin: 0; }
.pdf-link-row { display: grid; grid-template-columns: 170px 1fr; margin: 0 18px 18px; border: 1px solid #050607; font-size: .62rem; font-weight: 750; text-align: center; }
.pdf-link-row strong { padding: 9px; background: #d9e7f2; }
.pdf-display-checklist { border: 2px solid #050607; background: #d6d8d9; }
.pdf-display-checklist ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pdf-display-checklist li { display: grid; grid-template-columns: 24px 1fr; align-items: center; min-height: 29px; padding: 4px 9px; border-bottom: 1px solid #bcc1c4; font-size: .61rem; }
.pdf-display-checklist li:nth-child(even) { background: #d9e7f2; }
.pdf-display-checklist li span { color: #21639a; font-weight: 900; }
.pdf-display-checklist p { margin: 0; padding: 20px; color: #697279; font-size: .65rem; text-align: center; }
.pdf-triple-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 0 18px 18px; }
.pdf-document-sheet .attachment-section { margin-top: 22px; padding: 0; border: 7px solid #050607; }
.pdf-document-sheet .attachment-section > .document-section-heading { min-height: 38px; padding: 6px 12px; background: #050607; }
.pdf-document-sheet .attachment-section > .document-section-heading h2 { color: #fff; font-size: .72rem; }
.pdf-document-sheet .attachment-count { background: #d9e7f2; }
.pdf-document-sheet .attachment-gallery,
.pdf-document-sheet .attachment-section > .empty-line,
.pdf-document-sheet .attachment-upload { margin: 16px; }

@media (max-width: 900px) {
  .pdf-form-sheet, .pdf-document-sheet { padding: 12px; border-width: 6px; }
  .pdf-institution-header { grid-template-columns: 72px 1fr 72px; gap: 10px; padding: 12px; }
  .pdf-institution-header img { width: 65px; height: 65px; }
  .pdf-case-input-grid, .pdf-case-display-grid, .pdf-two-column-collections, .pdf-table-pair, .pdf-request-info { grid-template-columns: 1fr; gap: 14px; }
  .pdf-case-input-grid, .pdf-case-display-grid { padding: 14px; }
  .collection-evidence, .collection-interviews, .collection-resolutions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-suspects { grid-template-columns: 1fr; }
  .collection-suspects .field-name, .collection-suspects .field-dob, .collection-suspects .field-address, .collection-suspects .field-mdt, .collection-suspects .field-danger, .collection-suspects .field-offenses, .collection-suspects .field-note, .collection-suspects .field-reasoning { grid-column: 1; grid-row: auto; }
  .collection-suspects .field-offenses textarea { min-height: 120px; }
  .pdf-checklist-columns { grid-template-columns: 1fr 1fr; }
  .pdf-evidence-meta, .pdf-interview-meta { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .pdf-institution-header { grid-template-columns: 54px 1fr 54px; }
  .pdf-institution-header img { width: 50px; height: 50px; }
  .pdf-institution-header strong, .pdf-institution-header span { min-width: 0; padding-right: 8px; padding-left: 8px; }
  .pdf-input-facts label, .pdf-doj-subject label, .pdf-two-fields label, .pdf-request-info label, .pdf-wide-field { grid-template-columns: 1fr; }
  .pdf-context-grid, .pdf-doj-subject, .pdf-two-fields, .pdf-checklist-columns, .pdf-triple-select, .pdf-triple-status, .pdf-fact-pair, .pdf-suspect-top { grid-template-columns: 1fr; }
  .pdf-context-grid .summary, .pdf-doj-subject .span-2 { grid-column: 1; grid-row: auto; }
  .collection-responders, .collection-scenePersons, .collection-timeline, .collection-evidence, .collection-interviews, .collection-resolutions { grid-template-columns: 1fr; }
  .collection-evidence .field-description, .collection-evidence .field-mediaLinks, .collection-interviews .field-transcript, .collection-interviews .field-recordLink, .collection-resolutions .field-legalBasis, .collection-resolutions .field-charges, .collection-resolutions .field-reasoning, .collection-resolutions .field-instruction { grid-column: 1; }
  .pdf-evidence-meta, .pdf-interview-meta, .pdf-resolution-facts, .pdf-doj-display { grid-template-columns: 1fr; }
  .pdf-doj-display .wide { grid-column: 1; }
  .pdf-table-pair { overflow-x: auto; }
}

@media print {
  @page { size: A4 landscape; margin: 8mm; }
  html, body, .print-page { width: auto; margin: 0; padding: 0; overflow: visible !important; background: #fff; }
  body { orphans: 3; widows: 3; }
  .printable-document,
  .case-document,
  .case-sheet-panel,
  .document-sheet-panel,
  .pdf-document-sheet { overflow: visible !important; }
  .printable-document { width: 100%; max-width: none; margin: 0; border: 0; box-shadow: none; }
  .document-sheet-panel {
    display: block !important;
    min-height: 0;
    break-before: page;
    page-break-before: always;
    break-after: page;
    page-break-after: always;
  }
  #sheet-intro { break-before: auto; page-break-before: auto; }
  #sheet-doj { break-after: auto; page-break-after: auto; }
  .pdf-document-sheet {
    width: 100%;
    padding: 6mm;
    border-width: 2.5mm;
    break-inside: auto;
    page-break-inside: auto;
    break-after: auto;
    page-break-after: auto;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }
  .pdf-document-sheet .pdf-institution-header { min-height: 28mm; }
  .pdf-institution-header,
  .pdf-black-title,
  .pdf-case-display-grid,
  .pdf-context-grid,
  .pdf-fact-pair,
  .pdf-evidence-meta,
  .pdf-interview-meta,
  .pdf-resolution-facts,
  .pdf-doj-display,
  .pdf-triple-status,
  .pdf-link-row,
  .pdf-display-checklist,
  .pdf-instruction,
  .pdf-empty,
  .attachment-card,
  tr,
  img {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .pdf-institution-header,
  .pdf-black-title,
  .pdf-subtitle,
  thead { break-after: avoid; page-break-after: avoid; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  .pdf-suspect-card,
  .pdf-evidence-card,
  .pdf-interview-card,
  .pdf-resolution-card {
    break-inside: auto !important;
    page-break-inside: auto !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }
  .pdf-record-stack { display: block; }
  .pdf-record-stack > section {
    margin-top: 6mm;
    break-before: page;
    page-break-before: always;
    break-after: auto;
    page-break-after: auto;
  }
  .document-section { break-inside: auto; page-break-inside: auto; }
  .document-footer { break-inside: avoid; page-break-inside: avoid; }
  .attachment-gallery { align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attachment-preview,
  .attachment-preview img { max-height: 62mm; }
  .pdf-gray-text,
  .pdf-case-display-grid > div p,
  .pdf-resolution-law,
  .pdf-accused,
  .pdf-instruction { overflow-wrap: anywhere; }
  .pdf-document-sheet .attachment-upload { display: none !important; }
  .pdf-gray-text,
  .pdf-case-display-grid > div p,
  .pdf-document-sheet,
  .pdf-document-sheet * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
