/* Ethan's Invention Lab — Modern Young-Engineer Design Studio (Zero External CDN Dependencies) */
:root {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --navy: #0F172A;
  --navy-mid: #1E293B;
  --ink: #0F172A;
  --ink-soft: #475569;
  --border: #CBD5E1;
  --border-strong: #94A3B8;
  --blue: #0284C7;
  --blue-dark: #0369A1;
  --blue-soft: #F0F9FF;
  --cyan: #06B6D4;
  --cyan-soft: #ECFEFF;
  --amber: #F59E0B;
  --amber-soft: #FFFBEB;
  --emerald: #059669;
  --emerald-soft: #ECFDF5;
  --indigo: #4F46E5;
  --indigo-soft: #EEF2FF;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --font-display: 'Avenir Next', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle CAD drafting grid background */
.lab-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.09), transparent 38%),
    radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.08), transparent 34%);
  background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%;
}

.hidden { display: none !important; }

/* Header */
.lab-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border-bottom: 3px solid #0EA5E9;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.brand-sub {
  margin: 1px 0 0;
  font-size: 0.78rem;
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #38BDF8;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px #34D399;
}

/* Crisp Studio Buttons */
.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

.studio-btn:hover:not(:disabled) { transform: translateY(-1px); }
.studio-btn:active:not(:disabled) { transform: translateY(1px); }
.studio-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-large {
  font-size: 1.04rem;
  padding: 13px 24px;
  border-radius: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 5px 14px rgba(2, 132, 199, 0.4); }

.btn-amber {
  background: #F59E0B;
  color: #0F172A;
}
.btn-amber:hover:not(:disabled) { background: #FBBF24; }

.btn-emerald {
  background: #059669;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}
.btn-emerald:hover:not(:disabled) { background: #10B981; }

.btn-outline {
  background: #FFFFFF;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover:not(:disabled) { background: #F8FAFC; border-color: var(--navy); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.28);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.2); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #FCA5A5;
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #FFFFFF; border-color: var(--danger); }

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0F172A;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Main container */
.lab-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

/* Step Tracker */
.step-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.86rem;
}

.step-pill .step-num {
  padding: 2px 7px;
  border-radius: 999px;
  background: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
}

.step-pill.active {
  border-color: var(--navy);
  background: var(--navy);
  color: #FFFFFF;
}

.step-pill.active .step-num {
  background: #38BDF8;
  color: #0F172A;
}

.step-pill.done {
  border-color: #6EE7B7;
  background: var(--emerald-soft);
  color: #065F46;
}

.step-pill.done .step-num {
  background: var(--emerald);
  color: #FFFFFF;
}

.step-line {
  width: 28px;
  height: 2px;
  background: var(--border);
}

/* Chief Engineer Briefing Bar */
.mentor-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 5px solid #0284C7;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.mentor-badge-icon { flex-shrink: 0; }

.mentor-kicker {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--blue);
  margin-bottom: 2px;
}

.mentor-copy p {
  margin: 0;
  font-size: 0.99rem;
  font-weight: 600;
  color: var(--ink);
}

/* Main Cards */
.lab-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.section-hint {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* Idea Textarea */
.idea-box-wrap {
  border: 2px solid var(--border);
  border-radius: 14px;
  background: #F8FAFC;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.idea-box-wrap:focus-within {
  background: #FFFFFF;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.14);
}

.idea-textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1.06rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  padding: 15px 17px 8px;
}

.idea-textarea::placeholder { color: #94A3B8; }

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 14px 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.mini-clear-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
}
.mini-clear-btn:hover { background: #E2E8F0; color: var(--ink); }

/* Chips */
.starter-row, .quick-adds-wrap, .upgrade-chips-wrap { margin-top: 16px; }

.starter-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

.spark-chip {
  background: #F8FAFC;
  color: #0F172A;
  border: 1.5px solid #CBD5E1;
  border-radius: 999px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.spark-chip:hover {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-color: #38BDF8;
}

.spark-chip.added {
  background: var(--navy);
  color: #FFFFFF;
  border-color: var(--navy);
}

/* Style Picker */
.style-picker-block { margin-top: 22px; }

.picker-label {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.style-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #F8FAFC;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
}

.style-card:hover { border-color: var(--blue); background: #FFFFFF; }

.style-card.active {
  border-color: var(--navy);
  background: var(--blue-soft);
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.16);
}

.style-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
}

.style-desc {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 500;
  text-align: center;
}

.action-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 10px;
  margin-left: auto;
}
.text-link-btn:hover { color: var(--blue); text-decoration: underline; }

/* Coach Panel */
.spec-tag {
  display: inline-block;
  background: var(--navy);
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.tag-amber { background: #FEF3C7; color: #92400E; }

.coach-intro { margin: 0 0 14px; font-size: 0.98rem; color: var(--ink-soft); }

.coach-questions { display: grid; gap: 10px; margin-bottom: 16px; }

.coach-q-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-left: 4px solid #0284C7;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.98rem;
}

.coach-q-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--navy);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Loading */
.loading-card { text-align: center; padding: 44px 24px; }
.gear-loader { margin-bottom: 14px; }
.spin-slow { animation: spin360 2.4s linear infinite; }
@keyframes spin360 { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.loading-title { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.38rem; font-weight: 800; }
.loading-sub { margin: 0 auto 20px; max-width: 460px; color: var(--ink-soft); font-weight: 500; }
.loading-bar { max-width: 380px; height: 10px; margin: 0 auto; border-radius: 999px; background: #E2E8F0; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 20%; background: linear-gradient(90deg, #0284C7, #06B6D4, #10B981); transition: width 0.5s ease; }

/* Result Workspace */
.invention-hero-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.version-pill {
  display: inline-block;
  background: var(--navy);
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 11px;
  border-radius: 7px;
  margin-bottom: 6px;
}

.invention-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.invention-tagline {
  margin: 4px 0 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--blue-dark);
}

.export-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.export-bar .studio-btn { font-size: 0.88rem; padding: 8px 13px; }

/* Two-column Result Layout */
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1.14fr);
  gap: 20px;
  align-items: start;
}

.visual-card { padding: 16px; }

.image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  background: #0F172A;
  display: grid;
  place-items: center;
}

