@font-face {
  font-family: "Noto Sans Gujarati";
  src: url("/fonts/NotoSansGujarati-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Gujarati";
  src: url("/fonts/NotoSansGujarati-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #1a1035;
  --ink-soft: #2a1460;
  --paper: #fbf8ff;
  --desk: #efe8fb;
  --card: rgba(255, 252, 255, 0.9);
  --text: #1c1430;
  --muted: #6b6280;
  --line: rgba(42, 20, 96, 0.1);
  --line-strong: rgba(42, 20, 96, 0.16);
  --ember: #f59e0b;
  --ember-deep: #ea580c;
  --gold: #fbbf24;
  --purple: #6d28d9;
  --purple-deep: #2a1460;
  --purple-glow: rgba(124, 58, 237, 0.35);
  --sea: #7c3aed;
  --warn: #9a6230;
  --danger: #a33d3d;
  --shadow: 0 24px 60px rgba(42, 20, 96, 0.14);
  --serif: "Newsreader", Georgia, serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --gujarati: "Noto Sans Gujarati", "Manrope", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--desk);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.45;
  overflow: hidden;
}
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
::selection { background: rgba(124, 58, 237, 0.22); }

.wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(251, 191, 36, 0.28), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, rgba(124, 58, 237, 0.22), transparent 52%),
    radial-gradient(600px 380px at 50% 100%, rgba(42, 20, 96, 0.12), transparent 60%),
    linear-gradient(180deg, #f7f2ff 0%, #ebe4f8 100%);
  z-index: 0;
}

.top, main { position: relative; z-index: 1; }

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 74px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  color: #f6f1e8;
  background: linear-gradient(180deg, #2a1460, #1a1035);
  box-shadow: 0 10px 30px rgba(18, 22, 31, 0.18);
  animation: rise 0.6s var(--ease) both;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 210px; }
.logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #2a1460;
  box-shadow: 0 8px 18px rgba(42, 20, 96, 0.35);
  flex: none;
}
.mark { display: grid; place-items: center; }
.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.brand em { display: block; color: #c9c0b4; font-style: normal; font-size: 12px; }

.steps {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 4px;
  margin: 0;
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
@media (min-width: 1101px) {
  .steps { margin-right: min(540px, 46vw); }
}
.steps li {
  padding: 7px 12px;
  border-radius: 999px;
  color: #b7aea3;
  transition: color 0.35s var(--ease), background 0.35s var(--ease), transform 0.35s var(--ease);
}
.steps li.on {
  color: #2a1460;
  background: linear-gradient(180deg, #ffe7c2, #f59e0b);
  font-weight: 700;
}
.steps li.on:not(:has(+ li.on)) { transform: translateY(-1px); }

.action-dock {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 45;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}
.action-dock .export-bar {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: end;
  padding: 8px;
  border-radius: 16px;
  background: rgba(26, 16, 53, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(18, 22, 31, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.export-bar label, .zoom {
  display: grid;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9c0b4;
}
.action-dock select {
  background: #232a38;
  color: #f6f1e8;
  border-color: rgba(255, 255, 255, 0.12);
  min-width: 0;
}
.action-dock .ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f6f1e8;
}
.action-dock .download {
  background: #fffdf9;
}

select, textarea {
  background: #fffdf9;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--text);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
select:hover, textarea:hover { border-color: rgba(232, 131, 47, 0.55); }
select:focus, textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 4px rgba(232, 131, 47, 0.16);
}

.primary, .ghost, .download {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
}
.primary {
  background: linear-gradient(180deg, #ffd7a4, #e8832f);
  color: #2a1608;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(232, 131, 47, 0.28);
}
.primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(232, 131, 47, 0.34); }
.primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.ghost { background: rgba(255, 255, 255, 0.72); border-color: var(--line-strong); }
.ghost:hover:not(:disabled) {
  border-color: rgba(232, 131, 47, 0.45);
  background: #fff;
  transform: translateY(-1px);
}
.danger { color: var(--danger); }
.download {
  background: #fffdf9;
  color: #2a1608;
  font-weight: 700;
  animation: rise 0.45s var(--ease) both;
}

main {
  height: calc(100% - 74px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
}
aside, .stage { min-height: 0; }
.rail, .editor {
  overflow: auto;
  padding: 16px;
}
.rail { animation: slide-left 0.7s var(--ease) both; }
.editor { animation: slide-right 0.7s var(--ease) both; }
.panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 30px rgba(40, 28, 16, 0.05);
  backdrop-filter: blur(10px);
}

h2 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

/* upload + queue */
.upload-card {
  position: relative;
  border-radius: 22px;
  padding: 14px;
  background:
    radial-gradient(240px 140px at 100% 0%, rgba(251, 191, 36, 0.28), transparent 70%),
    radial-gradient(220px 160px at 0% 100%, rgba(124, 58, 237, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 255, 0.92));
  border: 1px solid rgba(124, 58, 237, 0.14);
  box-shadow: var(--shadow);
}
.upload-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 18px 12px 14px;
  border-radius: 18px;
  border: 1.5px dashed rgba(109, 40, 217, 0.28);
  background: rgba(255, 255, 255, 0.55);
  transition: border-color 0.3s var(--ease), transform 0.35s var(--ease), background 0.3s;
}
.upload-hero:hover, .upload-hero.hot {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(255, 255, 255, 0.78);
}
.upload-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(42, 20, 96, 0.28);
  animation: orb-float 4.6s ease-in-out infinite;
}
.upload-title {
  margin: 12px 0 4px;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.03em;
  color: var(--purple-deep);
}
.upload-hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.upload-actions .ghost {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.18);
  color: var(--purple-deep);
}
.drop-kicker, .empty-kicker, .veil-kicker {
  margin: 12px 0 6px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: var(--ember-deep);
}
.muted { color: var(--muted); }
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.check input { accent-color: var(--purple); }
.queue-panel { margin-top: 14px; padding-top: 4px; }
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.queue-head h2 { margin: 0; }
.queue-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.queue-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(124, 58, 237, 0.12);
}
.queue-item.on {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 10px 24px rgba(42, 20, 96, 0.1);
}
.queue-item[data-status="converting"] {
  border-color: rgba(124, 58, 237, 0.45);
  animation: pulse-border 1.8s ease-in-out infinite;
}
.queue-item[data-status="completed"] { border-color: rgba(34, 197, 94, 0.35); }
.queue-item[data-status="failed"] { border-color: rgba(163, 61, 61, 0.35); }
.q-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(160deg, #efe7ff, #fff);
}
.q-thumb.pdf {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--purple-deep);
  background: linear-gradient(160deg, #fff, #f3e8ff 60%, #ffe8b8);
}
.q-meta { min-width: 0; }
.q-meta strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-meta span { color: var(--muted); font-size: 12px; }
.q-error {
  display: block;
  color: var(--danger);
  font-size: 11px;
  font-style: normal;
  margin-top: 2px;
}
.q-actions { display: flex; gap: 6px; }
.tiny { padding: 7px 10px; border-radius: 10px; font-size: 12px; }
.wide { width: 100%; }
.queue-confirm { margin-top: 12px; }
.orb {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fffaf2 0 12%, #ffe1ad 28%, #f0b24a 52%, #e07a2b 78%, #9a4e16 100%);
  box-shadow:
    0 12px 24px rgba(224, 122, 43, 0.35),
    inset 0 -10px 16px rgba(90, 36, 8, 0.28),
    inset 0 8px 12px rgba(255, 255, 255, 0.35);
  animation: orb-float 4.6s ease-in-out infinite;
}
.orb i {
  position: absolute;
  left: 18%;
  top: 14%;
  width: 38%;
  height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(0.4px);
  transform: rotate(-18deg);
}
.orb-mark { width: 36px; height: 36px; animation-duration: 5.5s; }
.pages button, .blocks button {
  text-align: left;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.pages button:hover, .blocks button:hover {
  transform: translateX(4px);
  border-color: rgba(124, 58, 237, 0.35);
  background: #fff;
  box-shadow: 0 8px 18px rgba(42, 20, 96, 0.06);
}

.pages { display: grid; gap: 6px; margin-top: 10px; }
.pages button.on, .blocks button.on {
  border-color: transparent;
  background: linear-gradient(180deg, #ffe7c4, #f0b15a);
  color: #2a1608;
  font-weight: 700;
}
.modes button.on {
  color: #2a1608;
  background: linear-gradient(180deg, #ffe7c4, #f0b15a);
  font-weight: 700;
}
dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-variant-numeric: tabular-nums; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.log li {
  color: var(--muted);
  font-size: 13px;
  padding-left: 14px;
  position: relative;
}
.log:empty::after { content: "Waiting for a document."; color: var(--muted); }
.log li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  position: absolute;
  left: 0;
  top: 0.5em;
  box-shadow: 0 0 0 4px rgba(232, 131, 47, 0.12);
}

.stage {
  display: flex;
  flex-direction: column;
  margin: 14px 0;
  border-radius: 22px;
  background:
    radial-gradient(500px 220px at 50% 0%, rgba(255, 255, 255, 0.7), transparent 70%),
    rgba(255, 252, 248, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}
.stage-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 248, 0.72);
  backdrop-filter: blur(12px);
}
.modes {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 24, 32, 0.05);
}
.modes button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  transition: background 0.3s var(--ease), color 0.3s, transform 0.3s var(--ease);
}
.modes button:hover { color: var(--text); }
.zoom { color: var(--muted); }
.zoom input { width: 128px; accent-color: var(--ember); }
.canvas {
  overflow: auto;
  flex: 1;
  padding: 28px 24px 48px;
}
.canvas.drawing { cursor: crosshair; }
.canvas.reveal .sheet { animation: sheet-in 0.7s var(--ease) both; }
.empty {
  max-width: 420px;
  margin: 10vh auto;
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}
.empty-brand img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(42, 20, 96, 0.22);
  margin-bottom: 14px;
}
.empty-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.03em;
  color: var(--purple-deep);
}
.empty-sub {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}
.empty-cta {
  margin-top: 18px;
  min-width: 168px;
  display: none;
}
.sheet {
  position: relative;
  margin: 28px auto;
  width: min(100%, calc(720px * var(--zoom)));
  background: white;
  border-radius: 6px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(20, 24, 32, 0.06);
}
.sheet img { display: block; width: 100%; height: auto; border-radius: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.overlay { position: relative; }
.overlay .top-image {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  transition: opacity 0.35s var(--ease);
}
.hit {
  position: absolute;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.hit:hover { background: rgba(232, 131, 47, 0.14); }
.hit.on {
  border-color: var(--ember);
  background: rgba(232, 131, 47, 0.12);
  box-shadow: 0 0 0 4px rgba(232, 131, 47, 0.14);
}
.review-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.review-toggle .chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.25s var(--ease);
}
.review-toggle.open .chevron { transform: rotate(45deg); }
.review-body { margin-top: 12px; }
.review-body[hidden] { display: none !important; }
.review-quote {
  margin: 0 0 8px;
  font-family: var(--gujarati);
  line-height: 1.55;
}
.review-source {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.review-source:empty { display: none; }
.caption {
  position: absolute;
  left: 2px;
  top: -22px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.editor textarea { width: 100%; min-height: 92px; resize: vertical; }
#gujarati, .blocks button { font-family: var(--gujarati); }
.blocks button { line-height: 1.45; }
.kind {
  margin: 0 0 10px;
  color: var(--ember-deep);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.editor label { display: grid; gap: 6px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.issues, .blocks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.issues li {
  border-radius: 14px;
  background: rgba(232, 131, 47, 0.1);
  color: var(--warn);
  overflow: hidden;
}
.issues li.error { background: rgba(163, 61, 61, 0.1); color: var(--danger); }
.issues li button {
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  padding: 10px 12px;
}
.blocks button strong {
  font-family: var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 6;
  background: var(--ink);
  color: #f6f1e8;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toast-in 0.45s var(--ease) both;
}

.veil[hidden] { display: none !important; }
.veil {
  position: fixed !important;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(680px 420px at 50% 38%, rgba(124, 58, 237, 0.35), transparent 62%),
    radial-gradient(420px 280px at 18% 80%, rgba(245, 158, 11, 0.22), transparent 70%),
    rgba(18, 10, 40, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: veil-in 0.45s var(--ease) both;
  pointer-events: all;
  touch-action: none;
}
.veil::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 220, 160, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255, 220, 160, 0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255, 220, 160, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, rgba(255, 220, 160, 0.45), transparent),
    radial-gradient(2px 2px at 55% 45%, rgba(255, 220, 160, 0.3), transparent);
  animation: star-drift 14s linear infinite;
  opacity: 0.55;
  pointer-events: none;
}
.veil.leave { animation: veil-out 0.6s var(--ease) both; }
.veil-card {
  position: relative;
  width: min(460px, calc(100% - 40px));
  text-align: center;
  color: #f6f1e8;
  z-index: 1;
}
.orb-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 4px;
}
.scene-glow {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 120, 0.55), transparent 68%);
  filter: blur(14px);
  animation: pulse 2.8s ease-in-out infinite;
}
.ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 210, 140, 0.45);
  animation: ripple-out 3.2s var(--ease) infinite;
  pointer-events: none;
}
.r2 { animation-delay: 1.05s; }
.r3 { animation-delay: 2.1s; }
.page-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 112px;
  margin: -56px 0 0 -43px;
  perspective: 600px;
}
.page-sheet {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(160deg, #fffaf2, #f0e2c8 55%, #e8d4ae);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  transform-origin: center center;
  animation: page-flip 4.8s var(--ease) infinite;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px 14px;
}
.page-line {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(40, 28, 16, 0.22), rgba(40, 28, 16, 0.08));
  transform-origin: left center;
  animation: line-write 4.8s var(--ease) infinite;
}
.page-line:nth-child(2) { animation-delay: 0.12s; width: 92%; }
.page-line:nth-child(3) { animation-delay: 0.24s; width: 84%; }
.page-line.short { width: 58%; animation-delay: 0.36s; }
.orbit, .orbit-b {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 58%, rgba(255, 214, 150, 0.95) 72%, transparent 86%);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 66% 70%, transparent 72%);
  mask: radial-gradient(circle, transparent 64%, #000 66% 70%, transparent 72%);
  animation: spin 6.5s linear infinite;
}
.orbit-b {
  inset: 28px;
  animation-duration: 10s;
  animation-direction: reverse;
  opacity: 0.75;
}
.orb-hero {
  width: 92px;
  height: 92px;
  position: absolute;
  left: 64px;
  top: 48px;
  animation: orb-dance 3.6s cubic-bezier(0.45, 0.05, 0.25, 1) infinite;
  z-index: 3;
}
.orb-hero em {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.45), transparent 70%);
  filter: blur(6px);
  animation: pulse 2.2s ease-in-out infinite;
}
.glyph {
  position: absolute;
  font-family: var(--gujarati);
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 230, 180, 0.92);
  text-shadow: 0 0 12px rgba(240, 178, 90, 0.65);
  animation: glyph-fly 5.2s var(--ease) infinite;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}
