:root {
  --brand: #0069a7;
  --brand-ink: #0b2a3c;
  --brand-glow: rgba(0, 105, 167, 0.25);
  --bg: #f7f9fb;
  --bg-elev: #ffffff;
  --text: #0b1f2b;
  --text-subtle: #4f6573;
  --input-text: #2d3e4a;
  --danger: #c43131;
  --border: rgba(15, 37, 53, 0.12);
  --shadow: 0 20px 50px rgba(12, 32, 45, 0.12);
  --radius: 18px;
  --radius-pill: 999px;
  --font-display: "Fraunces", serif;
  --font-body: "DM Sans", sans-serif;
  --grid: radial-gradient(circle at 20% 20%, rgba(0, 105, 167, 0.16), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(7, 66, 102, 0.12), transparent 35%),
    radial-gradient(circle at 20% 90%, rgba(14, 60, 88, 0.12), transparent 45%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.1'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
  --bg: #0a1218;
  --bg-elev: #0f1a22;
  --text: #eef6fb;
  --text-subtle: #b3c4d2;
  --input-text: #c5d5e1;
  --danger: #ff8a8a;
  --border: rgba(231, 243, 252, 0.12);
  --shadow: 0 25px 60px rgba(5, 8, 12, 0.55);
  --grid: radial-gradient(circle at 20% 15%, rgba(0, 105, 167, 0.25), transparent 50%),
    radial-gradient(circle at 75% 10%, rgba(22, 96, 140, 0.2), transparent 35%),
    radial-gradient(circle at 30% 80%, rgba(0, 105, 167, 0.15), transparent 45%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  color-scheme: light dark;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--grid);
  z-index: -2;
  opacity: 0.9;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--noise);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: grid;
  gap: 28px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  position: sticky;
  top: 14px;
  z-index: 25;
  padding: 14px 22px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.45));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);
}

.hero-top-row,
.hero-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(14, 26, 34, 0.92), rgba(15, 27, 36, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hero-title-block {
  display: grid;
  gap: 8px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(0, 105, 167, 0.25);
}

.logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
}

/* Hero layout — compact single-bar design */
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

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

.hero-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-share-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  align-self: flex-start;
}

.hero-subtitle {
  margin: 6px 0 0;
  color: var(--text-subtle);
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.hero-actions > * {
  flex: 0 0 auto;
}

.hero-form-select {
  min-width: 220px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 32px 8px 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--bg-elev) 88%, var(--brand) 12%);
  border-color: color-mix(in oklab, var(--border) 82%, var(--brand) 18%);
  box-shadow: 0 2px 8px rgba(0, 105, 167, 0.1);
}

.hero-title-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-mini-field {
  display: grid;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.select--mini {
  min-width: 86px;
  padding: 4px 22px 4px 8px;
  font-size: 0.72rem;
  line-height: 1.1;
  border-radius: var(--radius-pill);
}

.hero-lookup {
  font-size: 0.78rem;
  color: var(--text-subtle);
  white-space: nowrap;
  padding: 0 8px;
}

.hero-share-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.hero-share-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.hero-share-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand);
  letter-spacing: 1px;
  padding: 4px 8px;
  background: rgba(0, 105, 167, 0.08);
  border-radius: 6px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.status-group {
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.status-badge__indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-subtle);
  opacity: 0.4;
  transition: all 0.3s ease;
}

.status-badge--active .status-badge__indicator {
  background: #00a759;
  opacity: 1;
  box-shadow: 0 0 8px rgba(0, 167, 89, 0.6);
  animation: pulse-glow 2s ease-in-out infinite;
}

.status-badge--active {
  color: #00a759;
  background: rgba(0, 167, 89, 0.08);
}

.status-badge--connecting .status-badge__indicator {
  background: var(--brand);
  opacity: 0.7;
  animation: pulse-fade 1.5s ease-in-out infinite;
}

.status-badge--connecting {
  color: var(--brand);
}

[data-theme="dark"] .status-badge--active {
  color: #5cdb95;
  background: rgba(92, 219, 149, 0.12);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 167, 89, 0.6); }
  50% { box-shadow: 0 0 12px rgba(0, 167, 89, 0.9); }
}

