:root {
  --bg: #080c09;
  --bg-2: #101711;
  --surface: #1c271e;
  --surface-2: #273429;
  --paper: #f7f3e8;
  --paper-2: #ece6d5;
  --paper-3: #fffdf7;
  --ink: #11150f;
  --ink-2: #30382f;
  --muted: #788374;
  --muted-dark: #bac4b3;
  --line: rgba(17, 21, 15, 0.14);
  --line-dark: rgba(247, 243, 232, 0.14);
  --accent: #d7ff68;
  --accent-soft: rgba(215, 255, 104, 0.16);
  --teal: #5ed2ba;
  --teal-soft: rgba(94, 210, 186, 0.18);
  --paid: #f2c66d;
  --paid-soft: rgba(242, 198, 109, 0.15);
  --danger: #ec6475;
  --danger-soft: rgba(236, 100, 117, 0.15);
  --success: #83df9b;
  --success-soft: rgba(131, 223, 155, 0.14);
  --radius: 8px;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --focus: 0 0 0 3px rgba(215, 255, 104, 0.18);
  --content: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  color: var(--paper);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(247, 243, 232, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(247, 243, 232, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 56px 56px, 56px 56px, auto;
}

.loading-shell {
  min-height: calc(100vh - 28px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  color: var(--muted-dark);
  text-align: center;
  background:
    radial-gradient(circle at 52% 26%, rgba(215, 255, 104, 0.16), transparent 24%),
    radial-gradient(circle at 28% 74%, rgba(94, 210, 186, 0.14), transparent 26%),
    var(--bg);
}

.loading-shell .brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  font-size: 22px;
  animation: ideaspro-boot-tilt 2.1s ease-in-out infinite;
}

.ideaspro-boot-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loading-shell h1 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(42px, 13vw, 76px);
  line-height: 0.9;
}

.loading-shell p:not(.ideaspro-boot-kicker) {
  margin: 0;
  max-width: 320px;
  color: var(--muted-dark);
  line-height: 1.5;
}

@keyframes ideaspro-boot-tilt {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-5px); }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand.big {
  align-items: flex-start;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(215, 255, 104, 0.28), 0 12px 28px rgba(215, 255, 104, 0.12);
}

.brand.big .brand-mark {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.brand h1,
.brand h2,
.auth-panel h2,
.empty-state h2,
.idea-card h2,
.idea-leaf h2,
.confirm-dialog h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
  line-height: 1.05;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 1.3;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: var(--content);
  margin: 0 auto 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.wallet-pill,
.user-pill {
  min-height: 42px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: rgba(247, 243, 232, 0.06);
  color: var(--paper);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.wallet-pill:hover,
.user-pill:hover,
.action-btn:hover,
.leaf-button:hover,
.draft-button:hover,
.check-toggle:hover {
  transform: translateY(-1px);
}

.wallet-pill span,
.user-pill span,
.wallet-pill strong,
.user-pill strong {
  display: block;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-pill span,
.user-pill strong {
  color: var(--muted-dark);
  font-size: 11px;
  font-weight: 760;
}

.wallet-pill strong,
.user-pill span {
  font-size: 13px;
  line-height: 1.2;
}

.wallet-pill.ready {
  border-color: rgba(215, 255, 104, 0.48);
}

.wallet-pill.insufficient,
.wallet-pill.unavailable {
  border-color: rgba(236, 100, 117, 0.58);
}

.tab-button,
.auth-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.tab-button {
  color: var(--muted-dark);
}

.tab-button.is-active {
  background: var(--paper);
  color: var(--ink);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-dark);
  font-size: 12px;
}

.status-strip span {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(247, 243, 232, 0.055);
}

.idea-stage {
  flex: 1;
  display: flex;
  min-height: 360px;
}

.empty-state,
.idea-card,
.idea-leaf {
  width: 100%;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.empty-state {
  display: grid;
  align-content: space-between;
  gap: 26px;
  padding: 28px;
  overflow: hidden;
  animation: rise 180ms ease-out;
}

.empty-copy {
  max-width: 760px;
}

.eyebrow,
.section-title,
.card-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state h2,
.idea-card h2,
.idea-leaf h2 {
  margin: 10px 0 12px;
  max-width: 860px;
  font-size: 40px;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.empty-state p,
.summary,
.deep-head p,
.confirm-dialog p {
  margin: 0;
  max-width: 780px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
}

.empty-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 760px;
}

.empty-map div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--paper-3);
}

.empty-map strong,
.empty-map span {
  display: block;
}

.empty-map strong {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}

.empty-map span {
  color: var(--ink-2);
  font-weight: 760;
}

.entry-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.entry-choice {
  min-height: 118px;
  border: 1px solid rgba(17, 21, 15, 0.12);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(17, 21, 15, 0.045);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.entry-choice:hover,
.entry-choice.is-selected {
  border-color: rgba(154, 116, 38, 0.44);
  background: rgba(224, 190, 122, 0.18);
  box-shadow: inset 0 0 0 1px rgba(224, 190, 122, 0.18);
}

.entry-choice:focus-visible {
  outline: 2px solid rgba(154, 116, 38, 0.7);
  outline-offset: 3px;
}

.entry-choice strong,
.entry-choice span {
  display: block;
}

.entry-choice strong {
  font-size: 17px;
  line-height: 1.15;
}

.entry-choice span {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.35;
}

.root-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
}

.root-preview span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
}

.root-preview .root-preview-label {
  background: var(--ink);
  color: var(--paper);
}

.idea-card,
.idea-leaf {
  padding: 24px;
  animation: rise 180ms ease-out;
}

.card-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-kicker strong {
  color: var(--ink);
}

.analysis-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.analysis-block,
.placement-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.analysis-block.lead {
  border-color: rgba(17, 21, 15, 0.22);
}

.analysis-grid p,
.placement-block p {
  margin: 7px 0 0;
  color: var(--ink-2);
  line-height: 1.5;
}

.placement-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.weak-list,
.link-list,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chip small {
  display: block;
  max-width: 420px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.chip.warn {
  border-color: rgba(189, 125, 42, 0.38);
  background: rgba(189, 125, 42, 0.1);
}

.chip.good {
  border-color: rgba(113, 142, 72, 0.38);
  background: rgba(113, 142, 72, 0.12);
}

.path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  align-items: center;
}

.path span {
  border-radius: 6px;
  padding: 7px 8px;
  background: #e2efd5;
  color: #162416;
  font-size: 13px;
}

.path i {
  color: var(--muted);
  font-style: normal;
}

.composer {
  position: sticky;
  bottom: 10px;
  z-index: 6;
  border: 1px solid rgba(247, 243, 232, 0.2);
  border-radius: var(--radius);
  background: rgba(25, 31, 26, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.billing-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-dark);
  padding: 9px 10px;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 1.35;
}

