:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --ink: #121722;
  --muted: #667085;
  --line: #d8e0ea;
  --panel: #ffffff;
  --accent: #0f8b8d;
  --accent-2: #26324a;
  --accent-3: #c2410c;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #047857;
  --shadow: 0 24px 70px rgba(28, 39, 58, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(194, 65, 12, 0.08), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 23, 34, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 23, 34, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

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

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

.brand,
.live-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.live-link {
  border: 1px solid rgba(38, 50, 74, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 13px;
  text-decoration: none;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

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

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

h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 7vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: 0;
}

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

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

.lede {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.status {
  flex: 0 0 auto;
  border: 1px solid rgba(38, 50, 74, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(28, 39, 58, 0.08);
  padding: 11px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.status.ok {
  color: var(--ok);
}

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

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

.stats div {
  border: 1px solid rgba(216, 224, 234, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 15px 16px;
  box-shadow: 0 14px 40px rgba(28, 39, 58, 0.07);
}

.stats span {
  display: block;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 900;
}

.stats p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(350px, 0.82fr);
  gap: 16px;
}

.panel {
  border: 1px solid rgba(216, 224, 234, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(18px);
}

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

.panel-head p {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

textarea {
  width: 100%;
  min-height: 178px;
  resize: vertical;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-2), #111827);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(38, 50, 74, 0.22);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sample {
  min-height: 34px;
  border: 1px solid rgba(15, 139, 141, 0.18);
  background: #eef8f7;
  color: #0f5f60;
  padding: 0 11px;
  font-size: 0.82rem;
}

.sample:hover {
  background: #dff2f0;
  box-shadow: none;
}

.result-card {
  display: grid;
  gap: 16px;
}

.result-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.label {
  font-size: 1.65rem;
  font-weight: 850;
}

.pill {
  border-radius: 999px;
  padding: 5px 10px;
  background: #ecfdf5;
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.warn {
  background: #fff7ed;
  color: var(--warn);
}

.meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid rgba(216, 224, 234, 0.95);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.bars {
  display: grid;
  gap: 8px;
}

.bar {
  display: grid;
  grid-template-columns: 138px 1fr 52px;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.track {
  height: 9px;
  border-radius: 999px;
  background: #e8edf3;
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border-radius: 999px;
  background: #edf7f6;
  color: #115e59;
  padding: 5px 9px;
  font-size: 0.8rem;
  font-weight: 700;
}

.empty {
  display: grid;
  min-height: 318px;
  align-content: center;
  justify-items: start;
  gap: 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 22px;
}

.empty-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 1.25rem;
}

.empty strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.empty p {
  margin: 0;
}

.batch-panel {
  margin-top: 18px;
}

.batch-panel textarea {
  min-height: 132px;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 0.9rem;
}

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

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.error {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  padding: 12px;
  font-weight: 700;
}

.loading {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 820px) {
  .intro,
  .panel-head,
  .result-title {
    display: block;
  }

  .status,
  button {
    margin-top: 14px;
    width: 100%;
  }

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

  .bar {
    grid-template-columns: 104px 1fr 46px;
  }
}
