/* Generate View + Materials Panel */

/* ── Generate / Onboarding Overlay ── */
.gen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(14px);
  color: var(--text);
}

.gen-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 50% 0%, rgba(255, 255, 255, 0.028), transparent 60%),
    radial-gradient(1000px 800px at 50% 100%, rgba(255, 255, 255, 0.014), transparent 60%),
    linear-gradient(180deg, #101010 0%, #070707 100%);
}

.gen-header {
  flex: none;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(8, 8, 8, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
}

.gen-brand {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
  color: inherit;
  background: transparent;
  border: none;
  line-height: 1;
}

.gen-brand img {
  display: block;
  width: 108px;
  height: auto;
  opacity: 0.95;
  transform: translateY(2px);
  transition: opacity 0.16s ease;
}

.gen-brand:hover img {
  opacity: 0.82;
}

.gen-back-button,
.gen-close-button {
  cursor: pointer;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  transition: 0.16s ease;
  font-family: 'Outfit', sans-serif;
}

.gen-back-button {
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gen-close-button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.gen-back-button:hover:not(:disabled),
.gen-close-button:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}

.gen-back-button:disabled,
.gen-close-button:disabled,
.gen-primary-button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Faint, almost invisible dev shortcut into the Test Roadmap graph. */
.gen-test-roadmap-button {
  cursor: pointer;
  color: var(--text-faint);
  background: transparent;
  border: none;
  padding: 6px 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.28;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.gen-test-roadmap-button:hover {
  opacity: 0.85;
  color: var(--text-soft);
}

.gen-mode-screen,
.gen-express-screen,
.gen-generating-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.gen-mode-screen {
  gap: 38px;
}

.gen-mode-screen h1,
.gen-express-panel h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
  text-align: center;
  background-image: linear-gradient(135deg, #ffffff 0%, #d7d7dc 52%, #8f9098 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.12),
    0 0 34px rgba(245, 245, 247, 0.16),
    0 14px 44px rgba(255, 255, 255, 0.08);
}

.gen-mode-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.gen-mode-card {
  width: 300px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 24px 26px 23px;
  color: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.22s cubic-bezier(0.4, 1.2, 0.5, 1), background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gen-mode-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border-color: var(--border-strong);
}

.gen-mode-card.green:hover {
  border-color: rgba(48, 209, 88, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 44px rgba(48, 209, 88, 0.12);
}

.gen-mode-card.blue:hover {
  border-color: rgba(10, 132, 255, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 44px rgba(10, 132, 255, 0.14);
}

.gen-mode-card.purple:hover {
  border-color: rgba(191, 90, 242, 0.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 44px rgba(191, 90, 242, 0.14);
}

.gen-mode-card span {
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gen-mode-card strong {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gen-mode-card.green strong {
  background-image: linear-gradient(135deg, #b9f6ca 0%, #4ade80 48%, #18c964 100%);
  text-shadow:
    0 0 10px rgba(48, 209, 88, 0.24),
    0 0 24px rgba(48, 209, 88, 0.2),
    0 10px 34px rgba(48, 209, 88, 0.16);
}

.gen-mode-card.blue strong {
  background-image: linear-gradient(135deg, #d8f3ff 0%, #5ac8fa 50%, #0a84ff 100%);
  text-shadow:
    0 0 10px rgba(90, 200, 250, 0.24),
    0 0 24px rgba(10, 132, 255, 0.2),
    0 10px 34px rgba(10, 132, 255, 0.16);
}

.gen-mode-card.purple strong {
  background-image: linear-gradient(135deg, #efd8ff 0%, #bf5af2 50%, #8e44ff 100%);
  text-shadow:
    0 0 10px rgba(191, 90, 242, 0.24),
    0 0 24px rgba(191, 90, 242, 0.2),
    0 10px 34px rgba(142, 68, 255, 0.16);
}

.gen-mode-card p,
.gen-express-panel p,
.gen-career-head p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}

.gen-express-panel {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gen-express-panel h1 {
  text-align: left;
  font-size: 40px;
}

.gen-input-area,
.gen-send-input,
.gen-profile-field textarea {
  outline: none;
  font-family: 'Outfit', sans-serif;
}

.gen-input-area {
  width: 100%;
  min-height: 150px;
  max-height: 320px;
  resize: none;
  overflow-y: auto;
  padding: 14px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 15px;
  line-height: 1.6;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.gen-input-area:focus {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(255, 255, 255, 0.05);
}

.gen-input-area::placeholder,
.gen-send-input::placeholder {
  color: var(--text-faint);
}

.gen-primary-button {
  align-self: flex-start;
  cursor: pointer;
  padding: 15px 28px;
  color: #07210e;
  background: linear-gradient(180deg, var(--completed-soft) 0%, var(--completed) 100%);
  border: none;
  border-radius: 14px;
  box-shadow:
    0 8px 24px rgba(48, 209, 88, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.gen-primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow:
    0 10px 28px rgba(48, 209, 88, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.gen-primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.gen-primary-button.full {
  width: 100%;
}

/* Locked target phase — neutral gray, non-inviting */
.gen-primary-button.is-locked,
.gen-primary-button.is-locked:disabled {
  color: var(--text-faint);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

.gen-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 18px 20px;
  --gen-profile-width: 390px;
  --gen-profile-offset: 426px;
}

.gen-profile-panel,
.gen-chat-panel,
.gen-career-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gen-chat-panel,
.gen-career-panel {
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5);
}

.gen-profile-panel {
  position: absolute;
  z-index: 2;
  top: 14px;
  bottom: 16px;
  left: 18px;
  width: var(--gen-profile-width);
  min-width: 300px;
  max-width: 540px;
  background: transparent;
  border: none;
}

.gen-profile-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  bottom: 0;
  width: 14px;
  cursor: col-resize;
}

.gen-profile-resize-handle::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 6px;
  bottom: 14px;
  width: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  opacity: 0;
  transition: 0.16s ease;
}

.gen-profile-panel:hover .gen-profile-resize-handle::after,
.gen-profile-resize-handle:hover::after,
.gen-is-resizing-profile .gen-profile-resize-handle::after {
  opacity: 1;
  background: rgba(255, 255, 255, 0.34);
}

.gen-profile-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.gen-profile-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 20px 16px;
  background: rgba(12, 12, 12, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 16px 44px rgba(0, 0, 0, 0.45);
}

.gen-profile-block h3 {
  margin: 0 0 17px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.gen-profile-completeness {
  margin-bottom: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.gen-profile-completeness span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gen-progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 99px;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(48, 209, 88, 0.08);
}

.gen-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--completed) 0%, var(--completed-soft) 100%);
  border-radius: 99px;
  box-shadow: 0 0 10px var(--completed-glow);
  transition: width 0.45s ease;
}

.gen-profile-text {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}

.gen-profile-field {
  position: relative;
  padding-left: 13px;
}

.gen-profile-field + .gen-profile-field {
  margin-top: 12px;
}

.gen-profile-field strong {
  position: absolute;
  top: 0;
  left: 13px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  pointer-events: none;
}

.gen-profile-field strong::after {
  content: ":";
}

.gen-status-dot {
  position: absolute;
  top: 10px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.gen-profile-field textarea {
  display: block;
  width: 100%;
  min-height: 25px;
  resize: none;
  overflow: hidden;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: none;
  font-size: 14px;
  line-height: 1.7;
  text-indent: var(--gen-field-indent, 0);
}

.gen-profile-field textarea:read-only {
  cursor: default;
  opacity: 0.7;
}

.gen-profile-legend {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.gen-profile-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.gen-profile-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Header + fields wrappers — layout-neutral on desktop (mobile collapses the block) */
.gen-profile-fields {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gen-profile-grip {
  display: none;
}

.gen-chat-panel,
.gen-career-panel {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.gen-chat-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 24px 24px 24px var(--gen-profile-offset);
}

.gen-message-row {
  display: flex;
  flex-direction: column;
  animation: genFadeIn 0.3s ease;
}

.gen-message-row > div {
  max-width: 82%;
  font-size: 14px;
}

.gen-message-row.bot > div {
  align-self: flex-start;
  color: var(--text);
  max-width: 74%;
}

.gen-message-row.user {
  align-items: flex-end;
}

.gen-message-row.user > div {
  align-self: flex-end;
  padding: 12px 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px 16px 5px 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  line-height: 1.5;
}

.gen-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 16px 2px 10px 10px;
}

.gen-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-soft, rgba(235, 235, 245, 0.6));
  opacity: 0.4;
  animation: genTypingBounce 1.2s ease-in-out infinite;
}

.gen-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.gen-typing-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes genTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 0.95; }
}

.gen-markdown-message {
  counter-reset: gen-markdown-step;
  padding: 2px 0;
  line-height: 1.58;
}

.gen-markdown-message h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.gen-markdown-message p {
  margin: 0;
  color: var(--text-soft);
}

.gen-markdown-message p + p {
  margin-top: 7px;
}

.gen-markdown-message strong {
  color: var(--text);
  font-weight: 700;
}

.gen-markdown-message code {
  padding: 2px 6px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92em;
}

.gen-markdown-message blockquote {
  margin: 10px 0;
  padding: 9px 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid rgba(245, 245, 247, 0.45);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.gen-markdown-message hr {
  width: 120px;
  height: 1px;
  margin: 12px 0;
  background: var(--border);
  border: 0;
}

.gen-markdown-bullet,
.gen-markdown-numbered {
  position: relative;
}

.gen-markdown-bullet {
  padding-left: 16px;
}

.gen-markdown-numbered {
  padding-left: 21px;
  counter-increment: gen-markdown-step;
}

.gen-markdown-numbered::before {
  content: counter(gen-markdown-step);
  position: absolute;
  top: 0.22em;
  left: 0;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  color: #050505;
  background: #d8d8dc;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.gen-markdown-bullet::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 4px;
  height: 4px;
  background: var(--text-faint);
  border-radius: 50%;
}

.gen-choice-stack {
  width: 84%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  animation: genFadeIn 0.3s ease;
}

.gen-choice-stack > span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gen-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
  font-family: 'Outfit', sans-serif;
}

.gen-choice:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.gen-choice.selected {
  background: #f5f5f7;
  border-color: #f5f5f7;
  color: #050505;
  box-shadow: 0 8px 24px rgba(245, 245, 247, 0.14);
}

.gen-choice.dim {
  cursor: default;
  opacity: 0.6;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.03);
  transform: none;
}

.gen-chat-footer {
  flex: none;
  padding: 14px 18px 16px var(--gen-profile-offset);
}

.gen-composer {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  padding: 13px 13px 12px 15px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.gen-composer:focus-within {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(255, 255, 255, 0.05);
}

.gen-composer-input-wrap {
  flex: 1;
  display: flex;
  min-height: 38px;
  padding: 0 0 6px;
}

.gen-send-input {
  width: 100%;
  min-height: 44px;
  max-height: 132px;
  resize: none;
  padding: 0;
  overflow-y: auto;
  color: var(--text);
  background: transparent;
  border: none;
  font-size: 14px;
  line-height: 1.5;
}

.gen-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-right: 2px;
}

.gen-voice-button,
.gen-send-button {
  display: grid;
  place-items: center;
  cursor: pointer;
  border: none;
}

.gen-voice-button {
  flex: none;
  width: 22px;
  height: 32px;
  background: transparent;
  border-radius: 0;
  transition: 0.16s ease;
}

.gen-voice-button svg {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translate(-4px, 1px);
}

.gen-voice-button:hover {
  opacity: 0.82;
}

.gen-send-button {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  background: #f5f5f7;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(245, 245, 247, 0.16);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.gen-send-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 22px rgba(245, 245, 247, 0.22);
}

.gen-send-button span {
  position: relative;
  width: 14px;
  height: 17px;
  transform: translateY(1px);
}

.gen-send-button span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 3px;
  height: 16px;
  background: #050505;
  border-radius: 999px;
  transform: translateX(-50%);
}

.gen-send-button span::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 3px solid #050505;
  border-left: 3px solid #050505;
  border-radius: 2px 0 0;
  transform: translateX(-50%) rotate(45deg);
}

.gen-status-line {
  padding: 14px;
  color: var(--text-faint);
  text-align: center;
  font-size: 12.5px;
}

.gen-status-line.purple {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.gen-career-head {
  flex: none;
  margin-top: 12px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.gen-career-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  background-image: linear-gradient(135deg, #ffffff 0%, #d7d7dc 52%, #8f9098 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.12),
    0 0 34px rgba(245, 245, 247, 0.16),
    0 14px 44px rgba(255, 255, 255, 0.08);
}

.gen-career-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 28px 32px var(--gen-profile-offset);
}

.gen-career-edge {
  flex: none;
  align-self: center;
  width: 2px;
  height: 28px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transition: background 0.4s ease, box-shadow 0.4s ease, width 0.4s ease;
}

/* Completed segment — green glowing edge, like the original roadmap's trail */
.gen-career-edge.is-done {
  width: 3px;
  background: linear-gradient(180deg, #28c95d 0%, #30d158 52%, #63e486 100%);
  box-shadow:
    0 0 6px rgba(48, 209, 88, 0.7),
    0 0 14px rgba(48, 209, 88, 0.4);
}

/* End / Total path pill — gray, muted like the closed phases */
.gen-career-total {
  flex: none;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.gen-career-total span {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 900;
  background-image: linear-gradient(135deg, #c9c9ce 0%, #9a9aa0 52%, #6c6c72 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Start pill — marked as passed: same border+glow as a selected phase, in green */
.gen-career-total.gen-career-start {
  background: var(--surface-2);
  border-width: 2px;
  border-color: rgba(48, 209, 88, 0.8);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.11),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 34px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(48, 209, 88, 0.14);
}

.gen-career-total.gen-career-start span {
  background-image: linear-gradient(135deg, #eafff2 0%, #4ade80 50%, #22a34a 100%);
  text-shadow:
    0 0 12px rgba(48, 209, 88, 0.24),
    0 0 26px rgba(74, 222, 128, 0.2);
}

.gen-career-total small {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gen-career-level {
  flex: none;
}

.gen-career-level.is-locked {
  cursor: default;
}

.gen-career-level.is-open,
.gen-career-level.is-completed {
  cursor: pointer;
}

.gen-level-card {
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 34px rgba(0, 0, 0, 0.35);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Cards are neutral gray by default; only the SELECTED card takes its phase's
   own colored border + a wide, soft glow. State is still readable from the
   colored meta text. */

/* Locked (future) phase — muted gray, non-interactive */
.gen-career-level.is-locked .gen-level-card {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.gen-career-level.is-locked h3,
.gen-career-level.is-locked .gen-level-card p {
  color: var(--text-dim);
}

/* Open / completed (non-selected) — gray border, no glow */
.gen-career-level.is-open .gen-level-card,
.gen-career-level.is-completed .gen-level-card {
  background: var(--surface-2);
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 34px rgba(0, 0, 0, 0.35);
}

/* Selected — the phase's own colored border + wide soft glow */
.gen-career-level.is-selected.is-open .gen-level-card {
  border-color: rgba(10, 132, 255, 0.85);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.11),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 34px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(10, 132, 255, 0.16);
}

.gen-career-level.is-selected.is-completed .gen-level-card {
  border-color: rgba(48, 209, 88, 0.8);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.11),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 34px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(48, 209, 88, 0.14);
}

.gen-career-level.is-selected.is-locked .gen-level-card {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.gen-level-meta {
  margin-bottom: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
}

/* Locked meta — gray */
.gen-career-level.is-locked .gen-level-meta {
  color: var(--text-faint);
}

/* Open meta — desaturated blue gradient (mirrors the yellow/green pattern) */
.gen-career-level.is-open .gen-level-meta {
  background-image: linear-gradient(135deg, #dbeaff 0%, #4da3ff 50%, #0a84ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 12px rgba(10, 132, 255, 0.28),
    0 0 26px rgba(77, 163, 255, 0.2);
}

/* Completed meta — desaturated green gradient (mirrors the neutral head/pills) */
.gen-career-level.is-completed .gen-level-meta {
  background-image: linear-gradient(135deg, #eafff2 0%, #4ade80 50%, #22a34a 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 12px rgba(48, 209, 88, 0.24),
    0 0 26px rgba(74, 222, 128, 0.2);
}

.gen-level-card h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 900;
}

.gen-level-card p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

.gen-career-footer {
  flex: none;
  padding: 16px 28px 20px var(--gen-profile-offset);
  border-top: 1px solid var(--border);
}

.gen-card {
  width: 520px;
  max-width: 90vw;
  padding: 36px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gen-title {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--text);
  font-weight: 900;
  background-image: linear-gradient(135deg, #ffffff 0%, #d7d7dc 52%, #8f9098 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.1),
    0 0 34px rgba(245, 245, 247, 0.14);
}

.gen-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
}

.gen-log {
  max-height: 210px;
  overflow-y: auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-soft);
}

.gen-log-line {
  animation: genFadeIn 0.3s ease;
}

@keyframes genFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.gen-error {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 55, 95, 0.08);
  border: 1px solid rgba(255, 55, 95, 0.3);
  color: #FF375F;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gen-retry {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 55, 95, 0.3);
  background: transparent;
  color: #FF375F;
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
}

.gen-cancel {
  align-self: center;
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
}

.gen-cancel:hover:not(:disabled) {
  color: var(--text-soft);
}

@media (max-width: 860px) {
  .gen-mode-screen,
  .gen-express-screen,
  .gen-generating-screen {
    padding: 22px;
  }

  .gen-mode-screen h1,
  .gen-express-panel h1 {
    font-size: 34px;
  }

  .gen-mode-card {
    width: min(100%, 360px);
  }

  .gen-workspace {
    padding: 12px;
  }

  /* Career Profile becomes one collapsible block floating over the chat.
     Side inset matches the chat content / composer (16px) so the edges line up. */
  .gen-profile-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
    z-index: 6;
    overflow: visible;
  }

  .gen-profile-body {
    overflow: visible;
  }

  .gen-profile-block {
    position: relative;
    max-height: 92vh;
    overflow: hidden;
    background: rgba(12, 12, 12, 0.72);
    transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* No transition while actively dragging the grip */
  body.gen-is-resizing-profile .gen-profile-block {
    transition: none;
  }

  .gen-profile-header {
    position: relative;
    cursor: pointer;
  }

  .gen-profile-header h3 {
    padding-right: 22px;
  }

  .gen-profile-header::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 2px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-faint);
    border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .gen-profile-panel.is-open .gen-profile-header::after {
    transform: rotate(-135deg);
  }

  /* Fields fill the block; the block's own height clips them (one shrinking card) */
  .gen-profile-fields {
    flex: 1;
    min-height: 0;
  }

  /* Hide the empty/partial/ready legend (and its divider) while collapsed to a header */
  .gen-profile-panel:not(.is-open) .gen-profile-legend {
    display: none;
  }

  /* Smooth spacing animation when collapsing/expanding */
  .gen-profile-block h3,
  .gen-profile-completeness {
    transition: margin-bottom 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                padding-bottom 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Compact collapsed header: tighter h3 margin, no divider under completeness bar */
  .gen-profile-panel:not(.is-open) .gen-profile-block h3 {
    margin-bottom: 6px;
  }

  .gen-profile-panel:not(.is-open) .gen-profile-completeness {
    margin-bottom: 0;
    padding-bottom: 0;
    border-color: transparent;
  }

  /* Bottom drag handle — draggable in both states, fades out when collapsed */
  .gen-profile-grip {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    cursor: grab;
    touch-action: none;
    opacity: 1;
    transition: opacity 0.28s ease;
  }

  .gen-profile-panel:not(.is-open) .gen-profile-grip {
    opacity: 0;
    pointer-events: none;
  }

  .gen-profile-grip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 36px;
    height: 4px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
  }

  .gen-profile-grip:active {
    cursor: grabbing;
  }

  .gen-profile-resize-handle {
    display: none;
  }

  .gen-chat-panel,
  .gen-career-panel {
    display: flex;
  }

  .gen-chat-panel,
  .gen-career-panel,
  .gen-workspace {
    flex-direction: column;
  }

  .gen-chat-scroll,
  .gen-chat-footer,
  .gen-career-list,
  .gen-career-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Push chat/career content below the floating collapsed header (measured in JS) */
  .gen-chat-scroll,
  .gen-career-list {
    padding-top: calc(var(--gen-collapsed-h, 118px) + 12px);
  }

  .gen-message-row.bot > div,
  .gen-message-row > div,
  .gen-choice-stack {
    max-width: 100%;
    width: 100%;
  }
}

/* ── Library Dropdown ── */
.library-btn {
  position: fixed; top: 16px; left: 16px; z-index: 500;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.library-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }

.library-panel {
  position: fixed; top: 64px; left: 16px; z-index: 500;
  width: 280px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  backdrop-filter: blur(20px);
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.library-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  border: none; background: transparent;
  text-align: left; width: 100%;
  font-family: 'Outfit', sans-serif;
}
.library-item:hover { background: var(--surface); }
.library-item.active { background: var(--surface-strong); }
.library-item-title {
  font-family: var(--font-heading);
  flex: 1;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.library-item-date {
  font-size: 10px; color: var(--text-faint);
}
.library-item-del {
  width: 24px; height: 24px;
  border-radius: 6px; border: none;
  background: transparent;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.library-item-del:hover { background: rgba(255, 55, 95, 0.1); color: #FF375F; }
.library-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  margin-top: 4px;
}
.library-new:hover { background: var(--surface); color: var(--text); }

/* ── Materials Overlay ── */
.mat-overlay {
  position: fixed; inset: 0; z-index: 8000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}
.mat-panel {
  width: 500px; max-width: 90vw; max-height: 80vh;
  border-radius: 20px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.mat-header {
  display: flex; align-items: center; justify-content: space-between;
}
.mat-title {
  font-family: var(--font-heading);
  font-size: 22px; color: var(--text);
  font-weight: 900;
}
.mat-close {
  width: 32px; height: 32px;
  border-radius: 8px; border: none;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
}
.mat-close:hover { background: var(--surface-2); }
.mat-loading {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  padding: 40px 0;
  color: var(--text-soft);
  font-size: 13px;
}
.mat-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--text-soft);
  border-radius: 50%;
  animation: matSpin 0.7s linear infinite;
}
@keyframes matSpin { to { transform: rotate(360deg); } }
.mat-list { display: flex; flex-direction: column; gap: 10px; }
.mat-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.mat-item-icon { font-size: 20px; margin-top: 2px; }
.mat-item-body { flex: 1; min-width: 0; }
.mat-item-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
}
.mat-item-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.mat-badge {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mat-free { background: rgba(48, 209, 88, 0.1); color: #30D158; }
.mat-item-desc {
  font-size: 12px; color: var(--text-soft); line-height: 1.5;
}
.mat-search-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
}
.mat-search-btn:hover { background: var(--surface); color: var(--text); }
.mat-empty {
  text-align: center; padding: 30px;
  color: var(--text-faint); font-size: 13px;
}

/* ── Generation loading panel (live narration) ── */
.gen-generating-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(6px);
  animation: genFadeIn 0.25s ease;
}
.gen-generating {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(520px, 100%);
  padding: 26px 28px;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px rgba(0, 0, 0, 0.5);
  animation: genFadeIn 0.3s ease;
}
.gen-generating-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.gen-generating-head-text { min-width: 0; }
.gen-generating-head h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 17px;
  color: var(--text);
}
.gen-gen-step {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}
.gen-gen-bar {
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}
.gen-gen-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--completed) 0%, var(--completed-soft) 100%);
  box-shadow: 0 0 10px var(--completed-glow);
  animation: genGenIndeterminate 1.4s ease-in-out infinite;
}
@keyframes genGenIndeterminate {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.gen-gen-narration {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-soft);
  max-height: 180px;
  overflow-y: auto;
}
.gen-gen-narration .gen-markdown-message p { margin: 0 0 6px; }
.gen-gen-narration-placeholder {
  margin: 0;
  color: var(--text-faint);
  font-style: italic;
}
.gen-gen-caption {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ── Proforientation questionnaire (deep mode entry) ── */
.gen-questionnaire-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.gen-questionnaire {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.gen-quest-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gen-quest-head h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
}

.gen-quest-head p {
  margin: 0;
  color: var(--text-faint);
  font-size: 14px;
}

.gen-quest-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gen-quest-q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.gen-quest-q strong {
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
}

.gen-quest-q span {
  flex: none;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gen-quest-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.gen-quest-chip {
  cursor: pointer;
  padding: 9px 15px;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease, color 0.16s ease;
}

.gen-quest-chip:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.gen-quest-chip.selected {
  background: #f5f5f7;
  border-color: #f5f5f7;
  color: #050505;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(245, 245, 247, 0.14);
}

.gen-quest-footer {
  flex: none;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(24px);
}

/* ── Mobile adjustments ── */
@media (max-width: 767px) {
  .gen-card { padding: 28px 20px; }
  .gen-input-row { flex-direction: column; }
  .library-btn { top: auto; bottom: 16px; left: 16px; }
  .library-panel { top: auto; bottom: 64px; left: 16px; }
  .mat-panel { padding: 20px; }
  .gen-generating { padding: 22px 20px; }
  .gen-questionnaire { padding: 24px 18px 16px; gap: 22px; }
  .gen-quest-head h1 { font-size: 25px; }
  .gen-quest-footer { padding: 12px 18px 16px; }
}
