:root {
  --ink: #17211a;
  --muted: #657067;
  --paper: #f7f0df;
  --panel: rgba(255, 250, 238, 0.9);
  --line: rgba(28, 48, 34, 0.18);
  --accent: #e15b2d;
  --accent-2: #0d7c66;
  --bad: #ad2f28;
  --good: #157d46;
  --shadow: 0 24px 80px rgba(51, 42, 24, 0.16);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(225, 91, 45, 0.22), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(13, 124, 102, 0.18), transparent 30rem),
    linear-gradient(135deg, #fff8e8, var(--paper));
  min-height: 100vh;
}

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

code, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 26px 0 32px;
}

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

h1, h2 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

h1 { font-size: clamp(3rem, 8vw, 7rem); max-width: 850px; }
h2 { font-size: clamp(1.8rem, 3vw, 3rem); }

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.5;
}

.status-card {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 238, 0.65);
  padding: 18px;
  box-shadow: var(--shadow);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(460px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  padding: 24px;
}

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

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.62);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(13, 124, 102, 0.12); }

.row { display: grid; gap: 14px; margin-bottom: 16px; }
.two { grid-template-columns: 1fr 1fr; }
.three { grid-template-columns: 1fr 1fr 0.8fr; align-items: end; margin-top: 16px; }
.checkline { align-items: center; grid-template-columns: auto 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.checkline input { width: auto; }

.attachment-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }

.format-info {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(13, 124, 102, 0.06);
  border: 1px solid rgba(13, 124, 102, 0.2);
}
.format-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.format-info a {
  color: var(--accent-2);
  text-decoration: none;
}
.format-info a:hover {
  text-decoration: underline;
}

.ext {
  font-size: 0.65em;
  background: #ff9800;
  color: white;
  padding: 3px 7px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

button {
  border: 1px solid var(--line);
  background: #fff6e2;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 15px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(51, 42, 24, 0.12); }

.send {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: var(--ink);
  color: #fff9e9;
  font-weight: 900;
  padding: 16px 18px;
}
.send[disabled] { opacity: 0.6; cursor: wait; }

.attachments { display: grid; gap: 14px; }
.attachment {
  border: 1px dashed rgba(28, 48, 34, 0.32);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255,255,255,0.36);
}
.attachment-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.attachment-body { display: grid; gap: 12px; }
.remove { color: var(--bad); padding: 7px 11px; }

.warnings { display: grid; gap: 8px; }
.warning {
  border: 1px solid rgba(173, 47, 40, 0.24);
  border-radius: 16px;
  background: rgba(173, 47, 40, 0.08);
  color: var(--bad);
  padding: 11px 13px;
}

.result-header { display: flex; justify-content: space-between; gap: 14px; align-items: start; margin-bottom: 16px; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.metrics span, .badge {
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(13, 124, 102, 0.1);
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.84rem;
}
.badge.fail { background: rgba(173,47,40,0.1); color: var(--bad); }
.badge.pass { background: rgba(21,125,70,0.1); color: var(--good); }

details { margin-top: 16px; }
summary { cursor: pointer; color: var(--muted); font-weight: 900; }
pre {
  overflow: auto;
  max-height: 360px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #1b221d;
  color: #f9efd9;
  padding: 16px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.history-panel { margin-top: 22px; }
.history { display: grid; gap: 10px; }
.history.empty { color: var(--muted); }
.history-item {
  display: grid;
  grid-template-columns: 90px 150px 1fr 100px 90px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.35);
}

@media (max-width: 980px) {
  .hero, .workspace { grid-template-columns: 1fr; display: grid; }
  .hero { align-items: start; }
  .two, .three, .history-item { grid-template-columns: 1fr; }
  .status-card { min-width: unset; }
}
