:root {
  --shell-bg: #f6f1e6;
  --shell-bg-deep: #e9dfcc;
  --shell-panel: rgba(255, 251, 244, 0.92);
  --shell-panel-strong: rgba(254, 248, 237, 0.98);
  --shell-panel-muted: rgba(246, 239, 226, 0.92);
  --shell-line: rgba(33, 42, 40, 0.1);
  --shell-line-strong: rgba(33, 42, 40, 0.18);
  --shell-text: #162825;
  --shell-muted: #64726d;
  --shell-accent: #0e7c64;
  --shell-accent-strong: #0a5948;
  --shell-accent-soft: rgba(14, 124, 100, 0.14);
  --shell-gold: #b58434;
  --shell-gold-soft: rgba(181, 132, 52, 0.16);
  --shell-danger: #b34c38;
  --shell-danger-soft: rgba(179, 76, 56, 0.12);
  --shell-success: #1e7d57;
  --shadow-soft: 0 26px 70px rgba(58, 46, 26, 0.08);
  --shadow-card: 0 18px 42px rgba(45, 34, 19, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-body: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(181, 132, 52, 0.16), transparent 26%),
    radial-gradient(circle at 86% 12%, rgba(14, 124, 100, 0.18), transparent 24%),
    linear-gradient(180deg, #faf6ef 0%, var(--shell-bg) 46%, var(--shell-bg-deep) 100%);
  color: var(--shell-text);
  font-family: var(--font-body);
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.shell-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.42;
  pointer-events: none;
}

.shell-glow--left {
  top: 72px;
  left: -120px;
  background: rgba(181, 132, 52, 0.22);
}

.shell-glow--right {
  top: 120px;
  right: -96px;
  background: rgba(14, 124, 100, 0.18);
}

.topbar,
.sidebar-card,
.support-card,
.canvas,
.drawer {
  backdrop-filter: blur(14px);
  background: var(--shell-panel);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-soft);
}

.topbar {
  position: sticky;
  top: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 auto 24px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--shell-accent) 0%, #0c5a49 100%);
  color: #f7f5ef;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.brand-copy__eyebrow,
.topbar__eyebrow,
.eyebrow,
.section-label,
.account-pill__label {
  margin: 0;
  color: var(--shell-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-copy strong,
.topbar strong,
.view-header h2,
.card-header h2,
.card-header h3,
.history-card h3,
.plan-card h3,
.provider-card h3,
.focus-card h3,
.step-card strong,
.signal-card strong {
  font-family: var(--font-display);
}

.topbar__meta {
  display: grid;
  gap: 10px;
}

.surface-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.surface-switch__item {
  border: 1px solid var(--shell-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--shell-text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-width: 150px;
  padding: 10px 14px;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.surface-switch__item:hover,
.surface-switch__item--current {
  background: var(--shell-accent-soft);
  border-color: rgba(14, 124, 100, 0.24);
  transform: translateY(-1px);
}

.surface-switch__label {
  font-size: 0.95rem;
  font-weight: 700;
}

.surface-switch__detail {
  color: var(--shell-muted);
  font-size: 0.78rem;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.account-pill {
  display: grid;
  gap: 2px;
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--shell-line);
}

.workspace {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  align-items: start;
}

.workspace--client {
  grid-template-columns: 320px minmax(0, 1fr) 300px;
}

.rail {
  display: grid;
  gap: 18px;
  align-self: start;
}

.sidebar-card,
.support-card,
.canvas {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.sidebar-card::after,
.support-card::after,
.canvas::after,
.drawer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 22%);
}

.sidebar-card,
.support-card {
  padding: 20px;
}

.sidebar-card--lead {
  background:
    linear-gradient(150deg, rgba(14, 124, 100, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 250, 242, 0.94));
}

.eyebrow,
.lede,
.section-copy,
.step-card__copy,
.timeline__detail,
.history-card__meta,
.feedback,
.provider-card p,
.summary-card p,
.empty-state__copy,
.wallet-inline p {
  color: var(--shell-muted);
}

.sidebar-card h1,
.canvas-header h2,
.card-header h2,
.card-header h3 {
  margin: 0;
  line-height: 1.05;
}

.sidebar-card h1 {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
}

.lede,
.canvas-header p,
.section-copy {
  margin: 0;
  line-height: 1.6;
}

.signal-stack,
.focus-list,
.journey-stepper,
.provider-list,
.history-list {
  display: grid;
  gap: 12px;
}

.signal-card,
.focus-card,
.step-card,
.provider-card,
.history-card,
.plan-card,
.summary-card,
.panel-card,
.message-card,
.mono-card,
.callout {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--shell-panel-strong);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shadow-card);
}

.signal-card,
.focus-card,
.provider-card,
.summary-card,
.history-card,
.message-card,
.mono-card,
.callout {
  padding: 16px 18px;
}

.signal-card strong,
.focus-card h3,
.summary-card strong,
.history-card h3,
.provider-card h3 {
  font-size: 1.12rem;
}

.step-card {
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.step-card:hover {
  transform: translateY(-1px);
}

.step-card[data-state="current"],
.flow-tabs__item--current,
.plan-card--current {
  border-color: rgba(14, 124, 100, 0.26);
  background: linear-gradient(180deg, rgba(14, 124, 100, 0.12), rgba(255, 252, 247, 0.98));
}

.step-card[data-state="done"] {
  background: linear-gradient(180deg, rgba(30, 125, 87, 0.08), rgba(255, 252, 247, 0.98));
}

.step-card[data-state="attention"],
.focus-card[data-tone="attention"] {
  border-color: rgba(181, 132, 52, 0.28);
}

.step-card[data-state="optional"] {
  border-style: dashed;
}

.step-card__top,
.card-header,
.inline-actions,
.summary-row,
.plan-card__header,
.history-card__header,
.provider-card__top,
.stat-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.step-card__top {
  align-items: flex-start;
}

.canvas {
  min-height: calc(100vh - 170px);
  padding: 22px;
}

.canvas-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.canvas-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.flow-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.flow-tabs__item {
  min-height: 92px;
  border-radius: 18px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.68);
  color: var(--shell-text);
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  text-align: left;
}

.flow-tabs__item small {
  color: var(--shell-muted);
  line-height: 1.45;
}

.flow-tabs__item[data-state="attention"] {
  border-color: rgba(181, 132, 52, 0.28);
}

.canvas-body,
.content-grid {
  display: grid;
  gap: 16px;
}

.content-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.content-grid--split {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.panel-card {
  padding: 20px;
}

.panel-card--hero {
  background:
    linear-gradient(135deg, rgba(14, 124, 100, 0.12), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 241, 0.98));
}

.panel-card--flat {
  box-shadow: none;
}

.panel-card--span-2 {
  grid-column: span 2;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-card--highlight {
  background: linear-gradient(180deg, rgba(14, 124, 100, 0.12), rgba(255, 253, 248, 0.98));
}

.summary-list,
.stat-list {
  display: grid;
  gap: 10px;
}

.summary-row strong,
.stat-row strong,
.wallet-inline__value,
.history-card__value,
.plan-card__price,
.mono-card pre {
  color: var(--shell-text);
  font-weight: 700;
}

.wallet-inline__value,
.history-card__value,
.plan-card__price {
  font-family: var(--font-display);
  font-size: 2rem;
}

.plan-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
  padding: 18px;
}

.bullet-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--shell-muted);
}

