/*
  Infinite Acquisitions — Acquisition OS
  Client guide / action console theme
  Matches IA member workspace (member-night.css light palette)
*/

:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --card: #ffffff;
  --inset: #f2f5f9;
  --track: #e2e7ef;
  --border: rgba(50, 68, 94, 0.14);
  --border-strong: rgba(50, 68, 94, 0.26);
  --text: #202936;
  --muted: #56677c;
  --secondary: #465569;
  --silver: #596b82;
  --silver-light: #35465e;
  --primary: #303b4b;
  --primary-soft: rgba(86, 104, 132, 0.12);
  --on-primary: #f8faff;
  --violet: #8873a7;
  --violet-mid: #7051a6;
  --violet-deep: #543778;
  --interaction: linear-gradient(120deg, #7051a6, #543778 58%, #3d294f);
  --interaction-border: #ac8ed6;
  --on-interaction: #fbf9ff;
  --primary-gradient: linear-gradient(135deg, #475569, #303b4b 55%, #202a38);
  --page-gradient: radial-gradient(ellipse at 85% 0%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(155deg, #f8f9fc, #eef1f5 60%);
  --chrome-gradient: linear-gradient(110deg, #ffffff, #f4f6fa 55%, #e8edf4);
  --sidebar-gradient: linear-gradient(180deg, #fafbfd, #e8edf4 85%);
  --header-rule: linear-gradient(90deg, #bdc8d7, #8393aa 40%, #8873a7 72%, #c7cfdb);
  --ok: #2f6b4f;
  --ok-soft: rgba(47, 107, 79, 0.1);
  --warn: #9c4d32;
  --warn-soft: rgba(156, 77, 50, 0.1);
  --danger: #9c4d32;
  --danger-soft: rgba(156, 77, 50, 0.1);
  --path-line: rgba(50, 68, 94, 0.18);
  --node-done: #2f6b4f;
  --node-current: #7051a6;
  --node-locked: #8a97a8;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 14px rgba(36, 51, 74, 0.045);
  --shadow-pop: 0 8px 28px rgba(36, 51, 74, 0.1), 0 1px 3px rgba(36, 51, 74, 0.06);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}
html.dark,
html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page-gradient);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

a {
  color: var(--silver-light);
  text-decoration: none;
  font-weight: 600;
}
a:hover {
  color: var(--violet-deep);
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--text);
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 48px;
}

/* —— Brand shell —— */
.brand-bar {
  height: 3px;
  width: 100%;
  background: var(--header-rule);
  margin: 0 0 18px;
  border-radius: 999px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--silver);
}

.quote {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: var(--radius);
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
}
.quote span {
  color: var(--violet-deep);
  font-weight: 700;
  margin-right: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

header.app-header,
.guide-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--chrome-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.sub strong {
  color: var(--text);
  font-weight: 600;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}
.meta strong {
  color: var(--text);
  font-weight: 600;
}

/* —— Tabs —— */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  width: fit-content;
  max-width: 100%;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, background 0.15s;
}
.tab:hover {
  color: var(--text);
  background: var(--inset);
}
.tab.active {
  color: var(--on-interaction);
  background: var(--interaction);
  box-shadow: 0 0 0 1px var(--interaction-border);
}
.tab .tab-ico {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}
.tab .tab-ico svg {
  width: 14px;
  height: 14px;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* —— Sections —— */
.section {
  margin: 22px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--silver);
}

/* —— Setup grid —— */
.setup {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 760px) {
  .setup {
    grid-template-columns: 1fr 1fr;
  }
}
.setup a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.setup a:hover {
  border-color: var(--interaction-border);
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
  color: inherit;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
}
.dot.green {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.dot.amber {
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.dot.red {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.setup .label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text);
}
.setup .detail {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.45;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--border));
  color: #7a3a24;
}
.banner.ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 28%, var(--border));
  color: #1f4d38;
}

