.app-shell { display: flex; flex-direction: column; }
.topbar { order: 0; }
.memorial-command { order: 1; margin-top: 22px; }
.masthead { order: 2; margin-top: 0; }
.interaction-note { order: 3; }
.command-grid { order: 4; }
.page-footer { order: 5; }

.memorial-command {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, .8fr) minmax(540px, 1.2fr);
  min-height: 440px;
  margin: 0 0 16px;
  overflow: hidden;
  color: white;
  background: var(--navy);
  border: 1px solid #314158;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.memorial-command::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cpath d='M0 80h160M80 0v160' stroke='%23b9a06a' stroke-opacity='.045'/%3E%3Ccircle cx='80' cy='80' r='38' fill='none' stroke='%23b9a06a' stroke-opacity='.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.memorial-command-copy {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 34px 22px 30px 34px;
  background: rgba(23, 34, 51, .92);
  border-right: 1px solid rgba(185, 160, 106, .24);
}

.memorial-command-copy h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 600;
  letter-spacing: .09em;
}

.pending-note {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 28px;
  margin-bottom: 15px;
  padding: 5px 9px;
  color: #f8ece7;
  background: var(--vermilion);
  border: 1px solid #ba6a61;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: .12em;
  transform: rotate(-1.5deg);
}

.active-memorial-kicker {
  margin-top: 21px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.active-memorial-title {
  max-width: 460px;
  margin: 8px 0 7px;
  color: white;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
}

.active-memorial-summary {
  display: -webkit-box;
  max-width: 470px;
  margin: 0;
  overflow: hidden;
  color: #bdc8d2;
  font-size: 11px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.active-memorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.active-memorial-meta span {
  padding: 4px 7px;
  color: #dbe2e8;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 9px;
}

.wheel-instruction {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: #9eabb7;
  font-size: 10px;
}

.wheel-instruction::before {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(185,160,106,.52);
  border-radius: 50%;
  content: "↕";
  font-size: 14px;
}

.memorial-wheel-stage {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.memorial-wheel-stage.is-dragging { cursor: grabbing; }

.wheel-disc {
  position: absolute;
  width: 330px;
  height: 330px;
  background: rgba(247, 245, 241, .055);
  border: 1px solid rgba(185,160,106,.24);
  border-radius: 50%;
  box-shadow: inset 0 0 0 38px rgba(23,34,51,.28), inset 0 0 0 39px rgba(185,160,106,.12);
  pointer-events: none;
}

.wheel-disc::before,
.wheel-disc::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.wheel-disc::before { inset: 82px; border: 1px solid rgba(185,160,106,.19); }
.wheel-disc::after { inset: 132px; background: rgba(185,160,106,.1); border: 1px solid rgba(185,160,106,.28); }

.wheel-core-copy {
  position: absolute;
  z-index: 2;
  width: 118px;
  color: #b8c3cd;
  text-align: center;
  pointer-events: none;
}

.wheel-core-copy b {
  display: block;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .1em;
}

.wheel-core-copy span { display: block; margin-top: 6px; font-size: 9px; line-height: 1.5; }

.wheel-cover {
  position: absolute;
  z-index: 3;
  display: block;
  width: 58px;
  height: 108px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  cursor: pointer;
  transform-origin: 50% 72%;
  will-change: transform, opacity;
}

.memorial-wheel-stage.is-snapping .wheel-cover {
  transition: left 420ms cubic-bezier(.2,.9,.2,1), top 420ms cubic-bezier(.2,.9,.2,1), transform 420ms cubic-bezier(.2,.9,.2,1), opacity 300ms ease, filter 300ms ease;
}

.wheel-cover-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #33271c;
  background-color: var(--cover-color, #d8cab2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='100'%3E%3Cpath d='M8 0v100M52 0v100M0 12h60M0 88h60' stroke='%23755d3b' stroke-opacity='.18'/%3E%3Cpath d='M4 4h12v1H5v11H4zM56 4H44v1h11v11h1zM4 96h12v-1H5V84H4zM56 96H44v-1h11V84h1z' fill='%23755d3b' fill-opacity='.32'/%3E%3C/svg%3E");
  border: 3px solid #f8f2e5;
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(5,10,18,.28), 0 0 0 1px rgba(185,160,106,.62);
  transition: box-shadow 180ms var(--ease);
}

.wheel-cover.is-active { z-index: 12; }
.wheel-cover.is-active .wheel-cover-face { box-shadow: 0 18px 32px rgba(5,10,18,.42), 0 0 0 2px var(--gold); }

.wheel-cover-label {
  display: grid;
  width: 30px;
  min-height: 58px;
  padding: 5px 3px;
  place-items: center;
  color: #2f281f;
  background: rgba(255,252,242,.89);
  border: 1px solid rgba(112,82,39,.58);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.42;
  text-align: center;
  white-space: pre-line;
}

.wheel-cover-department {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 130px;
  color: #e0d5bd;
  font-size: 9px;
  text-align: center;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 140ms ease;
  pointer-events: none;
}

.wheel-cover.is-active .wheel-cover-department { opacity: 1; }

.wheel-empty {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: none;
  place-items: center;
  color: #c8d1d8;
  text-align: center;
}

.wheel-empty.visible { display: grid; }
.wheel-empty b { display: block; color: var(--gold); font-family: var(--font-serif); font-size: 23px; }
.wheel-empty span { display: block; margin-top: 8px; font-size: 10px; }

body:has(.verdict-dialog[open]) { overflow: hidden; }

.verdict-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
}

.verdict-dialog::backdrop { background: rgba(6, 11, 18, .84); backdrop-filter: blur(8px); }

.verdict-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: white;
  background: #101b29;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cpath d='M0 90h180M90 0v180' stroke='%23b9a06a' stroke-opacity='.035'/%3E%3Ccircle cx='90' cy='90' r='60' fill='none' stroke='%23b9a06a' stroke-opacity='.04'/%3E%3C/svg%3E");
}

.verdict-topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(185,160,106,.22);
}