.billing-notice button {
  min-height: 32px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: transparent;
  color: var(--paper);
}

.billing-notice.insufficient {
  color: #ffb7c0;
}

.composer-inner {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.composer textarea {
  width: 100%;
  min-height: 112px;
  max-height: 230px;
  resize: vertical;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--paper);
  background: rgba(247, 243, 232, 0.065);
  outline: none;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: rgba(247, 243, 232, 0.54);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-btn {
  min-height: 42px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0 13px;
  color: var(--paper);
  background: rgba(247, 243, 232, 0.065);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.action-btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
  font-weight: 860;
}

.action-btn.free {
  border-color: rgba(131, 223, 155, 0.75);
  background: var(--success);
  color: var(--ink);
}

.action-btn.paid {
  border-color: rgba(242, 198, 109, 0.72);
  background: var(--paid-soft);
  color: #ffe2a2;
}

.action-btn.danger {
  border-color: rgba(236, 100, 117, 0.68);
  background: var(--danger-soft);
  color: #ffd1d8;
}

.action-btn.quiet {
  background: transparent;
}

.action-btn.is-busy {
  opacity: 0.68;
  cursor: progress;
}

.genius-wait-line {
  min-height: 18px;
  margin: 8px 0 0;
  color: color-mix(in srgb, var(--accent) 72%, var(--muted-dark));
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.genius-wait-phrase {
  display: inline-block;
  opacity: 0.88;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.genius-wait-phrase.is-changing {
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: reduce) {
  .genius-wait-phrase {
    transition: none;
  }

  .genius-wait-phrase.is-changing {
    transform: none;
  }
}

.error-bar,
.notice-bar {
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.4;
  font-size: 14px;
}

.error-bar {
  border: 1px solid rgba(236, 100, 117, 0.44);
  color: #ffd1d8;
  background: var(--danger-soft);
}

.notice-bar {
  border: 1px solid rgba(131, 223, 155, 0.36);
  color: #d9ffe1;
  background: var(--success-soft);
}

.tree-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted-dark);
}

.tree-summary strong {
  color: var(--paper);
  font-size: 22px;
}

.tree-view {
  display: grid;
  gap: 8px;
}

.tree-node {
  border-left: 2px solid rgba(215, 255, 104, 0.24);
  padding-left: 9px;
}

.node-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 4px 0 0;
  background: transparent;
  color: var(--paper);
  font-weight: 820;
  text-align: left;
}

.node-title span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.node-title i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  color: var(--accent);
  font-style: normal;
  font-size: 13px;
}

.node-title small {
  flex: 0 0 auto;
  color: var(--muted-dark);
  font-weight: 620;
}

.tree-children {
  display: grid;
  gap: 7px;
  margin-top: 6px;
}

.leaf-button,
.draft-button {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(247, 243, 232, 0.06);
  color: var(--paper);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.leaf-button:hover,
.draft-button:hover {
  border-color: rgba(215, 255, 104, 0.46);
}

.leaf-button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.leaf-button strong,
.draft-button strong {
  display: block;
  overflow-wrap: anywhere;
}

.leaf-button span,
.draft-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted-dark);
  font-size: 12px;
  line-height: 1.35;
}

.leaf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.leaf-toolbar,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.leaf-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.leaf-edit-form label,
.context-box,
.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.leaf-edit-form input,
.leaf-edit-form textarea,
.context-box textarea,
.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--paper-3);
  color: var(--ink);
  outline: none;
}

