/* ── Reset & Variables ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --bg-2:      #161b27;
  --bg-3:      #1e2535;
  --border:    #2a3347;
  --border-2:  #374461;
  --text:      #e2e8f0;
  --text-2:    #8b9ab0;
  --text-3:    #5a6782;
  --primary:   #4f7ef8;
  --primary-h: #3d67e0;
  --gold:      #f5a623;
  --success:   #22c55e;
  --danger:    #ef4444;
  --radius:    12px;
  --radius-sm: 7px;
}

[v-cloak] { display: none; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 58px;
  background: rgba(13,17,23,.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo img { display: block; }

/* ── Step nav ──────────────────────────────────────────────────────────────── */
.steps-nav { display: flex; gap: .25rem; }
.step-item {
  display: flex; align-items: center; gap: .45rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  color: var(--text-3);
  font-size: .8rem;
  cursor: default;
  transition: all .15s;
}
.step-item.done  { color: var(--text-2); cursor: pointer; }
.step-item.done:hover { background: var(--bg-3); }
.step-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.step-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
}
.step-dot svg { stroke: currentColor; stroke-width: 2; fill: none; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #0d1117 0%, #111827 50%, #0d1117 100%);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4rem;
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(79,126,248,.12);
  border: 1px solid rgba(79,126,248,.3);
  color: #90abff;
  padding: .3rem .85rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: #f0f4ff;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(90deg, #4f7ef8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── Stats bar ─────────────────────────────────────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 2rem;
  margin: 0 auto 2.5rem;
  max-width: 600px;
}
.stat { text-align: center; flex: 1; }
.stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -.02em;
}
.stat-label { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin: 0 1.5rem;
  flex-shrink: 0;
}

/* ── Hero CTA button ───────────────────────────────────────────────────────── */
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 2.2rem;
  background: linear-gradient(135deg, #4f7ef8, #6d5ce7);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(79,126,248,.35);
  text-decoration: none;
}
.btn-hero:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(79,126,248,.45);
}
.btn-hero:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── How it works ──────────────────────────────────────────────────────────── */
.how-it-works {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}
.how-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-2);
}
.how-steps {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.how-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .75rem;
  padding: 1.25rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.how-icon { font-size: 1.8rem; }
.how-info strong { display: block; font-size: .9rem; margin-bottom: .3rem; }
.how-info p { font-size: .8rem; color: var(--text-3); line-height: 1.5; }
.how-arrow {
  color: var(--text-3);
  font-size: 1.2rem;
  padding-top: 2.5rem;
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .how-steps { flex-direction: column; }
  .how-arrow { transform: rotate(90deg); padding-top: 0; align-self: center; }
}

/* ── Upload section ────────────────────────────────────────────────────────── */
.upload-section {
  max-width: 640px;
  margin: 3rem auto 5rem;
  padding: 0 1.5rem;
}

.upload-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

.upload-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.upload-sub {
  color: var(--text-2);
  font-size: .9rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ── Drop zone ─────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 1.25rem;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(79,126,248,.06);
}
.drop-zone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: rgba(34,197,94,.05);
  padding: 1rem 1.5rem;
}
.drop-icon { font-size: 2rem; margin-bottom: .6rem; }
.drop-primary { font-weight: 600; margin-bottom: .3rem; }
.drop-hint { color: var(--text-3); font-size: .8rem; }

.file-info { display: flex; align-items: center; gap: .85rem; text-align: left; }
.file-icon  { font-size: 1.8rem; }
.file-name  { font-weight: 600; }
.file-size  { color: var(--text-3); font-size: .8rem; }

/* ── Form ──────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.full-width  { grid-column: 1/-1; }
@media (max-width: 500px) { .form-grid { grid-template-columns: 1fr; } }
.form-group label { color: var(--text-2); font-size: .8rem; font-weight: 500; }
.hint  { font-weight: 400; color: var(--text-3); }
.link  { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

.input, .select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .55rem .75rem;
  font-size: .9rem;
  transition: border .15s;
  width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--primary); }

/* ── Cost estimate ─────────────────────────────────────────────────────────── */
.cost-estimate {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  background: rgba(79,126,248,.06);
  border: 1px solid rgba(79,126,248,.2);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
}
.cost-item { display: flex; align-items: center; gap: .6rem; font-size: .875rem; color: var(--text-2); }
.cost-icon { font-size: 1rem; }

.server-key-notice {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: var(--radius-sm);
  color: #86efac;
  font-size: .85rem;
}
.key-icon { font-size: 1rem; }

.upload-footnote {
  text-align: center;
  color: var(--text-3);
  font-size: .75rem;
  margin-top: .85rem;
}

/* ── Alert ─────────────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .875rem; }
.alert-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
}

/* ── Main + Panels ─────────────────────────────────────────────────────────── */
.main { max-width: 900px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.panel { animation: fadeIn .2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.75rem;
}
.panel-header-actions { display: flex; gap: .5rem; }
.panel-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.panel-sub   { color: var(--text-2); font-size: .9rem; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .15s; text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }

.btn-secondary {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--border-2); }

.btn-ghost {
  background: none; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-2); }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm       { padding: .35rem .85rem; font-size: .8rem; }

