:root {
  --ink: #0c0e12;
  --ink-soft: #2a2f3a;
  --paper: #fdfaf3;
  --panel: #ffffff;
  --line: #e6dccb;
  --teal: #0f9f8f;
  --teal-deep: #066b62;
  --teal-soft: #c6f1ea;
  --coral: #ff3b6f;
  --coral-deep: #d11e51;
  --amber: #ffb547;
  --amber-deep: #f08a00;
  --violet: #6c5cff;
  --violet-deep: #4a39d6;
  --muted: #6b6f7b;
  --shadow-card: 0 24px 60px -18px rgba(12, 14, 18, 0.28);
  --shadow-primary: 0 18px 36px -10px rgba(255, 59, 111, 0.42);
  --shadow-pop: 0 22px 48px -12px rgba(108, 92, 255, 0.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-pill: 999px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 720px at 8% -6%, rgba(108, 92, 255, 0.22), transparent 62%),
    radial-gradient(900px 760px at 108% 4%, rgba(255, 59, 111, 0.18), transparent 60%),
    radial-gradient(900px 800px at 60% 110%, rgba(15, 159, 143, 0.22), transparent 60%),
    linear-gradient(180deg, #fdfaf3 0%, #f6efe1 100%);
  color: var(--ink);
  font-family:
    "Microsoft JhengHei",
    "PingFang TC",
    "Noto Sans TC",
    system-ui,
    sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmin;
  background:
    radial-gradient(380px 380px at 22% 18%, rgba(108, 92, 255, 0.18), transparent 60%),
    radial-gradient(420px 420px at 82% 72%, rgba(255, 181, 71, 0.22), transparent 60%);
  filter: blur(20px);
  z-index: -1;
  animation: floatBg 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes floatBg {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(4deg); }
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px clamp(20px, 3vw, 40px) 24px;
  display: flex;
  flex-direction: column;
}

/* View switching */

body:not(.view-welcome) #welcomeView,
body:not(.view-choice) #choiceView,
body:not(.view-show) #workspaceShow,
body:not(.view-ask) #workspaceAsk {
  display: none !important;
}

body.view-show #workspaceShow,
body.view-ask #workspaceAsk {
  margin-top: 18px;
  flex: 1 1 auto;
  min-height: 0;
}

body.view-welcome #welcomeView,
body.view-choice #choiceView {
  flex: 1 1 auto;
  min-height: 0;
}

/* User-mode minimal topbar: only logos (+ optional back button) */

body.user-mode .topbar {
  grid-template-columns: 1fr auto;
  padding: 14px 22px;
}

body.user-mode .product-title,
body.user-mode .mode-toggle,
body.user-mode .run-status,
body.user-mode .topbar::after {
  display: none !important;
}

body.user-mode .brand-logo-liveabc {
  width: 118px;
  height: 40px;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr) auto;
  gap: 28px;
  align-items: center;
  padding: 22px 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(108, 92, 255, 0.0), rgba(108, 92, 255, 0.16) 40%, rgba(255, 59, 111, 0.18) 60%, rgba(15, 159, 143, 0.12));
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.7;
}

