/* voicenote — warm editorial aesthetic */

:root {
  --paper: #F5EDE0;
  --paper-deep: #EFE5D2;
  --paper-soft: #FBF6EC;
  --ink: #2A1F1A;
  --ink-soft: #5C4A3F;
  --ink-mute: #8C7868;
  --accent: #C8553D;
  --accent-deep: #A03E2C;
  --accent-soft: #E8A089;
  --accent-glow: rgba(200, 85, 61, 0.14);
  --rule: #D9CDB9;
  --rule-strong: #C2B49A;
  --success: #6B7F4C;
  --success-deep: #4F6238;
  --warn: #B5713A;
  --shadow: 0 1px 0 rgba(42, 31, 26, 0.04), 0 8px 32px -8px rgba(74, 50, 35, 0.18);
  --shadow-lift: 0 2px 0 rgba(42, 31, 26, 0.05), 0 24px 48px -16px rgba(74, 50, 35, 0.28);
  --shadow-pop: 0 12px 32px -8px rgba(74, 50, 35, 0.22);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Crimson Pro', 'Iowan Old Style', 'Source Serif Pro', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 700px at -10% -10%, rgba(232, 160, 137, 0.20), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(107, 127, 76, 0.10), transparent 60%);
  min-height: 100vh;
  min-height: 100dvh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -------- Header -------- */
.header {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(20px, 5vw, 40px) 12px;
  z-index: 2;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  animation: fadeUp 700ms var(--ease-out) both;
}

.wordmark-icon {
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
  height: 26px;
  transform: translateY(2px);
}
.wordmark-icon span {
  display: block;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: bottom;
  animation: barPulse 2.4s var(--ease) infinite;
}
.wordmark-icon span:nth-child(1) { height: 12px; animation-delay: 0s; }
.wordmark-icon span:nth-child(2) { height: 24px; animation-delay: 0.18s; }
.wordmark-icon span:nth-child(3) { height: 16px; animation-delay: 0.36s; }

@keyframes barPulse {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.wordmark-text {
  font-family: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 6vw, 46px);
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.wordmark-text i {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 19px;
  max-width: 36ch;
  animation: fadeUp 800ms 100ms var(--ease-out) both;
}

/* -------- Header actions (history + user pill) -------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeUp 700ms 200ms var(--ease-out) both;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: all 220ms var(--ease);
}
.header-link:hover { background: var(--paper-deep); border-color: var(--rule-strong); }
.header-link svg { color: var(--ink-soft); }
.header-link span {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.005em;
}
@media (max-width: 480px) {
  .header-link span { display: none; }
  .header-link { padding: 8px 10px; }
}

.text-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  transition: color 200ms var(--ease);
}
.text-link:hover { color: var(--accent-deep); }

.upload-history-link {
  text-align: center;
  margin: 22px 0 0;
}

/* -------- User pill -------- */
.user-pill { position: relative; }
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: all 220ms var(--ease);
}
.user-btn:hover { background: var(--paper-deep); border-color: var(--rule-strong); }
.user-name {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 10;
  animation: menuPop 180ms var(--ease-out);
}
.user-menu[hidden] { display: none; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 160ms var(--ease);
}
.user-menu-item:hover { background: var(--paper-deep); }
.user-menu-item svg { color: var(--ink-soft); }

@keyframes menuPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* -------- Page -------- */
.page {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 40px) 80px;
  z-index: 1;
}

/* -------- Active jobs -------- */
.active-jobs {
  margin: 0 0 24px;
  padding: 24px clamp(20px, 4vw, 30px);
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 500ms var(--ease-out);
}
.active-jobs[hidden] { display: none; }
.active-jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.eyebrow {
  margin: 0 0 2px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.active-jobs-title {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 500;
}
.active-jobs-list { display: flex; flex-direction: column; gap: 10px; }
.job-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: all 220ms var(--ease);
}
.job-row.job-ready {
  cursor: pointer;
  border-color: rgba(107, 127, 76, 0.45);
  background: rgba(248, 244, 232, 0.96);
  box-shadow: 0 0 0 3px rgba(107, 127, 76, 0.08);
}
.job-row.job-ready:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.job-main { flex: 1; min-width: 0; }
.job-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.job-title-line strong {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.job-meta {
  margin: 4px 0 8px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
}
.job-progress {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: rgba(217, 205, 185, 0.65);
  border-radius: 999px;
}
.job-progress span {
  display: block;
  height: 100%;
  min-width: 8px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: inherit;
  transition: width 300ms var(--ease);
}
.job-progress.indeterminate span { width: 36% !important; animation: sweep 1.2s var(--ease) infinite; }
@keyframes sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}
.job-actions { display: flex; align-items: center; justify-content: flex-end; min-width: max-content; }
.job-error { color: var(--accent-deep); font-size: 14px; font-style: italic; }

