:root {
  color-scheme: light;
  --ink: #484237;
  --muted: #746558;
  --line: #ffd6ca;
  --off-white: #faf4ec;
  --soft: #fff4f2;
  --panel: #fffaf6;
  --accent: #ff6f21;
  --accent-strong: #d84d00;
  --brand-cyan: #33ccff;
  --cyan-soft: #dff7ff;
  --cyan-ink: #006c8f;
  --peach: #ffcccc;
  --gold: #996600;
  --blue: #006c8f;
  --rose: #a4465d;
  --shadow: 0 18px 45px rgba(72, 66, 55, 0.1);
  --sidebar-tab-height: 44px;
  font-family: "Open Sans", "Public Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--off-white);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 160ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 72px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  min-width: 0;
  padding: 18px;
  border-right: 5px solid var(--accent);
  background: var(--brand-cyan);
  color: var(--ink);
}

.brand-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 32px;
  min-height: 60px;
  align-items: center;
  gap: 0;
}

.brand {
  display: grid;
  grid-column: 1 / 3;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-width: 0;
}

.brand-home {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-home:hover .brand-mark {
  box-shadow: 0 0 0 3px rgba(250, 244, 236, 0.56);
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
}

.brand-mark img {
  display: block;
  width: 42px;
  height: 42px;
}

.brand strong,
.brand span {
  display: block;
}

.brand-copy {
  min-width: 0;
  text-align: center;
}

.brand-copy strong {
  white-space: nowrap;
}

.brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-toggle {
  grid-column: 3;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(72, 66, 55, 0.2);
  border-radius: 8px;
  background: rgba(250, 244, 236, 0.78);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.sidebar-toggle:hover {
  border-color: var(--accent);
  background: var(--off-white);
}

.app-shell.is-sidebar-collapsed .sidebar {
  align-items: center;
  padding: 18px 10px;
}

.app-shell.is-sidebar-collapsed .brand-row,
.app-shell.is-sidebar-collapsed .brand {
  flex-direction: column;
  align-items: center;
}

.app-shell.is-sidebar-collapsed .brand-row {
  display: flex;
  width: 100%;
  justify-content: center;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 5px;
  right: -28px;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(72, 66, 55, 0.12);
}

.brand-section {
  min-height: 170px;
}

.app-shell.is-sidebar-collapsed .brand-section {
  width: 100%;
}

.app-shell.is-sidebar-collapsed .brand-copy,
.app-shell.is-sidebar-collapsed .sidebar-note,
.app-shell.is-sidebar-collapsed .sidebar-books {
  display: none;
}

.app-shell.is-sidebar-collapsed .layout-card {
  display: grid;
  justify-content: center;
  margin-top: 10px;
}

.app-shell.is-sidebar-collapsed .window-count-picker {
  grid-template-columns: 28px;
  gap: 0;
}

.app-shell.is-sidebar-collapsed .window-count-button {
  display: none;
}

.app-shell.is-sidebar-collapsed .window-count-button[data-count="6"] {
  display: grid;
  width: 28px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.app-shell.is-sidebar-collapsed .window-count-button[data-count="6"]:hover,
.app-shell.is-sidebar-collapsed .window-count-button[data-count="6"].is-active {
  background: rgba(72, 66, 55, 0.1);
}

.app-shell.is-sidebar-collapsed .tabs {
  width: 100%;
}

.app-shell.is-sidebar-collapsed .universal-tabs {
  margin-top: auto;
}

.app-shell.is-sidebar-collapsed .tab {
  display: flex;
  height: var(--sidebar-tab-height);
  min-height: var(--sidebar-tab-height);
  justify-content: center;
  align-items: center;
  padding: 0;
}

.app-shell.is-sidebar-collapsed .tab > span:not(.tab-icon) {
  display: none;
}

.tabs {
  display: grid;
  gap: 8px;
}

.council-picker {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.council-picker span,
.council-eyebrow {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.council-picker select {
  width: 100%;
  border: 1px solid rgba(72, 66, 55, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf6;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.council-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.council-intro h1 {
  margin: 3px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.council-intro p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.app-shell.is-sidebar-collapsed .council-picker {
  display: none;
}

.collapsed-council-badge {
  display: none;
}

.app-shell.is-sidebar-collapsed .collapsed-council-badge {
  display: grid;
  width: 38px;
  height: 26px;
  margin: 10px auto 8px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 10px rgba(42, 84, 102, 0.16);
}

@media (max-width: 720px) {
  .council-intro {
    display: grid;
  }

  .council-intro p {
    text-align: left;
  }
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--sidebar-tab-height);
  min-height: var(--sidebar-tab-height);
  border: 1px solid rgba(72, 66, 55, 0.18);
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(250, 244, 236, 0.72);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.tab-icon {
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  line-height: 1;
}

.tab-icon svg,
.settings-tab-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tab:hover,
.tab.is-active {
  border-color: var(--accent);
  background: var(--off-white);
  color: var(--ink);
  box-shadow: inset 5px 0 0 var(--accent);
}

.sidebar-books {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 36px;
  pointer-events: none;
}

.sidebar-books img {
  display: block;
  width: min(110px, 78%);
  height: auto;
  filter: drop-shadow(0 14px 16px rgba(72, 66, 55, 0.18));
}

.sidebar-books img:nth-child(2) {
  width: min(135px, 96%);
}

.ai-labs-artwork {
  display: none;
}

body:not([data-council="strategy"]) .strategic-book,
body:not([data-council="moods"]) .moods-book,
body:not([data-council="ai-labs"]) .ai-labs-artwork,
body[data-council="board"] .sidebar-books,
body[data-council="life"] .sidebar-books,
body[data-council="pitches"] .sidebar-books {
  display: none;
}

body[data-council="ai-labs"] .ai-labs-artwork {
  display: block;
  width: min(184px, 92%);
  border-radius: 8px;
  filter: drop-shadow(0 12px 14px rgba(72, 66, 55, 0.14));
}

body[data-council="pitches"] .universal-tabs {
  margin-top: auto;
}

.universal-tabs {
  flex: 0 0 auto;
  margin-top: auto;
  padding-bottom: 4px;
}

@media (max-height: 850px) and (min-width: 981px) {
  .sidebar {
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand-section {
    min-height: 158px;
  }

  .sidebar-books {
    gap: 8px;
  }

  .sidebar-books img {
    width: min(76px, 58%);
  }

  .sidebar-books img:nth-child(2) {
    width: min(93px, 80%);
  }

}

@media (max-height: 650px) and (min-width: 981px) {
  .sidebar-books {
    display: none;
  }

  .universal-tabs {
    margin-top: auto;
  }
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(72, 66, 55, 0.16);
  border-radius: 8px;
  background: rgba(250, 244, 236, 0.76);
}

.sidebar-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.layout-card {
  display: grid;
  margin-top: 10px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.topbar[hidden] {
  display: none;
}

.workspace-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.meter-chip {
  border: 1px solid rgba(51, 204, 255, 0.55);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 13px;
  font-weight: 800;
}

.meter-chip[data-tone="warning"] {
  border-color: rgba(255, 111, 33, 0.45);
  background: #fff4f2;
  color: var(--accent-strong);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  font-family: "Public Sans", "Open Sans", ui-sans-serif, system-ui, sans-serif;
}

h2 {
  font-size: 18px;
}

.status-pill,
.model-card-heading span,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 13px;
  font-weight: 700;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 18px;
}

#compare {
  grid-template-columns: 1fr;
  align-items: start;
}

.compare-console,
.output-panel,
.comparison-card,
.workflow-card,
.tool-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compare-console,
.output-panel {
  padding: 18px;
}

.compare-console {
  border-color: var(--brand-cyan);
  border-top: 5px solid var(--brand-cyan);
}

label,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field-row {
  margin-bottom: 16px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.prompt-voice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.voice-button {
  flex: 0 0 auto;
}

.voice-button.is-recording {
  border-color: var(--accent);
  background: #fff0e8;
  color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(255, 111, 33, 0.14);
}

.voice-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.voice-status[data-tone="recording"],
.voice-status[data-tone="error"] {
  color: var(--accent-strong);
  font-weight: 800;
}

.voice-status[data-tone="running"] {
  color: var(--blue);
  font-weight: 800;
}

.voice-status[data-tone="success"] {
  color: #24713a;
  font-weight: 800;
}

.listen-briefing {
  white-space: nowrap;
}

.listen-briefing.is-playing {
  border-color: var(--accent);
  background: #fff0e8;
  color: var(--accent-strong);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.primary,
.secondary {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-strong);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.66;
}

.secondary {
  border-color: var(--brand-cyan);
  background: var(--cyan-soft);
  color: var(--ink);
}

.ghost-button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.ghost-button:hover {
  color: var(--accent-strong);
}

.button-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary:disabled {
  cursor: wait;
  opacity: 0.66;
}

.compare-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.compare-status[data-tone="running"] {
  color: var(--blue);
  font-weight: 800;
}

.compare-status[data-tone="success"] {
  color: var(--accent-strong);
  font-weight: 800;
}

.compare-status[data-tone="warning"],
.compare-status[data-tone="error"] {
  color: var(--rose);
  font-weight: 800;
}

.access-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.access-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.access-card.is-recommended {
  border-color: rgba(255, 111, 33, 0.5);
}

.access-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 111, 33, 0.36), var(--shadow);
}

.access-card h2 {
  margin: 12px 0 8px;
  font-size: 19px;
}

.access-card p {
  color: var(--muted);
  line-height: 1.5;
}

.access-card button {
  margin-top: auto;
}

.access-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.access-note[data-tone="success"] {
  border-color: rgba(255, 111, 33, 0.32);
  background: #fff4f2;
  color: var(--accent-strong);
  font-weight: 700;
}

.access-note[data-tone="warning"] {
  border-color: rgba(164, 70, 93, 0.32);
  background: #fbf0f3;
  color: var(--rose);
  font-weight: 700;
}

.connections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.connections-header h2 {
  margin-bottom: 4px;
}

.connections-header p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.connection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.access-diagnostics {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand-cyan);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.diagnostics-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.diagnostics-heading h3 {
  margin-bottom: 3px;
}

.diagnostics-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.diagnostic-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(72, 66, 55, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.diagnostic-card.is-ready {
  border-color: rgba(255, 111, 33, 0.35);
  background: #fff7f0;
}

.diagnostic-card strong,
.diagnostic-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diagnostic-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-layout {
  display: grid;
  gap: 16px;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.settings-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.settings-tab-icon {
  display: inline-grid;
  flex: 0 0 20px;
  place-items: center;
}

.settings-tab:hover,
.settings-tab.is-active {
  border-color: var(--brand-cyan);
  background: var(--cyan-soft);
  color: var(--cyan-ink);
}

.settings-panel[hidden] {
  display: none;
}

.preferences-card {
  max-width: 980px;
}

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

.preferences-grid label,
.preference-synthesizer {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.preferences-grid select,
.preference-synthesizer select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.preference-synthesizer {
  max-width: 310px;
  margin-top: 18px;
}

.account-current:empty {
  display: none;
}

.auth-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.auth-grid {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
  padding: 20px 0 28px;
}

.auth-grid[hidden] {
  display: none;
}

.auth-card {
  max-width: 460px;
}

.auth-card-simple {
  display: grid;
  gap: 18px;
  width: 100%;
  border: 1px solid rgba(72, 66, 55, 0.12);
  border-radius: 18px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 22px 55px rgba(72, 66, 55, 0.12);
}

.auth-welcome {
  display: grid;
  gap: 20px;
}

.auth-welcome h3 {
  margin: 0 0 5px;
  font-size: 27px;
  letter-spacing: -0.025em;
}

.auth-welcome p {
  margin: 0;
  color: var(--muted);
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  filter: drop-shadow(0 8px 10px rgba(0, 108, 143, 0.18));
}

.auth-brand-mark img {
  display: block;
  width: 48px;
  height: 48px;
}

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

.auth-social-actions button {
  position: relative;
  min-height: 48px;
  border-color: rgba(72, 66, 55, 0.18);
  background: #fff;
  color: var(--ink);
}

.auth-provider-icon {
  position: absolute;
  left: 18px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-weight: 900;
}

.auth-provider-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.apple-icon { color: #202020; }
.apple-icon svg { width: 22px; height: 22px; }

.auth-email-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
}

.auth-email-row input,
.auth-email-row button {
  min-height: 46px;
}

.auth-email-row button {
  padding-inline: 18px;
}

.auth-fine-print {
  margin: -2px 0 0;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.password-step {
  display: grid;
  gap: 10px;
}

.password-step[hidden] {
  display: none;
}

.pricing-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pricing-card.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(255, 111, 33, 0.32), var(--shadow);
}

.pricing-card.is-featured {
  border-color: var(--accent);
  background: #fff7f0;
}

.pricing-card h3 {
  margin-bottom: 0;
  font-size: 22px;
}

.pricing-card > strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.pricing-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pack-actions,
.account-actions {
  display: grid;
  gap: 10px;
}

.account-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.account-stat-grid div {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(51, 204, 255, 0.35);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.account-stat-grid strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-hero {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.account-hero .connection-card-heading {
  grid-column: 1 / -1;
}

.usage-meter {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(51, 204, 255, 0.45);
  border-radius: 8px;
  padding: 12px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
}

.usage-meter small {
  color: var(--muted);
}

.oauth-actions {
  display: grid;
  gap: 10px;
}

.fine-print {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.billing-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.billing-table th,
.billing-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.connection-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.connection-card.is-connected {
  border-color: rgba(255, 111, 33, 0.42);
}

.connection-card.is-highlighted {
  border-color: var(--gold);
  box-shadow: 0 18px 45px rgba(184, 120, 24, 0.18);
}

.connection-card[data-result-tone="success"] {
  border-color: rgba(255, 111, 33, 0.55);
}

.connection-card[data-result-tone="error"] {
  border-color: rgba(164, 70, 93, 0.55);
}

.connection-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.connection-card-heading h3 {
  margin-bottom: 4px;
}

.connection-card-heading p,
.connection-card a,
.connection-result {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.connection-card-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: #ecefed;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.connection-card.is-connected .connection-card-heading span {
  background: #fff4f2;
  color: var(--accent-strong);
}

.setup-card {
  align-content: start;
}

.setup-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.setup-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.connection-result[data-tone="running"] {
  border: 1px solid rgba(45, 95, 147, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef4fb;
  color: var(--blue);
  font-weight: 800;
}

.connection-result[data-tone="success"] {
  border: 1px solid rgba(255, 111, 33, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff4f2;
  color: var(--accent-strong);
  font-weight: 800;
}

.connection-result[data-tone="error"] {
  border: 1px solid rgba(164, 70, 93, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbf0f3;
  color: var(--rose);
  font-weight: 800;
}

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

.model-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.card-model-select {
  width: min(100%, 310px);
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 2px 24px 2px 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.card-model-select:focus {
  outline: 2px solid rgba(51, 204, 255, 0.45);
  outline-offset: 2px;
}

.card-model-select:disabled {
  opacity: 0.7;
}

.model-card-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.response-body {
  min-height: 320px;
  margin: 0;
  overflow: auto;
  color: #263235;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
}

.response-body.muted {
  color: var(--muted);
}

.response-body p,
.response-body ul {
  margin: 0 0 14px;
}

.response-body p:last-child,
.response-body ul:last-child {
  margin-bottom: 0;
}

.response-body ul {
  padding-left: 20px;
}

.response-body li {
  margin-bottom: 8px;
}

.response-body h3,
.response-body h4,
.response-body h5 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
}

.response-body strong {
  color: var(--ink);
  font-weight: 800;
}

.response-body em {
  color: #435155;
}

.window-count-picker {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 6px;
}

.window-count-button {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.window-count-button:hover,
.window-count-button.is-active {
  background: rgba(72, 66, 55, 0.1);
  color: var(--ink);
}

.window-count-button.is-active {
  box-shadow: none;
}

.window-preview {
  --window-line: rgba(72, 66, 55, 0.34);
  display: block;
  width: 22px;
  height: 16px;
  border: 2px solid var(--window-line);
  border-radius: 3px;
  background-color: #ffffff;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

.window-preview[data-count="2"] {
  background-image:
    linear-gradient(
      to right,
      transparent calc(50% - 1px),
      var(--window-line) calc(50% - 1px),
      var(--window-line) calc(50% + 1px),
      transparent calc(50% + 1px)
    );
}

.window-preview[data-count="3"] {
  background-image:
    linear-gradient(
      to right,
      transparent calc(33.333% - 1px),
      var(--window-line) calc(33.333% - 1px),
      var(--window-line) calc(33.333% + 1px),
      transparent calc(33.333% + 1px)
    ),
    linear-gradient(
      to right,
      transparent calc(66.666% - 1px),
      var(--window-line) calc(66.666% - 1px),
      var(--window-line) calc(66.666% + 1px),
      transparent calc(66.666% + 1px)
    );
}

.window-preview[data-count="4"] {
  background-image:
    linear-gradient(
      to right,
      transparent calc(50% - 1px),
      var(--window-line) calc(50% - 1px),
      var(--window-line) calc(50% + 1px),
      transparent calc(50% + 1px)
    ),
    linear-gradient(
      to bottom,
      transparent calc(50% - 1px),
      var(--window-line) calc(50% - 1px),
      var(--window-line) calc(50% + 1px),
      transparent calc(50% + 1px)
    );
}

.window-preview[data-count="6"] {
  background-image:
    linear-gradient(
      to right,
      transparent calc(33.333% - 1px),
      var(--window-line) calc(33.333% - 1px),
      var(--window-line) calc(33.333% + 1px),
      transparent calc(33.333% + 1px)
    ),
    linear-gradient(
      to right,
      transparent calc(66.666% - 1px),
      var(--window-line) calc(66.666% - 1px),
      var(--window-line) calc(66.666% + 1px),
      transparent calc(66.666% + 1px)
    ),
    linear-gradient(
      to bottom,
      transparent calc(50% - 1px),
      var(--window-line) calc(50% - 1px),
      var(--window-line) calc(50% + 1px),
      transparent calc(50% + 1px)
    );
}

.window-preview span {
  display: none;
}

.window-count-button.is-active .window-preview {
  --window-line: rgba(72, 66, 55, 0.48);
}

.comparison-board[data-window-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.comparison-board[data-window-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-board[data-window-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.comparison-board[data-window-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-board[data-window-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.model-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.model-toggle input {
  width: 18px;
  height: 18px;
}

.model-toggle strong,
.model-toggle small {
  display: block;
}

.model-toggle small {
  margin-top: 2px;
  color: var(--muted);
}

.compare-actions {
  align-items: center;
  flex-wrap: wrap;
}

.compare-actions .synthesizer-control {
  margin-left: auto;
}

.compare-actions .synthesizer-control select {
  width: 220px;
}

.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.inline-select select {
  width: min(360px, 42vw);
  min-height: 40px;
  padding: 8px 10px;
}

.comparison-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.comparison-card {
  padding: 16px;
}

.comparison-card h3 {
  margin-bottom: 6px;
}

.comparison-card p {
  color: var(--muted);
  line-height: 1.45;
}

.comparison-card .response-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.summary-card {
  grid-column: 1 / -1;
  border: 2px solid rgba(51, 204, 255, 0.78);
  background: #e8faff;
  box-shadow: 0 16px 36px rgba(0, 108, 143, 0.14);
}

.summary-card .response-body {
  min-height: 0;
}

.synthesis-loading-card {
  min-height: 280px;
  background:
    radial-gradient(circle at 50% 68%, rgba(51, 204, 255, 0.2), transparent 42%),
    linear-gradient(145deg, #e8faff 0%, #f4fdff 100%);
  animation: fetching-card-pulse 1.8s ease-in-out infinite;
}

.synthesis-fetching {
  display: grid;
  min-height: 200px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.synthesis-fetching strong {
  margin-top: 6px;
  color: var(--cyan-ink);
  font-size: 22px;
}

.synthesis-fetching > span:last-child {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.next-prompt-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
  padding: 18px 20px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff3ed 0%, #effaff 100%);
  box-shadow: 0 10px 24px rgba(72, 66, 55, 0.1);
}

.next-prompt-card h4 {
  margin: 3px 0 7px;
  color: var(--ink);
  font-size: 19px;
}

.next-prompt-card p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

.next-prompt-kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-prompt-load {
  min-width: 210px;
  min-height: 48px;
  white-space: nowrap;
}

.next-prompt-load span {
  margin-left: 5px;
  font-size: 18px;
}

.comparison-card.is-loading {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 2px solid var(--brand-cyan);
  background:
    radial-gradient(circle at 50% 62%, rgba(51, 204, 255, 0.14), transparent 42%),
    linear-gradient(145deg, #fffaf6 0%, #f2fbff 100%);
  box-shadow: 0 18px 44px rgba(0, 108, 143, 0.16);
  animation: fetching-card-pulse 1.8s ease-in-out infinite;
}

.comparison-card.is-loading .model-card-heading {
  position: relative;
  z-index: 1;
}

.comparison-card.is-loading .model-card-heading > span {
  border: 1px solid rgba(255, 111, 33, 0.35);
  background: #fff0e8;
  color: var(--accent-strong);
}

.council-fetching-banner {
  grid-column: 1 / -1;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 2px solid var(--brand-cyan);
  border-radius: 12px;
  padding: 14px 22px;
  background: linear-gradient(115deg, #e8faff 0%, #fff4ed 100%);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(0, 108, 143, 0.14);
}

.council-fetching-banner div {
  display: grid;
  gap: 2px;
}

.council-fetching-banner strong {
  color: var(--cyan-ink);
  font-size: 20px;
  line-height: 1.2;
}

.council-fetching-banner div > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.model-fetching {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 270px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.model-fetching strong {
  margin-top: 6px;
  color: var(--cyan-ink);
  font-size: 20px;
}

.model-fetching > span:last-child {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.fetching-wheel {
  position: relative;
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent) 0deg 58deg,
    var(--brand-cyan) 58deg 225deg,
    rgba(51, 204, 255, 0.18) 225deg 360deg
  );
  box-shadow: 0 8px 22px rgba(0, 108, 143, 0.2);
  animation: fetching-wheel-spin 900ms linear infinite;
}

.fetching-wheel::before {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fffaf6;
  content: "";
}

.fetching-wheel > span {
  position: absolute;
  inset: 20px;
  z-index: 1;
  border: 4px solid rgba(255, 111, 33, 0.28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fetching-wheel-spin 650ms linear infinite reverse;
}

.fetching-wheel-small {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.fetching-wheel-small::before {
  inset: 7px;
  background: #f7fbfa;
}

.fetching-wheel-small > span {
  inset: 15px;
  border-width: 3px;
}

@keyframes fetching-wheel-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fetching-card-pulse {
  0%,
  100% {
    border-color: rgba(51, 204, 255, 0.8);
    box-shadow: 0 18px 44px rgba(0, 108, 143, 0.13);
  }

  50% {
    border-color: rgba(255, 111, 33, 0.75);
    box-shadow: 0 20px 50px rgba(255, 111, 33, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .comparison-card.is-loading,
  .synthesis-loading-card,
  .fetching-wheel,
  .fetching-wheel > span {
    animation: none;
  }
}

.empty-column .response-body,
.empty-state p {
  color: var(--muted);
}

.rating-control {
  display: grid;
  gap: 9px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 2px solid rgba(51, 204, 255, 0.55);
  border-radius: 10px;
  background: linear-gradient(105deg, #effbff, #fff7f2);
}

.rating-control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rating-control-heading > span {
  color: var(--cyan-ink);
  font-size: 13px;
  font-weight: 900;
}

.rating-control output {
  min-width: 72px;
  border: 1px solid rgba(255, 111, 33, 0.42);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff4ed;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.rating-control output[data-priority="0"] {
  border-color: rgba(116, 101, 88, 0.35);
  background: #f1ede8;
  color: var(--muted);
}

.rating-slider-row {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.rating-slider-row small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.response-weight[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--accent);
  appearance: none;
  -webkit-appearance: none;
}

.response-weight[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid rgba(0, 108, 143, 0.24);
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--synthesis-weight),
    rgba(51, 204, 255, 0.28) var(--synthesis-weight) 100%
  );
}

.response-weight[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(72, 66, 55, 0.28);
  appearance: none;
  -webkit-appearance: none;
}

.response-weight[type="range"]::-moz-range-track {
  height: 8px;
  border: 1px solid rgba(0, 108, 143, 0.24);
  border-radius: 999px;
  background: rgba(51, 204, 255, 0.28);
}

.response-weight[type="range"]::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.response-weight[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(72, 66, 55, 0.28);
}

.response-weight[type="range"]:focus-visible {
  outline: 3px solid rgba(51, 204, 255, 0.48);
  outline-offset: 2px;
}

.weight-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  align-items: start;
}

.history-list,
.history-detail,
.history-empty,
.history-section,
.history-response-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.history-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.history-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.history-item:hover,
.history-item.is-active {
  border-color: var(--accent);
  background: var(--brand-cyan);
}

.history-item span,
.history-item small {
  color: var(--muted);
  line-height: 1.35;
}

.history-item small {
  font-weight: 800;
}

.history-empty {
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
}

.history-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.history-detail-heading,
.history-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-detail-heading h2 {
  margin-bottom: 0;
}

.history-section {
  padding: 16px;
  box-shadow: none;
}

.history-synthesis {
  border: 2px solid rgba(51, 204, 255, 0.72);
  background: #e8faff;
}

.synthesis-byline {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.history-section h3 {
  margin-bottom: 8px;
}

.history-section p {
  color: var(--muted);
  line-height: 1.5;
}

.muted-panel {
  background: var(--soft);
}

.history-response-list {
  display: grid;
  gap: 12px;
  border: 0;
  box-shadow: none;
}

.history-response-list article {
  padding: 14px;
  box-shadow: none;
}

.history-response-list article > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.history-response-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.library-toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

.library-quick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.library-quick-list section,
.library-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.library-quick-list h3 {
  margin-bottom: 10px;
}

.library-quick-list section > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  color: var(--muted);
}

.library-empty strong {
  color: var(--ink);
}

.prompt-chip {
  display: inline-grid;
  max-width: 260px;
  border: 1px solid rgba(51, 204, 255, 0.45);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--cyan-soft);
  color: var(--ink);
  text-align: left;
}

.prompt-chip small,
.prompt-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-chip small {
  color: var(--cyan-ink);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.workflow-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.favorite-workflow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 111, 33, 0.4);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.workflow-card.is-favorite {
  border-color: rgba(255, 111, 33, 0.45);
}

.prompt-editor {
  display: grid;
  gap: 14px;
  border: 1px solid var(--brand-cyan);
  border-top: 5px solid var(--brand-cyan);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.prompt-editor[hidden] {
  display: none;
}

.prompt-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.prompt-editor-heading h2 {
  margin: 8px 0 0;
}

#prompt-editor-text {
  min-height: 360px;
  font-family: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.workflow-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 18px;
}

.workflow-card p {
  color: var(--muted);
  line-height: 1.5;
}

.workflow-card .prompt {
  margin: 12px 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: #334044;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.workflow-card .actions {
  margin-top: auto;
}

.stack-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

.stack-filters {
  display: grid;
  gap: 8px;
}

.filter-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.filter-button.is-active {
  border-color: var(--accent);
  background: #fff4f2;
  color: var(--accent-strong);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(72, 66, 55, 0.28);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  display: grid;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(72, 66, 55, 0.24);
}

.modal-card h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.modal-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-card:has(.upgrade-modal) {
  width: min(1080px, 100%);
  padding: 0;
  overflow-x: hidden;
  border-color: rgba(51, 204, 255, 0.45);
  border-radius: 24px;
  background:
    radial-gradient(circle at 23% 15%, rgba(51, 204, 255, 0.2), transparent 28%),
    radial-gradient(circle at 78% 40%, rgba(255, 111, 33, 0.12), transparent 26%),
    #fffdfb;
  box-shadow: 0 36px 100px rgba(35, 46, 50, 0.32);
}

.upgrade-modal {
  position: relative;
  display: grid;
  gap: 20px;
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(72, 66, 55, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(72, 66, 55, 0.1);
}

.upgrade-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 48px;
  text-align: center;
}

.upgrade-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  filter: drop-shadow(0 12px 14px rgba(0, 108, 143, 0.2));
}

.upgrade-mark img {
  display: block;
  width: 64px;
  height: 64px;
}

.upgrade-eyebrow {
  display: flex;
  gap: 8px;
}

.upgrade-eyebrow span {
  border: 1px solid rgba(51, 204, 255, 0.5);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--cyan-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.upgrade-eyebrow span:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.upgrade-hero h2 {
  max-width: 700px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.upgrade-hero p {
  max-width: 680px;
  margin: 0;
}

.upgrade-benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid rgba(51, 204, 255, 0.32);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.upgrade-benefits div {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 15px 10px;
  text-align: center;
}

.upgrade-benefits div + div { border-left: 1px solid rgba(51, 204, 255, 0.25); }
.upgrade-benefits span { color: var(--accent); font-size: 22px; font-weight: 900; }
.upgrade-benefits strong { font-size: 13px; }
.upgrade-benefits small { color: var(--muted); font-size: 11px; }

.upgrade-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.upgrade-plan {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(72, 66, 55, 0.12);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(72, 66, 55, 0.07);
}

.upgrade-plan.is-selected {
  border: 2px solid var(--brand-cyan);
  padding: 21px;
  box-shadow: 0 18px 44px rgba(0, 108, 143, 0.16);
}

.upgrade-plan-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.upgrade-plan-badge.is-neutral { background: #f1ede8; color: var(--muted); }
.upgrade-plan-badge.is-saving { background: #e4f8e9; color: #24713a; }
.upgrade-plan-check { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--brand-cyan); color: #fff; font-weight: 900; }
.upgrade-plan h3 { margin: 2px 0 0; font-size: 21px; }
.upgrade-plan > strong { color: var(--ink); font-size: 33px; letter-spacing: -0.04em; }
.upgrade-plan > strong span { font-size: 18px; vertical-align: top; }
.upgrade-plan > strong small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.upgrade-plan p { min-height: 42px; margin: 0; font-size: 13px; }
.upgrade-plan button { align-self: end; width: 100%; margin-top: 4px; }

.upgrade-checkout {
  display: grid;
  gap: 11px;
  border: 1px solid rgba(51, 204, 255, 0.28);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.upgrade-security { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; }
.upgrade-security span:first-child { color: #2da84a; }
.upgrade-security strong { color: var(--ink); }
.upgrade-cta { width: 100%; min-height: 50px; font-size: 16px; box-shadow: 0 12px 26px rgba(255, 111, 33, 0.22); }
.upgrade-cta span { margin-left: 7px; }
.upgrade-checkout > p { margin: 0; text-align: center; font-size: 11px; }
.upgrade-trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 6px; }
.upgrade-trust div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; }
.upgrade-trust div > span { grid-row: 1 / 3; color: var(--cyan-ink); font-size: 18px; }
.upgrade-trust strong { font-size: 11px; }
.upgrade-trust small { color: var(--muted); font-size: 10px; }
.upgrade-legal { margin: -8px 0 0 !important; text-align: center; font-size: 10px; }
.upgrade-legal a { color: var(--cyan-ink); }

.modal-card:has(.artifact-studio) {
  width: min(1160px, 100%);
  padding: 0;
  overflow-x: hidden;
  border-radius: 22px;
  background: #fffdfb;
}

.artifact-studio {
  display: grid;
  min-height: 650px;
}

.artifact-heading,
.artifact-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
}

.artifact-heading {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 16% 0%, rgba(51, 204, 255, 0.22), transparent 36%),
    linear-gradient(120deg, #fffdfb, #fff6ef);
}

.artifact-heading h2 {
  margin: 2px 0 3px;
  font-size: clamp(28px, 3vw, 38px);
}

.artifact-heading p,
.artifact-footer p {
  margin: 0;
}

.artifact-heading .artifact-close {
  position: absolute;
  top: 20px;
  right: 22px;
}

.artifact-body {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  min-height: 0;
}

.artifact-choices,
.artifact-brand-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px 28px;
}

.artifact-choices h3,
.artifact-brand-panel h3 {
  margin: 0;
  font-size: 20px;
}

.artifact-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.artifact-format {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 22px;
  align-items: center;
  gap: 11px;
  min-height: 78px;
  border: 1px solid #e8ddd6;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.artifact-format:hover {
  border-color: var(--brand-cyan);
  transform: translateY(-1px);
}

.artifact-format.is-selected {
  border: 2px solid var(--accent);
  padding: 11px;
  background: #fff8f3;
  box-shadow: 0 8px 22px rgba(255, 111, 33, 0.12);
}

.artifact-format strong,
.artifact-format small {
  display: block;
}

.artifact-format strong {
  margin-bottom: 3px;
  font-size: 15px;
}

.artifact-format small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.artifact-format-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid rgba(72, 66, 55, 0.09);
  background: #fff;
}

.artifact-format.is-selected .artifact-format-icon {
  border-color: rgba(255, 111, 33, 0.24);
  box-shadow: 0 4px 12px rgba(72, 66, 55, 0.1);
}

.artifact-format-icon img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.artifact-format-check {
  display: none;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.artifact-format.is-selected .artifact-format-check {
  display: grid;
}

.artifact-options,
.artifact-colours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.artifact-options label,
.artifact-brand-panel label,
.artifact-colours label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.artifact-options select,
.artifact-brand-panel input:not([type="color"]):not([type="file"]),
.artifact-brand-panel select {
  width: 100%;
  border: 1px solid #e5d7cf;
  border-radius: 10px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.artifact-preview {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 16px;
  padding: 22px 24px;
  background:
    linear-gradient(100deg, rgba(51, 204, 255, 0.16), transparent 50%),
    var(--ink);
  color: #fff;
}

.artifact-preview::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border: 35px solid rgba(255, 111, 33, 0.55);
  border-radius: 50%;
  content: "";
}

.artifact-preview > span {
  color: var(--brand-cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.artifact-preview h4 {
  position: relative;
  z-index: 1;
  max-width: 80%;
  margin: 9px 0 5px;
  font-size: 24px;
}

.artifact-preview p {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  max-width: 78%;
  margin: 0 0 18px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.artifact-preview div {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.artifact-preview div span {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
}

.artifact-brand-panel {
  border-left: 1px solid var(--line);
  background: #faf7f2;
}

.artifact-colours label {
  grid-template-columns: 1fr 36px;
  align-items: center;
  border: 1px solid #e5d7cf;
  border-radius: 10px;
  padding: 6px 7px 6px 10px;
  background: #fff;
}

.artifact-colours input[type="color"] {
  width: 34px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
}

.artifact-logo-control {
  border: 1px dashed #ccbcb0;
  border-radius: 11px;
  padding: 11px;
  background: #fff;
}

.artifact-logo-control input {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
}

.artifact-logo-control em {
  color: var(--cyan-ink);
  font-size: 11px;
  font-style: normal;
}

.artifact-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.artifact-footer > div {
  display: flex;
  gap: 10px;
}

.artifact-footer #artifact-status {
  color: var(--muted);
  font-size: 13px;
}

.artifact-footer #artifact-status[data-tone="success"] {
  color: #1f7a4c;
}

.artifact-footer #artifact-status[data-tone="error"],
.artifact-footer #artifact-status[data-tone="warning"] {
  color: var(--accent-strong);
}

.artifact-footer #artifact-status[data-tone="running"] {
  color: var(--cyan-ink);
}

@media (max-width: 760px) {
  .next-prompt-card {
    grid-template-columns: 1fr;
  }

  .next-prompt-load {
    width: 100%;
  }

  .modal-backdrop { padding: 10px; }
  .modal-card:has(.upgrade-modal) { max-height: calc(100vh - 20px); border-radius: 18px; }
  .upgrade-modal { gap: 14px; padding: 20px 14px; }
  .upgrade-hero { padding: 0 32px; }
  .upgrade-hero h2 { font-size: 29px; }
  .upgrade-eyebrow span:last-child { display: none; }
  .upgrade-benefits { grid-template-columns: 1fr 1fr; }
  .upgrade-benefits div:nth-child(3) { border-left: 0; border-top: 1px solid rgba(51, 204, 255, 0.25); }
  .upgrade-benefits div:nth-child(4) { border-top: 1px solid rgba(51, 204, 255, 0.25); }
  .upgrade-plans { grid-template-columns: 1fr; }
  .upgrade-plan p { min-height: 0; }
  .upgrade-trust { grid-template-columns: 1fr; }
  .modal-card:has(.artifact-studio) { max-height: calc(100vh - 20px); border-radius: 18px; }
  .artifact-studio { min-height: 0; }
  .artifact-heading,
  .artifact-footer { align-items: stretch; flex-direction: column; padding: 20px; }
  .artifact-body { grid-template-columns: 1fr; }
  .artifact-choices,
  .artifact-brand-panel { padding: 20px; }
  .artifact-brand-panel { border-top: 1px solid var(--line); border-left: 0; }
  .artifact-format-grid,
  .artifact-options { grid-template-columns: 1fr; }
  .artifact-footer > div { display: grid; grid-template-columns: 1fr 1.4fr; }
}

.tool-table {
  overflow: hidden;
}

.tool-row {
  display: grid;
  grid-template-columns: 160px 110px 1fr 1fr;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.tool-row:last-child {
  border-bottom: 0;
}

.tool-row strong {
  display: block;
}

.tool-row span,
.tool-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.information-page {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
  gap: 18px;
}

.information-hero,
.information-card,
.help-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.information-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  overflow: hidden;
  padding: clamp(24px, 5vw, 52px);
  background:
    radial-gradient(circle at 94% 14%, rgba(255, 111, 33, 0.18) 0 78px, transparent 79px),
    linear-gradient(120deg, var(--cyan-soft), var(--panel) 56%);
}

.information-hero h2 {
  max-width: 820px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.information-hero > div > p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
}

.hero-monogram {
  display: grid;
  width: 138px;
  height: 138px;
  place-items: center;
  border: 9px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 2.55rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: 0 18px 36px rgba(216, 77, 0, 0.22);
}

.about-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.about-story-grid > .information-card {
  min-width: 0;
  aspect-ratio: 1;
  padding: clamp(22px, 2.2vw, 27px);
  overflow: hidden;
}

.about-story-grid .information-card p {
  font-size: 0.88rem;
  line-height: 1.46;
}

.about-story-grid .information-link {
  font-size: 0.88rem;
}

.about-story-grid .book-card {
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
}

.about-story-grid .book-card-visual {
  min-height: 166px;
}

.about-story-grid .book-card-visual img {
  width: 92px;
}

.about-story-grid .moods-about-card .book-card-visual img {
  width: 104px;
}

.about-story-grid .concept-ribbon,
.about-story-grid .mood-pill-grid {
  gap: 5px;
  margin: 10px 0;
}

.about-story-grid .concept-ribbon span,
.about-story-grid .mood-pill-grid span {
  padding: 6px 8px;
  font-size: 0.7rem;
}

.information-card {
  padding: clamp(22px, 3vw, 32px);
}

.information-card h3,
.help-section h3 {
  margin: 5px 0 12px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.15;
}

.information-card p,
.help-section p {
  color: var(--muted);
  line-height: 1.65;
}

.information-kicker {
  display: block;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fred-card {
  background:
    linear-gradient(145deg, rgba(51, 204, 255, 0.12), transparent 48%),
    var(--panel);
}

.information-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--cyan-ink);
  font-weight: 900;
  text-decoration: none;
}

.information-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.book-card {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.book-card-visual {
  display: grid;
  min-height: 190px;
  place-items: center;
  border-radius: 10px;
  background: var(--cyan-soft);
}

.book-card-visual img {
  display: block;
  width: 104px;
  height: auto;
  filter: drop-shadow(0 14px 16px rgba(72, 66, 55, 0.22));
}

.moods-about-card .book-card-visual {
  background: #fff1e8;
}

.moods-about-card .book-card-visual img {
  width: 118px;
}

.concept-ribbon,
.mood-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}

.concept-ribbon span,
.mood-pill-grid span {
  border: 1px solid rgba(51, 204, 255, 0.58);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.mood-pill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mood-pill-grid span {
  border-color: rgba(255, 111, 33, 0.3);
  background: #fff1e8;
  color: var(--ink);
  text-align: center;
}

.mood-pill-grid b {
  color: var(--accent-strong);
}

.full-council-story {
  align-content: center;
  background:
    radial-gradient(circle at 88% 14%, transparent 0 44px, rgba(255, 111, 33, 0.68) 45px 65px, transparent 66px),
    var(--ink);
  color: #ffffff;
}

.full-council-story h3 {
  max-width: 720px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.full-council-story p {
  max-width: 850px;
  color: rgba(255, 255, 255, 0.8);
}

.information-action {
  width: fit-content;
  margin-top: 4px;
}

.help-page {
  gap: 22px;
}

.help-hero {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
}

.video-guide-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 15px;
  border: 1px solid rgba(255, 111, 33, 0.3);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(72, 66, 55, 0.1);
}

.video-guide-card strong {
  display: block;
  margin-bottom: 4px;
}

.video-guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.video-guide-play {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(216, 77, 0, 0.22);
}

.help-section {
  padding: clamp(22px, 3vw, 32px);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h3 {
  margin-bottom: 0;
}

.quick-start-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-start-grid article {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: var(--soft);
}

.quick-start-grid article > span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.quick-start-grid h4,
.council-help-grid h4 {
  margin: 0 0 7px;
  font-size: 1.05rem;
}

.quick-start-grid p,
.council-help-grid p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.council-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.council-help-grid article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
}

.council-help-grid article > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(51, 204, 255, 0.55);
  border-radius: 10px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.council-help-grid article[data-help-council="moods"] > span,
.council-help-grid article[data-help-council="life"] > span {
  border-color: rgba(255, 111, 33, 0.32);
  background: #fff1e8;
  color: var(--accent-strong);
}

.help-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.help-list {
  display: grid;
  gap: 11px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.help-list strong {
  color: var(--ink);
}

.help-practice-card {
  background:
    linear-gradient(145deg, rgba(51, 204, 255, 0.14), transparent 52%),
    var(--panel);
}

.prompt-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0;
}

.prompt-formula span {
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.prompt-formula b {
  color: var(--accent);
}

.feedback-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  background:
    radial-gradient(circle at 94% 16%, rgba(51, 204, 255, 0.24), transparent 31%),
    var(--panel);
}

.feedback-section p {
  max-width: 720px;
  margin-bottom: 0;
}

.feedback-actions {
  display: grid;
  gap: 9px;
  min-width: 190px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-books {
    position: absolute;
    top: 26px;
    right: 92px;
    z-index: 1;
    margin-top: 0;
    gap: 8px;
  }

  .sidebar-books img {
    width: 76px;
    filter: drop-shadow(0 10px 12px rgba(72, 66, 55, 0.18));
  }

  .sidebar-books img:nth-child(2) {
    width: 93px;
  }

  body[data-council="ai-labs"] .ai-labs-artwork {
    width: 128px;
  }

  .tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .information-hero,
  .help-hero {
    grid-template-columns: 1fr;
  }

  .hero-monogram {
    width: 92px;
    height: 92px;
    border-width: 6px;
    font-size: 1.8rem;
  }

  .about-story-grid,
  .council-help-grid,
  .help-two-column,
  .feedback-section {
    grid-template-columns: 1fr;
  }

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

  #compare,
  .stack-layout,
  .history-layout {
    grid-template-columns: 1fr;
  }

  .access-guide,
  .auth-grid,
  .comparison-board,
  .connection-grid,
  .modal-plan-grid,
  .pricing-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .comparison-board[data-window-count] {
    grid-template-columns: 1fr;
  }

  .tool-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .connections-header,
  .library-toolbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .tabs {
    grid-template-columns: 1fr 1fr;
  }

  .quick-start-grid,
  .book-card,
  .mood-pill-grid {
    grid-template-columns: 1fr;
  }

  .about-story-grid > .information-card {
    aspect-ratio: auto;
    overflow: visible;
  }

  .book-card-visual {
    min-height: 168px;
  }

  .video-guide-card {
    grid-template-columns: 1fr;
  }

  .feedback-actions,
  .feedback-actions .link-button {
    width: 100%;
  }

  .actions,
  .compare-actions,
  .history-detail-heading,
  .history-section-heading,
  .rating-control {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-select,
  .inline-select select,
  .rating-control select {
    width: 100%;
  }

  .compare-actions .synthesizer-control {
    margin-left: 0;
  }

  h1 {
    font-size: 28px;
  }
}

.legal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(51, 204, 255, 0.18), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(255, 111, 33, 0.1), transparent 24%),
    var(--off-white);
}

.legal-site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 4px solid var(--brand-cyan);
  padding: 12px max(24px, calc((100vw - 980px) / 2));
  background: rgba(250, 244, 236, 0.94);
  backdrop-filter: blur(14px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.legal-brand img {
  width: 44px;
  height: 44px;
}

.legal-site-header > span {
  border: 1px solid var(--brand-cyan);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--cyan-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-page {
  width: min(980px, calc(100% - 36px));
  margin: 34px auto 56px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--cyan-ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.legal-back:hover,
.legal-card a:hover,
.legal-footer a:hover {
  color: var(--accent-strong);
}

.legal-hero {
  overflow: hidden;
  border: 1px solid rgba(51, 204, 255, 0.55);
  border-top: 6px solid var(--brand-cyan);
  border-radius: 18px;
  padding: clamp(26px, 5vw, 54px);
  background: rgba(255, 250, 246, 0.94);
  box-shadow: var(--shadow);
}

.legal-hero .eyebrow {
  margin-bottom: 8px;
}

.legal-hero h1 {
  max-width: 720px;
  font-size: clamp(36px, 6vw, 58px);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.legal-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.legal-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.legal-contents {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 250, 246, 0.9);
  box-shadow: 0 12px 30px rgba(72, 66, 55, 0.08);
}

.legal-contents strong {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-contents a {
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.legal-contents a:hover {
  background: var(--cyan-soft);
  color: var(--cyan-ink);
}

.legal-content {
  display: grid;
  gap: 14px;
}

.legal-card {
  scroll-margin-top: 98px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 30px);
  background: rgba(255, 250, 246, 0.96);
  box-shadow: 0 12px 30px rgba(72, 66, 55, 0.07);
}

.legal-card h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 22px;
}

.legal-card h3 {
  margin: 20px 0 8px;
  font-size: 16px;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.legal-card p:last-child {
  margin-bottom: 0;
}

.legal-card ul {
  margin: 10px 0 0;
  padding-left: 21px;
}

.legal-card li + li {
  margin-top: 8px;
}

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

.legal-card a,
.legal-footer a {
  color: var(--cyan-ink);
  font-weight: 800;
}

.legal-callout {
  border-left: 5px solid var(--accent);
  background: linear-gradient(105deg, #fff1e9, #f2fbff);
}

.legal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 22px 4px 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .legal-site-header {
    padding: 10px 18px;
  }

  .legal-site-header > span {
    display: none;
  }

  .legal-page {
    width: min(100% - 28px, 980px);
    margin-top: 22px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-contents {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .legal-contents strong {
    grid-column: 1 / -1;
  }

  .legal-footer {
    flex-direction: column;
  }
}
