:root {
  color-scheme: light;
  --navy: #0b1f3a;
  --ink: #172033;
  --muted: #5c6575;
  --line: #d9dee8;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --green: #176b45;
  --green-dark: #0f5134;
  --gold: #ffca57;
  --red: #a83232;
  --focus: #2b75d6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 22px rgba(11, 31, 58, 0.24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.brand img {
  display: block;
  width: min(178px, 58vw);
  max-height: 42px;
  object-fit: contain;
}

.brand span {
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px 16px calc(26px + env(safe-area-inset-bottom));
}

.hero-surface,
.state-panel,
.asset-summary,
.edit-form,
.manual-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(23, 32, 51, 0.08);
}

.hero-surface {
  display: grid;
  gap: 24px;
  min-height: calc(100vh - 126px);
  align-content: space-between;
  padding: 28px 18px;
  border-top: 6px solid var(--gold);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.42rem;
  line-height: 1.12;
}

.hero-copy,
.help-text {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-actions {
  display: grid;
  gap: 12px;
}

.primary-action,
.secondary-action,
.icon-button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 16px 18px;
  background: var(--green);
  color: #fff;
  font-size: 1.08rem;
}

.primary-action:active {
  background: var(--green-dark);
}

.secondary-action {
  width: 100%;
  padding: 15px 18px;
  background: #e9edf3;
  color: var(--ink);
}

.icon-button {
  width: 52px;
  min-width: 52px;
  padding: 0;
  background: #edf1f7;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.state-panel,
.manual-panel {
  padding: 20px 16px;
}

.scanner-panel {
  min-height: calc(100vh - 126px);
}

.screen-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.screen-title.compact {
  margin-bottom: 12px;
}

.reader {
  overflow: hidden;
  min-height: 310px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #101827;
}

.reader video {
  border-radius: 6px;
}

.manual-panel {
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 0 0 14px;
}

.field span,
legend {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c7ceda;
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.asset-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.asset-row {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.asset-row strong {
  font-size: 1rem;
}

.asset-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.asset-edit {
  display: grid;
  gap: 14px;
}

.asset-summary,
.edit-form {
  padding: 18px 16px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.summary-grid div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e6f2ec;
  color: var(--green-dark);
  font-size: 0.9rem;
}

fieldset {
  margin: 0 0 14px;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-grid .field {
  margin-bottom: 0;
}

.form-message {
  min-height: 22px;
  margin: 4px 0 12px;
  color: var(--red);
  font-weight: 800;
}

.sticky-save {
  position: sticky;
  bottom: calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 12px 24px rgba(15, 81, 52, 0.24);
}

.success-panel {
  border-top: 6px solid var(--green);
}

.not-found-panel {
  border-top: 6px solid var(--red);
}

.confirmation-details {
  display: grid;
  gap: 10px;
  margin: 18px 0 22px;
}

.confirmation-details p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.hidden {
  display: none !important;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 28px;
  }

  .hero-surface {
    min-height: 560px;
    padding: 36px;
  }

  .hero-actions {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .asset-summary,
  .edit-form,
  .state-panel,
  .manual-panel {
    padding: 24px;
  }
}
