:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-alt: #f7faf8;
  --ink: #17211d;
  --muted: #62716b;
  --line: #d8e1dd;
  --accent: #1d6f73;
  --accent-strong: #124f52;
  --warn: #9a5b12;
  --bad: #a33125;
  --shadow: 0 18px 44px rgba(29, 46, 40, 0.11);
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: var(--accent-strong);
  font-weight: 800;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(2.45rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

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

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.metric-card,
.panel,
.notes article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 4px;
  min-height: 140px;
  padding: 22px;
}

.metric-card span,
.metric-card small,
label,
.stats span,
.notice,
.preview-shell th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.metric-card strong {
  align-self: center;
  color: var(--accent-strong);
  font-size: 3rem;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.drop-zone {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 22px;
  border: 2px dashed #b8c9c3;
  border-radius: 8px;
  background: var(--surface-alt);
  text-align: center;
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #eef8f6;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.drop-zone span {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
}

.drop-zone small {
  color: var(--muted);
}

.textarea-wrap,
.options {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

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

label {
  display: grid;
  gap: 7px;
}

select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.check {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.stats div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.stats strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.notice {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #bdd6d2;
  border-radius: 8px;
  background: #eef8f6;
  color: var(--accent-strong);
}

.notice.warn {
  border-color: #eed0a2;
  background: #fff7e8;
  color: var(--warn);
}

.notice.bad {
  border-color: #efc4bd;
  background: #fff3f1;
  color: var(--bad);
}

.preview-shell {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

td:last-child,
th:last-child {
  text-align: right;
}

td {
  font-size: 0.9rem;
}

.notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.notes article {
  padding: 22px;
}

.notes p {
  margin-bottom: 10px;
  color: var(--muted);
}

.notes p:last-child {
  margin-bottom: 0;
}

@media (max-width: 940px) {
  .hero,
  .workspace,
  .notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  h1 {
    font-size: 2.55rem;
  }

  .panel,
  .notes article {
    padding: 16px;
  }

  .panel-header,
  .options,
  .stats {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }
}