.btn-icon {
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: .25rem .5rem;
  border-radius: var(--radius-sm); font-size: 1rem;
  margin-left: auto;
}
.btn-icon:hover   { color: var(--text); background: var(--bg-3); }
.btn-icon:disabled { opacity: .3; cursor: default; }

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite; flex-shrink: 0;
}
.spinner.large { width: 40px; height: 40px; border-width: 3px; border-color: rgba(79,126,248,.2); border-top-color: var(--primary); }
.spinner.small { width: 12px; height: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading state ─────────────────────────────────────────────────────────── */
.loading-state { text-align: center; padding: 4rem 2rem; color: var(--text-2); }
.loading-state p { margin-top: 1rem; }
.loading-elapsed {
  margin-top: .35rem !important;
  font-size: .82rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.loading-typical { color: var(--text-3); }

/* ── Glossary ──────────────────────────────────────────────────────────────── */
.glossary-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.card-title { font-size: .8rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .85rem; }
.narrative-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: .5rem; }
@media (max-width: 600px) { .narrative-grid { grid-template-columns: 1fr 1fr; } }
.narrative-item { display: flex; flex-direction: column; gap: .15rem; }
.label { color: var(--text-3); font-size: .75rem; }
.style-notes { color: var(--text-2); font-size: .85rem; margin-top: .5rem; border-top: 1px solid var(--border); padding-top: .5rem; }

.glossary-section { margin-bottom: 1.75rem; }
.section-title    { font-size: .95rem; font-weight: 600; margin-bottom: .65rem; }

.glossary-table { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header {
  display: grid; grid-template-columns: 1.4fr 1.4fr .7fr 1.5fr;
  padding: .55rem 1rem;
  background: var(--bg-3); font-size: .72rem; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.table-row {
  display: grid; grid-template-columns: 1.4fr 1.4fr .7fr 1.5fr;
  align-items: center; padding: .4rem 1rem;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.table-row:last-child { border-bottom: none; }
.table-row:hover      { background: var(--bg-3); }
.original   { font-weight: 500; }
.cell-input {
  background: transparent; border: 1px solid transparent;
  border-radius: 4px; color: var(--text); padding: .22rem .4rem;
  font-size: .875rem; width: 100%; transition: border .15s;
}
.cell-input:focus { outline: none; border-color: var(--primary); background: var(--bg); }
.cell-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a6782' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .5rem center;
  padding-right: 1.6rem;
  cursor: pointer;
  background-color: rgba(79,126,248,.08);
  border-color: rgba(79,126,248,.3);
  color: #90abff;
}
.badge {
  display: inline-block; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 4px; padding: .12rem .45rem; font-size: .72rem; color: var(--text-2);
}

.glossary-actions {
  display: flex; gap: 1rem; justify-content: flex-end;
  padding-top: 1rem; border-top: 1px solid var(--border);
}

/* ── Preview reading column (Variant B — book-typography + inline reveal) ─── */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 2rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.preview-toolbar-hint {
  color: var(--text-3);
  font-size: .82rem;
  margin-left: auto;
}

.reading-col {
  max-width: 700px;
  margin: 0 auto 2rem;
  font-family: "Source Serif Pro", "Iowan Old Style", "Iowan", "Georgia", serif;
  font-size: 1.06rem;
  line-height: 1.78;
  color: #d8dce8;
}
.reading-title {
  font-family: "Source Serif Pro", "Iowan Old Style", "Iowan", "Georgia", serif;
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 2rem;
  color: var(--text);
  letter-spacing: -0.005em;
}

.reading-para {
  margin-bottom: .9rem;
}
.reading-para > p {
  margin: 0;
  text-indent: 1.6em;
}
.reading-para:first-of-type > p { text-indent: 0; }

.reveal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-left: .5rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: 50%;
  font-size: .72rem;
  font-family: -apple-system, sans-serif;
  vertical-align: middle;
  cursor: pointer;
  transition: all .15s;
}
.reveal-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}
.reading-para.expanded .reveal-btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: rotate(180deg);
}

.reading-original {
  margin: .6rem 0 1.4rem 1.6em;
  padding: .85rem 1.1rem;
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  animation: revealOrig .2s ease;
}
.reading-original > p {
  margin: 0;
  text-indent: 0;
  font-family: "Source Serif Pro", "Iowan Old Style", "Iowan", "Georgia", serif;
  font-size: .98rem;
  line-height: 1.65;
  color: var(--text-2);
}
.reading-original-label {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: .4rem;
}
@keyframes revealOrig {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .reading-col { font-size: 1rem; line-height: 1.7; }
  .reading-original { margin-left: 0; }
}

/* ── Preview step ──────────────────────────────────────────────────────────── */
.preview-generating {
  text-align: center;
  padding: 3rem 2rem;
}
.preview-gen-msg { font-size: 1.05rem; font-weight: 500; margin-top: 1rem; }
.preview-gen-sub { color: var(--text-3); font-size: .85rem; margin-top: .4rem; }

.preview-verdict {
  background: rgba(79,126,248,.08);
  border: 1px solid rgba(79,126,248,.2);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  color: var(--text-2);
  font-size: .9rem;
  margin-bottom: 1.25rem;
}

.preview-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 680px) { .preview-columns { grid-template-columns: 1fr; } }