/* —— Actions —— */
.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow);
}
.action.high {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: linear-gradient(90deg, var(--danger-soft), var(--surface) 30%);
}
.count {
  min-width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.action h3 {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.action p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* —— Buttons —— */
.btn {
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--primary-gradient);
  background-color: var(--primary);
  color: var(--on-primary) !important;
  white-space: nowrap;
  border: 1px solid var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  filter: brightness(1.06);
  color: var(--on-primary) !important;
}
.btn.ghost {
  background: var(--surface);
  color: var(--secondary) !important;
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  border-color: var(--violet);
  color: var(--violet-deep) !important;
  filter: none;
}
.btn.pay {
  background: var(--interaction);
  border-color: var(--interaction-border);
  color: var(--on-interaction) !important;
}

.empty {
  padding: 32px 18px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick a {
  text-decoration: none;
  color: var(--secondary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.quick a:hover {
  border-color: var(--interaction-border);
  color: var(--violet-deep);
  background: color-mix(in srgb, var(--violet) 8%, white);
}

.loading,
.error {
  padding: 56px 16px;
  text-align: center;
  color: var(--muted);
}
.error {
  color: var(--danger);
}

footer,
.guide-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
footer a,
.guide-footer a {
  color: var(--violet-deep);
  text-decoration: none;
  font-weight: 600;
}

/* —— Capacity path —— */
.path-shell,
.ai-shell,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.path-head,
.ai-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--chrome-gradient);
}
.path-head h2,
.ai-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.path-head p,
.ai-head p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 34rem;
}
.rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}
.track-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 10px;
  background: var(--surface);
}
.track-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.track-btn:hover {
  border-color: var(--interaction-border);
  color: var(--violet-deep);
}
.track-btn.active {
  background: color-mix(in srgb, var(--violet) 12%, white);
  border-color: var(--interaction-border);
  color: var(--violet-deep);
}
.track-btn .tb-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--node-locked);
  flex-shrink: 0;
}
.track-btn.active .tb-status,
.track-btn[data-state="current"] .tb-status {
  background: var(--violet-mid);
}
.track-btn[data-state="done"] .tb-status {
  background: var(--ok);
}
.track-btn[data-state="locked"] .tb-status {
  background: var(--node-locked);
}
.track-meta-line {
  margin: 0;
  padding: 0 18px 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.track-meta-line .sep {
  margin: 0 0.35em;
  color: var(--track);
}
.path-detail {
  border-left: 1px solid var(--border);
  padding: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.path-detail-main {
  padding: 18px 18px 12px;
  flex: 1 1 auto;
}
.path-detail .k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver);
  margin: 0 0 8px;
}
.path-detail h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.path-detail .desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.bypass-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px;
}
.bypass-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--inset);
}
.bypass-card h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--text);
}
.bypass-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.bypass-card .badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--silver-light);
  background: var(--track);
  border-radius: 999px;
  padding: 2px 7px;
  margin-bottom: 6px;
}
.bypass-card a {
  font-size: 12px;
  font-weight: 600;
  color: var(--violet-deep);
  text-decoration: none;
}
.unlimited-panel {
  margin-top: auto;
  padding: 14px 16px 16px;
  border-top: 1px solid color-mix(in srgb, var(--violet) 22%, var(--border));
  background: linear-gradient(180deg, #f7f5fb, color-mix(in srgb, var(--violet) 10%, white));
}
.unlimited-panel .up-kicker {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-deep);
}
.unlimited-panel .up-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.unlimited-panel .up-detail {
  margin: 0 0 12px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.unlimited-panel .btn {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.path-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 0;
  min-height: 480px;
  align-items: stretch;
}
@media (max-width: 820px) {
  .path-body {
    grid-template-columns: 1fr;
  }
  .path-detail {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
.path-track {
  position: relative;
  padding: 28px 20px 36px;
  background:
    radial-gradient(circle at 12% 8%, rgba(112, 81, 166, 0.06), transparent 42%),
    radial-gradient(circle at 88% 70%, rgba(47, 107, 79, 0.05), transparent 40%),
    var(--bg);
}
.path-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 420px;
  position: relative;
}
.path-list::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  background: var(--path-line);
  border-radius: 2px;
}
.path-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0;
}
.path-item:last-child {
  margin-bottom: 0;
}
.node {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.path-item:hover .node {
  transform: translateY(-1px);
}
.path-item.done .node {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--border));
  background: var(--ok-soft);
  color: var(--ok);
}
.path-item.current .node {
  border-color: color-mix(in srgb, var(--violet-mid) 55%, var(--border));
  background: color-mix(in srgb, var(--violet) 12%, white);
  color: var(--violet-deep);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 14%, transparent), var(--shadow);
}
.path-item.locked .node {
  border-color: var(--border);
  background: var(--inset);
  color: var(--node-locked);
}
.path-item.selected .node {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 20%, transparent), var(--shadow);
}
.node svg {
  width: 22px;
  height: 22px;
}
.node-label {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.path-item.current .node-label {
  border-color: color-mix(in srgb, var(--violet) 35%, var(--border));
}
.path-item.locked .node-label {
  opacity: 0.72;
}
.node-label .t {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.node-label .s {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--inset);
  color: var(--muted);
}
.pill.done {
  background: var(--ok-soft);
  color: #1f4d38;
}
.pill.current {
  background: color-mix(in srgb, var(--violet) 14%, white);
  color: var(--violet-deep);
}
.pill.locked {
  background: var(--track);
  color: var(--muted);
}

.usage-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.usage-stat {
  flex: 1;
  min-width: 110px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.usage-stat .n {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}
.usage-stat .l {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  margin: 4px 0 14px;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--interaction);
  min-width: 0;
}
.lock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.lock-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--inset);
}
.lock-card strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 3px;
  color: var(--text);
}
.lock-card p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.path-note {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  background: var(--inset);
}
.cadence {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.cadence summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  list-style: none;
}
.cadence summary::-webkit-details-marker {
  display: none;
}
.cadence summary:after {
  content: " ▾";
  color: var(--muted);
  font-weight: 500;
}
.cadence[open] summary:after {
  content: " ▴";
}
.cadence .prin {
  margin: 8px 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.cadence-cols {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 700px) {
  .cadence-cols {
    grid-template-columns: 1fr;
  }
}
.cadence h5 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--violet-deep);
}
.cadence ol {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--secondary);
  font-size: 0.75rem;
  line-height: 1.45;
}
.cadence li {
  margin: 4px 0;
}
.cadence .note {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 6px;
}