/* -------- Upload -------- */
.upload { animation: fadeUp 800ms 200ms var(--ease-out) both; }

.dropzone {
  display: block;
  position: relative;
  margin: 16px 0 28px;
  padding: clamp(36px, 8vw, 64px) 24px;
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  text-align: center;
  transition: all 280ms var(--ease);
  box-shadow: var(--shadow);
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(255, 252, 246, 0.85);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.dropzone.is-drag {
  border-style: solid;
  background: rgba(255, 246, 235, 0.95);
}
.dropzone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: rgba(248, 244, 232, 0.9);
}

.paste-row {
  display: flex;
  justify-content: center;
  margin: -14px 0 26px;
}

.dropzone-inner { pointer-events: none; }

.dropzone-icon {
  color: var(--accent);
  display: inline-flex;
  margin-bottom: 14px;
  transform-origin: center;
  transition: transform 400ms var(--ease);
}
.dropzone:hover .dropzone-icon { transform: scale(1.06) rotate(-3deg); }
.dropzone.has-file .dropzone-icon { color: var(--success); }

.dropzone-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(22px, 3vw, 26px);
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dropzone-sub {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 17px;
}
.dropzone-sub strong {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-soft);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.dropzone-formats {
  margin: 8px 0 0;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-mute);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* -------- Settings -------- */
.settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
@media (min-width: 600px) {
  .settings { grid-template-columns: 1.1fr 1fr; gap: 22px; }
  .settings.settings-single { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
}

.setting { display: flex; flex-direction: column; gap: 8px; }
.setting-label {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  padding-left: 4px;
}
.setting-help {
  margin: 4px 0 0 6px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

/* Segmented control */
.segmented {
  display: flex;
  background: rgba(217, 205, 185, 0.35);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--rule);
}
.seg {
  flex: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 240ms var(--ease);
  white-space: nowrap;
}
.seg:hover { color: var(--ink); }
.seg.active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}
.seg.active .seg-dot { background: var(--accent-soft); }
.seg-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rule-strong);
  transition: background 240ms var(--ease);
}

/* Select */
.select-wrap { position: relative; }
.select {
  appearance: none;
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.7);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 12px 44px 12px 18px;
  cursor: pointer;
  transition: all 240ms var(--ease);
}
.select:hover { border-color: var(--rule-strong); background: rgba(255, 252, 246, 0.95); }
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.select-caret {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  pointer-events: none;
  color: var(--ink-soft);
}

/* Submit */
.submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--paper);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 280ms var(--ease);
  box-shadow: 0 1px 0 var(--accent-deep), 0 12px 24px -8px rgba(160, 62, 44, 0.4);
}
.submit:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-deep);
  box-shadow: 0 1px 0 var(--accent-deep), 0 18px 32px -10px rgba(160, 62, 44, 0.5);
}
.submit:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--accent-deep), 0 6px 12px -4px rgba(160, 62, 44, 0.4);
}
.submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--ink-soft);
  box-shadow: none;
}
.submit-arrow { font-size: 22px; transition: transform 280ms var(--ease); }
.submit:hover:not(:disabled) .submit-arrow { transform: translateX(4px); }

.hint {
  text-align: center;
  margin: 14px 0 0;
  color: var(--ink-mute);
  font-style: italic;
  font-size: 15px;
  font-family: 'Fraunces', serif;
}
.hint.has-file { color: var(--success-deep); font-style: normal; }

/* -------- Result -------- */
.result {
  margin: 32px 0;
  animation: fadeUp 600ms var(--ease-out);
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(217, 205, 185, 0.4);
  border: 1px solid var(--rule);
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge.fallback {
  color: var(--warn);
  background: rgba(181, 113, 58, 0.08);
  border-color: rgba(181, 113, 58, 0.4);
}
.result-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 34px);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.result-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 2px;
}
.transcript {
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 36px);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow);
}
.transcript p { margin: 0 0 1em; }
.transcript p:last-child { margin-bottom: 0; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all 220ms var(--ease);
}
.action:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-1px);
}
.action svg { transition: transform 220ms var(--ease); }
.action:hover svg { transform: scale(1.1); }
.action.copied {
  background: var(--success);
  color: var(--paper);
  border-color: var(--success);
}
.action.ghost { background: transparent; }
.action.small { padding: 8px 14px; font-size: 14px; }