.verdict-topbar-copy small { display: block; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.verdict-topbar-copy b { display: block; margin-top: 4px; font-family: var(--font-serif); font-size: 13px; font-weight: 500; }
.verdict-mode-title { color: #dbe1e6; font-family: var(--font-serif); font-size: 14px; letter-spacing: .14em; text-align: center; }
.verdict-topbar .dialog-close { justify-self: end; }

.court-resources {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 9px;
  width: min(920px, calc(100% - 32px));
  margin: 12px auto 0;
}

.court-resource {
  min-width: 0;
  padding: 8px 10px 9px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.11);
}

.court-resource-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #b8c3cd; font-size: 8px; }
.court-resource-head b { color: white; font-size: 9px; }
.court-resource-track { position: relative; height: 4px; margin-top: 8px; overflow: hidden; background: #334154; }
.court-resource-current, .court-resource-preview { position: absolute; inset: 0 auto 0 0; transform-origin: left; transition: width 120ms linear, background-color 120ms linear; }
.court-resource-current { z-index: 1; background: var(--gold); }
.court-resource-preview { z-index: 2; background: #80b49b; opacity: .88; }
.court-resource-preview.negative { background: #b76d65; }
.court-resource-delta { min-height: 11px; margin-top: 5px; color: #91bda8; font-size: 8px; }
.court-resource-delta.negative { color: #d58d85; }

.verdict-arena {
  position: relative;
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(300px, 440px) minmax(145px, 1fr);
  align-items: center;
  min-height: 0;
  padding: 12px 20px 4px;
}

.verdict-zone {
  position: relative;
  z-index: 4;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: .18;
  transition: opacity 100ms linear, transform 100ms linear;
  pointer-events: none;
}

.verdict-zone.reject { align-items: flex-end; padding-right: 54px; text-align: right; }
.verdict-zone.approve { align-items: flex-start; padding-left: 54px; }
.verdict-zone.is-previewing { opacity: 1; transform: scale(1.025); }
.verdict-zone strong { color: var(--gold); font-family: var(--font-serif); font-size: clamp(30px, 4vw, 58px); font-weight: 500; letter-spacing: .1em; }
.verdict-zone span { max-width: 210px; margin-top: 8px; color: #bbc5ce; font-size: 10px; line-height: 1.6; }
.verdict-zone.reject strong { color: #d89a91; }

.verdict-stack {
  position: relative;
  z-index: 10;
  width: min(410px, 82vw);
  height: min(560px, calc(100dvh - 225px));
  min-height: 390px;
  margin: 0 auto;
  perspective: 1400px;
}

.verdict-back-card,
.verdict-card {
  position: absolute;
  inset: 0;
  border-radius: 5px;
}

.verdict-back-card {
  background: #e7ddc8;
  border: 1px solid #b8a47b;
  box-shadow: 0 14px 38px rgba(3,8,14,.28);
}

.verdict-back-card.second { transform: translate(9px, 16px) rotate(1.25deg) scale(.974); opacity: .72; }
.verdict-back-card.third { transform: translate(-7px, 29px) rotate(-1deg) scale(.95); opacity: .43; }

.verdict-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #332a20;
  background: #f6f0e4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M0 20h120M0 83h120' stroke='%238a7554' stroke-opacity='.08'/%3E%3Ccircle cx='18' cy='57' r='.8' fill='%238a7554' fill-opacity='.15'/%3E%3Ccircle cx='94' cy='104' r='.7' fill='%23b18d50' fill-opacity='.14'/%3E%3C/svg%3E");
  border: 1px solid #b9a06a;
  box-shadow: 0 25px 75px rgba(2, 7, 13, .48);
  touch-action: none;
  cursor: grab;
  transform-origin: 50% 72%;
  will-change: transform, opacity;
}

.verdict-card.is-dragging { cursor: grabbing; box-shadow: 0 32px 90px rgba(2,7,13,.58); }
.verdict-card.is-returning { transition: transform 260ms cubic-bezier(.2,0,0,1), opacity 260ms ease; }
.verdict-card.is-committing { transition: transform 480ms cubic-bezier(.18,.75,.2,1), opacity 360ms ease; }

.verdict-card::before,
.verdict-card::after {
  position: absolute;
  z-index: 3;
  left: 0;
  width: 100%;
  height: 22px;
  content: "";
  background: rgba(180,153,105,.12);
  border-bottom: 1px solid rgba(121,91,50,.2);
  pointer-events: none;
}

.verdict-card::before { top: 31%; }
.verdict-card::after { top: 69%; }

.verdict-paper-head {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 18px 18px 13px;
  border-bottom: 1px solid rgba(116,86,46,.26);
}

.verdict-vertical-title {
  display: grid;
  width: 34px;
  min-height: 78px;
  padding: 7px 4px;
  place-items: center;
  color: #2f281f;
  background: rgba(255,252,242,.66);
  border: 1px solid #9c8157;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-line;
}

.verdict-paper-heading small { color: #8b7657; font-size: 8px; letter-spacing: .09em; }
.verdict-paper-heading h2 { margin: 7px 0 0; font-family: var(--font-serif); font-size: clamp(17px, 2.2vw, 23px); font-weight: 600; line-height: 1.45; }
.verdict-urgency { padding: 4px 6px; color: var(--vermilion); border: 1px solid currentColor; font-family: var(--font-serif); font-size: 11px; transform: rotate(2deg); }

.verdict-paper-body {
  position: relative;
  z-index: 4;
  flex: 1;
  min-height: 0;
  padding: 17px 22px 14px;
  overflow: auto;
  scrollbar-width: thin;
}

.verdict-petition { margin: 0; font-family: var(--font-serif); font-size: 13px; line-height: 1.95; }
.verdict-kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 16px; }
.verdict-kpi { padding: 9px 8px; background: rgba(255,255,255,.38); border: 1px solid rgba(117,88,49,.22); }
.verdict-kpi small { display: block; color: #8a775e; font-size: 8px; }
.verdict-kpi b { display: block; margin-top: 5px; color: #3c3126; font-size: 14px; }
.verdict-reviews { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.verdict-reviews span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; color: #654f38; background: rgba(255,255,255,.3); border: 1px solid rgba(117,88,49,.22); font-size: 8px; }
.verdict-reviews span::before { width: 5px; height: 5px; background: var(--green); border-radius: 50%; content: ""; }

.verdict-paper-foot {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 18px;
  color: #776650;
  border-top: 1px solid rgba(116,86,46,.23);
  font-size: 9px;
}

.verdict-department-marks { display: flex; }
.verdict-department-marks span { display: grid; width: 23px; height: 23px; margin-left: -3px; place-items: center; color: var(--vermilion); background: #f6f0e4; border: 1px solid currentColor; border-radius: 50%; font-family: var(--font-serif); font-size: 9px; }

.verdict-stamp {
  position: absolute;
  z-index: 12;
  right: 15%;
  bottom: 19%;
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  color: var(--vermilion);
  border: 7px double currentColor;
  border-radius: 9px;
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 700;
  opacity: 0;
  transform: rotate(-10deg) scale(1.5);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.verdict-stamp.reject { right: auto; left: 15%; transform: rotate(9deg) scale(1.5); }
.verdict-stamp.hold { right: 50%; bottom: 16%; width: 118px; height: 72px; transform: translateX(50%) rotate(-2deg) scale(1.5); font-size: 27px; }

.hold-tray {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 3px;
  width: min(360px, 72vw);
  height: 52px;
  padding-top: 11px;
  color: #9ca9b4;
  background: #0a131e;
  border: 1px solid rgba(185,160,106,.24);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  text-align: center;
  opacity: .46;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 100ms linear, transform 100ms linear, border-color 100ms linear;
  pointer-events: none;
}

.hold-tray.is-previewing { color: var(--gold-soft); border-color: var(--gold); opacity: 1; transform: translateX(-50%) translateY(0); }
.hold-tray b { display: block; font-family: var(--font-serif); font-size: 12px; }
.hold-tray span { display: block; margin-top: 3px; font-size: 8px; }

.verdict-footer {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 16px;
  background: rgba(9,16,25,.84);
  border-top: 1px solid rgba(185,160,106,.18);
}

.verdict-footer-note { margin-right: 10px; color: #8795a1; font-size: 9px; }
.verdict-access-button { min-height: 36px; padding: 7px 10px; color: #c6d0d8; background: transparent; border: 1px solid rgba(255,255,255,.15); border-radius: 4px; cursor: pointer; }
.verdict-access-button:hover { color: white; border-color: var(--gold); }
.verdict-access-button.approve { color: var(--gold-soft); border-color: rgba(185,160,106,.45); }
.verdict-access-button.reject { color: #d7a29a; border-color: rgba(183,109,101,.42); }

@media (max-width: 980px) {
  .memorial-command { grid-template-columns: minmax(280px, .72fr) minmax(450px, 1.28fr); }
  .verdict-arena { grid-template-columns: 90px minmax(300px, 430px) 90px; }
  .verdict-zone.reject { padding-right: 14px; }
  .verdict-zone.approve { padding-left: 14px; }
  .verdict-zone span { display: none; }
}

@media (max-width: 820px) {
  .memorial-command { grid-template-columns: 1fr; min-height: 650px; }
  .memorial-command-copy { min-height: 245px; padding: 26px 22px 22px; border-right: 0; border-bottom: 1px solid rgba(185,160,106,.24); }
  .active-memorial-kicker { margin-top: 13px; }
  .active-memorial-summary { -webkit-line-clamp: 2; }
  .wheel-instruction { margin-top: 14px; }
  .memorial-wheel-stage { min-height: 405px; }
  .court-resources { grid-template-columns: repeat(5, minmax(72px, 1fr)); gap: 5px; }
  .court-resource { padding: 7px 6px; }
  .verdict-arena { grid-template-columns: 40px minmax(280px, 410px) 40px; padding-right: 4px; padding-left: 4px; }
  .verdict-zone strong { writing-mode: vertical-rl; font-size: 25px; }
  .verdict-zone.reject, .verdict-zone.approve { align-items: center; padding: 0; }
}

@media (max-width: 620px) {
  .memorial-command { min-height: 0; grid-template-rows: auto 360px; margin-top: 14px; }
  .memorial-command-copy { min-height: 0; padding: 23px 20px 20px; }
  .memorial-wheel-stage { height: 360px; min-height: 360px; }
  .active-memorial-summary { -webkit-line-clamp: 1; }
  .memorial-command-copy h2 { font-size: 31px; }
  .active-memorial-title { font-size: 15px; }
  .memorial-wheel-stage { min-height: 382px; }
  .verdict-topbar { grid-template-columns: 1fr auto; min-height: 58px; padding: 8px 12px; }
  .verdict-mode-title { display: none; }
  .court-resources { width: calc(100% - 16px); margin-top: 7px; overflow-x: auto; grid-template-columns: repeat(5, 86px); justify-content: start; padding-bottom: 3px; }
  .verdict-arena { grid-template-columns: 28px minmax(0, 1fr) 28px; padding-top: 6px; }
  .verdict-zone strong { font-size: 21px; }
  .verdict-stack { width: min(340px, calc(100vw - 62px)); height: min(530px, calc(100dvh - 206px)); min-height: 360px; }
  .verdict-paper-head { padding: 13px 13px 10px; }
  .verdict-vertical-title { width: 29px; min-height: 67px; font-size: 14px; }
  .verdict-paper-heading h2 { font-size: 16px; }
  .verdict-paper-body { padding: 13px 16px 11px; }
  .verdict-petition { font-size: 11px; line-height: 1.82; }
  .verdict-kpi-row { gap: 4px; margin-top: 11px; }
  .verdict-kpi { padding: 7px 5px; }
  .verdict-kpi b { font-size: 12px; }
  .verdict-stamp { width: 82px; height: 82px; font-size: 34px; }
  .hold-tray { width: 64vw; }
  .verdict-footer { min-height: 52px; padding: 6px 8px; }
  .verdict-footer-note { display: none; }
  .verdict-access-button { min-height: 34px; padding: 6px 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .memorial-wheel-stage.is-snapping .wheel-cover,
  .verdict-card.is-returning,
  .verdict-card.is-committing { transition-duration: .01ms !important; }
}

@media print {
  .memorial-command { break-inside: avoid; }
  .verdict-dialog { display: none !important; }
}
