:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #f7f5f0;
  color: #0b2e4a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { max-width: 720px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 96px; }
.app-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.eyebrow { color: #8a4416; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.6rem, 7vw, 2.2rem); }
h2 { font-size: 1.15rem; }
.sync-badge { border-radius: 999px; background: #efe6d8; color: #0b2e4a; padding: 7px 10px; font-size: 0.78rem; font-weight: 800; }
.sync-badge[data-state="SYNC_ERROR"], .sync-badge[data-state="CONFLICT_REVIEW_REQUIRED"] { background: #ffe3d2; color: #8f3e18; }
.screen { display: none; }
.screen.active { display: block; }
.card { border: 1px solid #d8cfbf; border-radius: 18px; background: #fff; padding: 18px; margin-bottom: 14px; box-shadow: 0 8px 24px rgb(11 46 74 / 7%); }
.muted { color: #4a5b66; }
.status-line { display: flex; gap: 8px; flex-wrap: wrap; color: #4a5b66; font-size: 0.9rem; }
.action { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: #c8743a; color: #0e1116; padding: 12px 15px; font-weight: 800; }
.action.secondary { background: #efe6d8; color: #0b2e4a; }
.action.danger { background: #9b3d1c; color: #fff; }
.action:disabled { cursor: not-allowed; opacity: 0.5; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { color: #2f4a57; font-size: 0.85rem; font-weight: 750; }
.field input, .field textarea { width: 100%; border: 1px solid #c9bfae; border-radius: 10px; padding: 10px; }
.nav { position: fixed; right: 0; bottom: 0; left: 0; background: rgb(255 255 255 / 94%); border-top: 1px solid #d8cfbf; padding: 8px; backdrop-filter: blur(8px); }
.nav-inner { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 720px; margin: 0 auto; }
.nav button { border: 0; border-radius: 10px; background: transparent; color: #4a5b66; padding: 8px 3px; font-size: 0.7rem; }
.nav button.active { background: #efe6d8; color: #0b2e4a; font-weight: 800; }
.notice { border-left: 4px solid #dd8c45; background: #fff7ed; border-radius: 10px; padding: 12px; color: #74431f; }
@media (min-width: 680px) { .app-shell { padding-top: 28px; } .nav { position: static; margin-top: 24px; border: 0; background: transparent; } }

[hidden] { display: none !important; }
body { line-height: 1.5; }
.app-header > div:first-child { min-width: 0; }
.sync-badge { max-width: 45%; text-align: center; overflow-wrap: anywhere; }
#order-scope { white-space: pre-line; overflow-wrap: anywhere; }
#sync-message, #package-state { overflow-wrap: anywhere; }
.status-line { margin: 10px 0; }
#storage-status { font-size: .8125rem; line-height: 1.5; }
.nav { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.nav button { min-height: 44px; font-size: .75rem; overflow-wrap: anywhere; }
.field select { width: 100%; min-height: 44px; font: inherit; border: 1px solid #c9bfae; border-radius: 10px; padding: 10px; }
#evidence-input { max-width: 100%; min-width: 0; }
#recovery-history ol { padding-left: 20px; }
#recovery-history li { padding: 10px 0; overflow-wrap: anywhere; }
#recovery-history time { display: block; color: #4a5b66; font-size: .875rem; }
#recovery-technical { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #8a4416; outline-offset: 3px; }
@media (max-width: 420px) { .app-header { align-items: flex-start; flex-wrap: wrap; } .sync-badge { max-width: 100%; } .button-row .action { flex: 1 1 180px; } }

#command-feedback:empty { display: none; }

.close-requirements { background: #f7f5f0; border: 1px solid #d8cfbf; border-radius: 12px; margin: 18px 0; min-width: 0; padding: 16px; }
.close-requirements h3 { color: #0b2e4a; font-size: 1rem; margin: 0 0 12px; }
.close-requirements p { overflow-wrap: anywhere; white-space: pre-line; }
#close-requirements-list { display: grid; gap: 8px; margin: 12px 0; padding-left: 20px; }
#close-requirements-list li { line-height: 1.5; overflow-wrap: anywhere; }
#close-verification-note { margin-bottom: 0; }
@media (max-width: 420px) {
  .close-requirements { padding: 14px; }
  .card { padding: 16px; }
}