/* —— AI chat —— */
.ai-shell {
  display: flex;
  flex-direction: column;
  min-height: min(72vh, 720px);
  height: min(72vh, 720px);
}
.ai-head {
  align-items: center;
}
.ai-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--interaction);
  color: var(--on-interaction);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 14%, transparent);
}
.ai-avatar svg {
  width: 20px;
  height: 20px;
}
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #1f4d38;
  background: var(--ok-soft);
  border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--border));
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}
.ai-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
  font-style: normal;
}
.ai-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 8px;
  background:
    radial-gradient(circle at 8% 0%, rgba(112, 81, 166, 0.06), transparent 36%),
    radial-gradient(circle at 92% 18%, rgba(48, 59, 75, 0.04), transparent 32%),
    var(--bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.ai-msg {
  display: flex;
  gap: 10px;
  max-width: min(100%, 640px);
  animation: ai-in 0.22s ease-out;
}
@keyframes ai-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
}
.ai-msg.assistant .ai-msg-avatar {
  background: var(--interaction);
  color: var(--on-interaction);
}
.ai-msg.assistant .ai-msg-avatar svg {
  width: 14px;
  height: 14px;
}
.ai-msg.user .ai-msg-avatar {
  background: var(--primary);
  color: var(--on-primary);
}
.ai-bubble {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.assistant .ai-bubble {
  background: var(--surface);
  color: var(--text);
  border-top-left-radius: 6px;
}
.ai-msg.user .ai-bubble {
  background: var(--primary-gradient);
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: transparent;
  border-top-right-radius: 6px;
}
.ai-bubble p {
  margin: 0 0 0.55em;
}
.ai-bubble p:last-child {
  margin-bottom: 0;
}
.ai-bubble ul {
  margin: 0.35em 0 0.2em;
  padding-left: 1.15rem;
}
.ai-bubble li {
  margin: 0.2em 0;
}
.ai-meta {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.ai-msg.user .ai-meta {
  text-align: right;
  color: color-mix(in srgb, var(--primary) 40%, var(--muted));
}
.ai-welcome {
  margin: 8px auto 4px;
  max-width: 520px;
  text-align: center;
  padding: 8px 8px 4px;
}
.ai-welcome-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--interaction);
  color: var(--on-interaction);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--violet) 22%, transparent);
}
.ai-welcome-badge svg {
  width: 28px;
  height: 28px;
}
.ai-welcome h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.ai-welcome p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 8px;
  padding: 0 4px 8px;
}
.ai-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  text-align: left;
  max-width: 100%;
}
.ai-chip:hover {
  border-color: var(--interaction-border);
  color: var(--violet-deep);
  background: color-mix(in srgb, var(--violet) 10%, white);
  transform: translateY(-1px);
}
.ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  min-height: 1.2em;
}
.ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.55;
  animation: ai-dot 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.ai-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ai-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-3px);
    opacity: 0.9;
  }
}
.ai-composer-wrap {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 14px 14px;
}
.ai-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 8px 8px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-composer:focus-within {
  border-color: var(--interaction-border);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--violet) 14%, transparent);
  background: var(--surface);
}
.ai-composer textarea {
  flex: 1 1 auto;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  max-height: 140px;
  min-height: 24px;
  padding: 6px 0;
  field-sizing: content;
}
.ai-composer textarea::placeholder {
  color: var(--muted);
}
.ai-send {
  appearance: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-gradient);
  background-color: var(--primary);
  color: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.15s, opacity 0.15s;
}
.ai-send:hover {
  filter: brightness(1.06);
}
.ai-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.ai-send svg {
  width: 18px;
  height: 18px;
}
.ai-foot {
  margin: 8px 2px 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}