.brand-lockup {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
  z-index: 1;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-logo-liveabc {
  width: 148px;
  height: 52px;
}

.product-title {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.product-title span,
.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(108, 92, 255, 0.16), rgba(255, 59, 111, 0.16));
  color: var(--violet-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  background: linear-gradient(135deg, rgba(15, 159, 143, 0.16), rgba(255, 181, 71, 0.18));
  color: var(--teal-deep);
}

.product-title strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(120deg, #121417 30%, #4a39d6 70%, #ff3b6f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.title-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #ffffff;
  text-transform: uppercase;
  box-shadow: 0 8px 18px -10px rgba(12, 14, 18, 0.4);
}

.tag-coral {
  background: linear-gradient(135deg, var(--coral), #ff7a5b);
}

.tag-coral::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
  animation: pulseDot 1.6s ease-in-out infinite;
}

.tag-violet {
  background: linear-gradient(135deg, var(--violet), #a07bff);
}

.heading-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-badge {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ink), #2a2f3a);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 26px -12px rgba(12, 14, 18, 0.55);
  flex-shrink: 0;
}

.session-panel .step-badge {
  background: linear-gradient(135deg, var(--teal), var(--violet));
  box-shadow: 0 14px 26px -10px rgba(15, 159, 143, 0.5);
}

.stage-panel .step-badge {
  background: linear-gradient(135deg, var(--violet), var(--coral));
  box-shadow: 0 14px 26px -10px rgba(108, 92, 255, 0.55);
}

.generate-panel .step-badge {
  background: linear-gradient(135deg, var(--amber), var(--coral));
  box-shadow: 0 14px 26px -10px rgba(255, 181, 71, 0.55);
}

.step-badge-accent {
  background: linear-gradient(135deg, var(--coral), var(--violet)) !important;
  box-shadow: 0 14px 26px -10px rgba(255, 59, 111, 0.55) !important;
}

.download-action {
  width: auto;
  min-width: 160px;
  background: linear-gradient(135deg, #ffffff, #f4efff);
  border-color: rgba(108, 92, 255, 0.28);
  color: var(--violet-deep);
}

.download-action:hover {
  border-color: var(--violet);
  color: var(--violet-deep);
  box-shadow: var(--shadow-pop);
}

.download-bottom {
  width: 100%;
  margin-top: 16px;
}

.run-status {
  position: relative;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-self: end;
  min-width: 168px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(15, 159, 143, 0.28);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ffffff, #ebfff9);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  z-index: 1;
}

.top-actions {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-self: end;
  z-index: 1;
}

.mode-toggle {
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid rgba(12, 14, 18, 0.12);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
  box-shadow: 0 8px 20px -10px rgba(12, 14, 18, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mode-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(12, 14, 18, 0.3);
}

.mode-toggle[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #ffffff;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.18);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(15, 159, 143, 0.05); }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(520px, 1.65fr) minmax(300px, 0.95fr);
  grid-template-rows: auto minmax(380px, 1fr);
  gap: 22px;
  margin-top: 24px;
}

/* 秀秀 AI (user mode) — single centered column: 拍照 → 選擇作品 → 結果.
   基本資料 panel removed (name comes from the welcome step); camera + file shown
   together with no source toggle / QR. */
.user-mode .workspace {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  max-width: 720px;
  margin: 24px auto 0;
}

.user-mode .session-panel {
  display: none;
}

.user-mode .stage-panel,
.user-mode .generate-panel,
.user-mode .result-panel {
  grid-column: 1;
  grid-row: auto;
  margin-top: 0;
  align-self: start;
}

/* no "本機 / 手機 / Webcam" toggle and no QR upload */
.user-mode .segmented-control {
  display: none !important;
}

/* camera + file upload stacked together */
.user-mode .capture-grid {
  grid-template-columns: 1fr;
  min-height: 0;
}

.user-mode .capture-view {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  place-items: stretch;
}

.user-mode #webcamMode,
.user-mode #fileMode {
  display: grid !important;
}

.user-mode #webcamMode {
  min-height: 320px;
}

.user-mode #fileMode {
  min-height: 0;
}

/* Native photo buttons — shown only on phones/tablets (see touch media query below). */
.mobile-photo {
  display: none;
}

.mobile-photo .photo-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.mobile-photo .photo-pick.cam {
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, var(--violet), var(--coral));
  box-shadow: var(--shadow-primary);
}

/* Phones / tablets (touch, no hover): getUserMedia webcam needs an HTTPS/secure context that a
   LAN/HTTP test lacks. Hide the webcam UI in BOTH flows and use the device's native camera /
   photo library via the buttons above. PC (mouse) keeps the 啟動鏡頭 webcam. */