.preview-col { display: flex; flex-direction: column; gap: .5rem; }
.preview-col-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
}
.preview-text {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  font-size: .9rem; line-height: 1.8;
  color: var(--text-2); white-space: pre-wrap;
  max-height: 480px; overflow-y: auto;
}
.translated-text { color: var(--text); }

.preview-actions {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.preview-actions-left  { display: flex; align-items: flex-end; gap: .75rem; }
.preview-actions-right { display: flex; align-items: flex-end; gap: 1.25rem; }
.preview-nogo { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.nogo-label   { font-size: .75rem; color: var(--text-3); }

/* ── Progress ──────────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 5px; background: var(--bg-3);
  border-radius: 99px; overflow: hidden; margin: 1.25rem 0 .65rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  border-radius: 99px; transition: width .5s ease;
}

.progress-stats {
  display: flex; gap: 1.5rem; color: var(--text-2);
  font-size: .85rem; margin-bottom: 1.5rem; align-items: center;
}
.done-badge    { color: var(--success); font-weight: 600; }
.working-badge { color: var(--primary); }

/* ── Chapter list ──────────────────────────────────────────────────────────── */
.chapter-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1.25rem; }
.chapter-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border);
  transition: all .2s;
}
.chapter-item.done   { border-color: rgba(34,197,94,.2); }
.chapter-item.active { border-color: var(--primary); background: rgba(79,126,248,.07); }
.chapter-item.error  { border-color: rgba(239,68,68,.3); }
.ch-status-icon { width: 18px; text-align: center; flex-shrink: 0; color: var(--success); font-size: .85rem; }
.chapter-item.error .ch-status-icon { color: var(--danger); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--border-2); }
.ch-info  { display: flex; align-items: center; gap: 1rem; flex: 1; }
.ch-title { font-size: .875rem; }
.ch-words { color: var(--text-3); font-size: .78rem; margin-left: auto; }

/* ── Event log ─────────────────────────────────────────────────────────────── */
.event-log {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .65rem;
  max-height: 140px; overflow-y: auto;
  font-family: "SF Mono", "Fira Mono", monospace; font-size: .75rem;
}
.log-line { display: flex; gap: .75rem; padding: .08rem 0; }
.log-time { color: var(--text-3); flex-shrink: 0; }
.log-msg  { color: var(--text-2); }

/* ── Download ──────────────────────────────────────────────────────────────── */
.download-hero { text-align: center; padding: 2rem 0 1.5rem; }
.download-hero-icon { font-size: 3rem; margin-bottom: .75rem; }
.download-cards { display: flex; flex-direction: column; gap: .75rem; margin: 1.5rem 0; }
.download-card {
  display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all .2s;
}
.download-card:hover { border-color: var(--primary); background: rgba(79,126,248,.07); }
.dl-icon  { font-size: 1.75rem; }
.dl-info  { flex: 1; }
.dl-title { font-weight: 600; margin-bottom: .2rem; }
.dl-hint  { color: var(--text-3); font-size: .8rem; }
.dl-arrow { font-size: 1.4rem; color: var(--primary); }

/* ── Chapter preview (download step) ──────────────────────────────────────── */
.chapter-preview {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin: 1.25rem 0;
}
.preview-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .85rem;
}
.preview-header h3 { font-size: .95rem; font-weight: 600; }
.preview-nav { display: flex; align-items: center; gap: .65rem; color: var(--text-2); font-size: .85rem; }

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════════ */
/* v2 ADDITIONS                                                                */
/* ══════════════════════════════════════════════════════════════════════════ */

/* ── Header right (lang switch + start button) ──────────────────────────── */
.header-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }

.lang-switch {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-3);
  padding: .35rem .65rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lang-btn:hover { color: var(--text-2); }