.form-stack,
.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.field {
  display: grid;
  gap: 8px;
}

.field--wide {
  grid-column: span 2;
}

.field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--shell-text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(14, 124, 100, 0.32);
  box-shadow: 0 0 0 4px rgba(14, 124, 100, 0.08);
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.72;
}

.button--primary {
  background: linear-gradient(135deg, var(--shell-accent) 0%, var(--shell-accent-strong) 100%);
  color: #f6f4ef;
}

.button--ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--shell-line);
  color: var(--shell-text);
}

.feedback {
  margin: 0;
  font-size: 0.9rem;
}

.feedback[data-tone="positive"] {
  color: var(--shell-success);
}

.feedback[data-tone="critical"] {
  color: var(--shell-danger);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--shell-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill[data-tone="current"] {
  background: var(--shell-accent-soft);
  color: var(--shell-accent-strong);
}

.status-pill[data-tone="attention"] {
  background: var(--shell-gold-soft);
  color: #8a5c18;
}

.status-pill[data-tone="positive"] {
  background: rgba(30, 125, 87, 0.14);
  color: var(--shell-success);
}

.status-pill[data-tone="critical"] {
  background: var(--shell-danger-soft);
  color: var(--shell-danger);
}

.empty-state {
  display: grid;
  gap: 12px;
  min-height: 240px;
  place-items: center;
  text-align: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--shell-line-strong);
  background: rgba(255, 255, 255, 0.54);
}

.empty-state--compact {
  min-height: 0;
  padding: 24px;
}

.empty-state__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline__item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--shell-line);
}

.timeline__time,
.timeline__title,
.timeline__detail {
  margin: 0;
}

.timeline__time {
  font-size: 0.82rem;
}

.timeline__title {
  margin-top: 6px;
  font-weight: 700;
}

.history-card__meta {
  display: grid;
  gap: 4px;
}

.message-card,
.review-card,
.mono-card,
.callout {
  display: grid;
  gap: 12px;
}

.mono-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.tag {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--shell-line);
  color: var(--shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(18, 27, 24, 0.32);
}

.drawer {
  position: fixed;
  top: 28px;
  right: 28px;
  z-index: 30;
  width: min(460px, calc(100vw - 40px));
  max-height: calc(100vh - 56px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-xl);
  overflow: auto;
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer__body {
  display: grid;
  gap: 16px;
}

.icon-button {
  background: rgba(255, 255, 255, 0.74);
  border-color: var(--shell-line);
  color: var(--shell-text);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1400px) {
  .workspace--client {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .rail--support {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .workspace--client,
  .content-grid,
  .content-grid--split,
  .summary-grid,
  .plan-grid,
  .form-grid,
  .rail--support {
    grid-template-columns: 1fr;
  }

  .panel-card--span-2,
  .field--wide {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    top: 16px;
    margin-bottom: 18px;
    padding: 16px;
  }

  .workspace--client {
    grid-template-columns: 1fr;
  }

  .canvas {
    min-height: 0;
    padding: 18px;
  }

  .canvas-header,
  .card-header,
  .plan-card__header,
  .history-card__header,
  .provider-card__top,
  .inline-actions,
  .summary-row,
  .stat-row,
  .topbar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .drawer {
    inset: auto 16px 16px 16px;
    width: auto;
    max-height: calc(100vh - 32px);
  }
}