.ai-actions-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ai-icon-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ai-icon-btn:hover {
  color: var(--violet-deep);
  border-color: var(--interaction-border);
}
.ai-icon-btn svg {
  width: 15px;
  height: 15px;
}
@media (max-width: 640px) {
  .ai-shell {
    height: min(78vh, 680px);
    min-height: 520px;
  }
  .ai-status span.label {
    display: none;
  }
}

/* —— Guide pages (advanced + setup) —— */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 4px;
}
.back-link:hover {
  color: var(--violet-deep);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 720px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.guide-card:hover {
  border-color: color-mix(in srgb, var(--violet) 30%, var(--border));
  box-shadow: var(--shadow-pop);
}
.guide-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text);
}
.guide-card p,
.guide-card li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.guide-card ul {
  margin: 0;
  padding-left: 1.1rem;
}
.guide-card a {
  color: var(--violet-deep);
}

.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-deep);
  background: color-mix(in srgb, var(--violet) 12%, white);
  border: 1px solid color-mix(in srgb, var(--violet) 22%, var(--border));
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 10px;
}

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  line-height: 1.55;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.prose-card strong,
.prose-card code {
  color: var(--text);
}
.prose-card ol {
  padding-left: 1.2rem;
  margin: 0;
}
.prose-card li {
  margin: 10px 0;
  color: var(--secondary);
}
.prose-card p {
  margin: 12px 0 0;
}

.guide-title-block {
  margin: 8px 0 20px;
}
.guide-title-block h1 {
  margin-bottom: 6px;
}


/* =========================================================
   DARK MODE — IA member workspace night palette
   Activated by html.dark / data-theme="dark" (theme-sync.js)
   ========================================================= */
