:root {
  --bg: #15110f;
  --panel: #231a16;
  --panel-border: rgba(255, 244, 232, 0.12);
  --text: #f8ead8;
  --muted: #c5b29e;
  --accent: #ff5a36;
  --accent-soft: rgba(255, 90, 54, 0.16);
  --ink: #0f0b09;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --ok: #5bc58c;
  --ok-soft: rgba(91, 197, 140, 0.16);
  --warn: #ffcb69;
  --warn-soft: rgba(255, 203, 105, 0.16);
  --danger: #ff7b6b;
  --danger-soft: rgba(255, 123, 107, 0.16);
  --pending: #86b4ff;
  --pending-soft: rgba(134, 180, 255, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 90, 54, 0.24), transparent 34%),
    linear-gradient(180deg, #0d0908 0%, #15110f 100%);
}

button,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Helvetica Neue", "Arial Narrow", sans-serif;
  letter-spacing: 0.02em;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.lede,
.panel-head p,
.muted,
.controls span {
  color: var(--muted);
}

.panel {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(35, 26, 22, 0.96), rgba(23, 17, 15, 0.98));
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

textarea {
  width: 100%;
  min-height: 250px;
  padding: 16px;
  border: 1px solid rgba(255, 244, 232, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  resize: vertical;
  line-height: 1.45;
}

.toolbar {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.controls label {
  display: grid;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

select,
button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
}

select {
  min-width: 180px;
  background: rgba(255, 244, 232, 0.08);
  color: var(--text);
}

button {
  background: linear-gradient(135deg, #ff5a36, #ff8b2b);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  border: 1px solid rgba(255, 244, 232, 0.14);
  background: rgba(255, 244, 232, 0.08);
  color: var(--text);
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
}

button:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: rgba(255, 244, 232, 0.04);
}

.summary-main {
  display: grid;
  gap: 10px;
  flex: 1;
}

.summary-copy,
.status-copy {
  margin: 0;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 244, 232, 0.08);
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8b2b, #ff5a36);
  transition: width 180ms ease;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr);
  gap: 20px;
  margin-bottom: 20px;
}

.list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 244, 232, 0.08);
  border-radius: 18px;
  background: rgba(255, 244, 232, 0.025);
}

.review-ambiguous,
.review-unresolved,
.review-parse_error {
  border-color: rgba(255, 123, 107, 0.18);
  background: rgba(255, 123, 107, 0.035);
}

.review-top,
.review-body {
  display: grid;
  gap: 14px;
}

.review-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.review-title-block,
.selection-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.review-title,
.review-subtitle,
.selection-title,
.selection-meta,
.cell-hint {
  margin: 0;
}

.review-title,
.selection-title {
  font-size: 1.06rem;
  font-weight: 700;
}

.review-subtitle,
.selection-meta,
.cell-hint {
  font-size: 0.92rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.meta-chip,
.status-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta-chip {
  background: rgba(255, 244, 232, 0.08);
  color: var(--text);
}

.quantity-badge {
  background: var(--accent-soft);
  color: #ffc4b6;
}

.tone-ok {
  background: var(--ok-soft);
  color: #b7f1ce;
}

.tone-warn {
  background: var(--warn-soft);
  color: #ffe0a3;
}

.tone-danger {
  background: var(--danger-soft);
  color: #ffc2bb;
}

.tone-pending {
  background: var(--pending-soft);
  color: #c7dcff;
}

.warning-list,
.issue-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.issue-list {
  margin-bottom: 16px;
}

.review-controls {
  display: grid;
  gap: 8px;
}

.review-controls select {
  min-width: 0;
  width: 100%;
}

.review-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.empty-review {
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
  border: 1px dashed rgba(255, 244, 232, 0.12);
  border-radius: 18px;
}

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

.preview {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  overflow: auto;
  white-space: pre-wrap;
}

.muted {
  color: var(--muted);
}

@media (max-width: 760px) {
  .shell {
    padding-top: 32px;
  }

  .controls,
  .panel-head,
  .grid,
  .summary-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .review-top {
    grid-template-columns: 1fr;
  }

  .chip-row {
    justify-content: flex-start;
  }

  .controls {
    justify-content: stretch;
  }

  button,
  select {
    width: 100%;
  }

  .button-row {
    justify-content: stretch;
  }
}
