:root {
  color-scheme: only light;
  --ink: #3b2e2a;
  --paper: #efe3c8;
  --paper-light: #fbf7ee;
  --paper-dark: #d9c79f;
  --claim: #c4433b;
  --violet: #5c4b8a;
  --grass: #a8c66c;
  --gold: #ffe58a;
  --shadow: rgba(59, 46, 42, .24);
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink);
  font: 16px/1.35 var(--body);
  overscroll-behavior: none;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, canvas:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
}

#game {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) clamp(300px, 37dvh, 360px);
  background: #241d1a;
  user-select: none;
}

#field {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #596538;
}

#game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: absolute;
  z-index: 5;
  inset: max(12px, env(safe-area-inset-top)) 12px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  pointer-events: none;
}

.hud-group, .hud-actions {
  width: max-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: rgba(239, 227, 200, .94);
  box-shadow: 4px 4px 0 rgba(59, 46, 42, .32);
}

.hud-group { display: grid; }
.hud-group strong { font: 700 clamp(14px, 1.6vw, 20px)/1.1 var(--display); }
.hud-actions { justify-self: end; display: flex; gap: 6px; padding: 5px; pointer-events: auto; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .74; }
.icon-button { min-width: 40px; min-height: 40px; border: 0; background: transparent; font-weight: 900; cursor: pointer; }
.icon-button:hover { background: rgba(59, 46, 42, .1); }
.ledger-figure.is-low { animation: budget-pulse .7s steps(2) infinite; border-color: var(--claim); }
.ledger-figure.is-hit { animation: budget-hit .28s ease-out; }

@keyframes budget-hit { 25% { transform: translateX(-6px) rotate(-1deg); } 65% { transform: translateX(5px) rotate(1deg); } }
@keyframes budget-pulse { 50% { background: #e8c5b7; } }

#desk {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, .7fr) minmax(0, 1.8fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 1px;
  background: var(--ink);
  border-top: 3px solid var(--ink);
  overflow: hidden;
}

.desk-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 10px 12px;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 24px, rgba(59,46,42,.035) 25px);
}

.desk-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 2px solid var(--ink); }
.desk-heading > div { display: grid; }
.desk-heading strong { font: 700 18px/1.1 var(--display); }
.desk-heading .desk-heading-meta { display: flex; align-items: end; gap: 9px; }
.desk-level-status { display: grid; gap: 1px; text-align: right; white-space: nowrap; }
.desk-level-status span { font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; opacity: .72; }
.desk-level-status strong { font: 700 12px/1.05 var(--display); }
.folder-count, #deck-count { font-size: 12px; font-weight: 800; }
.folder-count { color: var(--claim); }

.card-strip {
  min-height: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 2px 20px;
  scrollbar-color: var(--ink) transparent;
  scrollbar-width: thin;
}

.claim-card, .tool-card, .empty-card {
  width: 100%;
  min-height: 64px;
  margin: 0 0 8px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-light);
  box-shadow: 3px 3px 0 rgba(59,46,42,.18);
  text-align: left;
}

.claim-card, .card-strip > .empty-card { flex: 0 0 min(300px, 34vw); }