@media (hover: none) and (pointer: coarse) {
  .user-mode #webcamMode,
  .user-mode #fileMode,
  .ask-webcam {
    display: none !important;
  }
  /* but DO show the photo frame once a picture is taken/picked, to preview it */
  .ask-camera-stage.preview-on {
    display: block !important;
  }
  .mobile-photo {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* Insecure context (plain HTTP, non-localhost): getUserMedia can't run on any device, so fall
   back to the native file/camera buttons everywhere — same treatment as the touch case. */
body.insecure-ctx .user-mode #webcamMode,
body.insecure-ctx .user-mode #fileMode,
body.insecure-ctx .ask-webcam {
  display: none !important;
}

body.insecure-ctx .ask-camera-stage.preview-on {
  display: block !important;
}

body.insecure-ctx .mobile-photo {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.user-mode #webcamVideo,
.user-mode #captureCanvas {
  max-width: 420px;
}

.user-mode .portrait-frame {
  min-height: 300px;
}

.user-mode .dev-only {
  display: none !important;
}

.dev-mode .dev-only {
  display: revert;
}

/* selectors removed from 選擇作品 (輸出類型 / 文字) — kept in DOM, hidden */
.side-panel,
.stage-panel,
.result-panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.side-panel::before,
.stage-panel::before,
.result-panel::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 60%;
  height: 60%;
  background: radial-gradient(closest-side, rgba(108, 92, 255, 0.18), transparent);
  pointer-events: none;
}

.side-panel {
  padding: 26px;
}

.session-panel {
  grid-row: 1 / span 2;
}

.session-panel::after {
  content: "";
  position: absolute;
  bottom: -50%;
  left: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(15, 159, 143, 0.18), transparent);
  pointer-events: none;
}

.generate-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.generate-panel::after {
  content: "";
  position: absolute;
  bottom: -40%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(255, 181, 71, 0.22), transparent);
  pointer-events: none;
}

.stage-panel {
  grid-column: 2;
  padding: 28px;
}

.result-panel {
  grid-column: 2;
  padding: 28px;
}

.panel-heading,
.stage-top,
.result-heading {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  z-index: 1;
}

h1,
h2 {
  margin: 10px 0 0;
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.field,
.data-block,
.prompt-box {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.dev-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.field span,
.data-block span,
.prompt-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 12px;
}

input,
select {
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

input::placeholder {
  color: #b9b3a3;
  font-weight: 600;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(15, 159, 143, 0.18);
  transform: translateY(-1px);
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: #1a1d22;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.data-block {
  padding: 14px 16px;
  border: 1px solid rgba(108, 92, 255, 0.18);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #f6f4ff, #ffffff);
}

.data-block strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 900;
}

.primary-action,
.ghost-action,
.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-md);
  font-weight: 900;
  letter-spacing: 0.04em;
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.primary-action {
  position: relative;
  width: 100%;
  min-height: 66px;
  margin-bottom: 16px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--ink), #2b2f3a);
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 18px 36px -12px rgba(12, 14, 18, 0.4);
  overflow: hidden;
}

.primary-action::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.primary-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 44px -14px rgba(12, 14, 18, 0.5);
}

.primary-action:hover::before {
  transform: translateX(100%);
}

.primary-action:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.5;
  box-shadow: none;
}

.primary-action:disabled:hover {
  transform: none;
  box-shadow: none;
}

#generateButton {
  background: linear-gradient(135deg, var(--coral), var(--violet));
  box-shadow: var(--shadow-primary);
}

#generateButton:hover {
  box-shadow: 0 24px 50px -10px rgba(255, 59, 111, 0.55);
}

#newSessionButton {
  background: linear-gradient(135deg, var(--teal), var(--violet));
  box-shadow: 0 18px 36px -12px rgba(15, 159, 143, 0.5);
}

#newSessionButton:hover {
  box-shadow: 0 24px 44px -10px rgba(15, 159, 143, 0.6);
}

.primary-action.compact {
  width: auto;
  margin: 0;
  padding: 0 26px;
  min-height: 56px;
  font-size: 16px;
}

.ghost-action {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 1.5px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
}

.ghost-action:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  color: var(--teal-deep);
  box-shadow: 0 14px 28px -14px rgba(15, 159, 143, 0.35);
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(12, 14, 18, 0.08);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 2px 6px rgba(12, 14, 18, 0.05);
}

.segment {
  min-height: 50px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
}

.segment:hover {
  color: var(--ink);
}

.segment.active {
  background: linear-gradient(135deg, var(--teal), var(--violet));
  color: #ffffff;
  box-shadow: 0 12px 24px -10px rgba(15, 159, 143, 0.55);
}

.capture-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(240px, 0.78fr);
  gap: 22px;
  min-height: 360px;
}

.capture-view,
.portrait-preview {
  min-width: 0;
}

.capture-view {
  position: relative;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(108, 92, 255, 0.18);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(155deg, rgba(108, 92, 255, 0.12), rgba(255, 181, 71, 0.1) 50%, rgba(15, 159, 143, 0.12)),
    #ffffff;
  overflow: hidden;
}

.upload-mode {
  display: none;
  width: 100%;
  min-height: 340px;
  padding: 24px;
  place-items: center;
}

