:root {
  color-scheme: light;
  --bg: #eef2f3;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --ink: #182226;
  --muted: #64737a;
  --line: #d8e1e6;
  --teal: #087f75;
  --blue: #235789;
  --amber: #b76800;
  --red: #b3423d;
  --shadow: 0 16px 36px rgba(24, 34, 38, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button,
.top-actions a {
  min-height: 40px;
  border: 1px solid #1f3138;
  border-radius: 7px;
  background: #1f3138;
  color: #fff;
  padding: 0 13px;
  font-weight: 800;
  text-decoration: none;
}

button.secondary,
.top-actions a {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

button:disabled {
  opacity: 0.55;
}

.field-shell {
  display: grid;
  gap: 12px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(22px, env(safe-area-inset-bottom));
}

.field-top,
.hero-band,
.control-strip,
.section-title,
.queue-actions,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-top,
.hero-band,
.section-title {
  justify-content: space-between;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-lockup img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-lockup span,
.hero-band p,
.section-title span,
.metric-grid span,
.field-chip,
.queue-card time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-band {
  min-height: 110px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(24, 34, 38, 0.92), rgba(8, 127, 117, 0.76)),
    url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1200&q=70") center / cover;
  color: #fff;
  padding: 16px;
}

.hero-band p {
  color: rgba(255, 255, 255, 0.8);
}

.hero-band h1 {
  margin: 3px 0 0;
  font-size: 26px;
  line-height: 1.1;
}

.status-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip {
  background: #e9f4f2;
  color: var(--teal);
}

.status-chip.warn {
  background: #fff0d7;
  color: var(--amber);
}

.status-chip.bad {
  background: #fcebea;
  color: var(--red);
}

.control-strip,
.panel,
.metric-grid article {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-grid article {
  padding: 10px;
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.quick-update-panel {
  border-color: rgba(8, 127, 117, 0.28);
  box-shadow: 0 18px 42px rgba(8, 127, 117, 0.12);
}

.section-title h2 {
  margin: 0;
  font-size: 16px;
}

.action-list,
.queue-list,
.form-stack {
  display: grid;
  gap: 10px;
}

.action-card,
.queue-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 11px;
}

.action-card header,
.queue-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.action-card strong,
.queue-card strong {
  display: block;
}

.action-card p,
.queue-card p,
.empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.action-card footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.compact-progress-row {
  align-items: end;
}

.hidden-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quick-chip-group {
  display: grid;
  gap: 6px;
}

.quick-chip-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-chip-row button {
  width: auto;
  min-height: 36px;
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 11px;
}

.quick-chip-row button.active {
  border-color: var(--teal);
  background: #e8f5f2;
  color: var(--teal);
  box-shadow: inset 0 -3px 0 var(--teal);
}

.file-tile {
  border: 1px dashed var(--teal);
  border-radius: 8px;
  background: #e8f5f2;
  padding: 12px;
}

.file-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-tile strong,
.file-tile small {
  display: block;
}

.file-tile small {
  color: var(--muted);
}

.evidence-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.evidence-preview span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
}

.queue-actions {
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 24px));
  border-radius: 8px;
  background: #1f3138;
  color: #fff;
  box-shadow: var(--shadow);
  padding: 11px 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

html[dir="ltr"] .toast {
  right: auto;
  left: 12px;
}

@media (max-width: 520px) {
  .field-shell {
    padding-inline: 10px;
  }

  .field-top,
  .hero-band,
  .section-title,
  .action-card header,
  .queue-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions a,
  .top-actions button,
  .queue-actions button {
    flex: 1;
  }

  .control-strip,
  .two-col,
  .action-card footer {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