.lang-btn.active { background: var(--primary); color: #fff; }

/* ── Mock banner ────────────────────────────────────────────────────────── */
.mock-banner {
  background: rgba(245, 166, 35, 0.12);
  color: var(--gold);
  border-bottom: 1px solid rgba(245, 166, 35, 0.3);
  padding: .55rem 1rem;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* ── Resume overlay ─────────────────────────────────────────────────────── */
.resume-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.resume-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.resume-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.resume-card p  { color: var(--text-2); font-size: .85rem; margin-bottom: 1.2rem; }
.resume-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* ── Direction / target-language tiles (radio replacement) ─────────────── */
.direction-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .65rem;
}
.direction-tile {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1rem 1.1rem;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.direction-tile input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.direction-tile:hover { border-color: var(--border-2); }
.direction-tile.active {
  border-color: var(--primary);
  background: rgba(79, 126, 248, .08);
}
.dir-codes {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.dir-label { font-size: .85rem; color: var(--text-2); font-weight: 500; }
.direction-tile.active .dir-label { color: var(--text); }

/* ── Glossary split (Markdown editor + preview) ─────────────────────────── */
.glossary-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  min-height: 60vh;
}
.glossary-pane {
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pane-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.pane-label  { font-size: .78rem; font-weight: 600; color: var(--text-2); letter-spacing: .03em; }
.pane-status { font-size: .72rem; color: var(--text-3); }

.md-editor {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.55;
  padding: .9rem 1.1rem;
  resize: none;
  outline: none;
}

.md-preview {
  flex: 1;
  padding: 1rem 1.2rem;
  overflow-y: auto;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--text);
}
.md-preview h1 { font-size: 1.15rem; margin: 1rem 0 .65rem; color: var(--gold); }
.md-preview h2 { font-size: 1.0rem;  margin: .9rem 0 .55rem; color: var(--primary); }
.md-preview h3 { font-size: .92rem;  margin: .75rem 0 .45rem; color: var(--text); }
.md-preview h4 { font-size: .85rem;  margin: .6rem 0 .35rem; color: var(--text-2); }
.md-preview p, .md-preview li { font-size: .82rem; color: var(--text-2); }
.md-preview ul, .md-preview ol { padding-left: 1.4rem; margin: .35rem 0 .65rem; }
.md-preview li { margin-bottom: .25rem; }
.md-preview strong { color: var(--text); font-weight: 600; }
.md-preview em { color: var(--text); }
.md-preview code {
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .78rem;
  color: var(--gold);
}
.md-preview hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

@media (max-width: 900px) {
  .glossary-split { grid-template-columns: 1fr; min-height: auto; }
  .glossary-pane { min-height: 40vh; }
}

/* Review mode — full-width rendered glossary, no editor pane */
.glossary-review {
  margin-top: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 50vh;
}
.md-preview-wide {
  padding: 1.5rem 1.8rem;
  max-height: 70vh;
}

/* ── Admin panel ────────────────────────────────────────────────────────── */
.admin-page {
  max-width: 1200px;
  margin: 1.5rem auto 4rem;
  padding: 0 1.5rem;
}
.admin-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.admin-title {
  font-size: 1.6rem;
  margin: 0;
  color: var(--text);
}
.admin-tabs {
  display: flex;
  gap: .35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-tab {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: .65rem 1.1rem;
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}
.admin-toolbar {
  margin-bottom: 1rem;
  display: flex;
  gap: .5rem;
}
.admin-toolbar .input { max-width: 240px; }

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.admin-stat-label {
  font-size: .78rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}
.admin-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.admin-stat-hint {
  margin-top: .25rem;
  font-size: .8rem;
  color: var(--text-3);
}
.admin-section-title {
  font-size: 1rem;
  margin: 1.4rem 0 .6rem;
  color: var(--text-2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.admin-table th,
.admin-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  background: var(--bg-3);
  font-weight: 600;
  color: var(--text-2);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .muted { color: var(--text-3); text-align: center; padding: 2rem; }
.admin-cell-message {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-pill, .status-pill {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.role-admin {
  background: rgba(124, 58, 237, .18);
  color: #c4b5fd;
}
.role-user {
  background: var(--bg-3);
  color: var(--text-3);
}
.status-pill { background: var(--bg-3); color: var(--text-2); }
.status-done       { background: rgba(34,197,94,.15);  color: #86efac; }
.status-translating,.status-glossary,.status-previewing,.status-uploading,.status-analyzed { background: rgba(79,126,248,.18); color: #a5b4fc; }
.status-error      { background: rgba(239,68,68,.18); color: #fca5a5; }
.status-stopped,.status-preview_ready { background: rgba(243,178,79,.15); color: #fcd34d; }

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  font-size: .85rem;
  user-select: none;
}
.admin-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.admin-toggle-text { color: var(--text-2); }

.admin-action {
  font-size: .82rem;
  margin-right: .65rem;
}
.admin-action.danger {
  color: #f87171;
}
.admin-action.danger:hover { color: #ef4444; }

/* ── TOS / privacy checkbox on the signup form ──────────────────────────── */
.auth-tos {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: .35rem 0 .15rem;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.auth-tos input { margin-top: .2rem; flex-shrink: 0; }
.auth-tos .link { white-space: nowrap; }

/* ── Site footer ────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  padding: 1.6rem 1.5rem 2.2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-brand {
  font-size: .85rem;
  color: var(--text-3);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-size: .85rem;
}
@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Legal pages (privacy + terms) ──────────────────────────────────────── */
.legal-page {
  max-width: 760px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}
.legal-doc {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.4rem;
}
.legal-doc h1 {
  font-size: 1.7rem;
  margin: 0 0 1rem;
  color: var(--text);
}
.legal-doc h2 {
  font-size: 1.15rem;
  margin: 1.6rem 0 .65rem;
  color: var(--primary);
}
.legal-doc h3 {
  font-size: 1rem;
  margin: 1.2rem 0 .55rem;
  color: var(--text);
}
.legal-doc p,
.legal-doc li {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text);
}
.legal-doc table {
  border-collapse: collapse;
  width: 100%;
  margin: .8rem 0 1.2rem;
  font-size: .88rem;
}
.legal-doc th,
.legal-doc td {
  border: 1px solid var(--border);
  padding: .55rem .75rem;
  text-align: left;
  vertical-align: top;
}
.legal-doc th {
  background: var(--bg-3);
  font-weight: 600;
  color: var(--text);
}
.legal-doc em {
  color: var(--text-2);
}
@media (max-width: 600px) {
  .legal-doc { padding: 1.4rem 1.2rem; }
}

/* Diff modal — shown after Done if the server flags errors/warnings */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 12, 22, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn .15s ease;
}
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.modal-header {
  padding: 1.1rem 1.4rem .9rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.modal-body {
  padding: 1.1rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-section {
  border-radius: 10px;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-3);
}
.modal-section.tone-error {
  border-color: rgba(239, 68, 68, .4);
  background: rgba(239, 68, 68, .08);
}
.modal-section.tone-warning {
  border-color: rgba(243, 178, 79, .45);
  background: rgba(243, 178, 79, .08);
}
.modal-section.tone-success {
  border-color: rgba(34, 197, 94, .45);
  background: rgba(34, 197, 94, .08);
}

.modal-intro {
  margin: 0 0 .25rem;
  color: var(--text-2);
  font-size: .9rem;
  line-height: 1.5;
}

.sales-form {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
}
.form-row-optional {
  margin-left: .35rem;
  font-weight: 400;
  font-size: .75rem;
  color: var(--text-3);
}
.form-row-hint {
  font-size: .75rem;
  color: var(--text-3);
  margin-top: .15rem;
}
.form-row .input[disabled],
.form-row .input[readonly] {
  opacity: .65;
  cursor: not-allowed;
}
.form-row textarea.input {
  resize: vertical;
  min-height: 70px;
  font-family: inherit;
}
.modal-section strong { display: block; margin-bottom: .35rem; color: var(--text); }
.modal-section-desc {
  margin: 0 0 .55rem;
  color: var(--text-2);
  font-size: .88rem;
  line-height: 1.5;
}
.diff-name-list {
  list-style: none;
  margin: 0 0 .65rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.diff-name-list li {
  display: inline-block;
  padding: .2rem .55rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--text);
}
.modal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  font-size: .88rem;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.modal-checkbox input { margin-top: .2rem; flex-shrink: 0; }
.modal-checkbox span { line-height: 1.45; }
.modal-footer {
  padding: .85rem 1.4rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}

/* Edit-mode warning banner — shown above the split editor */
.glossary-edit-warning {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(243, 178, 79, .45);
  background: rgba(243, 178, 79, .08);
}
.glossary-edit-warning strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--text);
}
.glossary-edit-warning p {
  margin: 0;
  color: var(--text-2);
  font-size: .88rem;
  line-height: 1.5;
}

/* ── Style note in preview verdict ──────────────────────────────────────── */
.style-note {
  margin-top: .5rem;
  font-size: .78rem;
  color: var(--text-3);
  font-style: italic;
}

/* ── Style guide collapsible block ──────────────────────────────────────── */
.style-guide-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  margin: 1rem 0;
}
.style-guide-block summary {
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  font-size: .9rem;
  list-style: none;
}
.style-guide-block summary::-webkit-details-marker { display: none; }
.style-guide-block summary::before {
  content: "▸";
  color: var(--text-3);
  display: inline-block;
  transition: transform .15s;
}
.style-guide-block[open] summary::before { transform: rotate(90deg); }
.sg-hint { color: var(--text-3); font-size: .78rem; font-weight: normal; }


/* ─── Auth page (full-screen, split-layout) ──────────────────────────── */

.auth-page {
  display:        flex;
  align-items:    center;
  justify-content: center;
  padding:        3rem 1.5rem 5rem;
  min-height:     calc(100vh - 80px);
}

.auth-split {
  display:               grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 360px);
  gap:                   3rem;
  align-items:           start;
  width:                 100%;
  max-width:             860px;
}

@media (max-width: 760px) {
  .auth-split {
    grid-template-columns: 1fr;
    max-width: 460px;
    gap: 1.75rem;
  }
}

.auth-card {
  width:         100%;
  background:    var(--bg-2);
  border:        1px solid var(--border);
  border-radius: var(--radius);
  padding:       2rem 2rem 2.25rem;
  box-shadow:    0 8px 24px rgba(0,0,0,.25);
  position:      relative;
}

.auth-perks { padding: .25rem .25rem 0; }
.auth-perks h3 {
  font-size:      .8rem;
  font-weight:    600;
  color:          var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin:         0 0 1.25rem;
}
.auth-perks ul         { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.auth-perks li         { display: flex; gap: .9rem; align-items: flex-start; }
.auth-perks .perk-icon { font-size: 1.5rem; line-height: 1.1; flex-shrink: 0; }
.auth-perks strong     { display: block; color: var(--text); font-size: .96rem; font-weight: 600; margin-bottom: .2rem; }
.auth-perks p          { color: var(--text-2); font-size: .85rem; line-height: 1.5; margin: 0; }

.auth-title { font-size: 1.55rem; font-weight: 600; margin: 0 0 .35rem; }
.auth-sub   { color: var(--text-2); font-size: .92rem; margin: 0 0 1.4rem; line-height: 1.5; }

.auth-tabs {
  display:        grid;
  grid-template-columns: 1fr 1fr;
  background:     var(--bg);
  border:         1px solid var(--border);
  border-radius:  var(--radius-sm);
  padding:        .25rem;
  margin-bottom:  1.4rem;
  gap:            .25rem;
}

.auth-tab {
  background:    transparent;
  border:        none;
  color:         var(--text-2);
  padding:       .55rem .75rem;
  font-size:     .9rem;
  font-weight:   500;
  border-radius: 5px;
  cursor:        pointer;
  transition:    background .12s, color .12s;
}
.auth-tab:hover         { color: var(--text); }
.auth-tab.active        { background: var(--primary); color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-field        { display: flex; flex-direction: column; gap: .35rem; }
.auth-field span   { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.auth-field .input { width: 100%; box-sizing: border-box; }

.auth-hint   { font-size: .76rem; color: var(--text-3); margin-top: .15rem; }
.auth-submit { width: 100%; justify-content: center; margin-top: .25rem; }

.auth-forgot {
  display: flex; justify-content: flex-end;
  font-size: .82rem;
  margin-top: -.4rem;   /* tuck it close under the password field */
}
.auth-forgot .link { color: var(--text-2); }
.auth-forgot .link:hover { color: var(--primary); }

.auth-back-to-login {
  text-align: center;
  font-size: .85rem;
  margin-top: .25rem;
  color: var(--text-2);
}
.auth-back-to-login .link { color: var(--text-2); }
.auth-back-to-login .link:hover { color: var(--text); }

.alert-info {
  background:    rgba(79, 126, 248, .12);
  border:        1px solid rgba(79, 126, 248, .35);
  color:         #b9cdff;
  padding:       .7rem .9rem;
  border-radius: var(--radius-sm);
  font-size:     .88rem;
  line-height:   1.45;
}

/* ─── Header user chip ────────────────────────────────────────────────── */

.user-chip {
  display:       flex;
  align-items:   center;
  gap:           .5rem;
  background:    var(--bg-2);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       .35rem .65rem;
  font-size:     .82rem;
}

.user-email {
  color:         var(--text-2);
  max-width:     180px;
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
}

.btn-link {
  background:  transparent;
  border:      none;
  color:       var(--primary);
  font-size:   .82rem;
  padding:     0;
  cursor:      pointer;
  font-weight: 500;
}
.btn-link:hover { color: var(--primary-h); text-decoration: underline; }

/* ─── Dashboard ─────────────────────────────────────────────────────────── */

.dashboard {
  max-width:  1100px;
  margin:     0 auto;
  padding:    2.5rem 1.5rem 4rem;
}

.dashboard-header {
  display:        flex;
  align-items:    flex-end;
  justify-content: space-between;
  gap:            1.5rem;
  margin-bottom:  1.75rem;
}

.dashboard-title { font-size: 1.6rem; font-weight: 600; margin: 0 0 .25rem; }
.dashboard-sub   { color: var(--text-2); font-size: .92rem; margin: 0; }

.dashboard-empty {
  text-align:   center;
  padding:      3.5rem 1rem;
  background:   var(--bg-2);
  border:       1px dashed var(--border-2);
  border-radius: var(--radius);
}
.dashboard-empty h3 { margin: .75rem 0 .35rem; font-size: 1.15rem; }
.dashboard-empty p  { color: var(--text-2); margin: 0 0 1.5rem; }
.empty-icon         { font-size: 2.4rem; }

.job-grid {
  display:  grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:      1rem;
}

.job-card {
  background:   var(--bg-2);
  border:       1px solid var(--border);
  border-radius: var(--radius);
  padding:      1.1rem 1.15rem;
  cursor:       pointer;
  transition:   border-color .15s, transform .15s, background .15s;
  display:      flex;
  flex-direction: column;
  gap:          .65rem;
}
.job-card:hover {
  border-color: var(--border-2);
  background:   var(--bg-3);
  transform:    translateY(-1px);
}

.job-card-head { display: flex; align-items: center; gap: .55rem; }
.job-icon      { font-size: 1.15rem; }
.job-name      {
  font-weight:    500;
  color:          var(--text);
  white-space:    nowrap;
  overflow:       hidden;
  text-overflow:  ellipsis;
}

.job-meta {
  display:    flex;
  flex-wrap:  wrap;
  gap:        .35rem;
  font-size:  .82rem;
  color:      var(--text-2);
}

.job-foot {
  display:        flex;
  align-items:    center;
  justify-content: space-between;
  margin-top:     .25rem;
}

.status-badge {
  display:        inline-flex;
  align-items:    center;
  padding:        .22rem .55rem;
  border-radius:  999px;
  font-size:      .74rem;
  font-weight:    500;
  letter-spacing: .01em;
  background:     var(--bg-3);
  color:          var(--text-2);
  border:         1px solid var(--border);
  white-space:    nowrap;
}

.status-badge.tone-active   { background: rgba(79,126,248,.14);  color: #b9cdff; border-color: rgba(79,126,248,.32); }
.status-badge.tone-success  { background: rgba(34,197,94,.13);   color: #95efbb; border-color: rgba(34,197,94,.32); }
.status-badge.tone-warning  { background: rgba(245,166,35,.14);  color: #ffd28a; border-color: rgba(245,166,35,.32); }
.status-badge.tone-error    { background: rgba(239,68,68,.14);   color: #ffa7a7; border-color: rgba(239,68,68,.32); }
.status-badge.tone-neutral  { /* default */ }

.job-time { color: var(--text-3); font-size: .76rem; }

/* Subtle accent on the card border that matches the badge tone */
.job-card.tone-active   { border-color: rgba(79,126,248,.28); }
.job-card.tone-success  { border-color: rgba(34,197,94,.28);  }
.job-card.tone-warning  { border-color: rgba(245,166,35,.28); }
.job-card.tone-error    { border-color: rgba(239,68,68,.28);  }

/* ─── Back link inside upload card ─────────────────────────────────────── */

.btn-back {
  background:    transparent;
  border:        none;
  color:         var(--text-2);
  font-size:     .85rem;
  cursor:        pointer;
  padding:       0 0 .65rem;
  align-self:    flex-start;
}
.btn-back:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════ */
/* PRICING / CALCULATOR / PLAN TILES                                          */
/* ══════════════════════════════════════════════════════════════════════════ */

/* Header link */
.header-link {
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  padding: .35rem .55rem;
}
.header-link:hover { color: var(--text); }

/* ── Plan tiles (basic / pro radio replacement in upload form) ───────────── */
.plan-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.plan-tile {
  position: relative;
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem 1.1rem;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.plan-tile input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.plan-tile:hover { border-color: var(--border-2); }
.plan-tile.active {
  border-color: var(--primary);
  background: rgba(79, 126, 248, .08);
}
.plan-tile-name { font-weight: 600; font-size: .95rem; }
.plan-tile-desc { font-size: .82rem; color: var(--text-2); }
.plan-tile.active .plan-tile-desc { color: var(--text); }
.form-hint { font-size: .82rem; color: var(--text-2); margin-top: .35rem; }

/* ── Cost line (single-row price summary in upload) ──────────────────────── */
.cost-line {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: .9rem 1.1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: .35rem;
}
.cost-line-label { color: var(--text-2); font-size: .9rem; }
.cost-line-price { font-size: 1.4rem; color: var(--gold); }
.cost-hint { font-size: .82rem; color: var(--text-2); margin-top: .55rem; text-align: center; }

/* Mode banner on the analysis panel (demo / prod indicator) */
.analysis-mode-banner {
  margin-bottom: 1.2rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.analysis-mode-banner.tone-prod {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .07);
}
.analysis-mode-banner.tone-demo {
  border-color: rgba(124, 58, 237, .35);
  background: rgba(124, 58, 237, .06);
}
.analysis-mode-banner strong {
  display: block;
  margin-bottom: .25rem;
  color: var(--text);
}
.analysis-mode-banner p {
  margin: 0;
  color: var(--text-2);
  font-size: .88rem;
  line-height: 1.5;
}

/* ── Analysis panel (post-upload confirmation) ──────────────────────────── */
.analysis-body { padding: 1.5rem 0; }
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.analysis-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.analysis-card-label {
  font-size: .78rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}
.analysis-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: .25rem;
}
.analysis-card-hint {
  font-size: .82rem;
  color: var(--text-2);
}
/* Target-language picker on the analysis panel — sits between the
   detected-source cards and the warnings list. */
.analysis-target {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.analysis-target-label {
  display: block;
  font-size: .78rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .65rem;
  font-weight: 500;
}
.analysis-target-hint {
  margin-top: .65rem;
  font-size: .82rem;
  color: var(--text-2);
}

/* Output-format picker on the analysis panel — sister of analysis-target,
   but checkboxes (one OR both must be on) instead of radio. */
.analysis-formats {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
/* Mirror .direction-tiles dimensions so target-lang radio + format
   checkbox stack lock to the same visual rhythm. */
.format-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .65rem;
}
.format-checkbox {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-3);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s;
}
.format-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.format-checkbox:hover { border-color: var(--border-2); }
.format-checkbox.active {
  border-color: var(--primary);
  background: rgba(79, 126, 248, .08);
}
.format-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.format-hint { font-size: .85rem; color: var(--text-2); font-weight: 500; }
.format-checkbox.active .format-hint { color: var(--text); }

.analysis-warnings { display: flex; flex-direction: column; gap: .65rem; }
.analysis-warning {
  border-radius: 10px;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.analysis-warning.tone-warning {
  border-color: rgba(243, 178, 79, .45);
  background: rgba(243, 178, 79, .08);
}
.analysis-warning.tone-neutral {
  border-color: var(--border);
}
.analysis-warning strong { display: block; margin-bottom: .25rem; }
.analysis-warning p { color: var(--text-2); font-size: .9rem; margin: 0 0 .5rem; }
.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* ── Cost pill — rounded rectangle to match adjacent button shapes ──────── */
.cost-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .9rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: nowrap;
  line-height: 1;
}
.cost-pill-label { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.cost-pill-price { font-size: 1.05rem; color: var(--gold); font-weight: 700; }

/* ── Calculator on landing ───────────────────────────────────────────────── */
.calc-section {
  max-width: 960px;
  margin: 5rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}
.calc-title {
  font-size: 2.1rem; font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .55rem;
}
.calc-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}
.calc-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3) 240%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2rem 1.5rem;
  text-align: left;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 24px -16px rgba(0,0,0,.6);
}
.calc-row { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1.75rem; }
.calc-label {
  font-size: .75rem; color: var(--text-2); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.calc-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.calc-preset {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1rem 1.1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.calc-preset:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
}
.calc-preset.active {
  border-color: var(--primary);
  background: rgba(79, 126, 248, .1);
}
.calc-preset strong { font-size: 1.05rem; }
.calc-preset span { font-size: .8rem; color: var(--text-2); }
.calc-preset.active span { color: var(--text); }

.calc-prices {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-bottom: 1.25rem;
}
.calc-plan {
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: border-color .15s;
}
.calc-plan:hover { border-color: var(--border-2); }
.calc-plan-pro {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(79, 126, 248, .12), var(--bg) 70%);
}
.calc-plan-pro::before {
  content: "★";
  position: absolute;
  top: .55rem; right: .8rem;
  color: var(--gold);
  font-size: .9rem;
}
.calc-plan-name {
  font-size: .72rem; color: var(--text-2); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: .55rem;
}
.calc-plan-price {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: .35rem;
  line-height: 1;
}
.calc-plan-pro .calc-plan-price { color: var(--gold); }
.calc-plan-desc { font-size: .85rem; color: var(--text-2); line-height: 1.4; }

.calc-disclaimer {
  font-size: .78rem; color: var(--text-3); text-align: center;
  margin-top: .25rem;
}
.calc-more {
  background: transparent;
  border: none;
  color: var(--primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  width: 100%;
  padding: .75rem;
  margin-top: .25rem;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.calc-more:hover {
  color: var(--primary-h);
  background: rgba(79, 126, 248, .06);
}

/* ── Pricing page ────────────────────────────────────────────────────────── */
.pricing-page {
  max-width: 1080px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}
.pricing-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -.015em;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: .75rem;
}
.pricing-sub {
  text-align: center;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.55;
  max-width: 660px;
  margin: 0 auto 3rem;
}
.pricing-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-bottom: 3.5rem;
}
.pricing-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem 2rem 2rem;
  display: flex; flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.pricing-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
}
.pricing-card-pro {
  border-color: var(--primary);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(79, 126, 248, .14), transparent 60%),
    var(--bg-2);
  box-shadow: 0 0 0 1px var(--primary) inset, 0 24px 48px -28px rgba(79, 126, 248, .55);
}
.pricing-card-pro:hover {
  box-shadow: 0 0 0 1px var(--primary) inset, 0 30px 56px -28px rgba(79, 126, 248, .7);
}
.pricing-badge {
  position: absolute;
  top: -.85rem; left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35rem .85rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgba(79, 126, 248, .6);
}
.pricing-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .35rem;
}
.pricing-tagline {
  color: var(--text-2);
  font-size: .98rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  min-height: 2.95em;   /* keep cards aligned even with different tagline lengths */
}
.pricing-price {
  display: flex; align-items: baseline; gap: .5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed var(--border);
}
.pricing-from {
  color: var(--text-2);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 600;
}
.pricing-price strong {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}
.pricing-card-pro .pricing-price strong { color: var(--gold); }

.pricing-features {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: .65rem;
}
.pricing-features li {
  display: flex; align-items: flex-start; gap: .65rem;
  font-size: .94rem;
  line-height: 1.45;
  color: var(--text);
}
.pricing-features li::before {
  font-weight: 700;
  width: 1.25rem; flex: 0 0 1.25rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.45;
}
.pricing-features li.pf-yes::before { content: "✓"; color: var(--success); }
.pricing-features li.pf-no::before  { content: "—"; color: var(--text-3); }
.pricing-features li.pf-no { color: var(--text-3); }

.pricing-table-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: .35rem;
}
.pricing-table-sub {
  text-align: center;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}
.pricing-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.pricing-table {
  width: 100%;
  border-collapse: collapse;
}
.pricing-table th, .pricing-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.pricing-table th {
  background: var(--bg-3);
  color: var(--text-2);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pricing-table tbody tr:last-child td { border-bottom: none; }
.pricing-table tbody tr:hover { background: rgba(255,255,255,.02); }
.pricing-table td:nth-child(1) strong { font-size: 1rem; }
.pricing-table td:nth-child(2) { color: var(--text-2); }
.pricing-table td:nth-child(3),
.pricing-table td:nth-child(4) {
  font-weight: 700;
  font-size: 1.05rem;
}
.pricing-table td:nth-child(4) { color: var(--gold); }

.pricing-note {
  display: flex; align-items: center; gap: .55rem;
  width: max-content;
  max-width: 100%;
  margin: 1.5rem auto 0;
  padding: .65rem 1.1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: .88rem;
  line-height: 1.4;
}
.pricing-note::before {
  content: "ℹ";
  color: var(--primary);
  font-weight: 700;
  flex: 0 0 auto;
}
.pricing-cta-wrap {
  display: flex; justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 720px) {
  .pricing-page  { padding: 0 1rem; }
  .pricing-title { font-size: 1.9rem; }
  .pricing-cards { grid-template-columns: 1fr; gap: 1rem; }
  .pricing-card  { padding: 1.75rem 1.5rem; }
  .pricing-tagline { min-height: 0; }
  .calc-prices   { grid-template-columns: 1fr; }
  .calc-presets  { grid-template-columns: 1fr; }
  .plan-tiles    { grid-template-columns: 1fr; }
  .calc-card     { padding: 1.5rem 1.25rem 1rem; }
  .calc-title    { font-size: 1.65rem; }
}