.image-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.image-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.76);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
}

.mini-spinner {
  width: 34px;
  height: 34px;
  border: 3.5px solid rgba(255,255,255,0.28);
  border-top-color: #38BDF8;
  border-radius: 50%;
  animation: spin360 0.8s linear infinite;
}

.restyle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.restyle-label { font-size: 0.84rem; font-weight: 700; color: var(--ink-soft); }
.restyle-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.restyle-btn {
  border: 1.5px solid var(--border);
  background: #F8FAFC;
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 11px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.restyle-btn:hover { border-color: var(--navy); }
.restyle-btn.active { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }

.words-recap {
  margin-top: 14px;
  padding: 12px 14px;
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.recap-label {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.recap-text { margin: 0; font-size: 0.92rem; color: var(--ink); }

/* Revision Strip */
.timeline-card { padding: 16px; }
.timeline-header { margin-bottom: 10px; }
.timeline-header h3 { margin: 0; font-family: var(--font-display); font-size: 1.02rem; font-weight: 800; }
.timeline-hint { font-size: 0.8rem; color: var(--ink-soft); }

.version-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }

.version-thumb-wrap {
  position: relative;
  flex: 0 0 116px;
}

.version-thumb {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #F8FAFC;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.14s ease;
}

.version-thumb:hover { border-color: var(--blue); }
.version-thumb.active { border-color: var(--navy); background: var(--blue-soft); }

.version-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 5px;
}

.version-thumb-tag { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 800; color: var(--ink); }
.version-thumb-note { font-size: 0.74rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ver-del-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  background: rgba(15, 23, 42, 0.82);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s ease;
}
.ver-del-btn:hover { background: var(--danger); }

/* Engineering Plan Blocks */
.plan-card { display: grid; gap: 13px; padding: 18px; }

.plan-block {
  border: 1.5px solid var(--border);
  border-left-width: 4px;
  border-radius: 13px;
  padding: 13px 15px;
}

.plan-block h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 800;
}

.plan-block p { margin: 0; font-size: 0.95rem; }

