:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #d8dee8;
  --text: #172033;
  --muted: #637083;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #2563eb;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.12;
}

h2 {
  font-size: 1.15rem;
}

.header-actions,
.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 40px;
}

.order-panel,
.activity-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.order-panel {
  padding: 24px;
}

.activity-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.phase-pill {
  padding: 6px 10px;
  border: 1px solid #b7d8d4;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--brand-dark);
  font-weight: 700;
}

.delivery-form {
  display: grid;
  gap: 18px;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.span-2 {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c8d1df;
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

button {
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--brand);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button[type="button"] {
  color: var(--brand-dark);
  background: #ffffff;
}

button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

button[type="button"]:hover {
  color: #ffffff;
}

pre {
  min-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #d1fae5;
  font-size: 0.82rem;
  line-height: 1.5;
}

.result {
  min-height: 44px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.result.error {
  color: var(--danger);
}

.result.success {
  color: var(--brand-dark);
}

@media (max-width: 920px) {
  .app-header,
  .layout {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .activity-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  fieldset {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .form-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