.claim-card, .tool-card { display: grid; gap: 5px; padding: 10px; cursor: pointer; }
.claim-card { position: relative; overflow: hidden; }
.claim-card:hover, .tool-card:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 rgba(59,46,42,.2); }
.claim-card.selected { outline: 4px solid var(--violet); outline-offset: -4px; }
.claim-card header, .tool-card header { display: flex; gap: 8px; justify-content: space-between; align-items: start; }
.claim-card strong, .tool-card strong { font: 700 14px/1.15 var(--display); }
.claim-card p, .tool-card p { margin: 0; font-size: 12px; }
.claim-card .claim-value { color: var(--claim); white-space: nowrap; font-weight: 900; }
.claim-timer { height: 6px; border: 1px solid var(--ink); background: #fff; }
.claim-timer i { display: block; height: 100%; background: var(--claim); transform-origin: left; }
.claim-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.claim-tags span, .tool-kind { padding: 2px 5px; background: #e6d6b5; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.claim-tags .early-tag { background: #d7e4b7; color: #365426; }
.claim-tags .adjusted-tag { background: #d8c9ec; color: #46336e; }
.pay-claim {
  min-height: 38px;
  margin-top: 2px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.pay-claim:hover { background: var(--gold); }
.pay-claim:disabled { cursor: default; opacity: .55; }
.claim-stamp {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  min-width: 138px;
  padding: 7px 10px;
  border: 5px double var(--claim);
  color: var(--claim);
  background: rgba(251,247,238,.9);
  font: 900 18px/1 var(--display);
  letter-spacing: .11em;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-8deg) scale(2.2);
  opacity: 0;
  pointer-events: none;
}
.claim-card.resolving { pointer-events: none; animation: claim-filed 1.1s ease-in forwards; }
.claim-card.resolving .claim-stamp { animation: stamp-claim 1.1s cubic-bezier(.18,.9,.2,1) forwards; }
.auto-claim-action { display: none; }
@keyframes stamp-claim {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.2); }
  25%, 76% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(.96); }
}
@keyframes claim-filed { 72% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px) rotate(-1deg); } }
.tool-card { border-left-width: 8px; }
.tool-card[data-kind="denial"] { border-left-color: var(--claim); }
.tool-card[data-kind="deferral"] { border-left-color: #6d8fc4; }
.tool-card[data-kind="reduction"] { border-left-color: #b88942; }
.tool-card[data-kind="sweep"] { border-left-color: #5c4b8a; }
.tool-card[data-kind="field"] { border-left-color: #6e9b4e; }
.tool-card:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 rgba(59,46,42,.12); }
.tool-card.valid-for-claim {
  outline: 4px solid #7b9f43;
  outline-offset: -4px;
  background: #f6f3d7;
  animation: valid-tool 1.1s ease-in-out infinite alternate;
}
.tool-card.best-for-claim { outline-color: #c18d1d; background: #fff3bc; }
@keyframes valid-tool { to { box-shadow: 5px 5px 0 rgba(76,113,42,.45); } }
.empty-card { display: grid; place-items: center; padding: 14px; color: #6c5c50; font-style: italic; }

.satchel-groups {
  min-height: 0;
  overflow: hidden;
  padding: 7px 2px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, .95fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  scrollbar-color: var(--ink) transparent;
  scrollbar-width: thin;
}
.satchel-group { min-width: 0; min-height: 0; padding: 7px; border: 2px solid rgba(59,46,42,.5); background: rgba(251,247,238,.35); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.satchel-group > header { display: grid; gap: 1px; margin-bottom: 5px; padding-bottom: 4px; border-bottom: 1px solid rgba(59,46,42,.45); }
.satchel-group > header strong { font: 700 14px/1.1 var(--display); }
.satchel-group > header small { font-size: 9px; font-weight: 800; opacity: .68; }
.satchel-group-list { min-height: 0; display: grid; align-content: start; gap: 6px; overflow-y: auto; padding: 3px 5px 6px 3px; scrollbar-color: var(--ink) transparent; scrollbar-width: thin; }
.satchel-group-list .tool-card { margin: 0; gap: 4px; padding: 8px; }
.tool-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.tool-meta [data-tool-availability] { color: #5c4b8a; }
.tool-meta [data-tool-efficiency] { color: #446a2f; }
.field-orders { background: rgba(168,198,108,.15); }
.group-empty { padding: 10px; color: #76685c; font-size: 12px; font-style: italic; }

#game.auto-admin { grid-template-rows: minmax(0, 1fr) clamp(86px, 13dvh, 112px); }
#game.auto-admin #desk { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#game.auto-admin .satchel-section { display: none; }
#game.auto-admin .docket-section {
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 7px 12px;
}
#game.auto-admin .desk-heading {
  align-items: center;
  padding: 0 12px 0 0;
  border-right: 2px solid var(--ink);
  border-bottom: 0;
}
#game.auto-admin .desk-heading strong { font-size: 15px; }
#game.auto-admin .folder-count { display: none; }
#game.auto-admin .card-strip { align-items: stretch; gap: 7px; padding: 3px 4px 5px; }
#game.auto-admin .card-strip > .empty-card { flex: 1 1 auto; min-height: 0; margin: 0; }
#game.auto-admin .claim-card.auto-receipt {
  flex: 0 1 440px;
  min-width: 250px;
  min-height: 0;
  margin: 0;
  padding: 7px 9px;
  grid-template-columns: minmax(125px, 1fr) auto minmax(120px, 1.15fr);
  align-items: center;
  gap: 7px;
  cursor: default;
  pointer-events: none;
}
#game.auto-admin .claim-card.auto-receipt:hover { transform: none; box-shadow: 3px 3px 0 rgba(59,46,42,.18); }
#game.auto-admin .claim-card.auto-receipt.selected { outline: 0; }
#game.auto-admin .claim-card.auto-receipt header { grid-column: 1; display: grid; gap: 2px; }
#game.auto-admin .claim-card.auto-receipt > p,
#game.auto-admin .claim-card.auto-receipt .claim-tags,
#game.auto-admin .claim-card.auto-receipt .claim-timer,
#game.auto-admin .claim-card.auto-receipt .pay-claim { display: none; }
#game.auto-admin .claim-card.auto-receipt .claim-stamp {
  position: static;
  grid-column: 2;
  left: auto;
  top: auto;
  min-width: 78px;
  padding: 5px 7px;
  border-width: 4px;
  font-size: 11px;
  transform: rotate(-5deg) scale(1.8);
}
#game.auto-admin .claim-card.auto-receipt.resolving .claim-stamp { animation: auto-stamp 1.1s cubic-bezier(.18,.9,.2,1) forwards; }
#game.auto-admin .auto-claim-action {
  display: block;
  grid-column: 3;
  color: var(--claim);
  font: 800 11px/1.15 var(--body);
  text-transform: uppercase;
  letter-spacing: .045em;
  opacity: 0;
}
#game.auto-admin .claim-card.resolving .auto-claim-action { animation: auto-action-in 1.1s ease-out forwards; }
@keyframes auto-stamp {
  0% { opacity: 0; transform: rotate(-5deg) scale(1.8); }
  24%, 82% { opacity: 1; transform: rotate(-5deg) scale(1); }
  100% { opacity: 0; transform: rotate(-5deg) scale(.96); }
}
@keyframes auto-action-in { 0%, 16% { opacity: 0; transform: translateX(-8px); } 30%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#screen-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(28, 22, 20, .72);
  backdrop-filter: saturate(.8);
}
#screen-layer:empty { display: none; }

.document {
  position: relative;
  width: min(740px, 100%);
  max-height: 92dvh;
  overflow: auto;
  padding: clamp(22px, 5vw, 50px);
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 12px 14px 0 rgba(25, 18, 16, .45);
}
.document::before { content: "DSWA · FILE COPY"; position: absolute; top: 12px; right: 16px; font-size: 10px; font-weight: 900; letter-spacing: .12em; opacity: .55; }
.document h1, .document h2 { margin: 0 0 12px; font-family: var(--display); line-height: 1; }
.document h1 { font-size: clamp(44px, 9vw, 92px); letter-spacing: -.055em; }
.document h2 { font-size: clamp(28px, 5vw, 48px); }
.document .subtitle { max-width: 52ch; margin: 0 0 24px; font-size: clamp(16px, 2.5vw, 21px); }
.document .rule { border-top: 3px double var(--ink); margin: 20px 0; }
.document-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.document button, .document a.button {
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.document button.primary { background: var(--violet); color: #fff; }
.document button:hover, .document a.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.stamp { display: inline-block; margin: 6px 0; padding: 6px 10px; border: 4px double currentColor; color: var(--claim); font-size: 13px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; transform: rotate(-2deg); }
.memo-from { margin: 0 0 20px; font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.memo-body { max-width: 62ch; white-space: pre-line; }

.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; }
.level-grid button { min-height: 100px; display: grid; align-content: space-between; text-align: left; }
.level-grid button:disabled { opacity: .45; cursor: not-allowed; }
.level-grid small { display: block; font-weight: 500; }
.stars { color: #9b6d00; letter-spacing: .12em; }
.expense-report { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.expense-report td { padding: 5px 0; border-bottom: 1px dotted rgba(59,46,42,.45); }
.expense-report td:last-child { text-align: right; font-weight: 900; }
.expense-report .total td { padding-top: 12px; border-top: 3px double var(--ink); border-bottom: 0; font: 900 19px var(--display); }
.memo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.memo-card { min-height: 110px !important; text-align: left; }

#notice-stack { position: absolute; z-index: 8; top: 88px; right: 14px; width: min(320px, 55%); pointer-events: none; }
.notice-slip { margin-bottom: 8px; padding: 10px 12px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--shadow); animation: notice-in .25s ease-out; font-size: 13px; }
.notice-slip strong { display: block; font-family: var(--display); }
@keyframes notice-in { from { opacity: 0; transform: translateX(25px) rotate(2deg); } }

.pause-status {
  position: absolute;
  z-index: 9;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  display: grid;
  gap: 1px;
  min-width: 240px;
  padding: 9px 14px;
  border: 3px double var(--ink);
  background: var(--gold);
  box-shadow: 5px 5px 0 rgba(59,46,42,.35);
  text-align: center;
  pointer-events: none;
}
.pause-status[hidden] { display: none; }
.pause-status strong { font: 900 16px/1.05 var(--display); }
.pause-status small { font-size: 10px; font-weight: 800; }

.claimant-popup, .settlement-popup {
  position: absolute;
  z-index: 16;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(510px, calc(100% - 28px));
  border: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(59,46,42,.35);
}
.claimant-popup { min-height: 118px; display: grid; grid-template-columns: 100px 1fr; align-items: end; padding: 11px 13px 11px 3px; animation: claimant-arrives .25s ease-out; }
.claimant-popup[hidden], .settlement-popup[hidden] { display: none; }
.claimant-popup.upper-right { left: auto; right: 14px; top: 92px; bottom: auto; transform: none; width: min(440px, calc(100% - 28px)); }
.claimant-copy { align-self: center; display: grid; gap: 3px; }
.claimant-copy strong { font: 700 19px/1.05 var(--display); }
.claimant-copy p { margin: 0; font-size: 12px; }
.claimant-copy button, .settlement-popup button { min-height: 38px; margin-top: 5px; border: 2px solid var(--ink); background: var(--paper-light); font-size: 12px; font-weight: 900; cursor: pointer; }
.claimant-character { --skin: #d5a977; --coat: #6d8fc4; position: relative; width: 90px; height: 104px; justify-self: center; }
.claimant-head { position: absolute; z-index: 2; left: 25px; top: 7px; width: 48px; height: 47px; border: 3px solid var(--ink); border-radius: 48% 52% 45% 55%; background: var(--skin); transform: rotate(3deg); }
.claimant-head b { position: absolute; top: 18px; width: 5px; height: 6px; border-radius: 50%; background: var(--ink); }
.claimant-head b:first-child { left: 10px; }
.claimant-head b:nth-child(2) { right: 9px; top: 15px; }
.claimant-head em { position: absolute; left: 19px; bottom: 7px; width: 13px; height: 6px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 12px 12px; }
.claimant-hair { position: absolute; z-index: 3; left: 21px; top: 1px; width: 54px; height: 22px; border: 3px solid var(--ink); border-radius: 55% 45% 30% 25%; background: #6b5141; transform: rotate(-5deg); }
.claimant-body { position: absolute; left: 20px; bottom: 0; width: 57px; height: 59px; border: 3px solid var(--ink); border-radius: 20px 20px 8px 8px; background: var(--coat); }
.claimant-folder { position: absolute; z-index: 4; right: 0; bottom: 4px; width: 39px; height: 49px; display: grid; place-items: center; border: 3px solid var(--ink); background: var(--paper-light); font: 900 22px var(--display); transform: rotate(7deg); }
@keyframes claimant-arrives { from { opacity: 0; transform: translate(-50%, 35px) rotate(1deg); } }

.settlement-popup { padding: 16px 18px; display: grid; gap: 5px; text-align: center; }
.settlement-popup strong { font: 700 20px/1.1 var(--display); }
.settlement-popup p { margin: 0; font-size: 13px; }
.settlement-popup .stamp { justify-self: center; margin: 0 0 3px; }

.target-hint {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 9px 13px;
  border: 2px solid var(--ink);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  pointer-events: none;
}

@media (min-width: 1100px) {
  .claims-office .satchel-group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

#touch-controls { position: absolute; z-index: 12; inset: 0; display: none; touch-action: none; pointer-events: none; }
.touch-actions { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; gap: 7px; pointer-events: auto; }
.touch-actions-a { left: 14px; }
.touch-actions-b { right: 14px; }
.touch-actions button { min-width: 58px; min-height: 48px; border: 2px solid var(--ink); border-radius: 50%; background: rgba(239,227,200,.9); font-size: 11px; font-weight: 900; }
.stick-visual { position: fixed; z-index: 70; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 3px dashed rgba(251,247,238,.7); border-radius: 50%; background: rgba(59,46,42,.18); pointer-events: none; }
.stick-visual i { position: absolute; width: 46px; height: 46px; left: 35px; top: 35px; border: 3px solid var(--ink); border-radius: 50%; background: rgba(239,227,200,.92); }

#debug-panel { position: fixed; z-index: 100; top: 8px; right: 8px; width: min(390px, calc(100% - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: 14px; border: 3px solid var(--ink); background: var(--paper); box-shadow: 9px 9px 0 rgba(0,0,0,.35); }
.debug-heading { display: flex; justify-content: space-between; align-items: start; }
.debug-heading > div { display: grid; }
.debug-heading button { border: 0; background: transparent; font-size: 25px; }
#debug-panel label { display: grid; grid-template-columns: 1fr minmax(90px, 1.2fr) auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 12px; }
#debug-panel input[type="range"] { width: 100%; }
#debug-panel fieldset { margin: 12px 0; border: 2px solid var(--ink); }
#debug-panel legend { font-weight: 900; }
#debug-panel button { min-height: 38px; border: 2px solid var(--ink); background: var(--paper-light); font-weight: 800; }
#fps { margin-top: 10px; font-weight: 900; }

@media (pointer: coarse), (max-width: 850px) {
  #touch-controls { display: block; }
  .hud-actions { margin-right: env(safe-area-inset-right); }
  .claimant-popup, .settlement-popup { bottom: 80px; }
}

@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  #game { grid-template-columns: 1fr; grid-template-rows: minmax(0, 60dvh) minmax(0, 40dvh); }
  #desk { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; border-left: 0; border-top: 3px solid var(--ink); }
  .desk-section { padding: 8px 10px; }
  .desk-heading { padding-bottom: 6px; }
  .desk-heading strong { font-size: 14px; }
  .card-strip { padding: 8px 2px 11px; }
  .claim-card, .tool-card, .empty-card { flex: 0 0 min(75vw, 280px); min-height: 82px; margin: 0; }
  .satchel-groups { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 5px; padding: 5px 0 7px; overflow: hidden; }
  .satchel-group { min-height: 0; padding: 5px; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .satchel-group > header { margin-bottom: 4px; padding-bottom: 3px; }
  .satchel-group > header .eyebrow { font-size: 8px; }
  .satchel-group > header strong { font-size: 11px; }
  .satchel-group > header small { font-size: 8px; }
  .satchel-group-list { min-height: 0; overflow-y: auto; gap: 5px; }
  .satchel-group-list .tool-card { min-height: 72px; padding: 6px; border-left-width: 5px; }
  .satchel-group-list .tool-card strong { font-size: 11px; }
  .satchel-group-list .tool-card p { font-size: 10px; }
  .hud { inset: max(7px, env(safe-area-inset-top)) 7px auto; gap: 4px; }
  .hud-group, .hud-actions { padding: 5px 7px; box-shadow: 2px 2px 0 rgba(59,46,42,.3); }
  .hud-group .eyebrow { display: none; }
  .hud-group strong { font-size: 12px; }
  .desk-level-status strong { font-size: 10px; }
  .icon-button { min-width: 34px; min-height: 32px; padding: 0; }
  #notice-stack { top: 57px; }
  .touch-actions { bottom: 8px; }
  .touch-actions button { min-width: 52px; min-height: 44px; opacity: .88; }
  .claimant-popup { grid-template-columns: 74px 1fr; min-height: 100px; padding: 8px; }
  .claimant-character { width: 68px; height: 88px; transform: scale(.82); transform-origin: bottom center; }
  .claimant-copy strong { font-size: 15px; }
  .claimant-popup.upper-right { top: 58px; }
  .settlement-popup { padding: 11px; }
}

@media (max-width: 480px) {
  .hud { grid-template-columns: 1fr 1fr; }
  .desk-level-status #level-label { display: none; }
  .document { padding: 32px 20px 22px; }
  .document-actions { display: grid; }
  .document-actions button, .document-actions .button { width: 100%; }
  #game.auto-admin .docket-section { grid-template-columns: minmax(0, 1fr); padding: 6px 8px; }
  #game.auto-admin .desk-heading { display: none; }
  #game.auto-admin .claim-card.auto-receipt { min-width: 230px; grid-template-columns: minmax(105px, 1fr) auto minmax(105px, 1.05fr); padding: 6px; }
  #game.auto-admin .claim-card.auto-receipt strong { font-size: 12px; }
  #game.auto-admin .claim-card.auto-receipt .claim-value { font-size: 11px; }
  #game.auto-admin .auto-claim-action { font-size: 9px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  #game { grid-template-rows: minmax(0, 62dvh) minmax(0, 38dvh); }
  .desk-section { padding: 7px 9px; }
  .desk-heading { padding-bottom: 5px; }
  .desk-heading strong { font-size: 14px; }
}

@media (orientation: portrait), (max-aspect-ratio: 1/1), (max-height: 600px) and (orientation: landscape) {
  #game.auto-admin { grid-template-rows: minmax(0, 1fr) clamp(86px, 13dvh, 104px); }
  #game.auto-admin #desk { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .claim-card.resolving { animation: none !important; opacity: .45; }
  .claim-card.resolving .claim-stamp { animation: none !important; opacity: 1; transform: translate(-50%, -50%) rotate(-5deg) scale(1); }
  #game.auto-admin .claim-card.resolving .claim-stamp { transform: rotate(-5deg) scale(1); }
  #game.auto-admin .claim-card.resolving .auto-claim-action { animation: none !important; opacity: 1; transform: none; }
}