.leaf-edit-form textarea,
.context-box textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.deep-analysis-panel {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.deep-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.deep-head h3 {
  margin: 5px 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.deep-head p {
  font-size: 14px;
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-toggle {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--paper-3);
  color: var(--ink);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.check-toggle.is-selected {
  border-color: rgba(94, 210, 186, 0.78);
  background: var(--teal-soft);
}

.check-toggle strong,
.check-toggle span {
  display: block;
}

.check-toggle strong {
  font-size: 14px;
  line-height: 1.25;
}

.check-toggle span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.context-box {
  margin-top: 12px;
}

.context-box textarea {
  text-transform: none;
  font-weight: 520;
}

.analysis-result-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.analysis-result {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.analysis-result h3 {
  margin: 8px 0 6px;
  font-size: 20px;
  line-height: 1.2;
}

.analysis-result p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.analysis-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-left: 2px solid rgba(94, 210, 186, 0.62);
  padding-left: 10px;
}

.analysis-section div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.analysis-section span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.analysis-section ul,
.analysis-section ol {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  line-height: 1.45;
}

.empty-panel {
  margin: 0;
  color: var(--muted-dark);
  line-height: 1.45;
}

.empty-panel.light {
  color: var(--muted);
}

.draft-list {
  display: grid;
  gap: 8px;
}

.auth-shell {
  min-height: calc(100vh - 28px);
  display: grid;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: stretch;
}

.auth-hero,
.auth-panel {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(247, 243, 232, 0.06);
  box-shadow: var(--shadow);
}

.auth-hero {
  display: grid;
  align-content: space-between;
  min-height: 350px;
  padding: 26px;
  overflow: hidden;
}

.auth-hero h1 {
  font-size: 48px;
  line-height: 0.98;
}

.auth-hero p {
  max-width: 570px;
  font-size: 17px;
}

.auth-map {
  display: grid;
  gap: 8px;
  max-width: 760px;
}

.auth-map div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(16, 19, 17, 0.34);
}

.auth-map span {
  color: var(--paper);
  font-weight: 820;
}

.auth-map strong {
  color: var(--muted-dark);
  font-size: 13px;
}

.auth-panel {
  align-self: center;
  padding: 16px;
  background: var(--paper);
  color: var(--ink);
}

.auth-panel .error-bar {
  color: var(--danger);
  background: rgba(236, 100, 117, 0.08);
}

.auth-panel-head {
  margin-bottom: 12px;
}

.auth-panel-head h2 {
  margin-top: 4px;
  font-size: 24px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px;
  border-radius: var(--radius);
  background: var(--paper-2);
}

.auth-switch button {
  color: var(--muted);
}

.auth-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form input {
  min-height: 44px;
  padding: 0 12px;
}

.auth-submit {
  margin-top: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(7, 9, 8, 0.66);
  backdrop-filter: blur(10px);
}

.confirm-dialog {
  width: min(100%, 520px);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: rise 160ms ease-out;
}

.confirm-dialog h2 {
  margin-top: 6px;
  font-size: 28px;
}

.confirm-dialog p {
  margin-top: 8px;
  font-size: 15px;
}

.delete-path {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@keyframes rise {
  from {
    transform: translateY(6px);
    opacity: 0.72;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 779px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .wallet-pill span,
  .user-pill span,
  .wallet-pill strong,
  .user-pill strong {
    max-width: 102px;
  }

  .empty-state,
  .idea-card,
  .idea-leaf {
    padding: 18px;
  }

  .empty-state h2,
  .idea-card h2,
  .idea-leaf h2 {
    font-size: 30px;
  }

  .empty-map {
    grid-template-columns: 1fr;
  }

  .leaf-head,
  .deep-head {
    display: grid;
  }

  .leaf-toolbar,
  .modal-actions {
    justify-content: stretch;
  }

  .leaf-toolbar .action-btn,
  .modal-actions .action-btn,
  .action-row .action-btn {
    flex: 1 1 150px;
  }

  .auth-hero {
    min-height: 330px;
  }

  .auth-hero h1 {
    font-size: 42px;
  }

  .auth-map div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (min-width: 780px) {
  .app-shell {
    padding: 22px;
  }

  .composer-inner {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: end;
  }

  .composer textarea {
    min-height: 92px;
  }

  .action-row {
    justify-content: flex-end;
  }

  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  }

  .modal-backdrop {
    place-items: center;
  }
}

/* Messenger-style IdeasPro shell: one compact chrome, one scroll owner. */
.app-shell[data-auth="yes"] {
  height: 100svh;
  height: 100dvh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 16% -12%, rgba(215, 255, 104, 0.08), transparent 32%),
    radial-gradient(circle at 86% 8%, rgba(94, 210, 186, 0.08), transparent 30%),
    linear-gradient(180deg, #090d0a 0%, #0d130e 48%, #070a08 100%);
}

.app-shell[data-auth="yes"] .topbar {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  min-height: 62px;
  margin: 0;
  padding: 8px clamp(10px, 2vw, 22px) 16px;
  border-bottom: 1px solid rgba(247, 243, 232, 0.08);
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 0.99) 0%, rgba(7, 11, 8, 0.97) 76%, rgba(7, 11, 8, 0) 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.app-shell[data-auth="yes"] .brand-mark {
  width: 34px;
  height: 34px;
}

.app-shell[data-auth="yes"] .brand h1 {
  font-size: 20px;
}

.app-shell[data-auth="yes"] .brand p {
  margin-top: 2px;
  font-size: 11px;
}

.view-tabs {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 4px;
  border: 1px solid rgba(247, 243, 232, 0.16);
  border-radius: var(--radius);
  background: rgba(247, 243, 232, 0.085);
  backdrop-filter: blur(14px);
}

.view-tabs .tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  min-width: 0;
  padding: 0 11px;
  white-space: nowrap;
  font-size: 13px;
}

.view-tabs .tab-button span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(16, 19, 17, 0.16);
  font-size: 11px;
}

.app-shell[data-auth="yes"] .top-actions {
  justify-self: end;
}

.app-shell[data-auth="yes"] .wallet-pill,
.app-shell[data-auth="yes"] .user-pill {
  min-height: 36px;
  border-color: rgba(247, 243, 232, 0.17);
  padding: 5px 9px;
  background: rgba(18, 27, 18, 0.88);
}

.idea-center {
  flex: 1 1 auto;
  width: min(100%, 980px);
  min-height: 0;
  margin: 0 auto;
  padding: 8px clamp(10px, 2vw, 18px) 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.idea-center::-webkit-scrollbar {
  width: 10px;
}

.idea-center::-webkit-scrollbar-thumb {
  border: 3px solid var(--bg);
  border-radius: 999px;
  background: rgba(247, 243, 232, 0.2);
}

.idea-center .status-strip {
  position: sticky;
  top: 0;
  z-index: 3;
  margin-bottom: 10px;
  padding: 4px 0 8px;
  background: linear-gradient(180deg, rgba(16, 19, 17, 0.96) 0%, rgba(16, 19, 17, 0) 100%);
}

.idea-center .idea-stage {
  min-height: auto;
}

.center-panel {
  width: 100%;
  border: 1px solid rgba(247, 243, 232, 0.12);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--paper);
  background: rgba(8, 13, 9, 0.34);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  animation: rise 180ms ease-out;
}

.center-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.center-head h2 {
  margin: 5px 0 0;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.center-panel .empty-panel {
  border: 1px solid rgba(247, 243, 232, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(247, 243, 232, 0.075);
}

.center-panel .tree-summary {
  margin-bottom: 16px;
}

.center-panel .tree-view {
  gap: 10px;
}

.center-panel .leaf-button,
.center-panel .draft-button {
  background: rgba(247, 243, 232, 0.075);
}

.bottom-bar {
  position: relative;
  z-index: 9;
  flex: 0 0 auto;
  padding: 18px clamp(10px, 2vw, 22px) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(247, 243, 232, 0.08);
  background:
    linear-gradient(0deg, rgba(5, 8, 6, 0.99) 0%, rgba(7, 11, 8, 0.98) 76%, rgba(7, 11, 8, 0) 100%);
  box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.24);
}

.bottom-bar .composer {
  position: static;
  width: min(100%, 980px);
  margin: 0 auto;
  border-color: rgba(215, 255, 104, 0.22);
  background:
    linear-gradient(180deg, rgba(20, 31, 20, 0.97) 0%, rgba(13, 20, 14, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(247, 243, 232, 0.08),
    0 16px 52px rgba(0, 0, 0, 0.36);
}

.bottom-bar .billing-notice {
  padding: 7px 9px;
}

.bottom-bar .composer-inner {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
}

.bottom-bar .composer textarea {
  min-height: 58px;
  max-height: 150px;
  resize: vertical;
  border-color: rgba(247, 243, 232, 0.2);
  background: rgba(247, 243, 232, 0.09);
}

.bottom-bar .action-row {
  justify-content: flex-end;
  align-items: stretch;
  max-width: 390px;
}

.bottom-bar .action-btn {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

@media (max-width: 779px) {
  .app-shell[data-auth="yes"] {
    padding: 0;
  }

  .app-shell[data-auth="yes"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 7px 9px 13px;
  }

  .app-shell[data-auth="yes"] .brand {
    gap: 9px;
  }

  .app-shell[data-auth="yes"] .brand h1 {
    font-size: 18px;
  }

  .app-shell[data-auth="yes"] .brand p {
    display: none;
  }

  .app-shell[data-auth="yes"] .top-actions {
    gap: 5px;
  }

  .app-shell[data-auth="yes"] .wallet-pill,
  .app-shell[data-auth="yes"] .user-pill {
    min-height: 34px;
    padding: 4px 7px;
  }

  .app-shell[data-auth="yes"] .wallet-pill span,
  .app-shell[data-auth="yes"] .user-pill span,
  .app-shell[data-auth="yes"] .wallet-pill strong,
  .app-shell[data-auth="yes"] .user-pill strong {
    max-width: 76px;
  }

  .view-tabs {
    grid-column: 1 / -1;
    justify-self: stretch;
    overflow-x: auto;
  }

  .view-tabs .tab-button {
    flex: 1 0 auto;
    min-height: 32px;
  }

  .idea-center {
    width: 100%;
    padding: 4px 9px 10px;
  }

  .idea-center .status-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 7px;
  }

  .idea-center .status-strip span {
    flex: 0 0 auto;
  }

  .center-panel {
    padding: 14px;
  }

  .center-head {
    display: grid;
    gap: 8px;
  }

  .center-head h2 {
    font-size: 24px;
  }

  .bottom-bar {
    padding: 15px 8px calc(8px + env(safe-area-inset-bottom));
  }

  .bottom-bar .composer-inner {
    grid-template-columns: 1fr;
  }

  .bottom-bar .composer textarea {
    min-height: 54px;
    max-height: 120px;
  }

  .bottom-bar .action-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .bottom-bar .action-row .action-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .bottom-bar .billing-notice {
    align-items: flex-start;
  }
}

/* Minimal two-mode shell: idea thread + tree navigator. */
.app-shell[data-auth="yes"] .topbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  padding: 6px clamp(10px, 2vw, 18px) 10px;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.app-shell[data-auth="yes"] .brand {
  gap: 9px;
}

.app-shell[data-auth="yes"] .brand-mark {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.app-shell[data-auth="yes"] .brand h1 {
  font-size: 18px;
}

.app-shell[data-auth="yes"] .brand p {
  max-width: min(52vw, 420px);
  margin-top: 1px;
  overflow: hidden;
  color: rgba(247, 243, 232, 0.64);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell[data-auth="yes"] .wallet-pill,
.app-shell[data-auth="yes"] .user-pill {
  min-height: 31px;
  padding: 3px 8px;
}

.app-shell[data-auth="yes"] .wallet-pill span,
.app-shell[data-auth="yes"] .user-pill strong {
  font-size: 10px;
}

.app-shell[data-auth="yes"] .wallet-pill strong,
.app-shell[data-auth="yes"] .user-pill span {
  font-size: 12px;
}

.view-tabs {
  width: min(100%, 360px);
  padding: 3px;
}

.view-tabs .tab-button {
  flex: 1 1 0;
  min-height: 29px;
  padding: 0 10px;
  font-size: 12px;
}

.view-tabs .tab-button span {
  height: 18px;
  min-width: 18px;
  font-size: 10px;
}

.idea-center {
  border: 1px solid rgba(215, 255, 104, 0.16);
  border-radius: 12px;
  background:
    radial-gradient(circle at 18% 0%, rgba(94, 210, 186, 0.11), transparent 34%),
    linear-gradient(180deg, #223025 0%, #1b271d 58%, #172118 100%);
  box-shadow:
    inset 0 1px 0 rgba(247, 243, 232, 0.11),
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 22px 68px rgba(0, 0, 0, 0.34);
  padding-top: 2px;
}

.idea-stage {
  min-height: auto;
}

.idea-thread {
  display: grid;
  align-content: start;
  gap: 12px;
  width: 100%;
  padding: 10px 10px 12px;
}

.idea-intro {
  display: grid;
  align-content: center;
  gap: 18px;
  width: 100%;
  min-height: min(520px, 100%);
  padding: clamp(18px, 4vw, 34px);
  color: var(--paper);
}

.idea-intro-copy {
  max-width: 760px;
}

.idea-intro h2 {
  max-width: 780px;
  margin: 8px 0 10px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.98;
  letter-spacing: 0;
}

.idea-intro-copy > p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: rgba(247, 243, 232, 0.72);
  font-size: 16px;
  line-height: 1.5;
}

.intro-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 860px;
}

.intro-mode-list section {
  border-top: 1px solid rgba(225, 184, 97, 0.34);
  padding-top: 12px;
}

.intro-mode-list span,
.intro-mode-list strong,
.intro-mode-list p {
  display: block;
}

.intro-mode-list span {
  color: rgba(225, 184, 97, 0.78);
  font-size: 11px;
  font-weight: 900;
}

.intro-mode-list strong {
  margin-top: 6px;
  color: var(--paper);
  font-size: 17px;
  line-height: 1.2;
}

.intro-mode-list p {
  margin: 6px 0 0;
  color: rgba(247, 243, 232, 0.66);
  font-size: 13px;
  line-height: 1.42;
}

.thread-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 100%;
  animation: rise 170ms ease-out;
}

.thread-message.user {
  justify-content: flex-end;
}

.thread-message.ai {
  justify-content: flex-start;
}

.thread-message--compact {
  opacity: 0.92;
}

.thread-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.thread-bubble,
.thread-card {
  max-width: min(100%, 760px);
  min-width: 0;
  border: 1px solid rgba(247, 243, 232, 0.14);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(8, 13, 9, 0.34);
  color: var(--paper);
}

.thread-message.user .thread-bubble {
  max-width: min(82%, 720px);
  border-color: rgba(215, 255, 104, 0.28);
  background: rgba(215, 255, 104, 0.16);
}

.thread-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.48;
}

.thread-label {
  display: block;
  margin-bottom: 6px;
  color: rgba(247, 243, 232, 0.58);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.thread-card.idea-card,
.thread-card--welcome {
  width: min(100%, 820px);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
}

.thread-card--welcome h2 {
  max-width: 720px;
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
}

.thread-card--welcome > p {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.thread-card .summary,
.thread-card .analysis-block p,
.thread-card .placement-block p {
  overflow-wrap: anywhere;
}

.card-action-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.card-action-panel .action-btn {
  min-height: 38px;
}

.center-panel--tree {
  display: grid;
  gap: 14px;
  border-color: rgba(247, 243, 232, 0.2);
  background:
    linear-gradient(180deg, rgba(247, 243, 232, 0.12) 0%, rgba(247, 243, 232, 0.08) 100%),
    #263328;
}

.center-head.compact {
  margin-bottom: 8px;
}

.tree-detail {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.tree-detail .idea-leaf {
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
}

.tree-system-section {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  border: 1px solid rgba(247, 243, 232, 0.17);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(8, 13, 9, 0.28);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.tree-system-section.is-highlighted {
  border-color: rgba(215, 255, 104, 0.42);
  background: rgba(215, 255, 104, 0.09);
}

.tree-system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tree-system-head h3 {
  margin: 2px 0 0;
  color: var(--paper);
  font-size: 18px;
}

.tree-system-head > span {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(247, 243, 232, 0.1);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
}

.bottom-bar {
  padding: 12px clamp(10px, 2vw, 18px) calc(8px + env(safe-area-inset-bottom));
}

.bottom-bar .composer {
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.24);
}

.bottom-bar .composer-inner {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px;
}

.bottom-bar .composer textarea {
  min-height: 46px;
  max-height: 112px;
  padding: 10px;
}

.bottom-bar .action-row {
  max-width: 520px;
  gap: 6px;
}

.bottom-bar .action-btn {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.composer--tree textarea {
  min-height: 42px;
}

.composer--tree .action-row {
  max-width: 260px;
}

@media (max-width: 779px) {
  .app-shell[data-auth="yes"] .topbar {
    display: flex;
    gap: 5px;
    padding: 6px 8px 9px;
  }

  .topbar-main {
    gap: 8px;
  }

  .app-shell[data-auth="yes"] .brand h1 {
    font-size: 17px;
  }

  .app-shell[data-auth="yes"] .brand p {
    display: block;
    max-width: 42vw;
    font-size: 10px;
  }

  .app-shell[data-auth="yes"] .top-actions {
    flex: 0 0 auto;
  }

  .app-shell[data-auth="yes"] .wallet-pill,
  .app-shell[data-auth="yes"] .user-pill {
    min-height: 30px;
    padding: 3px 6px;
  }

  .app-shell[data-auth="yes"] .wallet-pill span,
  .app-shell[data-auth="yes"] .user-pill strong {
    display: none;
  }

  .app-shell[data-auth="yes"] .wallet-pill strong,
  .app-shell[data-auth="yes"] .user-pill span {
    max-width: 64px;
    font-size: 11px;
  }

  .view-tabs {
    width: 100%;
  }

  .idea-center {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 2px 8px 8px;
  }

  .thread-message {
    gap: 7px;
  }

  .thread-avatar {
    width: 24px;
    height: 24px;
  }

  .thread-message.user .thread-bubble,
  .thread-bubble,
  .thread-card {
    max-width: 100%;
    padding: 10px;
  }

  .thread-card--welcome h2 {
    font-size: 25px;
  }

  .bottom-bar {
    padding: 10px 8px calc(7px + env(safe-area-inset-bottom));
  }

  .bottom-bar .composer-inner {
    gap: 6px;
    padding: 6px;
  }

  .bottom-bar .composer textarea {
    min-height: 42px;
    max-height: 88px;
  }

  .bottom-bar .action-row {
    max-width: 100%;
  }
}

/* Final color hierarchy pass: shell, workspace and composer must read as separate layers. */
.app-shell[data-auth="yes"] {
  background:
    radial-gradient(circle at 16% -12%, rgba(215, 255, 104, 0.08), transparent 32%),
    radial-gradient(circle at 86% 8%, rgba(94, 210, 186, 0.08), transparent 30%),
    linear-gradient(180deg, #070a08 0%, #0d140f 50%, #060806 100%);
}

.app-shell[data-auth="yes"] .topbar,
.bottom-bar {
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 0.99) 0%, rgba(7, 11, 8, 0.98) 78%, rgba(7, 11, 8, 0) 100%);
}

.bottom-bar {
  background:
    linear-gradient(0deg, rgba(5, 8, 6, 0.99) 0%, rgba(7, 11, 8, 0.98) 78%, rgba(7, 11, 8, 0) 100%);
}

.idea-center {
  border-color: rgba(215, 255, 104, 0.18);
  background:
    radial-gradient(circle at 18% 0%, rgba(94, 210, 186, 0.12), transparent 34%),
    linear-gradient(180deg, #26372a 0%, #1e2c21 58%, #182319 100%);
}

.bottom-bar .composer {
  border-color: rgba(215, 255, 104, 0.24);
  background:
    linear-gradient(180deg, rgba(22, 33, 22, 0.98) 0%, rgba(12, 19, 13, 0.99) 100%);
  box-shadow:
    inset 0 1px 0 rgba(247, 243, 232, 0.08),
    0 16px 52px rgba(0, 0, 0, 0.38);
}

@media (max-width: 779px) {
  .idea-center {
    width: calc(100% - 14px);
    margin: 0 auto;
    border: 1px solid rgba(215, 255, 104, 0.18);
    border-radius: 12px;
    padding: 4px 7px 8px;
  }

  .bottom-bar .composer {
    border-radius: 12px;
  }
}

/* Final mobile shell authority: compact header, clean tree search, no overlap. */
.app-shell[data-auth="yes"] .topbar {
  flex: 0 0 auto;
  min-width: 0;
  border-bottom: 1px solid rgba(247, 243, 232, 0.1);
  background:
    linear-gradient(180deg, rgba(5, 8, 6, 1) 0%, rgba(7, 11, 8, 0.99) 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.topbar-main,
.app-shell[data-auth="yes"] .brand,
.app-shell[data-auth="yes"] .brand > div {
  min-width: 0;
}

.app-shell[data-auth="yes"] .brand {
  flex: 1 1 auto;
}

.app-shell[data-auth="yes"] .top-actions {
  flex: 0 0 auto;
}

.view-tabs {
  flex: 0 0 auto;
  align-self: center;
  border-color: rgba(247, 243, 232, 0.18);
  background: rgba(247, 243, 232, 0.09);
}

.idea-center {
  margin-top: 6px;
}

.composer--tree .composer-inner {
  grid-template-columns: 1fr;
}

.composer--tree input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(247, 243, 232, 0.2);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--paper);
  background: rgba(247, 243, 232, 0.09);
  outline: none;
  line-height: 1.35;
}

.composer--tree input::placeholder {
  color: rgba(247, 243, 232, 0.54);
}

@media (max-width: 779px) {
  .app-shell[data-auth="yes"] .topbar {
    gap: 5px;
    padding: 6px 7px 7px;
  }

  .topbar-main {
    min-height: 34px;
    gap: 7px;
  }

  .app-shell[data-auth="yes"] .brand {
    gap: 7px;
  }

  .app-shell[data-auth="yes"] .brand-mark {
    width: 28px;
    height: 28px;
  }

  .app-shell[data-auth="yes"] .brand h1 {
    font-size: 16px;
    line-height: 1;
  }

  .app-shell[data-auth="yes"] .brand p {
    display: block;
    max-width: 38vw;
    font-size: 9px;
    line-height: 1.15;
  }

  .app-shell[data-auth="yes"] .top-actions {
    gap: 4px;
  }

  .app-shell[data-auth="yes"] .wallet-pill,
  .app-shell[data-auth="yes"] .user-pill {
    min-height: 28px;
    padding: 3px 5px;
  }

  .app-shell[data-auth="yes"] .wallet-pill strong,
  .app-shell[data-auth="yes"] .user-pill span {
    max-width: 58px;
    font-size: 10px;
  }

  .view-tabs {
    width: 100%;
    padding: 2px;
  }

  .view-tabs .tab-button {
    min-height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }

  .view-tabs .tab-button span {
    height: 16px;
    min-width: 16px;
    font-size: 9px;
  }

  .idea-center {
    margin-top: 5px;
  }

  .composer--tree input {
    min-height: 40px;
    padding: 0 10px;
  }

  .composer--tree .composer-inner {
    grid-template-columns: 1fr;
  }
}

/* Tree surface polish: separate the atlas from the waiting box, keep it strong but elegant. */
.tree-navigator {
  display: grid;
  gap: 12px;
}

.center-panel--tree,
.center-panel--drafts {
  border: 1px solid rgba(247, 243, 232, 0.14);
  border-radius: 12px;
  padding: 16px;
  box-shadow:
    inset 0 1px 0 rgba(247, 243, 232, 0.08),
    0 18px 48px rgba(0, 0, 0, 0.24);
}

.center-panel--tree {
  background:
    linear-gradient(180deg, rgba(247, 243, 232, 0.1) 0%, rgba(247, 243, 232, 0.055) 100%),
    #253529;
}

.center-panel--drafts {
  display: grid;
  gap: 12px;
  border-color: rgba(215, 255, 104, 0.16);
  background:
    linear-gradient(180deg, rgba(215, 255, 104, 0.06) 0%, rgba(247, 243, 232, 0.045) 100%),
    #1d2a20;
}

.center-panel--drafts.is-highlighted {
  border-color: rgba(215, 255, 104, 0.42);
  background:
    linear-gradient(180deg, rgba(215, 255, 104, 0.12) 0%, rgba(247, 243, 232, 0.055) 100%),
    #203020;
}

.center-panel--tree .center-head,
.center-panel--drafts .tree-system-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(247, 243, 232, 0.09);
}

.center-panel--tree .center-head h2,
.center-panel--drafts .tree-system-head h3 {
  font-size: 22px;
  line-height: 1.08;
}

.center-panel--tree .tree-summary {
  margin: 0 0 12px;
}

.center-panel--tree .tree-summary strong {
  font-size: 20px;
}

.center-panel--tree .tree-view {
  gap: 6px;
}

.tree-node {
  border-left: 1px solid rgba(215, 255, 104, 0.2);
  padding-left: 10px;
}

.tree-children {
  gap: 6px;
  margin-top: 5px;
}

.node-title {
  min-height: 32px;
  padding-right: 0;
  color: rgba(247, 243, 232, 0.9);
  font-size: 14px;
}

.node-title i {
  width: 16px;
  height: 16px;
  border-color: rgba(247, 243, 232, 0.18);
  color: rgba(215, 255, 104, 0.82);
  font-size: 11px;
}

.node-title small {
  color: rgba(247, 243, 232, 0.68);
}

.leaf-button,
.draft-button {
  border-color: rgba(247, 243, 232, 0.14);
  background: rgba(247, 243, 232, 0.055);
  box-shadow: inset 0 1px 0 rgba(247, 243, 232, 0.055);
}

.leaf-button strong,
.draft-button strong {
  line-height: 1.16;
}

.leaf-button span,
.draft-button span {
  margin-top: 4px;
  color: rgba(247, 243, 232, 0.58);
  line-height: 1.25;
}

.center-panel--drafts .draft-list {
  display: grid;
  gap: 8px;
}

.center-panel--drafts .draft-button {
  background: rgba(247, 243, 232, 0.07);
}

.center-panel--drafts .empty-panel {
  margin: 0;
  border-color: rgba(247, 243, 232, 0.12);
  background: rgba(247, 243, 232, 0.045);
}

@media (max-width: 779px) {
  .tree-navigator {
    gap: 10px;
  }

  .center-panel--tree,
  .center-panel--drafts {
    padding: 13px;
    border-radius: 10px;
  }

  .center-panel--tree .center-head h2,
  .center-panel--drafts .tree-system-head h3 {
    font-size: 19px;
  }

  .tree-node {
    padding-left: 8px;
  }

  .node-title {
    font-size: 13px;
  }
}

/* Gold-edge elegance pass: clearer panel borders and compact discussion cards. */
.app-shell[data-auth="yes"] {
  background:
    radial-gradient(circle at 50% -12%, rgba(224, 190, 122, 0.12), transparent 34%),
    radial-gradient(circle at 12% 8%, rgba(215, 255, 104, 0.07), transparent 28%),
    linear-gradient(90deg, rgba(224, 190, 122, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(224, 190, 122, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #050806 0%, #0b120d 46%, #050806 100%);
  background-size: auto, auto, 56px 56px, 56px 56px, auto;
}

.app-shell[data-auth="yes"] .topbar,
.bottom-bar {
  border-color: rgba(224, 190, 122, 0.18);
}

.view-tabs,
.idea-center,
.bottom-bar .composer,
.center-panel--tree,
.center-panel--drafts {
  border-color: rgba(224, 190, 122, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.08),
    0 0 0 1px rgba(20, 12, 2, 0.16),
    0 18px 48px rgba(0, 0, 0, 0.28);
}

.idea-center {
  background:
    radial-gradient(circle at 22% 0%, rgba(224, 190, 122, 0.11), transparent 32%),
    linear-gradient(180deg, #243324 0%, #182519 64%, #101a12 100%);
}

.center-panel--tree {
  background:
    linear-gradient(180deg, rgba(224, 190, 122, 0.075) 0%, rgba(247, 243, 232, 0.045) 100%),
    #253329;
}

.center-panel--drafts {
  border-color: rgba(224, 190, 122, 0.3);
  background:
    linear-gradient(180deg, rgba(224, 190, 122, 0.07) 0%, rgba(215, 255, 104, 0.035) 100%),
    #1b281e;
}

.thread-card.idea-card,
.thread-card--welcome {
  border: 1px solid rgba(224, 190, 122, 0.44);
  background:
    linear-gradient(180deg, #fbf8ee 0%, #f2eddf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 18px 42px rgba(0, 0, 0, 0.28);
}

.thread-card.idea-card {
  padding: 14px;
}

.thread-card--welcome {
  padding: 14px;
}

.thread-card--welcome h2,
.thread-card.idea-card h2 {
  font-size: 25px;
  line-height: 1.04;
  letter-spacing: 0;
}

.thread-card--welcome > p,
.thread-card.idea-card .summary {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.38;
}

.thread-card.idea-card .card-kicker {
  margin-bottom: 8px;
}

.thread-card.idea-card .analysis-grid {
  gap: 8px;
  margin-top: 10px;
}

.thread-card.idea-card .analysis-block,
.thread-card.idea-card .placement-block {
  padding: 10px;
}

.thread-card.idea-card .analysis-block p,
.thread-card.idea-card .placement-block p {
  font-size: 14px;
  line-height: 1.34;
}

.thread-card.idea-card .section-title {
  margin-bottom: 5px;
  font-size: 10px;
}

.thread-card.idea-card .weak-list,
.thread-card.idea-card .tags {
  gap: 5px;
}

.thread-card.idea-card .chip,
.thread-card.idea-card .path span {
  padding: 6px 7px;
  font-size: 12px;
}

.card-action-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top-color: rgba(17, 21, 15, 0.12);
}

.card-action-panel .action-btn {
  min-height: 34px;
}

.thread-bubble {
  border-color: rgba(224, 190, 122, 0.24);
}

.thread-message.user .thread-bubble {
  border-color: rgba(224, 190, 122, 0.42);
  background: rgba(224, 190, 122, 0.13);
}

.auth-map div {
  border-color: rgba(224, 190, 122, 0.24);
  background: rgba(247, 243, 232, 0.055);
}

.thread-card--welcome .auth-map {
  gap: 7px;
  margin-top: 10px;
}

.thread-card--welcome .auth-map div {
  gap: 2px;
  min-height: 54px;
  padding: 8px 10px;
}

@media (max-width: 779px) {
  .entry-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .entry-choice {
    min-height: 86px;
    padding: 11px;
  }

  .entry-choice strong {
    font-size: 15px;
  }

  .entry-choice span {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.3;
  }

  .idea-thread {
    gap: 9px;
    padding: 7px 6px 10px;
  }

  .thread-card.idea-card,
  .thread-card--welcome {
    padding: 11px;
  }

  .thread-card--welcome h2,
  .thread-card.idea-card h2 {
    font-size: 22px;
  }

  .thread-card--welcome > p,
  .thread-card.idea-card .summary {
    font-size: 14px;
    line-height: 1.34;
  }

  .thread-card.idea-card .analysis-grid {
    gap: 7px;
  }

  .thread-card.idea-card .analysis-block,
  .thread-card.idea-card .placement-block {
    padding: 9px;
  }

  .thread-card.idea-card .analysis-block p,
  .thread-card.idea-card .placement-block p {
    font-size: 13px;
    line-height: 1.3;
  }

  .thread-card--welcome .auth-map {
    gap: 6px;
    margin-top: 9px;
  }

  .thread-card--welcome .auth-map div {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 42px;
    padding: 7px 8px;
  }

  .thread-card--welcome .auth-map span {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-size: 10px;
  }

  .card-action-panel {
    gap: 6px;
  }
}

/* Production shell polish: fewer competing layers, clearer money/action states. */
.app-shell[data-auth="yes"] {
  background:
    linear-gradient(90deg, rgba(225, 184, 97, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(101, 212, 197, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #050705 0%, #0c120d 48%, #060806 100%);
  background-size: 58px 58px, 58px 58px, auto;
}

.app-shell[data-auth="yes"] .topbar,
.bottom-bar {
  background: linear-gradient(180deg, rgba(5, 7, 5, 0.99) 0%, rgba(8, 12, 9, 0.99) 100%);
}

.bottom-bar {
  background: linear-gradient(0deg, rgba(5, 7, 5, 0.99) 0%, rgba(8, 12, 9, 0.99) 100%);
}

.view-tabs,
.idea-center,
.bottom-bar .composer,
.center-panel--tree,
.center-panel--drafts {
  border-radius: var(--radius);
}

.idea-center {
  border-color: rgba(225, 184, 97, 0.3);
  background: linear-gradient(180deg, #243126 0%, #172319 64%, #101713 100%);
}

.bottom-bar .composer {
  border-color: rgba(225, 184, 97, 0.34);
  background: linear-gradient(180deg, rgba(21, 29, 22, 0.99) 0%, rgba(10, 15, 11, 0.99) 100%);
}

.wallet-pill.ready {
  border-color: rgba(131, 223, 155, 0.62);
  background: rgba(24, 45, 30, 0.82);
}

.wallet-pill.insufficient,
.wallet-pill.unavailable {
  border-color: rgba(236, 100, 117, 0.62);
  background: rgba(58, 24, 31, 0.72);
}

.billing-notice {
  border-color: rgba(225, 184, 97, 0.2);
  background: rgba(225, 184, 97, 0.075);
  color: rgba(247, 243, 232, 0.78);
}

.billing-notice.insufficient,
.billing-notice.unavailable {
  color: #ffd3dc;
  background: rgba(236, 100, 117, 0.115);
}

.billing-notice button {
  padding: 0 10px;
}

.action-btn.primary {
  border-color: #d8f073;
  background: #d8f073;
}

.action-btn.paid {
  border-color: rgba(225, 184, 97, 0.76);
  background: rgba(225, 184, 97, 0.16);
  color: #ffe6ac;
}

.action-btn.free {
  border-color: rgba(131, 223, 155, 0.72);
  background: #83df9b;
}

.thread-card.idea-card,
.thread-card--welcome {
  border-color: rgba(176, 128, 44, 0.36);
  background: linear-gradient(180deg, #fbf7ec 0%, #f0eadc 100%);
}

.entry-choice.is-selected {
  box-shadow:
    inset 0 0 0 1px rgba(176, 128, 44, 0.22),
    0 8px 20px rgba(69, 42, 8, 0.08);
}

@media (max-width: 779px) {
  .idea-center,
  .bottom-bar .composer,
  .center-panel--tree,
  .center-panel--drafts {
    border-radius: var(--radius);
  }

  .billing-notice {
    gap: 8px;
  }

  .billing-notice button {
    flex: 0 0 auto;
  }

  .bottom-bar .composer-inner {
    grid-template-columns: 1fr;
  }

  .bottom-bar .composer textarea {
    min-height: 54px;
  }

  .bottom-bar .action-row {
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .bottom-bar .action-row .action-btn {
    flex: 1 0 auto;
  }
}

/* Profile safety + first-screen bottom chooser. */
.app-shell[data-auth="yes"] .top-actions {
  position: relative;
}

.app-shell[data-auth="yes"] .user-pill.is-open {
  border-color: rgba(225, 184, 97, 0.62);
  background: rgba(225, 184, 97, 0.14);
}

.profile-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 20px));
  border: 1px solid rgba(225, 184, 97, 0.42);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--paper);
  background:
    linear-gradient(180deg, rgba(21, 29, 22, 0.99) 0%, rgba(10, 15, 11, 0.99) 100%);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
}

.profile-panel-head span,
.profile-panel-head small {
  display: block;
  color: rgba(247, 243, 232, 0.62);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.profile-panel-head strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.2;
}

.profile-panel-actions {
  display: grid;
  gap: 8px;
}

.profile-panel-actions .action-btn {
  width: 100%;
  justify-content: center;
}

.start-explainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.start-explainer section {
  border: 1px solid rgba(17, 21, 15, 0.12);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(17, 21, 15, 0.045);
}

.start-explainer strong,
.start-explainer span,
.starter-choice-copy span,
.starter-choice-copy strong {
  display: block;
}

.start-explainer strong {
  font-size: 15px;
  line-height: 1.2;
}

.start-explainer span {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
}

.bottom-bar .composer--starter {
  display: grid;
  grid-template-columns: minmax(170px, 0.62fr) minmax(0, 1.38fr);
  gap: 10px;
  align-items: stretch;
  padding: 10px;
}

.starter-choice-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  border-right: 1px solid rgba(247, 243, 232, 0.1);
  padding-right: 10px;
}

.starter-choice-copy span {
  color: rgba(247, 243, 232, 0.56);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.starter-choice-copy strong {
  color: var(--paper);
  font-size: 15px;
  line-height: 1.25;
}

.entry-choice-grid--bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.bottom-bar .entry-choice {
  min-height: 86px;
  border-color: rgba(225, 184, 97, 0.32);
  background: rgba(247, 243, 232, 0.075);
  color: var(--paper);
}

.bottom-bar .entry-choice:hover {
  border-color: rgba(225, 184, 97, 0.62);
  background: rgba(225, 184, 97, 0.14);
}

.bottom-bar .entry-choice strong {
  font-size: 15px;
}

.bottom-bar .entry-choice span {
  color: rgba(247, 243, 232, 0.68);
  font-size: 12px;
}

@media (max-width: 779px) {
  .profile-panel {
    top: calc(100% + 6px);
    right: -2px;
  }

  .idea-intro {
    align-content: start;
    min-height: auto;
    padding: 16px 10px;
  }

  .idea-intro h2 {
    font-size: 30px;
    line-height: 1.02;
  }

  .idea-intro-copy > p:not(.eyebrow) {
    font-size: 14px;
  }

  .intro-mode-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .start-explainer,
  .bottom-bar .composer--starter,
  .entry-choice-grid--bottom {
    grid-template-columns: 1fr;
  }

  .start-explainer {
    gap: 8px;
  }

  .starter-choice-copy {
    border-right: 0;
    border-bottom: 1px solid rgba(247, 243, 232, 0.1);
    padding: 0 0 8px;
  }

  .bottom-bar .entry-choice {
    min-height: 72px;
  }

  .bottom-bar .entry-choice span {
    margin-top: 4px;
  }
}

/* First-screen readability: separate intro sheet, action rail and choices. */
.app-shell[data-auth="yes"] {
  background:
    linear-gradient(90deg, rgba(225, 184, 97, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(94, 210, 186, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, #030503 0%, #09100a 46%, #040604 100%);
  background-size: 58px 58px, 58px 58px, auto;
}

.idea-center {
  border-color: rgba(225, 184, 97, 0.38);
  background: linear-gradient(180deg, #1e2b21 0%, #142016 62%, #0c120d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.24),
    0 24px 70px rgba(0, 0, 0, 0.42);
}

.idea-intro {
  align-content: start;
  margin: 10px auto 14px;
  min-height: min(500px, 100%);
  border: 1px solid rgba(176, 128, 44, 0.32);
  border-radius: var(--radius);
  color: var(--ink);
  background: linear-gradient(180deg, #fbf6e8 0%, #efe4c9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 18px 44px rgba(0, 0, 0, 0.24);
}

.idea-intro .eyebrow {
  color: #8a6325;
}

.idea-intro h2 {
  color: #12180f;
}

.idea-intro-copy > p:not(.eyebrow) {
  color: #384331;
}

.intro-mode-list section {
  border: 1px solid rgba(176, 128, 44, 0.18);
  border-left-color: rgba(176, 128, 44, 0.56);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 253, 247, 0.56);
}

.intro-mode-list span {
  color: #8a6325;
}

.intro-mode-list strong {
  color: #12180f;
}

.intro-mode-list p {
  color: #44503d;
}

.bottom-bar {
  border-top-color: rgba(225, 184, 97, 0.32);
  background: linear-gradient(0deg, #030503 0%, #070b08 100%);
  box-shadow:
    0 -1px 0 rgba(255, 244, 214, 0.06),
    0 -22px 46px rgba(0, 0, 0, 0.42);
}

.bottom-bar .composer {
  border-color: rgba(225, 184, 97, 0.48);
  background: linear-gradient(180deg, #182219 0%, #0a100b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.11),
    0 16px 46px rgba(0, 0, 0, 0.46);
}

.bottom-bar .composer--starter {
  background:
    linear-gradient(180deg, rgba(225, 184, 97, 0.075) 0%, rgba(225, 184, 97, 0.025) 100%),
    linear-gradient(180deg, #182219 0%, #0a100b 100%);
}

.starter-choice-copy {
  border-right-color: rgba(225, 184, 97, 0.2);
}

.starter-choice-copy span {
  color: rgba(225, 184, 97, 0.78);
}

.starter-choice-copy strong {
  color: #fff7df;
}

.bottom-bar .entry-choice {
  border-color: rgba(225, 184, 97, 0.46);
  background: rgba(255, 253, 247, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.1),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.bottom-bar .entry-choice:nth-child(2) {
  border-color: rgba(94, 210, 186, 0.42);
  background: rgba(94, 210, 186, 0.095);
}

.bottom-bar .entry-choice:hover {
  border-color: rgba(225, 184, 97, 0.78);
  background: rgba(225, 184, 97, 0.17);
  transform: translateY(-1px);
}

.bottom-bar .entry-choice:nth-child(2):hover {
  border-color: rgba(94, 210, 186, 0.68);
  background: rgba(94, 210, 186, 0.16);
}

.bottom-bar .entry-choice span {
  color: rgba(247, 243, 232, 0.76);
}

@media (max-width: 779px) {
  .idea-intro {
    margin: 6px auto 10px;
    padding: 16px 12px;
  }

  .intro-mode-list section {
    padding: 11px;
  }

  .starter-choice-copy {
    border-bottom-color: rgba(225, 184, 97, 0.2);
  }
}

.legal-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: rgba(247, 243, 232, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.legal-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
}

.legal-check a {
  color: #e1b861;
}