html.dark,
html[data-theme="dark"] {
  --bg: #111318;
  --surface: #1b1f26;
  --card: #1b1f26;
  --inset: #101217;
  --track: #171b21;
  --border: rgba(215, 225, 240, 0.10);
  --border-strong: rgba(215, 225, 240, 0.20);
  --text: #f0f2f6;
  --muted: #aebbcf;
  --secondary: #c5ceda;
  --silver: #b9c4d3;
  --silver-light: #e4eaf2;
  --primary: #e3e8ef;
  --primary-soft: rgba(185, 196, 211, 0.12);
  --on-primary: #171b22;
  --violet: #9c93b8;
  --violet-mid: #7c5caf;
  --violet-deep: #c3b8da;
  --interaction: linear-gradient(120deg, #7c5caf, #684894 58%, #51356c);
  --interaction-border: #b99add;
  --on-interaction: #fbf9ff;
  --primary-gradient: linear-gradient(135deg, #f4f6f9, #e3e8ef 55%, #c4cedc);
  --page-gradient: radial-gradient(ellipse at 85% 0%, rgba(185, 196, 211, 0.10), transparent 55%),
    linear-gradient(155deg, #1c2027, #111318 65%);
  --chrome-gradient: linear-gradient(110deg, #262c34, #1c2128 55%, #101419);
  --sidebar-gradient: linear-gradient(180deg, #252b34, #181c23 65%, #111318);
  --header-rule: linear-gradient(90deg, #56616f, #b9c4d3 40%, #9c93b8 72%, #4c525f);
  --ok: #6fbf94;
  --ok-soft: rgba(111, 191, 148, 0.14);
  --warn: #c98164;
  --warn-soft: rgba(201, 129, 100, 0.14);
  --danger: #c98164;
  --danger-soft: rgba(201, 129, 100, 0.14);
  --path-line: rgba(215, 225, 240, 0.14);
  --node-done: #6fbf94;
  --node-current: #b99add;
  --node-locked: #6b7585;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 3px 14px rgba(0, 0, 0, 0.10);
  --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 32px rgba(0, 0, 0, 0.32);
}

html.dark .banner,
html[data-theme="dark"] .banner {
  color: #e8c4b4;
}
html.dark .banner.ok,
html[data-theme="dark"] .banner.ok {
  color: #b6e6cb;
}
html.dark .pill.done,
html[data-theme="dark"] .pill.done {
  color: #b6e6cb;
}
html.dark .ai-status,
html[data-theme="dark"] .ai-status {
  color: #b6e6cb;
}
html.dark .path-item.locked .node,
html[data-theme="dark"] .path-item.locked .node {
  background: var(--inset);
}
html.dark .unlimited-panel,
html[data-theme="dark"] .unlimited-panel {
  background: linear-gradient(180deg, #221c2c, color-mix(in srgb, var(--violet) 14%, #151820));
  border-top-color: color-mix(in srgb, var(--violet) 28%, var(--border));
}
html.dark .path-track,
html[data-theme="dark"] .path-track {
  background:
    radial-gradient(circle at 12% 8%, rgba(124, 92, 175, 0.12), transparent 42%),
    radial-gradient(circle at 88% 70%, rgba(111, 191, 148, 0.06), transparent 40%),
    var(--bg);
}
html.dark .ai-messages,
html[data-theme="dark"] .ai-messages {
  background:
    radial-gradient(circle at 8% 0%, rgba(124, 92, 175, 0.12), transparent 36%),
    radial-gradient(circle at 92% 18%, rgba(185, 196, 211, 0.05), transparent 32%),
    var(--bg);
}
html.dark .ai-msg.user .ai-bubble,
html[data-theme="dark"] .ai-msg.user .ai-bubble {
  color: var(--on-primary);
}
html.dark .btn,
html[data-theme="dark"] .btn {
  color: var(--on-primary) !important;
}
html.dark .btn.ghost,
html[data-theme="dark"] .btn.ghost {
  color: var(--secondary) !important;
  background: var(--surface);
}
html.dark .btn.pay,
html[data-theme="dark"] .btn.pay {
  color: var(--on-interaction) !important;
}

