:root {
  --ink: #1a1a1a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --line: #d8d4ce;
  --paper: #f7f6f3;
  --panel: #ffffff;
  --accent: #1a5c54;
  --accent-hover: #134740;
  --copper: #b86a45;
  --bad: #8b2e2e;
  --good: #1a5c54;
  --good-bg: #eef3f1;
  --bad-bg: #f8ecec;
  --shadow: 0 18px 50px rgba(26, 26, 26, 0.08);
  --radius: 2px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Segoe UI", Candara, "Gill Sans", Calibri, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(26, 92, 84, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(184, 106, 69, 0.08), transparent 50%),
    linear-gradient(180deg, #efeee9 0%, var(--paper) 45%, #ebe8e2 100%);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.app { min-height: 100vh; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img, .mark { width: 28px; height: 28px; display: block; }
.blank .mark { width: 48px; height: 48px; }
.brand:hover { text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.15rem 1rem; }
.topbar nav a { color: var(--ink-soft); padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.topbar nav a.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; }
.user, .muted { color: var(--muted); }
.main { width: min(1100px, 100%); margin: 0 auto; padding: 2.25rem 1rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 1.5rem; }
.page-head p { margin: 0.45rem 0 0; color: var(--muted); }
.panel, .status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.1rem;
  margin-bottom: 1.1rem;
}
.panel h2, .status-card h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.banner { padding: 0.7rem 0.85rem; border-radius: var(--radius); margin: 0 0 1rem; border: 1px solid var(--line); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.good { background: var(--good-bg); color: var(--good); }
.badge {
  display: inline-block;
  border: 1px solid var(--line);
  background: #f3f1ec;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
}
.actions { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; }
button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
button.secondary, .button.secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-weight: 500;
}
button.secondary:hover, .button.secondary:hover { background: #f3f1ec; color: var(--ink); }
button.ghost { background: transparent; color: var(--bad); padding-inline: 0.4rem; font-weight: 500; }
button:disabled { opacity: 0.7; cursor: wait; }
label { display: block; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 0.45rem; }
.field { margin-bottom: 1.1rem; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfaf8;
  color: var(--ink);
  font: inherit;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius);
}
textarea { min-height: 6rem; resize: vertical; }
.letter-area { min-height: 16rem; line-height: 1.55; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.blank { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.25rem; }
.blank .panel { width: min(520px, 100%); margin: 0; padding: 2.5rem 2.25rem 2.25rem; }
.blank button { width: 100%; }
.blank .brand { font-size: 2rem; margin: 0.7rem 0 0.35rem; }
.tagline { margin: 0 0 1.5rem; color: var(--muted); }
.validation { color: var(--bad); margin: 0 0 1rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.subpanel { border: 1px solid var(--line); background: #fbfaf8; padding: 1rem; }
.landing-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}
.landing-hero-copy { width: min(720px, 100%); }
.landing-brand { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 0.75rem; color: var(--accent); }
.landing-lead { color: var(--ink-soft); font-size: 1.1rem; max-width: 40rem; }
.landing-cta { margin-top: 1.5rem; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.1rem; }
.status-card { margin: 0; }
.good-text { color: var(--good); margin: 0; }
.bad-text { color: var(--bad); margin: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92rem; }
.stack-top { margin-top: 1rem; }
.blog-body { white-space: pre-wrap; }
audio { width: 100%; margin-top: 0.75rem; }
.wave {
  width: 100%;
  height: 128px;
  display: block;
  background: #f4f1eb;
  border: 1px solid var(--line);
  cursor: crosshair;
  touch-action: none;
}
.translation {
  white-space: pre-wrap;
  line-height: 1.6;
  margin: 0.4rem 0 0;
}
.wave-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: #fbfaf8;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--good-bg);
}
.drop-zone input[type="file"] { display: none; }
.drop-hint { margin: 0; color: var(--muted); pointer-events: none; }
.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.image-preview:empty { display: none; }
.preview-item {
  position: relative;
  width: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.preview-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.preview-info {
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
}
.preview-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}
.preview-size {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--bad);
}
.preview-remove:hover {
  background: var(--bad);
  color: #fff;
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; }
  .topbar nav { order: 3; width: 100%; }
  .grid-2, .status-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .preview-item { width: 100px; }
  .preview-item img { height: 60px; }
}
