:root {
    --bg: #f4f1ea;
    --surface: #fffdf8;
    --surface-2: #eee8dc;
    --ink: #25221e;
    --muted: #6c665d;
    --line: #c8bda9;
    --accent: #7c3f2c;
    --accent-2: #285b67;
    --gold: #a5792a;
    --danger: #9b2c2c;
    --success: #28643c;
    --shadow: 0 14px 40px rgba(39, 30, 20, .11);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top, #fffaf0, var(--bg) 46%); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { padding: 28px clamp(18px, 4vw, 64px); display: flex; justify-content: space-between; align-items: end; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.78); backdrop-filter: blur(10px); }
.topbar h1 { margin: 2px 0 4px; font-family: Georgia, serif; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; }
.topbar p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; color: var(--accent); font-weight: 750; }
.version { color: var(--muted); font-size: .86rem; white-space: nowrap; }
.layout { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 24px; padding: 24px clamp(14px, 3vw, 44px) 40px; align-items: start; }
.workspace { min-width: 0; display: grid; gap: 18px; }
.panel { background: var(--surface); border: 1px solid rgba(128, 105, 77, .22); border-radius: 18px; box-shadow: var(--shadow); }
.form-panel { padding: 24px; position: sticky; top: 18px; }
h2 { font-family: Georgia, serif; font-weight: 500; margin: 0 0 18px; }
label { display: grid; gap: 7px; font-weight: 650; font-size: .92rem; margin-bottom: 16px; }
input, select { width: 100%; border: 1px solid var(--line); background: #fff; color: #1f1d19; border-radius: 10px; padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(40,91,103,.12); }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help, .privacy { color: var(--muted); font-size: .79rem; font-weight: 400; }
.primary { width: 100%; border: 0; border-radius: 11px; padding: 13px 18px; background: var(--accent); color: white; font-weight: 800; box-shadow: 0 8px 22px rgba(124,63,44,.23); }
.primary:disabled { opacity: .55; cursor: wait; }
.coordinates { margin: -4px 0 17px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px 0; }
.coordinates summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.place-field { position: relative; }
.place-results { position: absolute; z-index: 10; top: 72px; left: 0; right: 0; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.place-result { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eee6da; padding: 10px 12px; background: white; color: var(--ink); }
.place-result:hover { background: var(--surface-2); }
.place-result small { display: block; color: var(--muted); margin-top: 3px; }
.status { border-radius: 12px; padding: 12px 16px; border: 1px solid; }
.status.info { background: #eef6f8; border-color: #b8d7dd; color: #244f58; }
.status.success { background: #edf7f0; border-color: #b8d9c2; color: var(--success); }
.status.error { background: #fff0f0; border-color: #e6b5b5; color: var(--danger); }
.chart-panel { padding: 20px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.section-heading h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions button, #print-synthesis-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 9px 12px; }
.chart-container { width: min(100%, 900px); margin: auto; aspect-ratio: 1; }
#chart-svg { width: 100%; height: 100%; display: block; }
.chart-panel:fullscreen { overflow: auto; background: var(--surface); padding: 20px; }
.chart-panel:fullscreen .chart-container { height: calc(100vh - 120px); width: auto; max-width: 100%; }
.chart-bg { fill: #fffdf8; }
.wheel-line { stroke: #7c6c58; stroke-width: 1.2; fill: none; }
.wheel-line.major { stroke-width: 2.2; }
.zodiac-band { fill: #f3ecdf; stroke: #9f8a70; }
.house-line { stroke: #9b8d7b; stroke-width: 1; }
.house-line.angular { stroke: var(--accent); stroke-width: 2.2; }
.sign-glyph { font-size: 29px; text-anchor: middle; dominant-baseline: middle; font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif; fill: #704d2c; }
.house-number { font-size: 16px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; fill: #786b5b; }
.planet-label { text-anchor: middle; dominant-baseline: middle; font-family: "Segoe UI Symbol", "Noto Sans Symbols", sans-serif; }
.planet-label.natal { font-size: 25px; fill: #7c3f2c; font-weight: 700; }
.planet-label.transit { font-size: 21px; fill: #285b67; font-weight: 700; }
.planet-degree { font: 10px Inter, sans-serif; fill: #625a51; text-anchor: middle; }
.retrograde-mark { font: 800 11px Inter, sans-serif; fill: #a12121; }
.aspect-line { stroke-width: 1.15; opacity: .58; }
.aspect-line.harmonic { stroke: #2d7181; }
.aspect-line.dynamic { stroke: #a43b32; }
.aspect-line.adjustment { stroke: #8b6a23; stroke-dasharray: 5 4; }
.aspect-line.fusion { stroke: #69417e; }
.axis-label { font: 800 12px Inter, sans-serif; fill: var(--accent); }
.center-label { text-anchor: middle; fill: #60584d; }
.center-label.name { font: 600 18px Georgia, serif; }
.center-label.meta { font: 11px Inter, sans-serif; }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .82rem; }
.dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; margin-right: 5px; }
.natal-dot { background: var(--accent); }
.transit-dot { background: var(--accent-2); }
.results-panel { overflow: hidden; }
.tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tab { border: 0; background: transparent; padding: 14px 18px; font-weight: 750; color: var(--muted); white-space: nowrap; }
.tab.active { color: var(--accent); background: var(--surface); border-bottom: 3px solid var(--accent); }
.tab-content { display: none; padding: 22px; }
.tab-content.active { display: block; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { border-bottom: 1px solid #e9e1d5; padding: 9px 8px; text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.planet-name { font-weight: 750; white-space: nowrap; }
.planet-glyph { font-size: 1.35rem; margin-right: 6px; }
.interpretation-card, .summary-card { padding: 16px; border: 1px solid #dfd5c7; border-radius: 12px; margin-bottom: 12px; background: #fffefa; }
.interpretation-card h3, .summary-card h3 { margin: 0 0 7px; font-family: Georgia, serif; font-weight: 500; }
.interpretation-card p, .summary-card p { margin: 7px 0; line-height: 1.58; }
.retrograde-box { margin-top: 10px; padding: 11px; border-left: 4px solid var(--gold); background: #fff7df; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--surface-2); }
footer { text-align: center; padding: 24px; color: var(--muted); font-size: .8rem; }
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .form-panel { position: static; }
}
@media (max-width: 620px) {
    .topbar { align-items: start; flex-direction: column; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .chart-panel { padding: 10px; }
    .tab-content { padding: 15px; }
    .data-table { font-size: .79rem; }
}
@media print {
    body { background: white; }
    .topbar, .form-panel, .status, footer, .tabs, .actions, .legend { display: none !important; }
    .layout { display: block; padding: 0; }
    .panel { box-shadow: none; border: 0; }
    body.print-chart .results-panel { display: none !important; }
    body.print-chart .chart-panel { display: block !important; }
    body.print-chart .chart-container { width: 180mm; }
    body.print-summary .chart-panel { display: none !important; }
    body.print-summary .results-panel { display: block !important; }
    body.print-summary .tab-content { display: none !important; }
    body.print-summary #synthesis { display: block !important; padding: 0; }
    #print-synthesis-button { display: none !important; }
}
