@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --ink: #10263c;
  --ink-deep: #0a1a2d;
  --ink-soft: #1a3752;
  --paper: #f5efe3;
  --paper-2: #fbf8f1;
  --gold: #d3a34a;
  --gold-light: #f4d78d;
  --aqua: #73c7c6;
  --text: #eaf0f2;
  --muted: #9dafbb;
  --line: rgba(215, 235, 235, .14);
  --dark-line: rgba(16, 38, 60, .14);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--ink-deep); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--ink); color: var(--text); font-family: var(--sans); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; background: radial-gradient(circle at 73% 0%, rgba(79, 140, 159, .16), transparent 32rem), var(--ink); }
.topbar { height: 78px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 42px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 35px; height: 35px; border: 1px solid var(--gold); border-radius: 50%; display: grid; place-items: center; color: var(--gold-light); font-size: 20px; box-shadow: inset 0 0 0 5px rgba(211,163,74,.08); }
.brand-lockup h1 { margin: 1px 0 0; font: 600 20px/1 var(--serif); letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; }
.eyebrow.warm { color: var(--gold-light); }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.local-badge { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 8px; }
.status-dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 11px var(--aqua); }
.ghost-button, .text-button, .outline-button { border: 0; background: transparent; color: var(--gold-light); font-size: 12px; font-weight: 700; }
.ghost-button { border: 1px solid rgba(211,163,74,.55); padding: 10px 14px; border-radius: 3px; }
.ghost-button:hover, .outline-button:hover { background: rgba(211,163,74,.09); }