.upload-mode.active {
  display: grid;
}

#webcamVideo,
#captureCanvas {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 4 / 3;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: #0a0c10;
  object-fit: cover;
}

#captureCanvas {
  display: none;
}

.camera-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  margin-top: 18px;
}

.camera-actions .ghost-action {
  width: auto;
  min-width: 160px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 10px;
  width: min(440px, 100%);
  min-height: 240px;
  padding: 24px;
  border: 2.5px dashed rgba(108, 92, 255, 0.42);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 255, 0.92));
  color: var(--violet-deep);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.dropzone:hover {
  transform: translateY(-2px);
  border-color: var(--coral);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 240, 246, 0.94));
}

.dropzone span {
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}

.dropzone strong {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.16em;
}

#photoInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.portrait-preview {
  display: grid;
  gap: 14px;
  align-content: start;
}

.portrait-frame {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border: 1.5px solid rgba(15, 159, 143, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(108, 92, 255, 0.14), transparent 50%),
    linear-gradient(0deg, rgba(255, 181, 71, 0.12), transparent 40%),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

#portraitImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#portraitImage.has-image {
  opacity: 1;
}

.silhouette-guide {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 58%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2.5px dashed rgba(255, 255, 255, 0.88);
  border-radius: 48% 48% 42% 42%;
  box-shadow:
    0 0 0 999px rgba(12, 14, 18, 0.22),
    inset 0 0 0 2px rgba(12, 14, 18, 0.18);
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid rgba(15, 159, 143, 0.22);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #ffffff, #ebfff9);
}

.preview-meta strong,
.preview-meta span {
  overflow-wrap: anywhere;
}

.preview-meta strong {
  font-size: 17px;
  font-weight: 900;
}

.preview-meta span {
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.prompt-box {
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #fffdf6, #ffffff);
}

.prompt-box p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 18px;
  border: 1.5px solid rgba(108, 92, 255, 0.18);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(closest-side at 30% 30%, rgba(15, 159, 143, 0.16), transparent 65%),
    radial-gradient(closest-side at 70% 70%, rgba(255, 59, 111, 0.14), transparent 65%),
    #ffffff;
  overflow: hidden;
}

/* width/height both auto + max-* keeps the canvas's own aspect ratio (AI output shape varies);
   a fixed width with max-height used to squash tall posters on laptop screens. */
#resultCanvas {
  display: block;
  width: auto;
  max-width: min(100%, 580px);
  height: auto;
  max-height: 72vh;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: 0 28px 60px -18px rgba(12, 14, 18, 0.35);
}

/* Ask-AI result poster — fit responsively just like the 秀秀 AI canvas. */
#askResultCanvas {
  display: block;
  width: auto;
  max-width: min(100%, 430px);
  height: auto;
  max-height: 80vh;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: 0 28px 60px -18px rgba(12, 14, 18, 0.35);
}

/* Ask AI camera stage */

.silhouette-guide-mobile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 2.5px dashed rgba(255, 255, 255, 0.78);
  border-radius: 48% 48% 42% 42%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  pointer-events: none;
}

.camera-placeholder strong {
  font-size: 19px;
  font-weight: 900;
}

.camera-placeholder span {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.06em;
}

.camera-start {
  background: linear-gradient(135deg, var(--violet), var(--teal)) !important;
  box-shadow: 0 18px 36px -10px rgba(108, 92, 255, 0.5) !important;
}

.camera-start::before {
  display: none;
}

.camera-capture {
  background: linear-gradient(135deg, var(--coral), var(--amber)) !important;
  box-shadow: 0 18px 36px -10px rgba(255, 59, 111, 0.55) !important;
  min-height: 72px;
  font-size: 20px;
}

.mobile-dropzone-alt {
  position: relative;
  width: 100%;
  min-height: 92px;
  margin: 2px 0 14px;
  padding: 14px;
  border: 1.5px dashed rgba(108, 92, 255, 0.32);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  z-index: 1;
}

.mobile-dropzone-alt span {
  font-size: 16px;
  font-weight: 900;
  color: var(--violet-deep);
}