.g1 { left: 18px; top: 54px; animation-delay: 0s; font-family: var(--sans); }
.g2 { left: 34px; top: 140px; animation-delay: 0.45s; font-family: var(--sans); }
.g3 { right: 24px; top: 42px; animation-delay: 0.9s; font-family: var(--sans); }
.g4 { right: 18px; top: 126px; animation-delay: 1.35s; }
.g5 { left: 8px; top: 96px; animation-delay: 1.8s; }
.g6 { right: 8px; top: 86px; animation-delay: 2.25s; }
.g7 { left: 72px; top: 8px; animation-delay: 2.7s; }
.g8 { right: 70px; top: 176px; animation-delay: 3.15s; }
.spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe7c4;
  box-shadow: 0 0 12px #ffd08a;
  animation: spark-pop 2.8s ease-in-out infinite;
}
.s1 { left: 42px; top: 38px; animation-delay: 0s; }
.s2 { right: 48px; top: 56px; animation-delay: 0.5s; }
.s3 { left: 56px; bottom: 42px; animation-delay: 1s; }
.s4 { right: 40px; bottom: 50px; animation-delay: 1.5s; }
.s5 { left: 108px; top: 22px; animation-delay: 2s; width: 3px; height: 3px; }

.veil[data-stage="analyze"] .page-sheet { animation-duration: 4.2s; }
.veil[data-stage="translate"] .orb-hero { animation-duration: 2.6s; }
.veil[data-stage="translate"] .glyph { animation-duration: 3.8s; }
.veil[data-stage="format"] .page-sheet {
  animation: page-settle 2.8s var(--ease) infinite;
}
.veil[data-stage="format"] .orb-hero {
  animation: orb-settle 2.8s var(--ease) infinite;
}

