:root {
  --premium-canvas: #080a0c;
  --premium-sidebar: #0b0e11;
  --premium-surface: #101418;
  --premium-raised: #151a1f;
  --premium-line: #242a31;
  --premium-line-strong: #343d47;
  --premium-text: #f3f5f7;
  --premium-soft: #b3bbc4;
  --premium-muted: #77818d;
  --premium-gold: #f4b942;
  --premium-cyan: #3ac7c2;
  --premium-green: #43c486;
  --premium-red: #f06a70;
}

[data-theme="light"] {
  --premium-canvas:#f3f5f7; --premium-sidebar:#ffffff; --premium-surface:#ffffff; --premium-raised:#eef2f4;
  --premium-line:#dbe1e5; --premium-line-strong:#bac4cb; --premium-text:#17212a; --premium-soft:#4f5d68; --premium-muted:#76828c;
  --premium-gold:#a86400; --premium-cyan:#087e77; --premium-green:#167b4c; --premium-red:#c94249;
}

[data-theme="light"] .rebuild-app .app-nav-link{ color:#66737e; }
[data-theme="light"] .rebuild-app .app-nav-link:hover{ color:#18232c; background:#f1f4f6; }
[data-theme="light"] .rebuild-app .app-nav-link.active{ color:#17212a; background:#edf1f3; border-color:#d8e0e4; }
[data-theme="light"] .rebuild-app .btn-primary{ color:#fff; }
[data-theme="light"] .rebuild-app .btn-primary:hover{ color:#fff; border-color:#8d5200; background:#8d5200; }
[data-theme="light"] .rebuild-app .btn-ghost{ color:#52606b; }
[data-theme="light"] .rebuild-app .btn-ghost:hover{ border-color:#aeb9c1; background:#eef2f4; color:#17212a; }
[data-theme="light"] .premium-topbar,
[data-theme="light"] .rebuild-secondary-content .app-topbar{ background:rgba(255,255,255,.94); }
[data-theme="light"] .premium-topbar-context strong,
[data-theme="light"] .rebuild-secondary-content .app-topbar h1{ color:#1a252e; }
[data-theme="light"] .premium-topbar-context span::after{ color:#b7c0c7; }
[data-theme="light"] .icon-text-button,
[data-theme="light"] .avatar-button{ border-color:#d6dde2; background:#fff; color:#52606b; }
[data-theme="light"] .icon-text-button:hover,
[data-theme="light"] .avatar-button:hover{ border-color:#b5c0c8; background:#eef2f4; color:#17212a; }
[data-theme="light"] .premium-segmented{ background:#e9eef1; }
[data-theme="light"] .premium-segmented .dash-tab{ color:#687580; }
[data-theme="light"] .premium-segmented .dash-tab.active{ background:#fff; color:#18232c; box-shadow:0 1px 3px rgba(24,38,50,.1),inset 0 0 0 1px #d4dce1; }
[data-theme="light"] .subscription-ribbon{ border-color:#cde2d5; background:#f1faf5; }
[data-theme="light"] .subscription-ribbon strong{ color:#205d3d; }
[data-theme="light"] .subscription-ribbon p{ color:#587264; }
[data-theme="light"] .metric-tile:hover{ border-color:#c4cdd3; background:#fbfcfc; }
[data-theme="light"] .metric-tile > strong,
[data-theme="light"] .section-heading h2,
[data-theme="light"] .settings-group-head h2,
[data-theme="light"] .saved-prompt strong,
[data-theme="light"] .workflow-card strong{ color:#17212a; }
[data-theme="light"] .metric-tile small,
[data-theme="light"] .project-copy small,
[data-theme="light"] .activity-row small,
[data-theme="light"] .activity-row time,
[data-theme="light"] .saved-prompt p,
[data-theme="light"] .workflow-card small,
[data-theme="light"] .settings-group-head p,
[data-theme="light"] .preference-row small{ color:#74818b; }
[data-theme="light"] .metric-tile .app-usage-bar{ background:#e5eaed; }
[data-theme="light"] .dashboard-project,
[data-theme="light"] .activity-row{ border-color:#e7ebee; }
[data-theme="light"] .dashboard-project:hover,
[data-theme="light"] .activity-row:hover{ background:#f5f7f8; }
[data-theme="light"] .project-symbol,
[data-theme="light"] .settings-icon{ border-color:#d5dde2; background:#f0f3f5; color:#52606a; }
[data-theme="light"] .project-copy strong,
[data-theme="light"] .activity-row strong,
[data-theme="light"] .preference-row strong{ color:#2a3640; }
[data-theme="light"] .saved-prompt,
[data-theme="light"] .workflow-card{ border-color:#dce2e6; background:#f8fafb; }
[data-theme="light"] .saved-prompt:hover,
[data-theme="light"] .workflow-card:hover{ border-color:#b9c4cc; background:#fff; }
[data-theme="light"] .saved-prompt-actions button{ border-color:#d2dae0; color:#52606b; }
[data-theme="light"] .saved-prompt-actions button:hover{ border-color:#aeb9c1; color:#17212a; }
[data-theme="light"] .settings-nav{ border-color:#dde3e7; }
[data-theme="light"] .settings-nav span{ color:#84909a; }
[data-theme="light"] .settings-nav a{ color:#64717c; }
[data-theme="light"] .settings-nav a:hover{ background:#edf1f3; color:#17212a; }
[data-theme="light"] .settings-form input,
[data-theme="light"] .settings-form select,
[data-theme="light"] .premium-modal input,
[data-theme="light"] .premium-modal textarea,
[data-theme="light"] .premium-modal select,
[data-theme="light"] .preference-row select{ border-color:#cfd8de; background:#fff; color:#17212a; }
[data-theme="light"] .settings-form label,
[data-theme="light"] .premium-modal label{ color:#56636e; }
[data-theme="light"] .settings-form-foot,
[data-theme="light"] .preference-row{ border-color:#e1e6e9; }
[data-theme="light"] .mini-segment{ border-color:#d3dbe0; background:#edf1f3; }
[data-theme="light"] .mini-segment span{ color:#64717c; }
[data-theme="light"] .mini-segment input:checked + span{ background:#fff; color:#17212a; box-shadow:0 1px 3px rgba(24,38,50,.1); }
[data-theme="light"] .switch i{ border-color:#c6d0d6; background:#e5eaed; }
[data-theme="light"] .danger-group{ border-color:#ecd1d4; background:#fff7f7; }
[data-theme="light"] .rebuild-app .dash-plan-card{ border-color:#d8e0e5; background:#f8fafb; }
[data-theme="light"] .rebuild-app .dash-plan-card:hover{ border-color:#bb9b68; background:#fff; }
[data-theme="light"] .premium-modal,
[data-theme="light"] .premium-menu,
[data-theme="light"] .command-panel{ border-color:#cbd4da; background:#fff; box-shadow:0 24px 70px rgba(25,39,52,.2); }
[data-theme="light"] .command-overlay{ background:rgba(36,47,56,.38); }
[data-theme="light"] .command-search{ border-color:#dbe1e5; }
[data-theme="light"] .command-search input{ color:#17212a; }
[data-theme="light"] .command-search kbd{ border-color:#d2dae0; background:#eef2f4; color:#64717c; }
[data-theme="light"] .command-results a:hover,
[data-theme="light"] .command-results a.selected{ background:#edf1f3; color:#17212a; }
[data-theme="light"] .premium-toast{ border-color:#bfd9c9; background:#fff; box-shadow:0 15px 38px rgba(25,39,52,.16); }
[data-theme="light"] .premium-toast.error{ border-color:#e7c2c5; background:#fff8f8; }
[data-theme="light"] .premium-toast p{ color:#35424c; }
[data-theme="light"] .surface-loading span{ background:linear-gradient(90deg,#edf1f3 25%,#f8fafb 50%,#edf1f3 75%); background-size:200% 100%; }
[data-theme="light"] .workspace-conversation,
[data-theme="light"] .workspace-stage,
[data-theme="light"] .workspace-inspector{ background:#fff; }
[data-theme="light"] .workspace-chart-wrap{ background:#fff; }
[data-theme="light"] .chart-empty-overlay{ background:rgba(255,255,255,.94); }
[data-theme="light"] .theme-toggle{ border-color:#d4dce1; background:#fff; color:#53616c; }
[data-theme="light"] .theme-toggle:hover{ border-color:#b4bfc7; background:#edf1f3; color:#17212a; }

.rebuild-app {
  background: var(--premium-canvas);
  color: var(--premium-text);
  letter-spacing: 0;
}

.rebuild-app *,
.rebuild-app *::before,
.rebuild-app *::after { box-sizing: border-box; letter-spacing: 0; }

.rebuild-app .rebuild-app-shell { min-height: 100dvh; grid-template-columns: 244px minmax(0, 1fr); }

.rebuild-app .rebuild-sidebar {
  width: 244px;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 12px 14px;
  background: var(--premium-sidebar);
  border-right: 1px solid var(--premium-line);
}

.rebuild-app .app-brand {
  min-height: 50px;
  margin: 0 6px 22px;
  gap: 10px;
  color: var(--premium-text);
  font-size: 0.86rem;
}

.rebuild-app .app-nav-links { gap: 3px; }

.rebuild-app .app-nav-link {
  position: relative;
  min-height: 42px;
  padding: 0 11px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #8e98a3;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.rebuild-app .app-nav-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rebuild-app .app-nav-link:hover {
  color: var(--premium-text);
  background: #12171b;
  transform: translateX(1px);
}

.rebuild-app .app-nav-link.active {
  color: #fff;
  background: #171b20;
  border-color: #2b323a;
}

.rebuild-app .app-nav-link.active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 9px;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: var(--premium-gold);
}

.rebuild-app .app-sidebar-foot {
  padding-top: 12px;
  border-top: 1px solid var(--premium-line);
}

.sidebar-service {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px 12px;
}

.sidebar-service > span,
.live-label i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--premium-green);
  box-shadow: 0 0 0 3px rgba(67, 196, 134, 0.1);
}

.sidebar-service div { display: grid; gap: 2px; }
.sidebar-service strong { color: #c8cfd6; font-size: 0.66rem; font-weight: 600; }
.sidebar-service small { color: var(--premium-muted); font-size: 0.58rem; }
.sidebar-service.is-checking > span{ background:var(--premium-gold); box-shadow:0 0 0 3px rgba(227,180,82,.1); animation:pendingPulse 1.7s ease infinite; }
.sidebar-service.is-degraded > span{ background:var(--premium-gold); box-shadow:0 0 0 3px rgba(227,180,82,.1); }
.sidebar-service.is-unknown > span{ background:var(--premium-muted); box-shadow:0 0 0 3px rgba(121,133,145,.1); }

.premium-page {
  min-width: 0;
  margin-left: 0;
  background: var(--premium-canvas);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.page-ready .premium-page,
.page-ready .rebuild-secondary-content,
.page-ready .rebuild-app-content { opacity: 1; transform: none; }

.premium-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 30px;
  background: rgba(8, 10, 12, 0.92);
  border-bottom: 1px solid var(--premium-line);
  backdrop-filter: blur(14px);
}

.premium-topbar-context { display: flex; align-items: center; gap: 9px; font-size: 0.72rem; }
.premium-topbar-context span { color: var(--premium-muted); }
.premium-topbar-context span::after { content: "/"; margin-left: 9px; color: #414952; }
.premium-topbar-context strong { color: #cbd1d7; font-weight: 600; }
.premium-topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-text-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 9px;
  gap: 7px;
  border: 1px solid var(--premium-line);
  border-radius: 6px;
  background: #0e1215;
  color: #929ca6;
  font: 500 0.68rem Inter, sans-serif;
}

.icon-text-button:hover { border-color: var(--premium-line-strong); color: #e5e9ed; }
.icon-text-button kbd { margin-left: 10px; padding: 2px 5px; border: 1px solid #2d343c; border-radius: 4px; color: #69737d; background: #15191e; font: 500 0.58rem var(--font-mono); }

.avatar-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #3a4149;
  border-radius: 50%;
  background: #1a2025;
  color: #f6c766;
  font: 700 0.67rem Inter, sans-serif;
}

.premium-menu { top: 42px; right: 0; min-width: 180px; border-color: var(--premium-line-strong); background: #12161a; box-shadow: 0 18px 50px rgba(0,0,0,.42); }
.premium-menu a, .premium-menu button { min-height: 38px; border-radius: 4px; }

.premium-page-inner { width: min(1360px, 100%); padding: 34px 34px 70px; }

.dashboard-heading,
.settings-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.dashboard-heading h1,
.settings-intro h2 {
  margin: 4px 0 6px;
  color: var(--premium-text);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 2.6vw, 2.55rem);
  line-height: 1.08;
}

.dashboard-heading p,
.settings-intro p,
.section-heading p { margin: 0; color: var(--premium-muted); font-size: 0.78rem; line-height: 1.55; }
.heading-actions { display: flex; align-items: center; gap: 8px; }

.rebuild-app .btn {
  min-height: 39px;
  padding: 0 15px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: none;
}

.rebuild-app .btn-primary { border-color: var(--premium-gold); background: var(--premium-gold); color: #16110a; }
.rebuild-app .btn-primary:hover { border-color: #ffd06d; background: #ffd06d; transform: translateY(-1px); }
.rebuild-app .btn-ghost { border-color: var(--premium-line-strong); background: transparent; color: #c2c9d0; }
.rebuild-app .btn-ghost:hover { border-color: #58636f; background: #151a1f; color: #fff; }
.rebuild-app .btn-sm { min-height: 33px; padding: 0 11px; font-size: 0.66rem; }

.premium-segmented {
  display: inline-flex;
  width: auto;
  margin: 0 0 24px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--premium-line);
  border-radius: 7px;
  background: #0e1114;
}

.premium-segmented .dash-tab {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--premium-muted);
  font: 600 0.68rem Inter, sans-serif;
}

.premium-segmented .dash-tab.active { background: #20262c; color: #f4f6f8; box-shadow: inset 0 0 0 1px #303840; }

.subscription-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #25372f;
  border-radius: 7px;
  background: #0d1612;
}

.subscription-ribbon > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.subscription-ribbon .status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--premium-green); }
.subscription-ribbon strong { color: #dce8e1; font-size: 0.72rem; }
.subscription-ribbon p { margin: 0; color: #84958b; font-size: 0.69rem; overflow-wrap: anywhere; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric-tile {
  position: relative;
  min-width: 0;
  min-height: 142px;
  padding: 17px;
  border: 1px solid var(--premium-line);
  border-radius: 7px;
  background: var(--premium-surface);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.metric-tile:hover { border-color: #353d46; background: #12171b; transform: translateY(-2px); }
.metric-icon { display: grid; width: 26px; height: 26px; margin-bottom: 17px; place-items: center; border-radius: 5px; font: 700 0.58rem var(--font-mono); }
.metric-icon.cyan { color: #73ded9; background: rgba(58,199,194,.11); border: 1px solid rgba(58,199,194,.2); }
.metric-icon.gold { color: #f6c861; background: rgba(244,185,66,.11); border: 1px solid rgba(244,185,66,.2); }
.metric-icon.green { color: #6ed8a5; background: rgba(67,196,134,.11); border: 1px solid rgba(67,196,134,.2); }
.metric-icon.red { color: #f08b90; background: rgba(240,106,112,.1); border: 1px solid rgba(240,106,112,.2); }
.metric-tile > span:not(.metric-icon) { display: block; color: var(--premium-muted); font-size: 0.65rem; font-weight: 600; }
.metric-tile > strong { display: block; margin: 5px 0 8px; color: #f5f7f8; font: 600 1.45rem "Space Grotesk", sans-serif; }
.metric-tile small { color: #68727c; font-size: 0.59rem; line-height: 1.4; }
.metric-tile .app-usage-bar { height: 3px; margin: 5px 0 8px; background: #252b31; }

.dashboard-flow-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 14px; margin-bottom: 14px; }

.surface-section {
  min-width: 0;
  margin-bottom: 14px;
  padding: 19px;
  border: 1px solid var(--premium-line);
  border-radius: 7px;
  background: var(--premium-surface);
}

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading h2 { margin: 2px 0 0; color: #e9edf0; font: 600 0.95rem "Space Grotesk", sans-serif; }
.section-heading > a, .section-heading > button:not(.btn) { color: #9da7b0; font-size: 0.64rem; }
.section-heading > a:hover { color: var(--premium-gold); }
.live-label { display: inline-flex; align-items: center; gap: 6px; color: #799385; font-size: 0.6rem; }
.live-label i { width: 5px; height: 5px; }

.project-list,
.activity-list { display: grid; gap: 2px; }

.dashboard-project,
.activity-row {
  display: grid;
  min-width: 0;
  align-items: center;
  border-top: 1px solid #1e242a;
  transition: background 140ms ease;
}

.dashboard-project { grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 62px; gap: 11px; padding: 7px 4px; }
.dashboard-project:first-child, .activity-row:first-child { border-top: 0; }
.dashboard-project:hover, .activity-row:hover { background: #13181d; }
.project-symbol { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid #2d353e; border-radius: 6px; background: #171c21; color: #d8dde2; font: 700 0.58rem var(--font-mono); }
.project-copy { min-width: 0; display: grid; gap: 3px; }
.project-copy strong { overflow: hidden; color: #dce1e5; font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.project-copy small { color: #6e7882; font-size: 0.58rem; }
.project-status { padding: 4px 6px; border-radius: 4px; color: #7cdbaa; background: rgba(67,196,134,.08); font-size: 0.55rem; text-transform: uppercase; }
.favorite-button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #59636d; font-size: 1rem; }
.favorite-button:hover, .favorite-button.active { color: var(--premium-gold); background: rgba(244,185,66,.08); }

.activity-row { grid-template-columns: 8px minmax(0,1fr) auto; min-height: 52px; gap: 10px; padding: 6px 4px; }
.activity-state { width: 6px; height: 6px; border-radius: 50%; background: var(--premium-cyan); }
.activity-state.failed, .activity-state.quarantined { background: var(--premium-red); }
.activity-state.completed, .activity-state.ready { background: var(--premium-green); }
.activity-row div { min-width: 0; display: grid; gap: 3px; }
.activity-row strong { color: #cfd5da; font-size: 0.66rem; text-transform: capitalize; }
.activity-row small, .activity-row time { color: #66717c; font-size: 0.57rem; }

.surface-loading { display: grid; gap: 9px; padding: 4px 0; }
.surface-loading span { display: block; height: 43px; border-radius: 5px; background: linear-gradient(90deg, #151a1f 25%, #1d2329 50%, #151a1f 75%); background-size: 200% 100%; animation: premiumShimmer 1.4s linear infinite; }
@keyframes premiumShimmer { to { background-position: -200% 0; } }

.prompt-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.saved-prompt { min-width: 0; padding: 12px; border: 1px solid #252c33; border-radius: 6px; background: #0d1114; transition: border-color 150ms ease, transform 150ms ease; }
.saved-prompt:hover { border-color: #39434c; transform: translateY(-1px); }
.saved-prompt strong { display: block; margin-bottom: 5px; color: #dce1e5; font-size: 0.68rem; }
.saved-prompt p { min-height: 34px; margin: 0 0 11px; overflow: hidden; color: #78838e; font-size: 0.6rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.saved-prompt-actions { display: flex; justify-content: space-between; gap: 6px; }
.saved-prompt-actions button { min-height: 28px; padding: 0 8px; border: 1px solid #2b333b; border-radius: 4px; background: transparent; color: #9ba5ae; font-size: 0.57rem; }
.saved-prompt-actions button:hover { border-color: #47525e; color: #fff; }
.saved-prompt-actions button:last-child { border: 0; color: #717b84; }
.quiet-empty { grid-column: 1 / -1; margin: 8px 0; color: #6f7983; font-size: 0.68rem; }

.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.workflow-card { min-width: 0; min-height: 132px; padding: 14px; text-align: left; border: 1px solid #272e35; border-radius: 6px; background: #0d1114; color: inherit; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.workflow-card:hover { border-color: #3c4650; background: #12171b; transform: translateY(-2px); }
.workflow-mark { display: grid; width: 25px; height: 25px; margin-bottom: 15px; place-items: center; border: 1px solid #35404a; border-radius: 5px; color: #9ea9b4; font: 600 0.56rem var(--font-mono); }
.workflow-card strong { display: block; margin-bottom: 4px; color: #dce1e5; font-size: 0.7rem; }
.workflow-card small { display: block; min-height: 28px; color: #717c86; font-size: 0.58rem; line-height: 1.45; }
.workflow-card em { display: block; margin-top: 9px; color: #b4bdc5; font-size: 0.58rem; font-style: normal; }

.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 780px); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 88px; display: grid; gap: 3px; padding-right: 22px; border-right: 1px solid var(--premium-line); }
.settings-nav span { margin: 16px 8px 4px; color: #555f69; font-size: 0.56rem; font-weight: 700; text-transform: uppercase; }
.settings-nav span:first-child { margin-top: 0; }
.settings-nav a { min-height: 34px; padding: 8px; border-radius: 5px; color: #8b959f; font-size: 0.67rem; }
.settings-nav a:hover { background: #111519; color: #eef1f3; }
.settings-stack { display: grid; gap: 14px; min-width: 0; }
.settings-group { padding: 21px; border: 1px solid var(--premium-line); border-radius: 7px; background: var(--premium-surface); scroll-margin-top: 88px; }
.settings-group-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.settings-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #343c45; border-radius: 6px; background: #171c21; color: #aab3bc; font: 700 0.56rem var(--font-mono); }
.settings-group-head h2 { margin: 1px 0 4px; color: #e4e8eb; font: 600 0.88rem "Space Grotesk", sans-serif; }
.settings-group-head p { margin: 0; color: #727d87; font-size: 0.62rem; line-height: 1.45; }
.settings-form label, .premium-modal label { display: grid; gap: 7px; color: #9aa4ae; font-size: 0.62rem; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.security-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.settings-form input, .settings-form select, .premium-modal input, .premium-modal textarea, .premium-modal select, .preference-row select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #2d353d;
  border-radius: 5px;
  outline: 0;
  background: #0b0e11;
  color: #e7ebee;
  font: 500 0.72rem Inter, sans-serif;
}
.premium-modal textarea { resize: vertical; line-height: 1.5; }
.settings-form input:focus, .premium-modal input:focus, .premium-modal textarea:focus, .preference-row select:focus { border-color: #756032; box-shadow: 0 0 0 3px rgba(244,185,66,.08); }
.settings-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 15px; border-top: 1px solid #20262c; }
.settings-form-foot > div { min-width: 0; }
.preference-list { display: grid; }
.preference-row { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 22px; border-top: 1px solid #20262c; }
.preference-row:first-child { border-top: 0; }
.preference-row > div { display: grid; gap: 4px; }
.preference-row strong { color: #cfd5da; font-size: 0.68rem; }
.preference-row small { color: #717c86; font-size: 0.59rem; line-height: 1.4; }
.preference-row select { width: 180px; min-height: 38px; }
.mini-segment { display: flex; padding: 3px; border: 1px solid #293039; border-radius: 6px; background: #0b0e11; }
.mini-segment label { cursor: pointer; }
.mini-segment input { position: absolute; opacity: 0; }
.mini-segment span { display: grid; min-height: 29px; padding: 0 9px; place-items: center; border-radius: 4px; color: #727c86; font-size: 0.58rem; }
.mini-segment input:checked + span { background: #20262c; color: #eef1f3; }
.switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border: 1px solid #343c44; border-radius: 12px; background: #151a1f; transition: background 150ms ease, border-color 150ms ease; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #7c8791; transition: transform 150ms ease, background 150ms ease; }
.switch input:checked + i { border-color: #98772d; background: rgba(244,185,66,.2); }
.switch input:checked + i::after { transform: translateX(17px); background: var(--premium-gold); }
.preference-status { min-height: 18px; margin: 8px 0 0; color: #708078; font-size: 0.6rem; }
.danger-group { border-color: #3d292c; background: #130e10; }

.dash-plan-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.rebuild-app .dash-plan-card { min-height: 178px; padding: 17px; border: 1px solid #2b3239; border-radius: 6px; background: #0d1114; }
.rebuild-app .dash-plan-card:hover { border-color: #5a4930; }
.billing-row { border-color: #242b32; }

.premium-modal { width: min(520px, calc(100vw - 30px)); max-height: calc(100dvh - 40px); overflow-y: auto; border: 1px solid #353e47; border-radius: 7px; background: #111519; box-shadow: 0 28px 80px rgba(0,0,0,.55); }
.premium-modal h3 { font-size: 1.1rem; }
.premium-modal form { display: grid; gap: 13px; }
.premium-modal .form-grid { margin-bottom: 12px; }
.checkout-code-row { align-items: stretch; }

/* Professional workspace */
.rebuild-app .rebuild-app-content { opacity: 0; transform: translateY(3px); transition: opacity 180ms ease, transform 180ms ease; }
.workspace-command-bar .workspace-search { min-height: 34px; }
.workspace-command-bar .workspace-search svg { flex: 0 0 auto; }
.workspace-rebuild-grid { grid-template-columns: minmax(290px, .82fr) minmax(430px, 1.48fr) minmax(240px, .7fr); }
.workspace-stage { background: #0b0e11; }
.stage-toolbar a { color: #8f99a3; font-size: .58rem; }
.stage-toolbar a:hover { color: var(--premium-gold); }
.live-chart-wrap { min-height: 410px; }
.tradingview-widget-container,
.tradingview-widget-container__widget,
.tradingview-widget-container iframe { width: 100% !important; height: 100% !important; min-height: 100%; }
.tradingview-widget-container { position: absolute; inset: 0; }
.tradingview-widget-container__widget { position: relative; }
.chart-loader { position: absolute; z-index: 1; inset: 0; display: grid; align-content: center; justify-items: center; gap: 12px; background: #080a0c; color: #78838d; font-size: .67rem; }
.chart-loader span { width: 24px; height: 24px; border: 2px solid #283039; border-top-color: var(--premium-cyan); border-radius: 50%; animation: chartSpin .8s linear infinite; }
@keyframes chartSpin { to { transform: rotate(360deg); } }
.live-chart-meta { justify-content: space-between; min-width: 0; }
.live-chart-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-data-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--premium-green); box-shadow: 0 0 0 3px rgba(67,196,134,.09); }
.code-toolbar-actions { display: flex; gap: 6px; }
.pine-editor-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pine-editor-shell[hidden] { display: none; }
.pine-editor-shell textarea { flex: 1; min-height: 330px; width: 100%; resize: none; padding: 15px; border: 0; border-radius: 0; outline: 0; background: #080a0c; color: #d4dde5; font: 500 .69rem/1.65 "JetBrains Mono", monospace; tab-size: 2; }
.pine-editor-shell textarea:focus { box-shadow: inset 0 0 0 1px #4f603a; }
.pine-editor-foot { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 11px; border-top: 1px solid var(--premium-line); background: #0e1215; }
.pine-editor-foot p { margin: 0; color: #6f7983; font-size: .57rem; line-height: 1.4; }
.pine-editor-foot > div { display: flex; flex: 0 0 auto; gap: 6px; }
#workspaceTestsTab { overflow-y: auto; }
.verification-workflow { margin: 0 12px 12px; border: 1px solid var(--premium-line); border-radius: 6px; background: var(--premium-surface); }
.verification-workflow[hidden] { display: none; }
.verification-head { display: flex; justify-content: space-between; gap: 16px; padding: 13px; border-bottom: 1px solid var(--premium-line); }
.verification-head strong { display: block; color: var(--premium-text); font-size: .7rem; }
.verification-head p { margin: 4px 0 0; color: var(--premium-muted); font-size: .58rem; line-height: 1.45; }
.verification-head > span { flex: 0 0 auto; color: var(--premium-cyan); font: 600 .56rem var(--font-mono); }
.verification-sync-row { display:flex; min-height:32px; align-items:center; justify-content:space-between; gap:10px; padding:7px 13px; border-bottom:1px solid var(--premium-line); color:var(--premium-muted); font-size:.55rem; }
.verification-sync-row span.error { color:var(--premium-red); }
.verification-sync-row button { padding:0; border:0; background:transparent; color:var(--premium-cyan); font:600 .55rem var(--font-body); }
.verification-workflow > label { display: grid; grid-template-columns: 17px minmax(0,1fr); align-items: start; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--premium-line); cursor: pointer; }
.verification-workflow > label > input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--premium-green); }
.verification-workflow label span { display: grid; gap: 3px; }
.verification-workflow label strong { color: var(--premium-soft); font-size: .64rem; }
.verification-workflow label small { color: var(--premium-muted); font-size: .56rem; line-height: 1.4; }
.evidence-form { display:grid; gap:12px; padding:14px 13px; border-bottom:1px solid var(--premium-line); background:var(--premium-canvas); }
.evidence-form-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.evidence-form-head > div { display:grid; gap:3px; }
.evidence-form-head strong { color:var(--premium-text); font-size:.65rem; }
.evidence-form-head small,.evidence-form-head > span { color:var(--premium-muted); font-size:.54rem; line-height:1.4; }
.evidence-form-head > span { flex:0 0 auto; font-family:var(--font-mono); }
.evidence-field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.evidence-field-grid label,.evidence-notes { display:grid; gap:5px; min-width:0; color:var(--premium-muted); font-size:.55rem; font-weight:600; }
.evidence-field-grid input,.evidence-field-grid select,.evidence-notes textarea { width:100%; min-width:0; min-height:36px; padding:7px 8px; border:1px solid var(--premium-line); border-radius:5px; outline:0; background:var(--premium-raised); color:var(--premium-text); font:500 .61rem var(--font-body); }
.evidence-notes textarea { min-height:76px; resize:vertical; line-height:1.45; }
.evidence-field-grid input:focus,.evidence-field-grid select:focus,.evidence-notes textarea:focus { border-color:var(--premium-cyan); box-shadow:0 0 0 2px rgba(58,199,194,.1); }
.evidence-form-actions { display:flex; justify-content:flex-end; gap:7px; }
.verification-actions { display: flex; justify-content: flex-end; gap: 7px; padding: 11px 13px; }
.handoff-steps { display: grid; gap: 0; margin: 16px 0; padding: 0; list-style: none; border-top: 1px solid #293139; border-bottom: 1px solid #293139; }
.handoff-steps li { display: grid; grid-template-columns: 27px minmax(0,1fr); gap: 10px; align-items: center; min-height: 62px; border-top: 1px solid #20262c; }
.handoff-steps li:first-child { border-top: 0; }
.handoff-steps li > span { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid #39434c; border-radius: 50%; color: #9da7b0; font: 600 .58rem var(--font-mono); }
.handoff-steps div { display: grid; gap: 3px; }
.handoff-steps strong { color: #ced4d9; font-size: .67rem; }
.handoff-steps small { color: #717b85; font-size: .57rem; line-height: 1.4; }
.chat-retry-row { display: flex; justify-content: flex-start; margin: -5px 0 14px 28px; }
.density-compact .workspace-conversation .chat-body { padding: 6px 8px; }
.density-compact .workspace-conversation .chat-line { margin-bottom: 9px; }
.density-compact .spec-ledger > div { padding-top: 9px; padding-bottom: 9px; }

.ai-mode-switch { display:flex; gap:2px; padding:3px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-canvas); }
.ai-mode-switch button { min-height:28px; padding:0 9px; border:0; border-radius:4px; background:transparent; color:var(--text-muted); font:600 .58rem var(--font-body); }
.ai-mode-switch button:hover { color:var(--text-primary); }
.ai-mode-switch button.active { color:var(--text-primary); background:var(--premium-raised); box-shadow:0 1px 3px rgba(0,0,0,.16); }
.ai-depth-control { display:flex; min-height:39px; align-items:center; justify-content:space-between; gap:10px; padding:5px 9px; border-bottom:1px solid var(--premium-line); background:color-mix(in srgb,var(--premium-raised) 42%,transparent); }
.ai-depth-control > span { flex:0 0 auto; color:var(--premium-muted); font:600 .52rem var(--font-mono); text-transform:uppercase; }
.ai-depth-control > div { display:grid; min-width:0; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; padding:3px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-canvas); }
.ai-depth-control button { min-width:0; min-height:25px; padding:0 7px; overflow:hidden; border:0; border-radius:4px; background:transparent; color:var(--premium-muted); font:600 .54rem var(--font-body); text-overflow:ellipsis; white-space:nowrap; }
.ai-depth-control button:hover { color:var(--premium-text); }
.ai-depth-control button.active { color:var(--premium-text); background:var(--premium-raised); box-shadow:0 1px 3px rgba(0,0,0,.16); }
.ai-mode-settings { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; padding:0 20px 20px; }
.ai-mode-settings label { cursor:pointer; }
.ai-mode-settings input { position:absolute; opacity:0; pointer-events:none; }
.ai-mode-settings span { min-height:92px; display:flex; flex-direction:column; gap:7px; padding:15px; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-raised); transition:border-color .16s ease, background .16s ease; }
.ai-mode-settings input:checked + span { border-color:var(--analysis); background:color-mix(in srgb,var(--analysis) 8%,var(--premium-raised)); }
.ai-mode-settings input:focus-visible + span { outline:2px solid var(--analysis); outline-offset:2px; }
.ai-mode-settings strong { font-size:.78rem; }
.ai-mode-settings small { color:var(--text-muted); font-size:.65rem; line-height:1.5; }
.ai-depth-settings { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 20px 20px; padding-top:17px; border-top:1px solid var(--premium-line); }
.ai-depth-settings > div:first-child strong,.ai-depth-settings > div:first-child small { display:block; }
.ai-depth-settings > div:first-child strong { margin-bottom:3px; font-size:.68rem; }
.ai-depth-settings > div:first-child small { color:var(--premium-muted); font-size:.59rem; }
.ai-depth-segment { display:grid; min-width:330px; grid-template-columns:repeat(4,minmax(0,1fr)); }
.ai-depth-segment span { display:grid; min-height:38px; place-items:center; }
.settings-inline-action { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 20px 20px; padding-top:17px; border-top:1px solid var(--premium-line); }
.settings-inline-action strong,.settings-inline-action small { display:block; }
.settings-inline-action strong { margin-bottom:3px; font-size:.68rem; }
.settings-inline-action small { color:var(--premium-muted); font-size:.59rem; }
.next-action-band { display:flex; align-items:center; justify-content:space-between; gap:28px; margin:14px 0 18px; padding:20px 22px; border:1px solid var(--premium-line-strong); border-left:3px solid var(--analysis); border-radius:7px; background:var(--premium-surface); }
.next-action-band h2 { margin:5px 0 5px; font-size:1rem; }
.next-action-band p { max-width:720px; color:var(--premium-soft); font-size:.67rem; line-height:1.55; }
.next-action-band .btn { flex-shrink:0; }
.onboarding-modal { width:min(760px,calc(100% - 24px)); }
.onboarding-modal fieldset { margin:18px 0 0; padding:0; border:0; }
.onboarding-modal legend { margin-bottom:9px; color:var(--premium-text); font-size:.65rem; font-weight:700; }
.onboarding-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.onboarding-options label { cursor:pointer; }
.onboarding-options input { position:absolute; opacity:0; pointer-events:none; }
.onboarding-options span { min-height:67px; display:flex; flex-direction:column; justify-content:center; gap:4px; padding:11px 13px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-soft); font-size:.64rem; }
.onboarding-options.compact span { min-height:44px; }
.onboarding-options input:checked + span { border-color:var(--analysis); background:color-mix(in srgb,var(--analysis) 9%,var(--premium-raised)); color:var(--premium-text); }
.onboarding-options input:focus-visible + span { outline:2px solid var(--analysis); outline-offset:2px; }
.onboarding-options strong { color:var(--premium-text); font-size:.68rem; }
.onboarding-options small { color:var(--premium-muted); font-size:.57rem; }
.onboarding-modal .btn-primary { margin-top:18px; }
.project-toolbar { display:grid; grid-template-columns:minmax(190px,1fr) auto 170px; gap:8px; align-items:center; margin:0 0 9px; }
.project-search { display:flex; min-height:38px; align-items:center; gap:8px; padding:0 10px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); }
.project-search svg { width:15px; height:15px; fill:none; stroke:var(--premium-muted); stroke-width:1.4; }
.project-search input { width:100%; min-height:0; padding:0; border:0; outline:0; background:transparent; color:var(--premium-text); font-size:.64rem; }
.project-filters { display:flex; gap:2px; padding:3px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); }
.project-filters button { min-height:30px; padding:0 8px; border:0; border-radius:4px; background:transparent; color:var(--premium-muted); font-size:.57rem; font-weight:600; }
.project-filters button.active { color:var(--premium-text); background:var(--premium-surface); }
#projectSort { min-height:38px; padding:0 9px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-soft); font-size:.61rem; }
.project-results-count { min-height:17px; margin-bottom:5px; color:var(--premium-muted); font-size:.56rem; }
.indicator-card { position:relative; }
.project-favorite { position:absolute; top:9px; right:9px; width:28px; height:28px; border:0; border-radius:5px; background:transparent; color:var(--premium-muted); font-size:1rem; }
.project-favorite:hover,.project-favorite.active { color:var(--premium-gold); background:var(--premium-raised); }

@media (max-width: 700px) {
  .conversation-head { align-items:flex-start; }
  .workspace-command-bar .command-new { width:34px; min-width:34px; padding:0; }
  .workspace-command-bar .command-new svg { width:16px; min-width:16px; flex-shrink:0; }
  .ai-mode-switch button { padding:0 7px; }
  .ai-mode-settings { grid-template-columns:1fr; }
  .ai-mode-settings span { min-height:0; }
  .ai-depth-settings { align-items:stretch; flex-direction:column; }
  .ai-depth-segment { width:100%; min-width:0; }
  .ai-depth-segment span { min-height:44px; }
  .next-action-band { align-items:flex-start; flex-direction:column; }
  .next-action-band .btn { width:100%; }
  .onboarding-options { grid-template-columns:1fr; }
  .settings-inline-action { align-items:flex-start; flex-direction:column; }
  .project-toolbar { grid-template-columns:1fr; }
  .project-filters { overflow-x:auto; }
  .project-filters button { flex:0 0 auto; }
}

@media (max-width: 420px) {
  .ai-depth-control { align-items:stretch; flex-direction:column; gap:4px; }
  .ai-depth-control > div { width:100%; }
  .ai-depth-control button { min-height:32px; padding:0 4px; }
  .ai-depth-segment { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Secondary authenticated surfaces */
.rebuild-secondary-content { min-width: 0; padding: 28px 30px 60px; opacity: 0; transform: translateY(3px); transition: opacity 180ms ease, transform 180ms ease; background: var(--premium-canvas); }
.page-ready.rebuild-app .rebuild-app-content,
.page-ready.rebuild-app .rebuild-secondary-content { opacity: 1; transform: none; }
.rebuild-secondary-content .app-topbar { position: sticky; z-index: 30; top: -28px; align-items: center; margin: -28px -30px 28px; padding: 18px 30px; border-bottom: 1px solid var(--premium-line); background: rgba(8,10,12,.94); backdrop-filter: blur(12px); }
.rebuild-secondary-content .app-topbar h1 { margin: 3px 0 0; color: var(--premium-text); font-size: 1.45rem; }
.rebuild-secondary-content .app-topbar p { margin: 5px 0 0; color: var(--premium-muted); font-size: .68rem; }
.rebuild-secondary-content .indicators-panel,
.rebuild-secondary-content .journal-add-form,
.rebuild-secondary-content .journal-feedback,
.rebuild-secondary-content .journal-table-wrap { border-color: var(--premium-line); border-radius: 7px; background: var(--premium-surface); box-shadow: none; }
.rebuild-secondary-content .indicator-card,
.rebuild-secondary-content .history-card,
.rebuild-secondary-content .journal-stat-card,
.rebuild-secondary-content .library-card { border-color: var(--premium-line); border-radius: 7px; background: var(--premium-surface); box-shadow: none; }
.rebuild-secondary-content .indicator-card:hover,
.rebuild-secondary-content .history-card:hover,
.rebuild-secondary-content .library-card:hover { border-color: #3a444e; transform: translateY(-2px); }
.rebuild-secondary-content input,
.rebuild-secondary-content select,
.rebuild-secondary-content textarea { border-color: #2d353d; border-radius: 5px; background: #0b0e11; }
.journal-table-wrap { overflow-x: auto; }
.journal-table { min-width: 680px; }

/* Learning Hub */
.premium-learning-page { overflow-y: auto; }
.premium-secondary-topbar > div:first-of-type { min-width: 0; }
.learning-progress { width: 190px; flex: 0 0 auto; }
.learning-progress > span { display: block; margin-bottom: 7px; color: var(--premium-muted); font-size: .58rem; text-align: right; }
.learning-progress strong { color: var(--premium-soft); }
.learning-progress > div { height: 4px; overflow: hidden; border-radius: 4px; background: var(--premium-line); }
.learning-progress i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--premium-green); transition: width 240ms ease; }
.learning-feature { display: grid; grid-template-columns: minmax(300px,.75fr) minmax(440px,1.25fr); min-height: 310px; margin-bottom: 24px; overflow: hidden; border: 1px solid var(--premium-line); border-radius: 7px; background: var(--premium-surface); }
.learning-feature-copy { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; padding: 32px; border-right: 1px solid var(--premium-line); }
.learning-product-shot { position:relative; min-width:0; margin:0; overflow:hidden; background:#080a0c; }
.learning-product-shot img { display:block; width:100%; height:100%; min-height:310px; object-fit:cover; object-position:left center; }
.learning-product-shot figcaption { position:absolute; right:14px; bottom:13px; left:14px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:9px 11px; border:1px solid rgba(255,255,255,.14); border-radius:5px; background:rgba(8,10,12,.88); color:#c8d0d7; backdrop-filter:blur(10px); }
.learning-product-shot figcaption span { color:#55c6c4; font:600 .5rem var(--font-mono); text-transform:uppercase; }
.learning-product-shot figcaption strong { font-size:.58rem; font-weight:600; text-align:right; }
.learning-feature-copy h2 { max-width: 450px; margin: 8px 0 12px; color: var(--premium-text); font: 600 1.7rem/1.14 "Space Grotesk",sans-serif; }
.learning-feature-copy p { max-width: 440px; margin: 0 0 22px; color: var(--premium-muted); font-size: .72rem; line-height: 1.6; }
.learning-product-visual { align-self: stretch; margin: 28px; overflow: hidden; border: 1px solid #343c45; border-radius: 7px; background: #080a0c; box-shadow: 0 24px 60px rgba(0,0,0,.32); }
.visual-top { display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border-bottom: 1px solid #262d34; }
.visual-top i { width: 6px; height: 6px; border-radius: 50%; background: #3a424a; }
.visual-top i:first-child { background: var(--premium-red); }.visual-top i:nth-child(2) { background: var(--premium-gold); }.visual-top i:nth-child(3) { background: var(--premium-green); }
.visual-top span { margin-left: auto; color: #737d86; font: 500 .5rem var(--font-mono); }
.visual-body { display: grid; grid-template-columns: .7fr 1.2fr .85fr; min-height: 198px; }
.visual-body > div { position: relative; min-width: 0; padding: 12px; border-right: 1px solid #242b32; }
.visual-body > div:last-child { border-right: 0; }
.visual-chat { display: flex; flex-direction: column; gap: 7px; }
.visual-chat span { display: block; height: 5px; border-radius: 3px; background: #303841; }
.visual-chat span.short { width: 65%; }
.visual-chat b { height: 42px; margin: 6px 0; border-left: 2px solid var(--premium-cyan); background: #11161a; }
.visual-chart { overflow: hidden; background-image: linear-gradient(#1d2329 1px,transparent 1px),linear-gradient(90deg,#1d2329 1px,transparent 1px); background-size: 32px 32px; }
.visual-chart em { position: absolute; left: 8%; right: 8%; top: 46%; height: 2px; transform: rotate(-8deg); background: var(--premium-cyan); box-shadow: 35px -8px 0 -1px var(--premium-cyan); }
.visual-chart i { position: relative; display: inline-block; width: 5px; height: 28px; margin: 60px 7px 0; border-top: 9px solid var(--premium-green); border-bottom: 8px solid var(--premium-green); background: var(--premium-green); }
.visual-chart i:nth-of-type(even) { border-color: var(--premium-red); background: var(--premium-red); transform: translateY(13px); }
.visual-chart strong { position: absolute; left: 10px; bottom: 9px; color: #6e7882; font-size: .5rem; }
.visual-code { display: flex; flex-direction: column; gap: 8px; padding-top: 25px !important; }
.visual-code span { overflow: hidden; color: #aab3bc; font: 500 .48rem var(--font-mono); white-space: nowrap; }.visual-code .cyan { color: var(--premium-cyan); }.visual-code .green { color: var(--premium-green); }
.visual-pipeline { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid #252c33; }
.visual-pipeline span { padding: 8px; color: #5d6872; font-size: .49rem; text-align: center; border-right: 1px solid #252c33; }.visual-pipeline span:last-child { border-right: 0; }.visual-pipeline .done { color: var(--premium-green); }
.learning-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.learning-search { display: flex; width: min(300px,100%); min-height: 39px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--premium-line); border-radius: 6px; background: var(--premium-raised); }
.learning-search svg { width: 16px; height: 16px; fill: none; stroke: var(--premium-muted); stroke-width: 1.4; stroke-linecap: round; }
.learning-search input { min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--premium-text); font-size: .68rem; }
.learning-filters { display: flex; gap: 4px; overflow-x: auto; }
.learning-filters button { min-height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--premium-muted); font-size: .61rem; }
.learning-filters button:hover { color: var(--premium-text); }.learning-filters button.active { border-color: var(--premium-line-strong); background: var(--premium-raised); color: var(--premium-text); }
.lesson-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.lesson-card { position: relative; min-width: 0; min-height: 225px; padding: 17px; text-align: left; border: 1px solid var(--premium-line); border-radius: 7px; background: var(--premium-surface); color: inherit; transition: border-color 150ms ease, transform 150ms ease, background 150ms ease; }
.lesson-card:hover { border-color: var(--premium-line-strong); background: var(--premium-raised); transform: translateY(-2px); }
.lesson-card.completed { border-color: #294337; }
.lesson-number { display: inline-grid; width: 27px; height: 27px; margin-bottom: 28px; place-items: center; border: 1px solid var(--premium-line-strong); border-radius: 5px; color: var(--premium-muted); font: 600 .58rem var(--font-mono); }
.lesson-category { position: absolute; top: 18px; right: 17px; color: var(--premium-muted); font-size: .53rem; font-weight: 700; text-transform: uppercase; }
.lesson-card > strong { display: block; margin-bottom: 7px; color: var(--premium-text); font: 600 .83rem "Space Grotesk",sans-serif; }
.lesson-card > p { min-height: 48px; margin: 0; color: var(--premium-muted); font-size: .62rem; line-height: 1.5; }
.lesson-meta { display: flex; gap: 7px; margin-top: 12px; }.lesson-meta em,.lesson-meta i { padding: 3px 5px; border-radius: 3px; color: var(--premium-muted); background: var(--premium-raised); font-size: .52rem; font-style: normal; }
.lesson-open { position: absolute; left: 17px; bottom: 15px; color: var(--premium-soft); font-size: .58rem; }.lesson-card.completed .lesson-open { color: var(--premium-green); }
.learning-empty { grid-column: 1 / -1; padding: 50px; text-align: center; border: 1px solid var(--premium-line); border-radius: 7px; color: var(--premium-muted); font-size: .7rem; }
.learning-boundary { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 24px; padding: 16px; border: 1px solid var(--premium-line-strong); border-radius: 7px; background: var(--premium-surface); }
.learning-boundary > div { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }.boundary-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--premium-line-strong); border-radius: 5px; color: var(--premium-cyan); font: 700 .55rem var(--font-mono); }
.learning-boundary strong { display: block; margin-bottom: 3px; color: var(--premium-text); font-size: .68rem; }.learning-boundary p { margin: 0; color: var(--premium-muted); font-size: .59rem; line-height: 1.5; }.learning-boundary > a { flex: 0 0 auto; color: var(--premium-soft); font-size: .6rem; }
.lesson-drawer { position: fixed; z-index: 1300; inset: 0; display: grid; grid-template-columns: 1fr minmax(420px,550px); }
.lesson-drawer[hidden] { display: none; }.lesson-drawer-backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.lesson-drawer > article { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--premium-surface); border-left: 1px solid var(--premium-line-strong); box-shadow: -24px 0 60px rgba(0,0,0,.4); animation: drawerIn 180ms ease both; }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } }
.lesson-drawer header { position: relative; padding: 27px 26px 22px; border-bottom: 1px solid var(--premium-line); }.lesson-close { position: absolute; top: 17px; right: 17px; width: 32px; height: 32px; border: 0; border-radius: 5px; background: var(--premium-raised); color: var(--premium-muted); font-size: 1.1rem; }
.lesson-drawer h2 { margin: 7px 36px 8px 0; color: var(--premium-text); font: 600 1.35rem/1.2 "Space Grotesk",sans-serif; }.lesson-drawer header p { margin: 0; color: var(--premium-muted); font-size: .68rem; line-height: 1.55; }
.lesson-drawer-content { flex: 1; min-height: 0; padding: 8px 26px 20px; overflow-y: auto; }.lesson-drawer-content section { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 11px; padding: 18px 0; border-bottom: 1px solid var(--premium-line); }.lesson-drawer-content section > span { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--premium-line-strong); border-radius: 50%; color: var(--premium-soft); font: 600 .58rem var(--font-mono); }.lesson-drawer-content h3 { margin: 2px 0 5px; color: var(--premium-text); font-size: .72rem; }.lesson-drawer-content p { margin: 0; color: var(--premium-muted); font-size: .64rem; line-height: 1.62; }
.lesson-drawer footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 26px; border-top: 1px solid var(--premium-line); }.drawer-open { overflow: hidden; }
.lesson-visual { margin:0 0 20px; overflow:hidden; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-canvas); }
.lesson-visual img { display:block; width:100%; height:auto; }
.lesson-visual figcaption { padding:9px 11px; color:var(--premium-muted); font-size:.56rem; }

@media (max-width: 1200px) {
  .workspace-rebuild-grid { grid-template-columns: minmax(290px,.8fr) minmax(430px,1.2fr); overflow: visible; }
  .workspace-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; overflow: visible; }
  .workspace-inspector > * { margin: 0; }
  .inspector-boundary { grid-column: 1 / -1; }
  .learning-feature { grid-template-columns: 1fr; }
  .learning-feature-copy { border-right: 0; border-bottom: 1px solid var(--premium-line); }
  .learning-product-shot img { min-height:220px; }
  .learning-product-shot figcaption { align-items:flex-start; flex-direction:column; }
  .lesson-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.toast-region { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: grid; width: min(360px, calc(100vw - 30px)); gap: 8px; }
.premium-toast { display: grid; grid-template-columns: 25px minmax(0,1fr) 24px; align-items: center; min-height: 52px; padding: 8px 9px; border: 1px solid #315041; border-radius: 7px; background: #101814; box-shadow: 0 16px 40px rgba(0,0,0,.45); animation: toastIn 180ms ease both; }
.premium-toast.error { border-color: #5b3337; background: #1a1113; }
.premium-toast > span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; color: #09110d; background: var(--premium-green); font-size: .65rem; }
.premium-toast.error > span { background: var(--premium-red); }
.premium-toast p { margin: 0; color: #d3d9dd; font-size: .67rem; line-height: 1.4; }
.premium-toast button { border: 0; background: transparent; color: #6c7781; font-size: 1rem; }
.premium-toast.leaving { opacity: 0; transform: translateY(4px); transition: 180ms ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.command-overlay { position: fixed; z-index: 1200; inset: 0; padding: 12vh 18px 18px; background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
.command-panel { width: min(580px, 100%); max-height: 70vh; margin: auto; overflow: hidden; border: 1px solid #3b444d; border-radius: 8px; background: #111519; box-shadow: 0 30px 90px rgba(0,0,0,.64); }
.command-search { display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 0 15px; border-bottom: 1px solid #293039; }
.command-search svg, .command-results svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.command-search svg { color: #737e88; }
.command-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #eef1f3; font-size: .84rem; }
.command-search kbd { padding: 3px 6px; border: 1px solid #343c44; border-radius: 4px; color: #6e7882; background: #181d22; font-size: .57rem; }
.command-panel > p { margin: 13px 16px 6px; color: #59636d; font-size: .56rem; font-weight: 700; text-transform: uppercase; }
.command-results { display: grid; max-height: 50vh; padding: 4px 8px 10px; overflow-y: auto; }
.command-results a { display: grid; grid-template-columns: 23px minmax(0,1fr) auto; min-height: 48px; padding: 7px 9px; align-items: center; gap: 9px; border-radius: 5px; color: #85909a; }
.command-results a:hover, .command-results a.selected { background: #1b2126; color: #eef1f3; }
.command-results span { display: grid; gap: 2px; }
.command-results strong { color: inherit; font-size: .69rem; }
.command-results small { color: #66717b; font-size: .57rem; }
.command-results em { color: #535d67; font-size: .67rem; font-style: normal; }
.command-empty { padding: 28px; text-align: center; color: #69737d; font-size: .68rem; }

/* Billing centre */
.billing-intro { align-items: center; }
.billing-security-note { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #294137; border-radius: 6px; color: var(--premium-green); background: #0d1512; font-size: .62rem; font-weight: 700; white-space: nowrap; }
.billing-security-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.billing-success-banner { display: grid; grid-template-columns: 34px minmax(0,1fr) 30px; align-items: center; gap: 11px; margin: -5px 0 18px; padding: 12px; border: 1px solid #2a533f; border-radius: 7px; background: #0e1914; animation: billingBannerIn 220ms ease both; }
.billing-success-banner[hidden] { display: none; }
.billing-success-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #07100b; background: var(--premium-green); font-weight: 800; }
.billing-success-banner strong { display: block; color: #dce9e1; font-size: .75rem; }
.billing-success-banner p { margin: 3px 0 0; color: #82988b; font-size: .64rem; }
.billing-success-banner button { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #71847a; font-size: 1.15rem; }
.billing-service-warning { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; margin: -5px 0 18px; padding: 11px 12px; border: 1px solid #59482d; border-radius: 7px; background: #18140e; }.billing-service-warning[hidden]{display:none;}.billing-service-warning>span{display:grid;width:24px;height:24px;place-items:center;border-radius:50%;background:var(--premium-gold);color:#171109;font-weight:800;}.billing-service-warning strong{display:block;color:#e6dac4;font-size:.69rem;}.billing-service-warning p{margin:2px 0 0;color:#9b8b70;font-size:.6rem;}.billing-service-warning .btn{white-space:nowrap;}
.account-verification-banner { margin: 0 0 18px; }
.email-verification-setting { margin-top: 0; }
@keyframes billingBannerIn { from { opacity: 0; transform: translateY(-5px); } }

.billing-account-grid { display: grid; grid-template-columns: minmax(360px,1.5fr) minmax(210px,.75fr) minmax(250px,.9fr); gap: 10px; margin-bottom: 18px; }
.billing-current-card,.billing-usage-card,.billing-method-card { min-width: 0; min-height: 236px; padding: 19px; border: 1px solid var(--premium-line); border-radius: 7px; background: var(--premium-surface); }
.billing-current-card { background: linear-gradient(135deg,#101713 0%,var(--premium-surface) 58%); border-color: #2a3d33; }
.billing-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.billing-card-head h3 { margin: 5px 0 0; color: var(--premium-text); font: 600 1.05rem "Space Grotesk",sans-serif; }
.billing-state-pill,.billing-method-lock { padding: 4px 7px; border: 1px solid var(--premium-line-strong); border-radius: 4px; color: var(--premium-muted); background: var(--premium-raised); font: 600 .54rem var(--font-mono); text-transform: uppercase; white-space: nowrap; }
.billing-state-pill.active { border-color: #2e5a45; color: var(--premium-green); background: #0c1812; }
.billing-state-pill.scheduled { border-color: #5a492d; color: var(--premium-gold); background: #18140d; }
.billing-current-copy { min-height: 38px; margin: 16px 0 13px; color: var(--premium-soft); font-size: .69rem; line-height: 1.55; }
.billing-account-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid var(--premium-line); border-bottom: 1px solid var(--premium-line); }
.billing-account-stats > div { min-width: 0; padding: 11px 9px; border-right: 1px solid var(--premium-line); }
.billing-account-stats > div:first-child { padding-left: 0; }.billing-account-stats > div:last-child { border-right: 0; }
.billing-account-stats span { display: block; margin-bottom: 4px; color: var(--premium-muted); font-size: .53rem; text-transform: uppercase; }
.billing-account-stats strong { display: block; overflow: hidden; color: #dce1e5; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.billing-current-actions { display: flex; gap: 7px; margin-top: 14px; }
.billing-fine-print { margin: 10px 0 0; color: #657069; font-size: .54rem; line-height: 1.45; }

.billing-usage-card .billing-card-head > strong { color: var(--premium-green); font: 700 .7rem var(--font-mono); }
.billing-usage-number { margin-top: 25px; }.billing-usage-number strong { display: block; color: var(--premium-text); font: 600 2.05rem/1 "Space Grotesk",sans-serif; }.billing-usage-number span { color: var(--premium-muted); font-size: .61rem; }
.billing-usage-track { height: 6px; margin: 19px 0 8px; overflow: hidden; border-radius: 5px; background: #20262c; }.billing-usage-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--premium-green); transition: width 260ms ease; }
.billing-usage-meta { display: flex; justify-content: space-between; color: var(--premium-muted); font-size: .55rem; }
.billing-inline-link { display: inline-block; margin-top: 20px; color: var(--premium-soft); font-size: .61rem; }.billing-inline-link:hover { color: var(--premium-text); }

.billing-method-card > p { margin: 15px 0 12px; color: var(--premium-muted); font-size: .64rem; line-height: 1.5; }
.billing-method-fields { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(84px,.55fr); gap: 7px; }
.billing-method-fields label { color: var(--premium-muted); font-size: .55rem; }
.billing-method-fields select { width: 100%; min-height: 37px; margin-top: 5px; padding: 0 8px; border: 1px solid var(--premium-line-strong); border-radius: 5px; background: #0b0e11; color: var(--premium-text); font-size: .62rem; }
.billing-method-card > small { display: block; margin-top: 10px; color: #626d77; font-size: .52rem; line-height: 1.45; }
.billing-preference-status { min-height: 15px; margin: 7px 0 0 !important; color: var(--premium-green) !important; }

.billing-plans-section,.pending-payment-card,#billingHistoryCard,.billing-comparison-section,.billing-faq-section { margin-top: 12px; }
.billing-section-heading { align-items: flex-end; }.billing-section-heading > a,.billing-faq-section .section-heading > a { color: var(--premium-soft); font-size: .61rem; white-space: nowrap; }
.rebuild-app .dash-plan-grid { gap: 8px; }
.rebuild-app .dash-plan-card { position: relative; display: flex; min-height: 330px; flex-direction: column; padding: 19px; transition: border-color 160ms ease,background 160ms ease,transform 160ms ease; }
.rebuild-app .dash-plan-card:hover { transform: translateY(-2px); }
.rebuild-app .dash-plan-card.recommended { border-color: #5c4826; box-shadow: inset 0 2px 0 var(--premium-gold); }
.rebuild-app .dash-plan-card.current { border-color: #315342; background: #0e1612; box-shadow: inset 0 2px 0 var(--premium-green); }
.dash-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.dash-plan-head h4 { color: var(--premium-text); }.dash-plan-head span { padding: 3px 5px; border-radius: 3px; color: var(--premium-gold); background: #1c170d; font-size: .52rem; font-weight: 700; text-transform: uppercase; }.dash-plan-card.current .dash-plan-head span { color: var(--premium-green); background: #0b1a12; }
.dash-plan-price { margin: 15px 0 0; }.dash-plan-description { min-height: 36px; margin: 13px 0 12px; color: var(--premium-muted); font-size: .63rem; line-height: 1.5; }
.dash-plan-card ul { display: grid; gap: 8px; margin: 0 0 17px; }.dash-plan-card li { position: relative; padding-left: 15px; color: var(--premium-soft); font-size: .6rem; line-height: 1.4; }.dash-plan-card li::before { content: ""; position: absolute; left: 1px; top: 4px; width: 6px; height: 3px; border-left: 1px solid var(--premium-green); border-bottom: 1px solid var(--premium-green); transform: rotate(-45deg); }
.dash-plan-card > .btn { width: 100%; margin-top: auto !important; }

.pending-payment-layout { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 24px; }.pending-payment-title { margin: 0 0 4px; color: var(--premium-text); font-size: .75rem; font-weight: 700; }.pending-payment-layout .app-chat-note { margin: 0; }.pending-payment-details { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 13px 0 0; border-top: 1px solid var(--premium-line); }.pending-payment-details > div { padding: 11px 10px 0 0; border: 0; }.pending-payment-details > div:nth-child(2) { text-align: left; }.pending-payment-details dt { font-size: .52rem; }.pending-payment-details dd { font-size: .64rem; }
.pending-payment-actions { display: grid; justify-items: end; gap: 10px; }.pending-payment-actions > span { color: var(--premium-green); font-size: .55rem; }.pending-payment-actions i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--premium-green); animation: pendingPulse 1.7s ease infinite; }@keyframes pendingPulse { 50% { opacity: .35; } }
.pending-expired-state { display: flex; align-items: center; justify-content: space-between; gap: 18px; }.pending-expired-state strong { color: var(--premium-text); font-size: .72rem; }.pending-expired-state p { margin: 4px 0 0; color: var(--premium-muted); font-size: .62rem; }

.billing-history-tools { display: grid; grid-template-columns: minmax(180px,1fr) 170px 140px; gap: 7px; margin: 16px 0 8px; }.billing-search { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--premium-line); border-radius: 5px; background: #0b0e11; }.billing-search svg { width: 15px; height: 15px; fill: none; stroke: var(--premium-muted); stroke-width: 1.4; }.billing-search input { width: 100%; min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--premium-text); font-size: .64rem; }.billing-history-tools select { min-height: 38px; padding: 0 9px; border: 1px solid var(--premium-line); border-radius: 5px; background: #0b0e11; color: var(--premium-soft); font-size: .62rem; }
.billing-history { gap: 0; }.billing-row { display: grid; grid-template-columns: 30px minmax(0,1fr) minmax(210px,auto); align-items: center; gap: 11px; min-height: 76px; padding: 11px 2px; }.billing-row-icon { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid var(--premium-line-strong); border-radius: 50%; color: var(--premium-green); background: var(--premium-raised); font-size: .65rem; }.billing-row-main { gap: 3px; }.billing-plan { color: var(--premium-text); font-size: .67rem; text-transform: none; }.billing-date { font-size: .57rem; }.billing-row-meta { display: grid; grid-template-columns: minmax(100px,auto) auto; justify-items: end; gap: 4px 8px; }.billing-amount { font-size: .65rem; }.billing-status { font-size: .5rem; }.billing-row-actions { grid-column: 1 / -1; display: flex; gap: 11px; }.billing-row-action { color: var(--premium-muted); font-size: .55rem; }.billing-row-action:hover { color: var(--premium-text); }.billing-row-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }.billing-settlement,.billing-expected,.billing-discount-code { padding: 2px 4px; border-radius: 3px; background: var(--premium-raised); color: var(--premium-muted); font-size: .48rem; text-transform: uppercase; }.billing-settlement.overpaid { color: var(--premium-cyan); }.billing-settlement.underpaid { color: var(--premium-gold); }.billing-discount-code { color: var(--premium-green); }.billing-show-more { display: block; margin: 13px auto 0; }

.billing-comparison { overflow-x: auto; border-top: 1px solid var(--premium-line); }.billing-comparison-row { display: grid; min-width: 610px; grid-template-columns: 1.4fr repeat(3,1fr); border-bottom: 1px solid var(--premium-line); }.billing-comparison-row > * { padding: 12px; border-right: 1px solid var(--premium-line); color: var(--premium-soft); font-size: .61rem; text-align: center; }.billing-comparison-row > *:first-child { color: var(--premium-text); text-align: left; }.billing-comparison-row > *:last-child { border-right: 0; }.billing-comparison-row.head > * { color: var(--premium-muted); font: 600 .52rem var(--font-mono); text-transform: uppercase; }
.billing-faq-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }.billing-faq-list details { border-bottom: 1px solid var(--premium-line); }.billing-faq-list summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; color: var(--premium-soft); font-size: .65rem; font-weight: 600; cursor: pointer; list-style: none; }.billing-faq-list summary::-webkit-details-marker { display: none; }.billing-faq-list summary span { color: var(--premium-muted); font-size: 1rem; transition: transform 150ms ease; }.billing-faq-list details[open] summary span { transform: rotate(45deg); }.billing-faq-list p { margin: -2px 28px 14px 0; color: var(--premium-muted); font-size: .6rem; line-height: 1.6; }

[data-theme="light"] .billing-security-note { border-color:#c8dfd1;background:#f1faf5;color:#167b4c; }
[data-theme="light"] .billing-success-banner { border-color:#bddbc9;background:#f1faf5; }[data-theme="light"] .billing-success-banner strong{color:#205d3d;}[data-theme="light"] .billing-success-banner p{color:#5d7667;}
[data-theme="light"] .billing-service-warning{border-color:#e2d0ad;background:#fff9ee;}[data-theme="light"] .billing-service-warning strong{color:#704d12;}[data-theme="light"] .billing-service-warning p{color:#806b49;}
[data-theme="light"] .billing-current-card { border-color:#cfe0d6;background:linear-gradient(135deg,#f3faf6,#fff 58%); }
[data-theme="light"] .billing-current-copy,[data-theme="light"] .billing-plan-card p { color:#617069; }[data-theme="light"] .billing-account-stats strong{color:#29363f;}[data-theme="light"] .billing-account-stats,[data-theme="light"] .billing-account-stats>div{border-color:#e0e6e3;}
[data-theme="light"] .billing-state-pill,[data-theme="light"] .billing-method-lock,[data-theme="light"] .billing-settlement,[data-theme="light"] .billing-expected,[data-theme="light"] .billing-discount-code{border-color:#d5dde2;background:#eef2f4;}
[data-theme="light"] .billing-state-pill.active{border-color:#b9dac7;background:#eef9f2;color:#167b4c;}[data-theme="light"] .billing-state-pill.scheduled{border-color:#dfd0b8;background:#fff8ec;color:#8d5d0d;}
[data-theme="light"] .billing-usage-track{background:#e5eaed;}[data-theme="light"] .billing-method-fields select,[data-theme="light"] .billing-search,[data-theme="light"] .billing-history-tools select{border-color:#cfd8de;background:#fff;color:#26333d;}[data-theme="light"] .billing-search input{color:#17212a;}
[data-theme="light"] .rebuild-app .dash-plan-card.recommended{border-color:#d6be94;}[data-theme="light"] .rebuild-app .dash-plan-card.current{border-color:#bdd7c8;background:#f5faf7;}[data-theme="light"] .dash-plan-head span{background:#fff5e2;color:#8f5b00;}[data-theme="light"] .dash-plan-card.current .dash-plan-head span{background:#eaf7ef;color:#167b4c;}
[data-theme="light"] .billing-row-icon{border-color:#d5dde2;background:#f2f5f6;}[data-theme="light"] .billing-comparison-row,[data-theme="light"] .billing-comparison-row>*{border-color:#e1e6e9;}

@media (max-width: 1160px) { .billing-account-grid { grid-template-columns: 1.4fr 1fr; }.billing-method-card { grid-column: 1 / -1; min-height: 0; }.billing-method-fields { max-width: 460px; } }

@media (prefers-reduced-motion: reduce) {
  .rebuild-app *, .rebuild-app *::before, .rebuild-app *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body.user-reduce-motion *, body.user-reduce-motion *::before, body.user-reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .prompt-grid, .workflow-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workflow-card:last-child { grid-column: 1 / -1; }
  .security-fields { grid-template-columns: 1fr; }
  .workspace-command-bar .workspace-search { display: none; }
}

@media (max-width: 1040px) {
  .rebuild-app .rebuild-app-shell { grid-template-columns: minmax(0,1fr); }
  .rebuild-app .rebuild-sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; transform: translateX(-100%); }
  .rebuild-app .rebuild-sidebar.open { transform: translateX(0); }
  .workspace-rebuild-grid { flex: none; }
}

@media (max-width: 860px) {
  .rebuild-app .rebuild-sidebar { width: min(286px, 86vw); }
  .premium-page { margin-left: 0; }
  .premium-topbar { padding: 0 18px; }
  .premium-topbar-context { display: none; }
  .premium-page-inner { padding: 24px 18px 56px; }
  .dashboard-flow-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; gap: 18px; }
  .settings-nav { position: static; grid-template-columns: repeat(3,1fr); padding: 0 0 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--premium-line); }
  .settings-nav span { display: none; }
  .settings-nav a { min-width: max-content; text-align: center; }
  .dash-plan-grid { grid-template-columns: 1fr; }
  .billing-account-grid { grid-template-columns: 1fr; }
  .billing-method-card { grid-column: auto; }
  .billing-current-card,.billing-usage-card,.billing-method-card { min-height: 0; }
  .rebuild-app .rebuild-app-shell { grid-template-columns: 1fr; }
  .rebuild-secondary-content { padding: 22px 18px 50px; }
  .rebuild-secondary-content .app-topbar { top: -22px; margin: -22px -18px 22px; padding: 14px 18px; }
  .learning-feature-copy { padding: 24px; }
  .learning-product-visual { margin: 18px; }
}

@media (max-width: 620px) {
  .premium-topbar { min-height: 56px; padding: 0 12px; }
  .icon-text-button span, .icon-text-button kbd { display: none; }
  .icon-text-button { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .avatar-button,.theme-toggle,.page-tour-trigger { width:44px; height:44px; }
  .premium-page-inner { padding: 21px 13px 48px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; margin-bottom: 18px; }
  .dashboard-heading h1 { font-size: 1.75rem; }
  .heading-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .premium-segmented { display: grid; width: 100%; grid-template-columns: 1fr 1fr 1fr; }
  .premium-segmented .dash-tab { min-width: 0; min-height:44px; padding: 0 5px; font-size: .61rem; }
  .subscription-ribbon { align-items: flex-start; flex-direction: column; }
  .subscription-ribbon > div { align-items: flex-start; flex-wrap: wrap; }
  .subscription-ribbon p { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .metric-tile { min-height: 132px; padding: 13px; }
  .prompt-grid, .workflow-grid { grid-template-columns: 1fr; }
  .workflow-card:last-child { grid-column: auto; }
  .surface-section, .settings-group { padding: 15px; }
  .section-heading { align-items: flex-start; }
  .dashboard-project { grid-template-columns: auto minmax(0,1fr) auto; }
  .dashboard-project .project-status { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-form-foot { align-items: stretch; flex-direction: column; }
  .settings-form-foot .btn { width: 100%; }
  .preference-row { min-height: 82px; align-items: flex-start; flex-direction: column; gap: 12px; padding: 13px 0; }
  .preference-row select, .mini-segment { width: 100%; }
  .mini-segment label { flex: 1; }
  .mini-segment span { width: 100%; }
  .preference-row > .switch { align-self: flex-end; margin-top: -38px; }
  .billing-intro { align-items: flex-start; flex-direction: column; }.billing-security-note { align-self: flex-start; }
  .billing-success-banner { grid-template-columns: 30px minmax(0,1fr) 28px; }
  .billing-service-warning { grid-template-columns: 28px minmax(0,1fr); }.billing-service-warning .btn{grid-column:2;width:100%;}
  .billing-current-card,.billing-usage-card,.billing-method-card { padding: 15px; }
  .billing-account-stats { grid-template-columns: 1fr 1fr; }.billing-account-stats > div:nth-child(2) { border-right: 0; }.billing-account-stats > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--premium-line); }
  .billing-current-actions { align-items: stretch; flex-direction: column; }.billing-current-actions .btn { width: 100%; }
  .billing-method-fields,.billing-history-tools { grid-template-columns: 1fr; }.billing-method-fields { max-width: none; }
  .rebuild-app .dash-plan-card { min-height: 305px; }
  .pending-payment-layout { grid-template-columns: 1fr; gap: 15px; }.pending-payment-details { grid-template-columns: 1fr 1fr; }.pending-payment-actions { justify-items: stretch; }.pending-payment-actions > span { text-align: left; }.pending-payment-actions .btn { width: 100%; }
  .pending-expired-state { align-items: stretch; flex-direction: column; }.pending-expired-state .btn { width: 100%; }
  .billing-row { grid-template-columns: 28px minmax(0,1fr); align-items: start; }.billing-row-meta { grid-column: 2; justify-items: start; grid-template-columns: auto auto; }.billing-row-actions { grid-column: 1 / -1; }.billing-history-tools select,.billing-search { min-height: 42px; }
  .billing-section-heading { align-items: flex-start; flex-direction: column; }.billing-faq-list { grid-template-columns: 1fr; }
  .toast-region { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .live-chart-meta span:last-child { display: none; }
  .pine-editor-foot { align-items: stretch; flex-direction: column; }
  .pine-editor-foot > div { display: grid; grid-template-columns: 1fr 1fr; }
  .verification-actions { display: grid; grid-template-columns: 1fr; }
  .evidence-field-grid { grid-template-columns: 1fr; }
  .evidence-form-head,.evidence-form-actions { align-items:stretch; flex-direction:column; }
  .evidence-form-actions .btn { width:100%; }
  .workspace-rebuild-grid { display: flex; flex-direction: column; margin: 7px; overflow: visible; gap: 7px; border: 0; background: transparent; }
  .workspace-conversation, .workspace-stage, .workspace-inspector { border: 1px solid var(--premium-line); border-radius: 7px; }
  .workspace-conversation { min-height: 520px; }
  .workspace-stage { min-height: 620px; }
  .workspace-inspector { display: flex; overflow: hidden; }
  .premium-secondary-topbar { align-items: flex-start !important; }
  .premium-secondary-topbar > div { flex: 1; }
  .premium-secondary-topbar h1 { font-size: 1.15rem !important; }
  .premium-secondary-topbar p { display: none; }
  .learning-progress { width: 95px; }
  .learning-feature-copy h2 { font-size: 1.35rem; }
  .learning-product-visual { margin: 10px; }
  .visual-body { grid-template-columns: .8fr 1.2fr; }
  .visual-code { display: none; }
  .learning-toolbar { align-items: stretch; flex-direction: column; }
  .learning-search { width: 100%; }
  .lesson-grid { grid-template-columns: 1fr; }
  .learning-boundary { align-items: flex-start; flex-direction: column; }
  .lesson-drawer { grid-template-columns: 1fr; padding-top: 36px; }
  .lesson-drawer-backdrop { position: absolute; inset: 0; }
  .lesson-drawer > article { position: relative; z-index: 1; border-top: 1px solid #343d46; border-left: 0; border-radius: 8px 8px 0 0; }
}

/* Authenticated mobile navigation and optional contextual tours */
.mobile-product-nav,.mobile-more-sheet { display:none; }
.page-tour-trigger { display:grid; width:34px; height:34px; flex:0 0 auto; place-items:center; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-soft); font:700 .68rem var(--font-mono); }
.page-tour-trigger:hover { border-color:var(--premium-line-strong); color:var(--premium-text); }
.product-tour { position:fixed; z-index:1400; inset:0; }
.product-tour-backdrop { position:absolute; inset:0; width:100%; border:0; background:rgba(0,0,0,.64); backdrop-filter:blur(2px); }
.product-tour section { position:absolute; z-index:2; right:22px; bottom:22px; width:min(390px,calc(100vw - 28px)); padding:17px; border:1px solid var(--premium-line-strong); border-radius:7px; background:var(--premium-surface); box-shadow:0 24px 70px rgba(0,0,0,.5); }
.product-tour header { display:flex; align-items:center; justify-content:space-between; color:var(--premium-muted); font:600 .58rem var(--font-mono); text-transform:uppercase; }
.product-tour header button { width:30px; height:30px; border:0; border-radius:5px; background:var(--premium-raised); color:var(--premium-muted); font-size:1rem; }
.product-tour h2 { margin:12px 0 7px; color:var(--premium-text); font-size:1rem; }
.product-tour p { min-height:42px; margin:0; color:var(--premium-muted); font-size:.7rem; line-height:1.55; }
.product-tour footer { display:flex; justify-content:flex-end; gap:7px; margin-top:16px; }
.tour-target { position:relative !important; outline:2px solid var(--premium-cyan); outline-offset:5px; box-shadow:0 0 0 8px rgba(74,201,214,.18) !important; }
.tour-open { overflow:hidden; }

@media (max-width: 760px) {
  .rebuild-app,.premium-shell { padding-bottom:68px; }
  .rebuild-app .rebuild-app-content,
  .rebuild-app .rebuild-secondary-content {
    padding-bottom:calc(84px + env(safe-area-inset-bottom));
  }
  .rebuild-app .workspace-rebuild-grid {
    padding-bottom:calc(84px + env(safe-area-inset-bottom));
  }
  .mobile-product-nav { position:fixed; z-index:1000; right:0; bottom:0; left:0; display:grid; grid-template-columns:repeat(5,1fr); height:64px; padding:5px max(7px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left)); border-top:1px solid var(--premium-line-strong); background:color-mix(in srgb,var(--premium-canvas) 94%,transparent); box-shadow:0 -12px 30px rgba(0,0,0,.22); backdrop-filter:blur(14px); }
  .mobile-product-nav a,.mobile-product-nav button { display:grid; min-width:0; min-height:48px; place-items:center; align-content:center; gap:3px; border:0; border-radius:5px; background:transparent; color:var(--premium-muted); font-size:.5rem; font-weight:600; }
  .mobile-product-nav a.active,.mobile-product-nav a:hover,.mobile-product-nav button:hover { color:var(--premium-text); background:var(--premium-raised); }
  .mobile-product-nav svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.35; stroke-linecap:round; stroke-linejoin:round; }
  .mobile-more-sheet { position:fixed; z-index:1300; inset:0; display:block; }
  .mobile-more-sheet[hidden] { display:none; }
  .mobile-sheet-backdrop { position:absolute; inset:0; width:100%; border:0; background:rgba(0,0,0,.66); }
  .mobile-more-sheet > div { position:absolute; right:0; bottom:0; left:0; display:grid; padding:10px 13px calc(14px + env(safe-area-inset-bottom)); border-top:1px solid var(--premium-line-strong); border-radius:8px 8px 0 0; background:var(--premium-surface); box-shadow:0 -24px 70px rgba(0,0,0,.44); }
  .mobile-more-sheet header { display:flex; min-height:42px; align-items:center; justify-content:space-between; border-bottom:1px solid var(--premium-line); }
  .mobile-more-sheet header strong { color:var(--premium-text); font-size:.78rem; }
  .mobile-more-sheet header button { width:32px; height:32px; border:0; border-radius:5px; background:var(--premium-raised); color:var(--premium-muted); font-size:1rem; }
  .mobile-more-sheet a { display:grid; grid-template-columns:24px minmax(0,1fr); align-items:center; gap:10px; min-height:54px; border-bottom:1px solid var(--premium-line); color:var(--premium-muted); }
  .mobile-more-sheet a > svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.4; }
  .mobile-more-sheet a span { display:grid; gap:2px; }.mobile-more-sheet a strong { color:var(--premium-text); font-size:.68rem; }.mobile-more-sheet a small { color:var(--premium-muted); font-size:.56rem; }
  .mobile-sheet-open { overflow:hidden; }
  .toast-region { bottom:74px; }
  .product-tour section { right:10px; bottom:74px; left:10px; width:auto; }
  .settings-nav a,.project-filters button,.calendar-controls button,
  .journal-entry-actions button,.template-card > header button,
  .journal-editor-overlay > aside > header button,.template-drawer > aside > header button,
  .product-tour header button,.mobile-more-sheet header button { min-height:44px; }
  .journal-entry-actions button,.template-card > header button,
  .journal-editor-overlay > aside > header button,.template-drawer > aside > header button,
  .product-tour header button,.mobile-more-sheet header button { width:44px; height:44px; }
}

/* Research journal workbench */
.journal-workbench { max-width:1500px; }
.journal-metric-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.journal-metric-grid article { display:grid; min-width:0; min-height:116px; align-content:space-between; padding:14px; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-surface); }
.journal-metric-grid span { color:var(--premium-muted); font-size:.56rem; font-weight:700; text-transform:uppercase; }
.journal-metric-grid strong { overflow:hidden; color:var(--premium-text); font:600 clamp(1rem,1.7vw,1.45rem) var(--font-mono); text-overflow:ellipsis; white-space:nowrap; }
.journal-metric-grid small { color:var(--premium-muted); font-size:.53rem; line-height:1.35; }
.journal-analysis-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(290px,.75fr); gap:10px; margin-bottom:10px; }
.journal-analysis-panel,.journal-calendar-panel,.journal-records-panel { min-width:0; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-surface); }
.journal-analysis-panel { min-height:270px; padding:16px; }
.journal-analysis-panel > header,.journal-calendar-panel > header,.journal-records-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.journal-analysis-panel h2,.journal-calendar-panel h2,.journal-records-panel h2 { margin:3px 0 0; color:var(--premium-text); font-size:.85rem; }
.journal-chart { position:relative; min-height:190px; margin-top:15px; overflow:hidden; border-top:1px solid var(--premium-line); }
.journal-chart svg { display:block; width:100%; height:155px; overflow:visible; }
.journal-zero-line { stroke:var(--premium-line-strong); stroke-width:1; stroke-dasharray:4 4; }
.journal-equity-line { fill:none; stroke:var(--premium-cyan); stroke-width:2; vector-effect:non-scaling-stroke; }
.journal-chart-axis { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; color:var(--premium-muted); font-size:.52rem; }
.journal-chart-axis strong { color:var(--premium-text); font:600 .68rem var(--font-mono); }.journal-chart-axis span:last-child { text-align:right; }
.journal-chart-empty { display:grid; min-height:185px; place-content:center; gap:5px; text-align:center; }.journal-chart-empty strong { color:var(--premium-text); font-size:.72rem; }.journal-chart-empty span { color:var(--premium-muted); font-size:.59rem; }
.journal-insight-copy { min-height:64px; margin:17px 0 14px; color:var(--premium-soft); font-size:.68rem; line-height:1.6; }
.journal-breakdown { display:grid; gap:5px; }
.journal-breakdown > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 10px; padding:9px 0; border-top:1px solid var(--premium-line); }
.journal-breakdown span { overflow:hidden; color:var(--premium-text); font-size:.62rem; text-overflow:ellipsis; white-space:nowrap; }.journal-breakdown strong { font:600 .63rem var(--font-mono); }.journal-breakdown strong.win { color:var(--premium-green); }.journal-breakdown strong.loss { color:var(--premium-red); }.journal-breakdown small { grid-column:1/-1; color:var(--premium-muted); font-size:.52rem; }
.journal-calendar-panel { margin-bottom:10px; padding:16px; }
.calendar-controls { display:flex; gap:4px; }.calendar-controls button { min-height:30px; padding:0 9px; border:1px solid var(--premium-line); border-radius:5px; background:var(--premium-raised); color:var(--premium-muted); font-size:.56rem; }.calendar-controls button:hover { color:var(--premium-text); border-color:var(--premium-line-strong); }
.journal-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; margin-top:14px; }
.calendar-weekday { padding:3px; color:var(--premium-muted); font-size:.49rem; font-weight:700; text-align:center; text-transform:uppercase; }
.calendar-day { display:grid; min-width:0; min-height:48px; align-content:space-between; padding:6px; border:1px solid var(--premium-line); border-radius:5px; background:var(--premium-raised); }.calendar-day.blank { visibility:hidden; }.calendar-day i { color:var(--premium-muted); font-size:.51rem; font-style:normal; }.calendar-day strong { overflow:hidden; font:600 .56rem var(--font-mono); text-overflow:ellipsis; }.calendar-day.positive { border-color:#27513e; background:rgba(67,196,134,.06); }.calendar-day.positive strong { color:var(--premium-green); }.calendar-day.negative { border-color:#513035; background:rgba(237,105,111,.05); }.calendar-day.negative strong { color:var(--premium-red); }
.journal-records-panel { padding:16px; }.journal-records-heading > span { color:var(--premium-muted); font-size:.56rem; }
.journal-filterbar { display:grid; grid-template-columns:minmax(240px,1fr) 190px 150px auto; gap:7px; margin:14px 0 10px; }.journal-filterbar select { min-height:38px; padding:0 29px 0 10px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-soft); font-size:.61rem; }
.journal-favorite-filter { display:flex; min-height:38px; align-items:center; gap:7px; padding:0 10px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-muted); font-size:.59rem; }
.journal-entry-list { display:grid; gap:6px; }
.journal-entry-card { position:relative; display:grid; grid-template-columns:48px minmax(0,1fr) auto; min-width:0; gap:12px; padding:13px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); transition:border-color 150ms ease,background 150ms ease; }.journal-entry-card:hover { border-color:var(--premium-line-strong); background:var(--premium-surface); }
.journal-entry-date { display:grid; align-content:start; text-align:center; }.journal-entry-date strong { color:var(--premium-text); font:600 1rem var(--font-mono); }.journal-entry-date span { color:var(--premium-muted); font-size:.49rem; text-transform:uppercase; }
.journal-entry-main { min-width:0; }.journal-entry-main header { display:flex; align-items:center; justify-content:space-between; gap:10px; }.journal-entry-main header > div { display:flex; min-width:0; align-items:center; gap:6px; }.journal-entry-main header > div > strong { overflow:hidden; color:var(--premium-text); font-size:.72rem; text-overflow:ellipsis; white-space:nowrap; }.journal-entry-main header > em { color:var(--premium-muted); font:600 .72rem var(--font-mono); font-style:normal; }.journal-entry-main header > em.win { color:var(--premium-green); }.journal-entry-main header > em.loss { color:var(--premium-red); }
.journal-direction,.journal-status { padding:3px 5px; border-radius:3px; color:var(--premium-muted); background:var(--premium-canvas); font-size:.48rem; text-transform:uppercase; }.journal-direction.long { color:var(--premium-green); }.journal-direction.short { color:var(--premium-red); }
.journal-entry-main > p { margin:5px 0 7px; color:var(--premium-soft); font-size:.61rem; }.journal-entry-meta,.journal-tag-row { display:flex; min-width:0; flex-wrap:wrap; gap:5px; }.journal-entry-meta span,.journal-tag-row span { padding:3px 5px; border-radius:3px; color:var(--premium-muted); background:var(--premium-canvas); font-size:.49rem; }.journal-entry-main blockquote { margin:9px 0; padding:7px 9px; border-left:2px solid var(--premium-line-strong); color:var(--premium-muted); font-size:.58rem; line-height:1.5; }
.journal-entry-actions { display:flex; align-items:flex-start; gap:2px; }.journal-entry-actions button { display:grid; width:30px; height:30px; place-items:center; border:0; border-radius:5px; background:transparent; color:var(--premium-muted); font-size:.8rem; }.journal-entry-actions button:hover { background:var(--premium-canvas); color:var(--premium-text); }
.journal-editor-overlay { position:fixed; z-index:1300; inset:0; display:grid; grid-template-columns:1fr minmax(520px,680px); }.journal-editor-overlay[hidden] { display:none; }.journal-editor-backdrop { border:0; background:rgba(0,0,0,.7); backdrop-filter:blur(3px); }.journal-editor-overlay > aside { display:flex; min-height:0; flex-direction:column; background:var(--premium-surface); border-left:1px solid var(--premium-line-strong); box-shadow:-24px 0 70px rgba(0,0,0,.45); }.journal-editor-overlay > aside > header { display:flex; align-items:flex-start; justify-content:space-between; padding:22px; border-bottom:1px solid var(--premium-line); }.journal-editor-overlay h2 { margin:4px 0 0; color:var(--premium-text); font-size:1rem; }.journal-editor-overlay > aside > header button { width:32px; height:32px; border:0; border-radius:5px; background:var(--premium-raised); color:var(--premium-muted); font-size:1.1rem; }
.journal-editor-overlay form { min-height:0; padding:18px 22px 22px; overflow-y:auto; }.journal-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }.journal-form-grid label,.journal-notes-field { display:grid; gap:5px; color:var(--premium-muted); font-size:.56rem; font-weight:600; }.journal-form-grid input,.journal-form-grid select,.journal-notes-field textarea { width:100%; min-height:40px; padding:9px 10px; border:1px solid var(--premium-line); border-radius:6px; outline:0; background:var(--premium-raised); color:var(--premium-text); font:500 .65rem var(--font-body); }.journal-form-grid input:focus,.journal-form-grid select:focus,.journal-notes-field textarea:focus { border-color:var(--premium-cyan); box-shadow:0 0 0 2px rgba(74,201,214,.1); }.journal-check-row { display:flex; flex-wrap:wrap; gap:18px; margin:15px 0; }.journal-check-row label { display:flex; align-items:center; gap:7px; color:var(--premium-soft); font-size:.6rem; }.journal-notes-field textarea { min-height:120px; resize:vertical; }.journal-editor-overlay form > footer { display:flex; justify-content:flex-end; gap:7px; margin-top:16px; }.journal-editor-open { overflow:hidden; }

@media (max-width:1100px) {
  .journal-metric-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .journal-filterbar { grid-template-columns:minmax(220px,1fr) 170px 140px; }.journal-favorite-filter { grid-column:1/-1; width:max-content; }
}
@media (max-width:760px) {
  .journal-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.journal-metric-grid article { min-height:100px; }
  .journal-analysis-grid { grid-template-columns:1fr; }.journal-analysis-panel { min-height:0; }
  .journal-filterbar { grid-template-columns:1fr 1fr; }.journal-filterbar .project-search { grid-column:1/-1; }.journal-favorite-filter { grid-column:auto; width:auto; }
  .journal-entry-card { grid-template-columns:40px minmax(0,1fr); }.journal-entry-actions { grid-column:1/-1; justify-content:flex-end; border-top:1px solid var(--premium-line); padding-top:7px; }
  .journal-editor-overlay { grid-template-columns:1fr; padding-top:28px; }.journal-editor-backdrop { position:absolute; inset:0; }.journal-editor-overlay > aside { position:relative; z-index:1; border-top:1px solid var(--premium-line-strong); border-left:0; border-radius:8px 8px 0 0; }
}
@media (max-width:480px) {
  .journal-metric-grid { gap:6px; }.journal-metric-grid article { min-height:94px; padding:11px; }
  .journal-calendar-panel { padding:12px; }.calendar-day { min-height:42px; padding:4px; }.calendar-day strong { font-size:.48rem; }
  .journal-records-panel { padding:12px; }.journal-filterbar { grid-template-columns:1fr; }.journal-filterbar .project-search,.journal-favorite-filter { grid-column:auto; }
  .journal-entry-main header { align-items:flex-start; flex-direction:column; }.journal-entry-main header > div { flex-wrap:wrap; }.journal-entry-main blockquote { max-height:76px; overflow:hidden; }
  .journal-form-grid { grid-template-columns:1fr; }.journal-editor-overlay form { padding:15px; }
}

/* Template discovery and customisation */
.template-workbench { max-width:1500px; }
.template-feature { display:grid; grid-template-columns:minmax(0,1.05fr) minmax(380px,.95fr); min-height:300px; margin-bottom:14px; overflow:hidden; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-surface); }
.template-feature-copy { display:grid; align-content:center; padding:34px; border-right:1px solid var(--premium-line); }.template-feature-copy h2 { max-width:620px; margin:8px 0 10px; color:var(--premium-text); font-size:1.7rem; }.template-feature-copy > p { max-width:640px; margin:0; color:var(--premium-muted); font-size:.7rem; line-height:1.65; }.template-feature-copy > div:last-child { display:flex; gap:7px; margin-top:18px; }
.template-feature-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:15px; }.template-feature-meta span { padding:5px 7px; border:1px solid var(--premium-line); border-radius:4px; color:var(--premium-muted); background:var(--premium-raised); font-size:.54rem; }
.template-pattern-visual { position:relative; min-height:126px; overflow:hidden; border-bottom:1px solid var(--premium-line); background:var(--premium-canvas); }.template-pattern-visual.large { min-height:260px; border:0; }.template-gridlines { position:absolute; inset:0; background-image:linear-gradient(var(--premium-line) 1px,transparent 1px),linear-gradient(90deg,var(--premium-line) 1px,transparent 1px); background-size:34px 34px; opacity:.55; }.template-pattern-visual > span { position:relative; display:inline-block; width:7px; height:34px; margin:50px 5% 0; border-top:10px solid var(--premium-green); border-bottom:8px solid var(--premium-green); background:var(--premium-green); }.template-pattern-visual > span:nth-of-type(2),.template-pattern-visual > span:nth-of-type(4) { border-color:var(--premium-red); background:var(--premium-red); transform:translateY(19px); }.template-pattern-visual > span:nth-of-type(3) { transform:translateY(-14px); }.template-pattern-visual > span:nth-of-type(5) { transform:translateY(-25px); }.template-pattern-visual > i { position:absolute; left:7%; right:7%; top:49%; height:2px; transform:rotate(-8deg); background:var(--premium-cyan); box-shadow:0 12px 0 rgba(207,170,91,.78); }.template-pattern-visual > em { position:absolute; right:10px; bottom:8px; padding:4px 6px; border-radius:3px; color:var(--premium-muted); background:var(--premium-surface); font-size:.48rem; font-style:normal; text-transform:uppercase; }
.template-toolbar { align-items:flex-start; }.template-toolbar .category-chip > span { margin-left:3px; color:var(--premium-soft); }
.template-results-head { display:flex; min-height:28px; align-items:center; justify-content:space-between; }.template-results-head > span { color:var(--premium-muted); font-size:.57rem; }
.template-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.template-card { min-width:0; overflow:hidden; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-surface); transition:transform 150ms ease,border-color 150ms ease; }.template-card:hover { transform:translateY(-2px); border-color:var(--premium-line-strong); }
.template-card > header { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:14px 14px 0; }.template-card > header span { color:var(--premium-muted); font-size:.5rem; font-weight:700; text-transform:uppercase; }.template-card h3 { margin:4px 0 0; color:var(--premium-text); font-size:.81rem; }.template-card > header button { display:grid; width:30px; height:30px; flex:0 0 auto; place-items:center; border:0; border-radius:5px; background:var(--premium-raised); color:var(--premium-gold); font-size:.9rem; }.template-card > p { min-height:69px; margin:9px 14px 11px; color:var(--premium-muted); font-size:.61rem; line-height:1.55; }
.template-card-meta { display:flex; flex-wrap:wrap; gap:5px; padding:0 14px 12px; }.template-card-meta span { padding:4px 6px; border-radius:3px; color:var(--premium-muted); background:var(--premium-raised); font-size:.49rem; }
.template-card-actions { display:flex; min-height:51px; align-items:center; justify-content:flex-end; gap:5px; padding:8px 10px; border-top:1px solid var(--premium-line); }.template-card-actions label { display:flex; margin-right:auto; align-items:center; gap:5px; color:var(--premium-muted); font-size:.51rem; }
.template-drawer { position:fixed; z-index:1300; inset:0; display:grid; grid-template-columns:1fr minmax(500px,650px); }.template-drawer[hidden] { display:none; }.template-drawer-backdrop { border:0; background:rgba(0,0,0,.7); backdrop-filter:blur(3px); }.template-drawer > aside { display:flex; min-width:0; min-height:0; flex-direction:column; border-left:1px solid var(--premium-line-strong); background:var(--premium-surface); box-shadow:-24px 0 70px rgba(0,0,0,.46); }.template-drawer > aside > header { display:flex; align-items:flex-start; justify-content:space-between; padding:22px; border-bottom:1px solid var(--premium-line); }.template-drawer h2 { margin:5px 0 0; color:var(--premium-text); font-size:1.15rem; }.template-drawer > aside > header button { width:32px; height:32px; border:0; border-radius:5px; background:var(--premium-raised); color:var(--premium-muted); font-size:1.1rem; }
.template-drawer-body { min-height:0; padding:18px 22px; overflow-y:auto; }.template-drawer-body > p { margin:16px 0; color:var(--premium-soft); font-size:.68rem; line-height:1.6; }.template-drawer-body > section { padding:15px 0; border-top:1px solid var(--premium-line); }.template-concepts { display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }.template-concepts span { padding:5px 7px; border-radius:4px; color:var(--premium-soft); background:var(--premium-raised); font-size:.55rem; }.template-custom-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:10px; }.template-custom-grid label { display:grid; gap:5px; color:var(--premium-muted); font-size:.54rem; }.template-custom-grid input,.template-custom-grid select { min-height:40px; padding:8px 9px; border:1px solid var(--premium-line); border-radius:6px; outline:0; background:var(--premium-raised); color:var(--premium-text); font-size:.63rem; }.template-drawer blockquote { margin:10px 0 0; padding:11px; border-left:2px solid var(--premium-cyan); color:var(--premium-muted); background:var(--premium-raised); font-size:.6rem; line-height:1.6; }.template-drawer > aside > footer { display:flex; justify-content:flex-end; gap:7px; padding:14px 22px; border-top:1px solid var(--premium-line); }.template-drawer-open { overflow:hidden; }
.template-compare-bar { position:fixed; z-index:950; right:20px; bottom:20px; display:flex; min-width:300px; align-items:center; justify-content:space-between; gap:16px; padding:10px 11px 10px 14px; border:1px solid var(--premium-line-strong); border-radius:7px; background:var(--premium-surface); box-shadow:0 18px 50px rgba(0,0,0,.38); }.template-compare-bar[hidden] { display:none; }.template-compare-bar > span { color:var(--premium-soft); font-size:.62rem; }.template-compare-bar > div { display:flex; gap:5px; }
.template-compare-modal { width:min(760px,calc(100vw - 28px)); }.template-compare-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:16px 0; }.template-compare-grid article { display:flex; min-width:0; flex-direction:column; padding:15px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); }.template-compare-grid article > span { color:var(--premium-muted); font-size:.5rem; text-transform:uppercase; }.template-compare-grid h4 { margin:5px 0 8px; color:var(--premium-text); font-size:.8rem; }.template-compare-grid p { min-height:76px; margin:0; color:var(--premium-muted); font-size:.58rem; line-height:1.5; }.template-compare-grid dl { display:grid; gap:7px; margin:12px 0 16px; }.template-compare-grid dl div { padding-top:7px; border-top:1px solid var(--premium-line); }.template-compare-grid dt { color:var(--premium-muted); font-size:.48rem; text-transform:uppercase; }.template-compare-grid dd { margin:3px 0 0; color:var(--premium-soft); font-size:.57rem; line-height:1.45; }.template-compare-grid .btn { margin-top:auto; }
@media (max-width:1100px) { .template-feature { grid-template-columns:1fr; }.template-feature-copy { border-right:0; border-bottom:1px solid var(--premium-line); }.template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .template-feature-copy { padding:22px; }.template-feature-copy h2 { font-size:1.35rem; }.template-pattern-visual.large { min-height:210px; }.template-grid { grid-template-columns:1fr; }.template-drawer { grid-template-columns:1fr; padding-top:28px; }.template-drawer-backdrop { position:absolute; inset:0; }.template-drawer > aside { position:relative; z-index:1; border-top:1px solid var(--premium-line-strong); border-left:0; border-radius:8px 8px 0 0; }.template-compare-bar { right:10px; bottom:74px; left:10px; min-width:0; }.template-compare-grid { grid-template-columns:1fr; max-height:60vh; overflow-y:auto; } }
@media (max-width:480px) { .template-feature-copy > div:last-child { display:grid; grid-template-columns:1fr 1fr; }.template-custom-grid { grid-template-columns:1fr; }.template-drawer-body { padding:15px; }.template-drawer > aside > footer { align-items:stretch; flex-direction:column-reverse; }.template-drawer > aside > footer .btn { width:100%; } }

/* Project portfolio and metadata */
.project-overview-strip { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin-bottom:10px; border:1px solid var(--premium-line); border-radius:7px; background:var(--premium-surface); }
.project-overview-strip > div { display:grid; min-height:88px; align-content:center; gap:7px; padding:14px; border-right:1px solid var(--premium-line); }.project-overview-strip > div:last-child { border-right:0; }.project-overview-strip span { color:var(--premium-muted); font-size:.51rem; font-weight:700; text-transform:uppercase; }.project-overview-strip strong { color:var(--premium-text); font:600 1.2rem var(--font-mono); }
.rebuild-secondary-content .indicators-panel { max-width:none; padding:16px; }
.rebuild-secondary-content .indicators-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.rebuild-secondary-content .indicator-card { display:flex; min-width:0; min-height:245px; align-items:stretch; flex-direction:column; padding:15px; }
.indicator-card-info { width:100%; flex:1; padding-right:28px; }.indicator-card-name { min-height:28px; }.indicator-card-name-btn { max-width:calc(100% - 54px); }.indicator-card-name-btn span { color:var(--premium-text); font-size:.76rem; }
.indicator-card-meta { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; font-family:var(--font-body); }.indicator-card-meta > span { padding:4px 6px; border-radius:3px; color:var(--premium-muted); background:var(--premium-raised); font-size:.49rem; }.indicator-card-meta .project-lifecycle { color:var(--premium-soft); text-transform:uppercase; }
.indicator-card-description { min-height:39px; margin:10px 0 9px; color:var(--premium-muted); font-size:.59rem; line-height:1.55; }
.indicator-card-tags { display:flex; min-height:24px; flex-wrap:wrap; gap:4px; }.indicator-card-tags span { padding:3px 5px; border:1px solid var(--premium-line); border-radius:3px; color:var(--premium-muted); font-size:.48rem; }.indicator-card-tags .folder { color:var(--premium-cyan); background:rgba(74,201,214,.05); }
.rebuild-secondary-content .indicator-card-actions { width:100%; justify-content:flex-start; margin-top:13px; padding-top:10px; border-top:1px solid var(--premium-line); }.rebuild-secondary-content .indicator-card-actions .btn-sm { min-height:32px; padding:0 8px; font-size:.52rem; }.rebuild-secondary-content .project-favorite { top:12px; right:12px; }
.project-toolbar { grid-template-columns:minmax(220px,1fr) auto 150px 160px; }.project-toolbar > select,#projectFolderFilter { min-height:38px; padding:0 28px 0 9px; border:1px solid var(--premium-line); border-radius:6px; background:var(--premium-raised); color:var(--premium-soft); font-size:.59rem; }
.project-details-modal { width:min(620px,calc(100vw - 28px)); }.project-details-modal form { display:grid; gap:10px; margin-top:14px; }.project-details-modal form > label,.project-details-grid label { display:grid; gap:5px; color:var(--premium-muted); font-size:.55rem; font-weight:600; }.project-details-modal textarea { resize:vertical; }.project-details-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
@media (max-width:1100px) { .project-toolbar { grid-template-columns:1fr 1fr; }.project-search,.project-filters { grid-column:1/-1; } }
@media (max-width:760px) { .project-overview-strip { grid-template-columns:repeat(3,1fr); }.project-overview-strip > div:nth-child(3) { border-right:0; }.project-overview-strip > div:nth-child(n+4) { border-top:1px solid var(--premium-line); }.project-overview-strip > div:last-child { grid-column:2/4; }.rebuild-secondary-content .indicators-grid { grid-template-columns:1fr; }.project-toolbar { grid-template-columns:1fr; }.project-search,.project-filters { grid-column:auto; } }
@media (max-width:480px) { .project-overview-strip { grid-template-columns:1fr 1fr; }.project-overview-strip > div { min-height:76px; }.project-overview-strip > div:nth-child(2n) { border-right:0; }.project-overview-strip > div:nth-child(n+3) { border-top:1px solid var(--premium-line); }.project-overview-strip > div:last-child { grid-column:1/-1; }.project-details-grid { grid-template-columns:1fr; }.rebuild-secondary-content .indicator-card-actions { display:grid; grid-template-columns:1fr 1fr; }.rebuild-secondary-content .indicator-card-actions .btn { width:100%; } }

/* Owner product analytics */
.admin-product-grid { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(320px,.7fr); gap:10px; margin-bottom:var(--space-3); }.admin-product-grid > section { min-width:0; }
.admin-analytics-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:13px; }.admin-analytics-heading h3 { margin:3px 0 0; }.admin-analytics-heading > span { color:var(--premium-muted); font-size:.51rem; }
.admin-funnel { display:grid; gap:9px; }.admin-funnel > div { display:grid; gap:4px; }.admin-funnel header { display:flex; justify-content:space-between; color:var(--premium-soft); font-size:.58rem; }.admin-funnel header strong { color:var(--premium-text); font:600 .6rem var(--font-mono); }.admin-funnel > div > div { height:6px; overflow:hidden; border-radius:3px; background:var(--premium-raised); }.admin-funnel i { display:block; height:100%; border-radius:inherit; background:var(--premium-cyan); }.admin-funnel small { color:var(--premium-muted); font-size:.48rem; }
.admin-engagement-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }.admin-engagement-grid > div { display:grid; min-height:72px; align-content:center; gap:6px; padding:10px; border:1px solid var(--premium-line); border-radius:5px; background:var(--premium-raised); }.admin-engagement-grid span { color:var(--premium-muted); font-size:.49rem; text-transform:uppercase; }.admin-engagement-grid strong { color:var(--premium-text); font:600 .9rem var(--font-mono); }
@media (max-width:900px) { .admin-product-grid { grid-template-columns:1fr; } }

/* Final mobile interaction overrides live after the page-specific rules so
   later compact desktop declarations cannot shrink touch targets again. */
@media (max-width:760px) {
  .rebuild-app .btn-sm,
  .rebuild-app .settings-nav a,
  .rebuild-app .project-filters button,
  .rebuild-app .learning-filters button,
  .rebuild-app .ai-mode-switch button,
  .rebuild-app .ai-depth-control button,
  .rebuild-app .goal-starters button,
  .rebuild-app .workspace-tabs button,
  .rebuild-app .workspace-conversation .category-chip,
  .rebuild-app .calendar-controls button,
  .rebuild-app .saved-prompt-actions button,
  .rebuild-app .inspector-section-head button,
  .rebuild-app .indicator-card-name-btn,
  .rebuild-app .project-copy,
  .rebuild-app .section-heading > a,
  .rebuild-app .billing-inline-link,
  .rebuild-app .learning-boundary > a {
    min-height:44px;
  }

  .rebuild-app .learning-filters button,
  .rebuild-app .calendar-controls button {
    min-width:44px;
  }

  .rebuild-app .section-heading > a,
  .rebuild-app .billing-inline-link,
  .rebuild-app .learning-boundary > a {
    display:inline-flex;
    align-items:center;
  }

  .rebuild-app .favorite-button,
  .rebuild-app .page-tour-trigger,
  .rebuild-app #sidebarNewProject,
  .rebuild-app .project-favorite,
  .rebuild-app .template-card > header button,
  .rebuild-app .journal-entry-actions button,
  .rebuild-app .journal-editor-overlay > aside > header button,
  .rebuild-app .template-drawer > aside > header button,
  .rebuild-app .lesson-close,
  .rebuild-app .product-tour header button,
  .rebuild-app .mobile-more-sheet header button {
    width:44px;
    height:44px;
    min-height:44px;
  }

  .rebuild-app .workspace-command-bar .command-new {
    width:44px;
    height:44px;
    min-height:44px;
  }

  .rebuild-app .stage-toolbar .icon-text-button {
    width:44px;
    height:44px;
    min-height:44px;
    padding:0;
    justify-content:center;
  }

  .rebuild-app .project-search,
  .rebuild-app .learning-search,
  .rebuild-app .billing-search,
  .rebuild-app .billing-history-tools select,
  .rebuild-app .journal-filterbar select,
  .rebuild-app .journal-favorite-filter,
  .rebuild-app .admin-plan-select {
    min-height:44px;
  }

  .rebuild-app .rebuild-secondary-content .indicator-card-actions .btn-sm {
    min-height:44px;
  }
}