.block-slate { background: #F8FAFC; border-left-color: #334155; }
.block-blue { background: var(--blue-soft); border-left-color: #0284C7; }
.block-cyan { background: var(--cyan-soft); border-left-color: #0891B2; }
.block-amber { background: var(--amber-soft); border-left-color: #D97706; }
.block-emerald { background: var(--emerald-soft); border-left-color: #059669; }
.block-indigo { background: var(--indigo-soft); border-left-color: #4F46E5; }
.block-sky { background: #F0F9FF; border-left-color: #0EA5E9; }

.sub-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  margin: 10px 0 6px;
}
.plan-block .sub-label:first-of-type { margin-top: 2px; }

.eng-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.eng-steps li { font-size: 0.94rem; }

.feature-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.feature-badge {
  background: #FFFFFF;
  border: 1.5px solid #67E8F9;
  color: #155E75;
  border-radius: 8px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.materials-list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.materials-list li {
  background: #FFFFFF;
  border: 1.5px solid #6EE7B7;
  color: #065F46;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.materials-real li {
  border-color: #94A3B8;
  color: #1E293B;
}

.challenge-hint { font-size: 0.84rem !important; color: var(--ink-soft); margin-bottom: 8px !important; }
.challenge-list { margin: 0; padding-left: 19px; display: grid; gap: 6px; font-size: 0.94rem; }

/* Iterate Card */
.iterate-card {
  margin-top: 20px;
  border-top: 4px solid #F59E0B;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-panel {
  width: 100%;
  max-width: 640px;
  max-height: 84vh;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  padding: 22px;
}

.modal-small { max-width: 420px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.modal-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.32rem; font-weight: 800; }

.modal-head-actions { display: flex; align-items: center; gap: 8px; }

.mini-danger-btn {
  border: 1.5px solid #FCA5A5;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 5px 11px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.mini-danger-btn:hover { background: var(--danger); color: #FFFFFF; }

.close-x-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: #F8FAFC;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.modal-sub { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.92rem; }

.name-text-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.shelf-list { display: grid; gap: 10px; }

.shelf-item {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 10px 12px;
  background: #F8FAFC;
}

.shelf-item img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.shelf-info { flex: 1; min-width: 0; }
.shelf-title { font-family: var(--font-display); font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-meta { font-size: 0.82rem; color: var(--ink-soft); }
.shelf-btns { display: flex; gap: 6px; }

.shelf-open-btn {
  border: 1.5px solid var(--navy);
  background: var(--navy);
  color: #FFFFFF;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.shelf-del-btn {
  border: 1.5px solid #FCA5A5;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 8px;
  padding: 6px 11px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.shelf-del-btn:hover { background: var(--danger); color: #FFFFFF; }

.shelf-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-soft);
  font-weight: 500;
  border: 1.5px dashed var(--border-strong);
  border-radius: 13px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--navy);
  color: #FFFFFF;
  border: 1.5px solid #38BDF8;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
}

.btn-indigo {
  background: var(--indigo);
  color: #FFFFFF;
  border-color: var(--indigo);
}
.btn-indigo:hover { background: #4338CA; border-color: #4338CA; }

/* Slide Deck Studio Modal */
.deck-modal-panel {
  max-width: 980px;
  width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deck-export-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-stage-shell {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.deck-preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #0F172A;
}

.deck-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.deck-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.deck-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 0;
  background: #CBD5E1;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}

.deck-dot.active {
  background: var(--indigo);
  transform: scale(1.25);
}

.deck-counter {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.print-only-header, .print-sketch-box { display: none; }

@media (max-width: 880px) {
  .result-grid { grid-template-columns: 1fr; }
  .invention-title { font-size: 1.62rem; }
}

@media (max-width: 600px) {
  .style-cards { grid-template-columns: 1fr; }
  .step-label { display: none; }
  .lab-card { padding: 18px; }
}

@media print {
  body { background: #FFFFFF !important; font-size: 11pt; }
  .no-print, .lab-bg { display: none !important; }
  .lab-main { max-width: 100%; padding: 0; }
  .print-only-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0F172A;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .print-kicker { font-family: var(--font-mono); font-weight: 800; font-size: 11pt; }
  .print-meta { display: flex; gap: 14px; font-size: 9.5pt; }
  .result-grid { display: grid; grid-template-columns: 38% 60%; gap: 14px; }
  .lab-card { box-shadow: none !important; border: 1.5px solid #334155; padding: 10px; margin-bottom: 10px; break-inside: avoid; }
  .plan-block { padding: 8px 10px; break-inside: avoid; }
  .invention-title { font-size: 17pt; }
  .print-sketch-box {
    display: block;
    border: 1.5px dashed #64748B;
    border-radius: 10px;
    height: 115px;
    padding: 8px 10px;
    margin-top: 6px;
  }
  .print-sketch-title { font-size: 9.5pt; font-weight: 700; color: #475569; }
}