.veil .veil-kicker {
  margin: 8px 0 6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  color: #f0b24a;
  animation: kicker-glow 2.4s ease-in-out infinite;
}
.veil-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.veil-title.swap { animation: swap 0.55s var(--ease); }
.veil-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 18px 0 16px;
  color: rgba(246, 241, 232, 0.4);
  font-size: 12px;
}
.veil-steps li {
  position: relative;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s, border-color 0.4s;
}
.veil[data-stage="analyze"] .veil-steps li[data-step="analyze"],
.veil[data-stage="translate"] .veil-steps li[data-step="analyze"],
.veil[data-stage="translate"] .veil-steps li[data-step="translate"],
.veil[data-stage="format"] .veil-steps li {
  color: #ffe3b8;
}
.veil[data-stage="analyze"] .veil-steps li[data-step="analyze"],
.veil[data-stage="translate"] .veil-steps li[data-step="translate"],
.veil[data-stage="format"] .veil-steps li[data-step="format"] {
  transform: translateY(-2px);
  background: rgba(240, 178, 90, 0.14);
  border-color: rgba(240, 178, 90, 0.35);
}
.veil-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
#veil-bar {
  display: block;
  height: 100%;
  width: 12%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c45e16, #f0b24a, #ffe7c4, #f0b24a);
  background-size: 200% 100%;
  box-shadow: 0 0 16px rgba(240, 178, 90, 0.55);
  transition: width 0.6s var(--ease);
  animation: bar-shine 1.8s linear infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-left {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-right {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%); }
}
@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes orb-dance {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  18% { transform: translate(28px, -18px) scale(1.05) rotate(12deg); }
  36% { transform: translate(-10px, -34px) scale(0.96) rotate(-8deg); }
  54% { transform: translate(-30px, 6px) scale(1.08) rotate(-16deg); }
  72% { transform: translate(16px, 22px) scale(1.02) rotate(10deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}
@keyframes orb-settle {
  0%, 100% { transform: translate(0, 8px) scale(1); }
  50% { transform: translate(0, -4px) scale(1.06); }
}
@keyframes page-flip {
  0%, 100% { transform: rotateY(-8deg) rotateX(4deg) translateY(0); }
  40% { transform: rotateY(18deg) rotateX(-2deg) translateY(-6px); }
  70% { transform: rotateY(-4deg) rotateX(6deg) translateY(2px); }
}
@keyframes page-settle {
  0%, 100% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(0deg) scale(1.03); }
}
@keyframes line-write {
  0%, 12% { transform: scaleX(0.15); opacity: 0.35; }
  35%, 70% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0.2); opacity: 0.4; }
}
@keyframes glyph-fly {
  0% { opacity: 0; transform: translate(0, 12px) scale(0.6) rotate(-8deg); filter: blur(2px); }
  18% { opacity: 1; transform: translate(8px, -8px) scale(1) rotate(0deg); filter: blur(0); }
  55% { opacity: 1; transform: translate(-4px, -28px) scale(1.05); }
  100% { opacity: 0; transform: translate(0, -48px) scale(0.8); filter: blur(3px); }
}
@keyframes spark-pop {
  0%, 100% { opacity: 0.15; transform: scale(0.6); }
  40% { opacity: 1; transform: scale(1.35); }
  70% { opacity: 0.55; transform: scale(0.9); }
}
@keyframes ripple-out {
  0% { transform: scale(0.7); opacity: 0.7; }
  100% { transform: scale(3.1); opacity: 0; }
}
@keyframes star-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, -28px, 0); }
}
@keyframes kicker-glow {
  0%, 100% { text-shadow: 0 0 0 transparent; opacity: 0.85; }
  50% { text-shadow: 0 0 18px rgba(240, 178, 90, 0.55); opacity: 1; }
}
@keyframes bar-shine {
  to { background-position: 200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes veil-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes veil-out {
  to { opacity: 0; visibility: hidden; }
}
@keyframes swap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Premium logo-centric conversion scene */
.convert-scene .logo-hero {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 24px;
  object-fit: cover;
  background: #2a1460;
  z-index: 4;
  box-shadow:
    0 18px 40px rgba(42, 20, 96, 0.28),
    0 0 0 3px rgba(255, 214, 150, 0.35);
  animation: logo-pulse 3.2s var(--ease) infinite;
}
.convert-scene .swoosh {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, transparent 0 55%, #fbbf24 68%, #f59e0b 78%, transparent 88%);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60% 72%, transparent 74%);
  mask: radial-gradient(circle, transparent 58%, #000 60% 72%, transparent 74%);
  animation: spin 5.5s linear infinite;
  opacity: 0.95;
  z-index: 3;
}
.convert-doc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 102px;
  margin: -70px 0 0 -70px;
  border-radius: 8px;
  background: linear-gradient(160deg, #fff, #f4ecff 60%, #ffe8b5);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  transform: rotate(-12deg);
  z-index: 1;
  animation: doc-float 4.4s var(--ease) infinite;
  overflow: hidden;
  padding: 14px 12px;
  display: grid;
  align-content: start;
  gap: 7px;
}
.doc-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-top: 16px solid #6d28d9;
  opacity: 0.55;
}
.doc-line {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(42, 20, 96, 0.28), rgba(42, 20, 96, 0.08));
  animation: line-write 4.8s var(--ease) infinite;
}
.doc-line:nth-child(3) { width: 88%; animation-delay: 0.1s; }
.doc-line:nth-child(4) { width: 76%; animation-delay: 0.2s; }
.doc-line.short { width: 54%; animation-delay: 0.3s; }
.doc-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 18px;
  background: linear-gradient(180deg, transparent, rgba(245, 158, 11, 0.45), transparent);
  animation: scan-sweep 2.4s var(--ease) infinite;
}
.lang-chip {
  position: absolute;
  z-index: 5;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
.lang-chip.en {
  left: 8px;
  top: 18px;
  background: linear-gradient(180deg, #fff, #efe7ff);
  color: #2a1460;
  animation: chip-in 3.6s var(--ease) infinite;
}
.lang-chip.gu {
  right: 8px;
  bottom: 22px;
  background: linear-gradient(180deg, #ffe7c2, #f59e0b);
  color: #2a1460;
  font-family: var(--gujarati);
  font-size: 18px;
  animation: chip-out 3.6s var(--ease) infinite;
}
.lang-chip.arrow {
  left: 50%;
  bottom: 8px;
  margin-left: -17px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffe7c4;
  border: 1px solid rgba(255, 214, 150, 0.35);
  animation: arrow-glow 2.2s ease-in-out infinite;
}
.veil-file {
  margin: 8px 0 0;
  color: rgba(246, 241, 232, 0.7);
  font-size: 13px;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.veil[data-stage="analyze"] .convert-doc { animation-duration: 3.6s; }
.veil[data-stage="translate"] .lang-chip.en { animation-duration: 2.4s; }
.veil[data-stage="translate"] .lang-chip.gu { animation-duration: 2.4s; }
.veil[data-stage="format"] .logo-hero { animation-duration: 2.4s; }
.compact-log { opacity: 0.95; }

@keyframes logo-pulse {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  40% { transform: translate(0, -6px) scale(1.04) rotate(-2deg); }
  70% { transform: translate(0, 2px) scale(1.02) rotate(2deg); }
}
@keyframes doc-float {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-8px); }
}
@keyframes scan-sweep {
  0% { top: 8%; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 78%; opacity: 0; }
}
@keyframes chip-in {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
  50% { transform: translateY(-6px) scale(1.08); opacity: 1; }
}
@keyframes chip-out {
  0%, 100% { transform: translateY(0) scale(1.05); opacity: 1; }
  50% { transform: translateY(6px) scale(0.96); opacity: 0.8; }
}
@keyframes arrow-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
  50% { box-shadow: 0 0 18px rgba(251, 191, 36, 0.55); }
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.15); }
  50% { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18); }
}

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