.mobile-dropzone-alt strong {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* Ask AI quiz */

.quiz-legend {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.quiz-option {
  display: block;
  position: relative;
  cursor: pointer;
}

.quiz-option input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quiz-option span {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 12px 18px 12px 50px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.quiz-option span::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.quiz-option span::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  background: #ffffff;
  transition: transform 0.18s ease;
}

.quiz-option input[type="radio"]:checked + span {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), var(--coral));
  color: #ffffff;
  box-shadow: 0 16px 30px -14px rgba(108, 92, 255, 0.55);
  transform: translateY(-1px);
}

.quiz-option input[type="radio"]:checked + span::before {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.18);
}

.quiz-option input[type="radio"]:checked + span::after {
  transform: translateY(-50%) scale(1);
}

.quiz-option:hover span {
  border-color: rgba(108, 92, 255, 0.45);
}

/* RWD — tablet */

@media (max-width: 1240px) {
  .workspace,
  .user-mode .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .session-panel,
  .generate-panel,
  .stage-panel,
  .result-panel,
  .user-mode .session-panel,
  .user-mode .generate-panel,
  .user-mode .stage-panel,
  .user-mode .result-panel {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .product-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .top-actions {
    justify-self: end;
  }

  .run-status {
    justify-self: stretch;
  }
}

/* RWD — phone */

@media (max-width: 720px) {
  .app-shell {
    padding: 16px 14px 28px;
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .top-actions {
    justify-self: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-actions > * {
    flex: 1 1 140px;
  }

  .brand-lockup {
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand-logo-liveabc {
    width: 124px;
    height: 42px;
  }

  .side-panel,
  .stage-panel,
  .result-panel {
    padding: 22px 18px;
    border-radius: var(--radius-lg);
  }

  .capture-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .capture-grid {
    min-height: 0;
  }

  .upload-mode {
    min-height: 280px;
    padding: 16px;
  }

  .panel-heading,
  .stage-top,
  .result-heading {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .segmented-control {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .segment {
    padding: 0 8px;
    font-size: 13.5px;
  }

  .camera-actions {
    flex-direction: column;
  }

  .camera-actions .ghost-action,
  .primary-action.compact {
    width: 100%;
  }

  .primary-action {
    min-height: 64px;
    font-size: 17px;
  }

  .ghost-action {
    min-height: 56px;
  }

  .mode-toggle {
    min-height: 50px;
  }

  .canvas-wrap {
    min-height: 360px;
    padding: 12px;
  }

  .portrait-frame {
    min-height: 280px;
  }
}

/* Welcome view */

.welcome-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.welcome-card {
  position: relative;
  width: min(640px, 100%);
  padding: 40px clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.welcome-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -25%;
  width: 70%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(108, 92, 255, 0.22), transparent);
  pointer-events: none;
}

.welcome-card::after {
  content: "";
  position: absolute;
  bottom: -40%;
  left: -25%;
  width: 70%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 181, 71, 0.22), transparent);
  pointer-events: none;
}

.welcome-card > * {
  position: relative;
  z-index: 1;
}

.welcome-card h1 {
  margin: 14px 0 18px;
  font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 900;
  line-height: 1.16;
  background: linear-gradient(120deg, #121417 30%, #4a39d6 70%, #ff3b6f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-sub {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.55;
}

.welcome-form {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.welcome-cta {
  min-height: 72px;
  font-size: 19px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--violet), var(--coral));
  box-shadow: 0 22px 48px -16px rgba(108, 92, 255, 0.55);
}

.welcome-cta:hover {
  box-shadow: 0 28px 54px -14px rgba(255, 59, 111, 0.6);
}

.welcome-foot {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* Laptop screens (~730px tall): keep 「同意並開始」 on the first screen. */
@media (min-width: 721px) and (max-height: 820px) {
  .welcome-card {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .welcome-card h1 {
    margin: 10px 0 12px;
    font-size: clamp(28px, 3.6vw, 40px);
  }

  .welcome-sub {
    margin-bottom: 16px;
  }

  .welcome-form {
    margin-bottom: 14px;
  }

  .welcome-cta {
    min-height: 60px;
    margin-bottom: 10px;
  }
}

/* Privacy consent (welcome) */

.consent-box {
  margin-bottom: 16px;
  border: 1.5px solid rgba(108, 92, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(108, 92, 255, 0.05);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.consent-text {
  padding: 14px 16px;
  max-height: 138px;
  overflow-y: auto;
}

.consent-text strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 900;
  color: var(--ink);
}

.consent-text p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--ink-soft);
}

.consent-check {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 16px;
  border-top: 1px solid rgba(108, 92, 255, 0.16);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.consent-check input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  /* undo the global text-input box (min-height 56px, padding, border) that made a tall frame around the box */
  min-height: 0;
  padding: 0;
  border: 0;
  margin: 0;
  accent-color: var(--violet);
  cursor: pointer;
}

.consent-box.consent-error {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 59, 111, 0.16);
  animation: consentShake 0.4s ease;
}

@keyframes consentShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Choice view */

.choice-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}

.choice-hero {
  width: min(780px, 100%);
  text-align: center;
}

.choice-hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.16;
  background: linear-gradient(120deg, #121417 30%, #4a39d6 70%, #ff3b6f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.choice-code {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.choice-code strong {
  margin-left: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(860px, 100%);
}

.choice-card-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 28px;
  border: none;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.choice-card-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.choice-card-button::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 80%;
  pointer-events: none;
}

.choice-ask::after {
  background: radial-gradient(closest-side, rgba(108, 92, 255, 0.32), transparent);
}

.choice-show::after {
  background: radial-gradient(closest-side, rgba(255, 181, 71, 0.32), transparent);
}

.choice-card-button:hover {
  transform: translateY(-6px);
  box-shadow: 0 32px 68px -22px rgba(12, 14, 18, 0.4);
}

.choice-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 2px;
  border-radius: 50%;
  font-size: 52px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 22px 44px -16px rgba(12, 14, 18, 0.42);
  z-index: 1;
}