/* -------- Settings panel -------- */
.settings-panel {
  margin: 32px 0;
  padding: 28px clamp(20px, 4vw, 32px);
  background: rgba(255, 252, 246, 0.75);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 500ms var(--ease-out);
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.settings-card {
  padding: 20px;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.settings-card h3, .settings-card h4 {
  margin: 0 0 16px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-style: italic;
}
.settings-card h4 { margin-top: 18px; font-size: 18px; }
.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.inline-message {
  margin: 4px 0 14px;
  padding: 10px 12px;
  color: var(--success-deep);
  background: rgba(107, 127, 76, 0.08);
  border: 1px solid rgba(107, 127, 76, 0.25);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.inline-message.is-error {
  color: var(--accent-deep);
  background: rgba(200, 85, 61, 0.07);
  border-color: rgba(200, 85, 61, 0.3);
}
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: rgba(245, 237, 224, 0.72);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.user-row strong { display: block; font-family: 'Fraunces', serif; font-weight: 500; }
.user-row span { color: var(--ink-mute); font-size: 14px; }
.user-row-actions { display: flex; align-items: center; gap: 8px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink-soft);
}
.check-row input { accent-color: var(--accent); }
@media (min-width: 720px) {
  .settings-grid { grid-template-columns: 1fr 1.2fr; }
}

/* -------- History -------- */
.history {
  margin: 32px 0;
  padding: 28px clamp(20px, 4vw, 32px);
  background: rgba(255, 252, 246, 0.75);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 500ms var(--ease-out);
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
}
.history-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(24px, 3.5vw, 28px);
  margin: 0;
  letter-spacing: -0.01em;
}
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-empty {
  color: var(--ink-mute);
  font-style: italic;
  text-align: center;
  padding: 16px 0;
  margin: 0;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: all 200ms var(--ease);
  width: 100%;
}
.history-item:hover {
  background: var(--paper);
  border-color: var(--rule-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.history-item-main { flex: 1; min-width: 0; }
.history-item-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-meta {
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  font-family: 'Fraunces', serif;
  margin-bottom: 4px;
}
.history-item-snippet {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-item-arrow { color: var(--ink-mute); flex-shrink: 0; transition: transform 220ms var(--ease); }
.history-item:hover .history-item-arrow { transform: translateX(3px); color: var(--accent); }

/* -------- Error -------- */
.error {
  margin: 32px 0;
  padding: 24px;
  background: rgba(200, 85, 61, 0.06);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg);
  animation: fadeUp 400ms var(--ease-out);
}
.error-title {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-style: italic;
  margin: 0 0 6px;
  color: var(--accent-deep);
}
.error-text { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }

/* -------- Footer -------- */
.footer {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px clamp(20px, 5vw, 40px) 32px;
  text-align: center;
  color: var(--ink-mute);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  z-index: 1;
}

/* -------- Login page -------- */
.auth-shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: clamp(32px, 5vw, 44px) clamp(28px, 5vw, 40px);
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  animation: fadeUp 700ms var(--ease-out);
}
.auth-card .wordmark { margin-bottom: 22px; }
.auth-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 32px);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.auth-sub {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 16px;
}
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.auth-field label {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  padding-left: 4px;
}
.auth-field input {
  font: inherit;
  font-size: 17px;
  padding: 13px 18px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  transition: all 220ms var(--ease);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--paper-soft);
}
.auth-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: rgba(200, 85, 61, 0.08);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  color: var(--accent-deep);
  font-size: 14px;
  font-style: italic;
}

/* -------- Animations -------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* -------- Mobile tweaks -------- */
@media (max-width: 480px) {
  body { font-size: 17px; }
  .submit { padding: 16px 20px; font-size: 18px; }
  .dropzone { margin-bottom: 22px; }
  .seg { font-size: 14px; padding: 10px 12px; }
  .tagline { font-size: 17px; }
  .result-actions .action { flex: 1; justify-content: center; }
  .job-row { align-items: stretch; flex-direction: column; }
  .job-actions { justify-content: flex-start; }
  .paste-row .action { width: 100%; justify-content: center; }
}