@media (max-width: 1100px) {
  html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.has-job {
    padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  }
  main {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .top {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-top, 0px) * 0);
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    position: sticky;
    top: 0;
  }
  .brand { min-width: 0; gap: 8px; }
  .brand em { display: none; }
  .brand strong { font-size: 20px; }
  .logo { width: 36px; height: 36px; border-radius: 10px; }
  .steps {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    flex: none;
  }
  .steps::-webkit-scrollbar { display: none; }
  .steps li { white-space: nowrap; font-size: 11px; padding: 6px 9px; }

  .rail {
    order: 1;
    padding: 12px 12px 8px;
    overflow: visible;
  }
  .stage {
    order: 2;
    min-height: 0;
    margin: 0 12px;
    border-radius: 18px;
  }
  .editor {
    order: 3;
    padding: 8px 12px 16px;
    overflow: visible;
  }
  body:not(.has-job) .editor,
  body:not(.has-job) .compact-log,
  body:not(.has-job) #summary,
  body:not(.has-job) .stage,
  body:not(.has-job) .action-dock {
    display: none !important;
  }
  body:not(.has-job) .rail {
    min-height: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  body:not(.has-job) .upload-card {
    margin: 0;
    padding: 16px 14px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  body:not(.has-job) .upload-hero {
    padding: 20px 14px 18px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  body:not(.has-job) .upload-mark {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }
  body:not(.has-job) .upload-title {
    margin-top: 10px;
    font-size: clamp(26px, 7vw, 34px);
  }
  body:not(.has-job) .upload-hint { margin-bottom: 14px; }
  body:not(.has-job) .upload-actions {
    width: 100%;
    flex-direction: column;
  }
  body:not(.has-job) .upload-actions .primary,
  body:not(.has-job) .upload-actions .ghost {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .rail, .editor { animation: none; }
  body.has-job .rail .upload-hero { display: none; }
  body.has-job .stage {
    min-height: 58vh;
    scroll-margin-top: 12px;
    order: 1;
    margin: 0;
    border-radius: 0;
  }
  body.has-job .rail { order: 2; }
  body.has-job .editor { order: 3; }
  .stage-bar {
    position: sticky;
    top: 58px;
    z-index: 20;
    background: rgba(247, 242, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .canvas { padding: 16px 12px 28px; overflow-x: hidden; }
  .empty {
    margin: 4vh auto 2vh;
    padding: 0 8px;
  }
  .empty-title { font-size: 24px; }
  .empty-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sheet { margin: 16px auto; }
  .convert-scene .logo-hero { width: 78px; height: 78px; margin: -39px 0 0 -39px; border-radius: 20px; }
  .lang-chip { min-width: 30px; height: 30px; font-size: 13px; }

  .action-dock {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    justify-content: stretch;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent, rgba(18, 22, 31, 0.55) 28%, rgba(18, 22, 31, 0.96));
    pointer-events: none;
  }
  .action-dock .export-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
    padding: 10px;
    border-radius: 18px 18px 14px 14px;
    pointer-events: auto;
  }
  .action-dock .export-bar label { width: 100%; }
  .action-dock .export-bar select { width: 100%; font-size: 16px; }
  .action-dock #add,
  .action-dock #export,
  .action-dock #download {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .action-dock #add { grid-column: 1 / 2; }
  .action-dock #export { grid-column: 2 / 3; }
  .action-dock #download {
    grid-column: 1 / -1;
    text-align: center;
  }

  .veil-card { width: min(420px, calc(100% - 28px)); padding: 8px; }
  .veil-title { font-size: clamp(22px, 6vw, 30px); }
  .orb-wrap { width: 180px; height: 180px; }
  .orb-hero { width: 76px; height: 76px; left: 52px; top: 40px; }
  .veil-steps { gap: 6px; margin: 14px 0 12px; }
  .veil-steps li { font-size: 11px; padding: 5px 8px; }
  .panel { margin-top: 10px; }
  .queue-item { grid-template-columns: 44px minmax(0, 1fr) auto; }
  select, textarea, input { font-size: 16px; }
}

@media (max-width: 430px) {
  .steps li { padding: 5px 8px; font-size: 10.5px; }
  body:not(.has-job) .upload-card { padding: 12px; }
  body:not(.has-job) .upload-hero { padding: 16px 12px; }
  body:not(.has-job) .upload-mark { width: 64px; height: 64px; }
}