.choice-ask .choice-icon {
  background: linear-gradient(135deg, var(--violet), var(--coral));
}

.choice-show .choice-icon {
  background: linear-gradient(135deg, var(--teal), var(--amber));
}

.choice-body {
  position: relative;
  z-index: 1;
  width: 100%;
}

.choice-card-button h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 900;
}

.choice-card-button p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.6;
}

.choice-cta {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.choice-ask .choice-cta {
  background: linear-gradient(135deg, var(--violet), var(--coral));
}

.choice-show .choice-cta {
  background: linear-gradient(135deg, var(--teal), var(--amber));
}

.choice-back {
  width: auto;
  min-width: 200px;
  padding: 0 28px;
}

/* Top back button (always visible inside any sub-view) */

.top-back {
  width: auto;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
}

/* Ask-AI workspace */

/* Mobile-first: the three blocks stack in one centered column (analysis → photo → result). */
.workspace-ask {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  max-width: 720px;
  width: 100%;
  margin: 24px auto 0;
}

.ask-camera-panel,
.ask-analysis-panel {
  padding: 24px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ask-quiz-panel {
  padding: 24px;
  align-self: start;
}

/* Quiz wizard (one-question-per-card) */

.quiz-wizard {
  position: relative;
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 1.5px solid rgba(108, 92, 255, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(248, 244, 255, 0.85));
  min-height: 440px;
}

.wizard-progress {
  display: flex;
  gap: 6px;
}

.wizard-dot {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(12, 14, 18, 0.08);
  transition: background 0.25s ease;
}

.wizard-dot.done {
  background: linear-gradient(90deg, var(--teal), var(--violet));
}

.wizard-dot.active {
  background: linear-gradient(90deg, var(--violet), var(--coral));
  box-shadow: 0 0 0 3px rgba(108, 92, 255, 0.15);
}

.wizard-step {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: wizardFade 0.32s ease;
}

.wizard-step.active {
  display: flex;
}

@keyframes wizardFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-step .quiz-legend {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  color: var(--ink);
}

.wizard-step textarea {
  width: 100%;
  min-height: 140px;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wizard-step textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 5px rgba(108, 92, 255, 0.18);
}

.wizard-step textarea::placeholder {
  color: #b6b0a0;
}

.wizard-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: auto;
}

.wizard-prev,
.wizard-next {
  flex: 1 1 0;
}

.wizard-prev[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

.wizard-next.is-final {
  background: linear-gradient(135deg, var(--coral), var(--violet));
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.ask-result-panel {
  padding: 24px;
  align-self: stretch;
}

/* Phase visibility — source order fixes the stack: analysis → photo → result.
   Quiz phase shows only the quiz; the result image appears only after generation. */
body.ask-phase-quiz .workspace-ask {
  max-width: 920px;
}

body.ask-phase-quiz .ask-analysis-panel,
body.ask-phase-quiz .ask-camera-panel,
body.ask-phase-quiz .ask-result-panel {
  display: none !important;
}

body.ask-phase-photo .ask-quiz-panel,
body.ask-phase-result .ask-quiz-panel {
  display: none !important;
}

/* 完成才會跳結果圖:photo 階段先把結果區藏起來 */
body.ask-phase-photo .ask-result-panel {
  display: none !important;
}

.ask-camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 8px;
  border-radius: var(--radius-lg);
  border: 1.5px solid rgba(108, 92, 255, 0.22);
  background:
    linear-gradient(160deg, rgba(108, 92, 255, 0.2), rgba(255, 181, 71, 0.12)),
    #0c0e12;
  overflow: hidden;
  box-shadow: 0 14px 32px -14px rgba(12, 14, 18, 0.4);
}

#askVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.ask-camera-stage.camera-on #askVideo {
  opacity: 1;
}

#askPreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ask-camera-stage.preview-on #askPreview {
  opacity: 1;
}

