:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --ink: #1f2328;
  --muted: #69717d;
  --panel: #ffffff;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #dff4ef;
  --warning: #9a3412;
  --shadow: 0 18px 45px rgba(35, 40, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(154, 52, 18, 0.11), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.workspace {
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

h2 {
  font-size: 1.05rem;
}

.status {
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.4fr);
  gap: 18px;
}

.panel {
  border: 1px solid rgba(217, 222, 231, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.upload-panel,
.results-panel,
.text-panel {
  padding: 22px;
}

.upload-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.dropzone {
  display: grid;
  min-height: 230px;
  place-items: center;
  gap: 9px;
  border: 2px dashed #aab4c1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.upload-icon {
  display: grid;
  width: 74px;
  height: 92px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--accent-dark);
  font-size: 1.05rem;
  font-weight: 900;
}

.upload-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.upload-copy,
.file-meta,
.hint,
.muted {
  color: var(--muted);
}

.upload-copy {
  max-width: 280px;
  line-height: 1.45;
}

.file-meta {
  min-height: 22px;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.ghost-button {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

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

.ghost-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
  padding: 0 16px;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.results div {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
}

.results dt {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.results dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.hint {
  margin: 18px 0 0;
  line-height: 1.45;
}

.hint.has-warning {
  color: var(--warning);
  font-weight: 700;
}

.text-panel pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #eef2ff;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

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

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status {
    width: 100%;
  }

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

  .upload-panel,
  .results-panel,
  .text-panel {
    padding: 16px;
  }
}