@keyframes pulse-fade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.9; }
}

.btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 12px 25px var(--brand-glow);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.btn:hover {
  transform: translateY(-1px);
}

.panel {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-compact {
  padding: 16px 20px;
}

.progress {
  display: flex;
  gap: 10px;
  align-items: center;
}

.progress-bar {
  flex: 1;
  height: 10px;
  position: relative;
  border-radius: var(--radius-pill);
  overflow: visible;
}

.progress-bar__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(0, 105, 167, 0.12);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, #0069a7, #00a0d8);
  transition: width 0.3s ease;
}

.progress-journey {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -130%);
  transition: left 0.35s ease;
  pointer-events: none;
}

.progress-journey__icon {
  display: block;
  font-size: 1.1rem;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(11, 42, 60, 0.25));
  animation: journey-bob 1.2s ease-in-out infinite;
}

@keyframes journey-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.wizard-body {
  display: grid;
  gap: 20px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
}

.question-grid {
  display: grid;
  gap: 18px;
}

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

.label {
  font-weight: 600;
}

.input,
.select,
.textarea {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg-elev);
  color: var(--input-text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-subtle);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 105, 167, 0.2);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
}

.question-group {
  display: grid;
  gap: 10px;
}

.address-suggestions {
  position: relative;
}

.suggestion-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.suggestion-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--bg-elev);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.suggestion-item:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 105, 167, 0.2);
  transform: translateY(-1px);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: var(--brand);
  background: rgba(0, 105, 167, 0.05);
}

.pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 105, 167, 0.3);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.session-box {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  font-size: 0.9rem;
}

.session-box__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  opacity: 0.8;
}

.session-box__link {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 105, 167, 0.06);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 105, 167, 0.15);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.session-box__link:hover {
  background: rgba(0, 105, 167, 0.12);
}

.session-box__code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(0, 105, 167, 0.12);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
}

[data-theme="dark"] .session-box__link {
  background: rgba(0, 105, 167, 0.15);
  border-color: rgba(0, 105, 167, 0.25);
}

@media (max-width: 900px) {
  .session-box {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.mirror-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .mirror-card {
  background: rgba(11, 22, 30, 0.6);
}

.mirror-grid {
  display: grid;
  gap: 12px;
}

.tag {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 105, 167, 0.12);
  color: var(--brand);
  font-size: 0.78rem;
}

.percentage-picker {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elev);
}

.pill-small {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.total-indicator {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
}

.total-indicator.valid {
  background: rgba(0, 167, 89, 0.12);
  color: #00a759;
  border: 1px solid rgba(0, 167, 89, 0.3);
}

.total-indicator.invalid {
  background: rgba(196, 49, 49, 0.12);
  color: var(--danger);
  border: 1px solid rgba(196, 49, 49, 0.3);
}

[data-theme="dark"] .total-indicator.invalid {
  color: #ff8a8a;
}

.intro-grid {
  display: grid;
  gap: 16px;
}

.intro-input .textarea {
  width: 100%;
  resize: vertical;
}

.trust-panel {
  padding: 20px 24px;
}

.trust-grid {
  display: grid;
  gap: 14px;
}

.trust-advisor-card {
  display: flex;
  gap: 14px;
  align-items: center;
}

.trust-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(0, 105, 167, 0.15);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
}

.trust-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trust-advisor-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.trust-intro {
  margin: 0;
  color: var(--text-subtle);
  font-style: italic;
}

.trust-detail {
  font-size: 0.85rem;
  color: var(--text-subtle);
}

.trust-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-subtle);
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-icon {
  flex-shrink: 0;
  color: var(--brand);
}

.trust-link {
  color: var(--brand);
  font-weight: 600;
}



@media (max-width: 900px) {
  .hero {
    top: 8px;
    padding: 12px 16px;
  }
  .hero-top-row,
  .hero-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .hero-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .hero-title-tools {
    min-width: 100%;
  }
  .hero-share-inline {
    width: 100%;
  }
  .hero-inner {
    align-items: flex-start;
  }
  .hero-right {
    width: 100%;
  }
  .hero-advisor-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }
  .hero-share-strip {
    width: 100%;
  }
}