.ask-camera-stage .silhouette-guide-mobile {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ask-camera-stage.camera-on .silhouette-guide-mobile {
  opacity: 1;
}

.ask-camera-stage .camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  pointer-events: none;
}

/* Career result card */

.career-result {
  position: relative;
  padding: 18px;
  border: 1.5px solid rgba(108, 92, 255, 0.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 244, 255, 0.85));
}

.career-result .eyebrow {
  background: linear-gradient(135deg, rgba(108, 92, 255, 0.18), rgba(255, 59, 111, 0.16));
  color: var(--violet-deep);
}

.career-fit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 6px;
}

.fit-stars {
  font-size: 22px;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--amber);
}

.career-result h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.career-result p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.ask-submit {
  min-height: 70px !important;
  font-size: 18px !important;
  background: linear-gradient(135deg, var(--coral), var(--violet)) !important;
  box-shadow: var(--shadow-primary) !important;
}

/* Mobile tweaks for new views */

/* (ask workspace is a single centered column at all sizes now — no extra breakpoint needed) */

@media (max-width: 720px) {
  body.view-welcome .topbar,
  body.view-choice .topbar {
    display: none;
  }

  body.view-welcome .app-shell,
  body.view-choice .app-shell {
    padding-top: 0;
  }

  .app-shell {
    padding: 12px 12px 16px;
  }

  body.view-welcome .welcome-view,
  body.view-choice .choice-view {
    min-height: 100dvh;
    padding: 12px 0;
  }

  .welcome-card {
    padding: 22px 20px;
  }

  .welcome-card h1 {
    font-size: clamp(24px, 7.5vw, 32px);
    margin: 8px 0 12px;
  }

  .welcome-sub {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .welcome-form {
    gap: 10px;
    margin-bottom: 14px;
  }

  .welcome-cta {
    min-height: 60px;
    font-size: 16px;
    margin-bottom: 10px;
  }

  .welcome-foot {
    font-size: 12px;
  }

  .choice-hero h1 {
    font-size: clamp(22px, 6vw, 28px);
    margin: 6px 0 6px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .choice-card-button {
    padding: 18px 14px;
    gap: 12px;
    align-items: center;
    text-align: center;
  }

  .choice-body {
    width: 100%;
  }

  .choice-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
    border-radius: 50%;
    margin-bottom: 0;
  }

  .choice-card-button h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .choice-card-button p {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
  }

  .choice-cta {
    height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .choice-back {
    min-width: 0;
    width: auto;
    padding: 0 22px;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: 14px;
  }

  .product-title strong {
    font-size: 22px;
  }

  .side-panel,
  .stage-panel,
  .result-panel {
    padding: 18px 14px;
  }

  .dropzone {
    min-height: 200px;
  }

  .dropzone span {
    font-size: 19px;
  }

}

/* ---- Ask AI: Top 5 careers ---- */

.top-careers {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.top-careers .eyebrow {
  display: inline-block;
  margin-bottom: 2px;
}

.career-rank {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid rgba(108, 92, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.career-rank-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.career-rank-body strong {
  font-size: 14px;
  font-weight: 900;
}

.career-rank-body span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.career-rank-stars {
  font-size: 15px;
  letter-spacing: 1px;
  white-space: nowrap;
  color: var(--amber);
}