.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr) 265px; min-height: calc(100vh - 78px); }
.sidebar { border-right: 1px solid var(--line); padding: 35px 17px 24px; background: rgba(8, 24, 41, .34); }
.side-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 12px 14px; color: var(--paper); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line); }
.side-count { font-size: 10px; color: var(--muted); font-weight: 500; }
.module-nav { display: grid; gap: 4px; margin-top: 16px; }
.module-link { border: 0; display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; color: #b9c7ce; background: transparent; text-align: left; border-left: 2px solid transparent; font-size: 12px; transition: color .2s, background .2s, border-color .2s; }
.module-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.module-link.active { color: var(--gold-light); background: rgba(211,163,74,.11); border-left-color: var(--gold); }
.module-icon { color: var(--gold); width: 18px; text-align: center; font-size: 14px; }
.side-note { margin: 38px 11px 0; border-top: 1px solid var(--line); padding-top: 18px; display: flex; gap: 9px; color: var(--muted); }
.side-note-glyph { color: var(--aqua); font-size: 14px; }
.side-note p { margin: 0; font-size: 11px; line-height: 1.65; }

.main-area { min-width: 0; padding: 36px 46px 70px; }
.hero-row { max-width: 890px; display: flex; justify-content: space-between; gap: 30px; padding: 9px 0 33px; }
.hero-row h2 { margin: 11px 0 10px; color: var(--paper); font: 600 clamp(27px, 3vw, 43px)/1.12 var(--serif); letter-spacing: -.035em; max-width: 660px; }
.hero-copy { margin: 0; color: #b5c3c8; font-size: 14px; line-height: 1.75; max-width: 620px; }
.hero-seal { width: 94px; height: 94px; flex: 0 0 94px; position: relative; display: grid; place-items: center; color: var(--gold-light); text-align: center; font: 20px/1.3 var(--serif); }
.hero-seal small { color: var(--muted); font: 10px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.seal-ring, .seal-ring::before, .seal-ring::after { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(211,163,74,.5); content: ''; }
.seal-ring::before { inset: 8px; border-color: rgba(115,199,198,.35); transform: rotate(45deg); }
.seal-ring::after { inset: 17px; border-style: dashed; border-color: rgba(211,163,74,.35); }

.form-panel { max-width: 890px; background: var(--paper); color: var(--ink); padding: 29px 31px 25px; border-radius: 6px; box-shadow: 0 22px 55px rgba(0,0,0,.16); }
.panel-heading, .dashboard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.panel-heading h3, .dashboard-head h3 { margin: 5px 0 0; font: 600 25px/1.2 var(--serif); letter-spacing: -.02em; }
.text-button { color: #88651f; padding: 5px 0; }
.text-button:hover { color: var(--ink); }
.form-grid { display: grid; gap: 14px; }
.primary-grid { grid-template-columns: repeat(4, 1fr); margin-top: 25px; }
.birth-grid { grid-template-columns: 1fr 1fr 1.5fr; }
.number-grid { grid-template-columns: repeat(3, 1fr); }
.field { display: grid; gap: 6px; }
.field span { color: #536775; font-size: 11px; font-weight: 700; }
.field span em { color: #879394; font-style: normal; font-weight: 500; }
.field input { width: 100%; border: 1px solid rgba(16,38,60,.2); background: rgba(255,255,255,.51); color: var(--ink); padding: 12px 11px; border-radius: 2px; outline: none; font-size: 13px; transition: border .2s, box-shadow .2s; }
.field input::placeholder { color: #9da9a5; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(211,163,74,.15); }
.field.required > span::after { content: ' *'; color: #b77c43; }
.form-divider { margin: 25px 0 14px; display: flex; align-items: center; gap: 10px; color: #8b7452; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.divider-line { height: 1px; flex: 1; background: rgba(16,38,60,.12); }
.form-actions { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-top: 25px; }
.form-hint { margin: 0; color: #7b8681; font-size: 11px; line-height: 1.5; }
.form-hint span { color: #b77c43; }
.primary-button { border: 0; border-radius: 2px; background: var(--ink); color: var(--paper); padding: 13px 18px; font-size: 12px; font-weight: 700; white-space: nowrap; transition: background .2s, transform .2s; }
.primary-button span { color: var(--gold-light); margin-left: 10px; }
.primary-button:hover { background: var(--ink-soft); transform: translateY(-1px); }
.form-error { min-height: 17px; margin: 9px 0 0; color: #a05245; font-size: 11px; }

.insight-rail { border-left: 1px solid var(--line); padding: 35px 18px; background: rgba(8, 24, 41, .24); }
.rail-card { border: 1px solid rgba(211,163,74,.35); border-radius: 5px; padding: 19px; margin-bottom: 15px; background: rgba(15, 36, 57, .7); }
.rail-intro { min-height: 215px; position: relative; overflow: hidden; }
.rail-intro::after { content: ''; position: absolute; width: 140px; height: 140px; border: 1px solid rgba(115,199,198,.18); border-radius: 50%; right: -50px; bottom: -60px; }
.oracle-avatar { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold-light); border-radius: 50%; margin-bottom: 21px; }
.rail-card h3 { margin: 7px 0 11px; color: var(--paper); font: 600 22px/1.12 var(--serif); }
.rail-card p { margin: 0; color: #aebdc4; font-size: 12px; line-height: 1.65; }
.rail-status { padding: 17px; }
.status-header, .status-meta { display: flex; justify-content: space-between; align-items: center; }
.status-header { color: var(--paper); font-size: 11px; font-weight: 700; }
.status-header strong { color: var(--gold-light); font-size: 16px; font-weight: 500; }
.progress-track { height: 5px; margin: 13px 0 9px; border-radius: 10px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--aqua)); transition: width .5s ease; }
.status-meta { color: var(--muted); font-size: 9px; }
.rail-quote { padding: 21px 19px 17px; }
.quote-mark { color: var(--gold); display: block; height: 20px; font: 37px/20px var(--serif); }
.rail-quote p { color: var(--paper); font: 500 13px/1.55 var(--serif); }
.quote-author { display: block; margin-top: 13px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.rail-share { width: 100%; border: 1px solid rgba(115,199,198,.5); background: rgba(115,199,198,.07); color: var(--aqua); padding: 13px 10px; border-radius: 3px; font-size: 11px; font-weight: 700; }
.rail-share span { margin-right: 8px; }
.rail-share:hover { background: rgba(115,199,198,.14); }

.dashboard { max-width: 980px; }
.dashboard-head { margin-bottom: 22px; }
.dashboard-head h3 { color: var(--paper); font-size: 31px; }
.outline-button { border: 1px solid rgba(211,163,74,.58); padding: 10px 13px; border-radius: 2px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.metric { padding: 15px 16px; background: rgba(245,239,227,.07); border-top: 2px solid var(--gold); }
.metric-label { color: var(--muted); display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }
.metric-value { display: block; color: var(--paper); margin-top: 6px; font: 600 25px var(--serif); }
.metric-note { display: block; color: #95b4b7; margin-top: 3px; font-size: 10px; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.report-card { background: var(--paper); color: var(--ink); border-radius: 4px; padding: 23px; min-height: 160px; position: relative; overflow: hidden; }
.report-card.full { grid-column: 1 / -1; }
.report-card::before { content: ''; position: absolute; top: 0; right: 0; width: 75px; height: 75px; border-left: 1px solid rgba(211,163,74,.25); border-bottom: 1px solid rgba(211,163,74,.25); transform: translate(28px,-28px) rotate(45deg); }
.report-card h4 { margin: 5px 0 12px; font: 600 23px/1.2 var(--serif); letter-spacing: -.02em; }
.report-card .card-kicker { color: #8d6f31; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.report-card p { margin: 0; color: #475866; font-size: 13px; line-height: 1.7; }
.report-card strong { color: var(--ink); }
.report-card .reading { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--dark-line); }
.source-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(190, 152, 78, .22); }
.source-section h5 { margin: 0 0 8px; color: var(--ink); font-family: var(--display); font-size: 15px; letter-spacing: .01em; }
.source-section p { margin-bottom: 9px; }
.pin-code { font: 600 18px var(--serif); letter-spacing: .08em; color: var(--ink) !important; }
.matrix-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin: 10px 0 12px; }
.matrix-grid span { display: grid; place-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--dark-line); background: rgba(255,255,255,.34); }
.matrix-grid strong { color: var(--ink); font-size: 12px; }
.matrix-grid small { color: #78858b; font-size: 10px; }
.esma-hero { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 22px; align-items: center; }
.esma-number { width: 140px; height: 140px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid var(--gold); border-radius: 50%; color: var(--ink); background: radial-gradient(circle, rgba(211,163,74,.2), transparent 65%); }
.esma-number strong { font: 600 38px var(--serif); }
.esma-number span { color: #8d6f31; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.tag { display: inline-block; padding: 5px 8px; border: 1px solid rgba(16,38,60,.16); color: #536675; font-size: 10px; }
.locked-card { background: rgba(245,239,227,.05); border: 1px dashed rgba(211,163,74,.4); color: var(--paper); }
.locked-card .card-kicker { color: var(--gold-light); }
.locked-card p { color: #aebdc4; }
.locked-card .lock-message { display: flex; gap: 10px; align-items: flex-start; margin-top: 15px; color: var(--aqua); font-size: 11px; line-height: 1.55; }
.chakra-list { display: grid; gap: 9px; margin-top: 15px; }
.chakra-row { display: grid; grid-template-columns: 83px 1fr 31px; align-items: center; gap: 10px; }
.chakra-name { color: #50626e; font-size: 10px; font-weight: 700; }
.chakra-track { height: 7px; border-radius: 8px; background: #dfded5; overflow: hidden; }
.chakra-fill { height: 100%; min-width: 2px; background: linear-gradient(90deg, var(--aqua), var(--gold)); border-radius: 8px; }
.chakra-count { color: #8b6a25; font: 600 13px var(--serif); text-align: right; }
.summary-list { display: grid; gap: 9px; margin: 14px 0 0; }
.summary-line { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--dark-line); padding-bottom: 8px; color: #657680; font-size: 11px; }
.summary-line strong { color: var(--ink); text-align: right; }
.life-number-note { display:grid; gap:4px; margin:14px 0 4px; padding:12px 14px; border-left:3px solid var(--gold); background:rgba(211,163,74,.10); color:#50616a; font-size:12px; line-height:1.6; }
.life-number-note strong { color:var(--ink); font-size:12px; }
.recommendation { border-left: 3px solid var(--gold); padding-left: 13px; margin-top: 16px; }
.recommendation p { font-size: 12px; }
.affirmation { font: 500 16px/1.55 var(--serif) !important; color: var(--ink) !important; }
.copy-box { border: 1px solid var(--dark-line); padding: 13px; margin-top: 14px; background: rgba(255,255,255,.35); }
.copy-actions { display: flex; gap: 8px; margin-top: 12px; }
.small-button { border: 1px solid rgba(16,38,60,.25); color: var(--ink); background: transparent; padding: 8px 11px; font-size: 10px; font-weight: 700; }
.small-button:hover { background: rgba(16,38,60,.07); }
.coaching-grid { grid-template-columns: repeat(3, 1fr); }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.saved-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--dark-line); border-radius: 4px; background: rgba(255,255,255,.34); color: var(--ink); }
.saved-panel-dark { background: rgba(245,239,227,.07); border-color: var(--line); color: var(--paper); }
.saved-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.saved-panel h4 { margin: 4px 0 0; color: inherit; font: 600 20px/1.2 var(--serif); }
.saved-panel-note { margin: 8px 0 13px; color: #6b7b80; font-size: 11px; line-height: 1.55; }
.saved-panel-dark .saved-panel-note { color: var(--muted); }
.saved-analysis-list { display: grid; gap: 7px; }
.saved-analysis-row { display: flex; align-items: stretch; gap: 5px; }
.saved-analysis-open { display: flex; flex: 1; align-items: center; gap: 10px; border: 1px solid var(--dark-line); padding: 9px 10px; background: rgba(255,255,255,.42); color: var(--ink); text-align: left; }
.saved-panel-dark .saved-analysis-open { border-color: var(--line); background: rgba(255,255,255,.045); color: var(--paper); }
.saved-analysis-open:hover { border-color: var(--gold); background: rgba(211,163,74,.12); }
.saved-analysis-symbol { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); }
.saved-analysis-open strong, .saved-analysis-open small { display: block; }
.saved-analysis-open strong { font-size: 12px; }
.saved-analysis-open small { margin-top: 3px; color: #829095; font-size: 10px; }
.saved-panel-dark .saved-analysis-open small { color: var(--muted); }
.saved-analysis-delete { width: 34px; border: 1px solid var(--dark-line); background: transparent; color: #8d6f31; font-size: 19px; }
.saved-panel-dark .saved-analysis-delete { border-color: var(--line); color: var(--gold-light); }
.saved-analysis-delete:hover { border-color: #b77c43; background: rgba(183,124,67,.1); }
.saved-empty { margin: 0; color: #7e8b8d; font-size: 11px; line-height: 1.55; }
.saved-panel-dark .saved-empty { color: var(--muted); }
.calculation-detail { margin-top: 10px !important; color: #77858a !important; font-size: 11px !important; }
.calculation-detail strong { color: #596b72; }

.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 16px; border-radius: 3px; background: var(--paper); color: var(--ink); box-shadow: 0 8px 25px rgba(0,0,0,.25); font-size: 12px; transition: opacity .2s, transform .2s; z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr); }
  .insight-rail { display: none; }
  .main-area { padding-left: 36px; padding-right: 36px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 18px; height: 66px; }
  .topbar-actions .local-badge { display: none; }
  .workspace { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 13px; }
  .side-heading { padding-bottom: 10px; }
  .module-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:11px; padding-bottom:2px; }
  .module-link { width:100%; min-height:52px; padding:11px 10px; border-left:0; border-bottom:2px solid transparent; white-space:normal; font-size:12px; line-height:1.25; }
  .module-link.active { border-bottom-color:var(--gold); }
  .module-icon { display:block; flex:0 0 19px; }
  .side-note { display: none; }
  .main-area { padding: 25px 16px 50px; }
  .hero-seal { display: none; }
  .hero-row { padding-top: 0; }
  .form-panel { padding: 22px 18px 20px; }
  .primary-grid, .birth-grid, .number-grid, .coaching-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { align-items: flex-start; flex-direction: column; }
  .primary-button { width: 100%; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .report-card.full { grid-column: auto; }
  .esma-hero { grid-template-columns: 1fr; }
  .esma-number { width: 112px; height: 112px; }
  .esma-number strong { font-size: 31px; }
  .dashboard-actions { width: 100%; justify-content: stretch; }
  .dashboard-actions button { flex: 1; }
}
@media (max-width: 440px) {
  .primary-grid, .birth-grid, .number-grid, .coaching-grid { grid-template-columns: 1fr; }
  .brand-lockup h1 { font-size: 17px; }
  .hero-row h2 { font-size: 29px; }
}

html.mza-embed, html.mza-embed body { min-height: 0; }
html.mza-embed .app-shell, html.mza-embed .workspace { min-height: 0; }
html.mza-embed .main-area { padding-bottom: 24px; }
.life-number-form-note { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(211,163,74,.10); color: #536775; font-size: 11px; line-height: 1.55; }

@media print {
  html, body { background: #fff !important; color: #10263c !important; }
  .topbar, .sidebar, .insight-rail, .form-panel, .dashboard-head .outline-button, .dashboard-actions, .saved-panel, .toast { display: none !important; }
  .workspace, .main-area { display: block; padding: 0; }
  .dashboard { display: block !important; max-width: none; }
  .dashboard-head { margin: 0 0 18px; }
  .content-grid { display: block; }
  .report-card { break-inside: avoid; margin-bottom: 14px; border: 1px solid #ccd1cc; box-shadow: none; }
  .metric { border: 1px solid #ccd1cc; color: #10263c; }
  .metric-value, .metric-note, .metric-label { color: #10263c; }
}
