:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --ink: #111827;
  --muted: #647084;
  --line: #d9dee8;
  --accent: #2563eb;
  --accent-strong: #1744a7;
  --green: #0f7b55;
  --warn: #a75b00;
  --bad: #b42318;
  --shadow: 0 16px 38px rgba(22, 31, 48, 0.1);
}

* {
  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.45;
}

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

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

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

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

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

nav a {
  text-decoration: none;
}

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

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

.hero > div {
  padding: 20px;
}

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

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

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

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

.metric-card {
  display: grid;
  gap: 5px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #edf4ff 100%);
}

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

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

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(440px, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace > *,
.notes > * {
  min-width: 0;
}

.panel {
  padding: 18px;
}

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

button {
  min-height: 38px;
  padding: 0 12px;
  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: 142px;
  overflow: hidden;
  place-items: center;
  padding: 18px;
  border: 2px dashed #b8c4d6;
  border-radius: 8px;
  background: var(--surface-alt);
  text-align: center;
}

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

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

.drop-zone span {
  max-width: 100%;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

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

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

textarea {
  width: 100%;
  min-height: 170px;
  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: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.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: 10px;
}

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

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

.notice {
  margin: 16px 0;
  padding: 13px;
  border: 1px solid #bed3ff;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--accent-strong);
}

.notice.bad {
  border-color: #efc8c4;
  background: #fff4f3;
  color: var(--bad);
}

.preview-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

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

td {
  color: var(--ink);
  font-size: 0.92rem;
}

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

tr:last-child td {
  border-bottom: 0;
}

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

.notes article {
  padding: 18px;
}

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

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

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .topbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  h1 {
    font-size: 2.7rem;
  }

  .hero > div,
  .metric-card,
  .panel,
  .notes article {
    padding: 15px;
  }

  button {
    width: 100%;
  }
}
