/* Bidu. Tokens, depois base, depois componentes. Espaçamento em múltiplos de 4px. */
:root {
  --paper: #eef2f8;
  --surface: #ffffff;
  --ink: #16203b;
  --muted: #55627f;
  --line: #d5dcea;
  --line-soft: #e4e9f3;
  --rose: #cf2f66;
  --rose-soft: #fbe3ec;
  --on-rose: #ffffff;
  --teal: #17788a;
  --teal-soft: #dcf0f3;
  --focus: #1d4ed8;
  --fogo: #c0412f;
  --terra: #6d7f2c;
  --ar: #2a76ad;
  --agua: #5651ab;
  --shadow: 0 1px 2px rgb(22 32 59 / .05), 0 12px 32px -16px rgb(207 47 102 / .22);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --font-sym: 'Noto Sans Symbols', 'Noto Sans Symbols 2', 'Segoe UI Symbol', 'Apple Symbols', 'DejaVu Sans', sans-serif;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0e1426; --surface: #172039; --ink: #e8ecf8; --muted: #9ba8c7; --line: #2c3a5e; --line-soft: #222d4b;
    --rose: #ff6b97; --rose-soft: #3a1f30; --on-rose: #1a0b14; --teal: #4fc3d6; --teal-soft: #15343b; --focus: #8ab4ff;
    --fogo: #ff8a76; --terra: #b4c860; --ar: #6fb7ee; --agua: #9d99ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
  }
}
:root[data-theme='dark'] {
  --paper: #0e1426; --surface: #172039; --ink: #e8ecf8; --muted: #9ba8c7; --line: #2c3a5e; --line-soft: #222d4b;
  --rose: #ff6b97; --rose-soft: #3a1f30; --on-rose: #1a0b14; --teal: #4fc3d6; --teal-soft: #15343b; --focus: #8ab4ff;
  --fogo: #ff8a76; --terra: #b4c860; --ar: #6fb7ee; --agua: #9d99ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--teal); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.sym { font-family: var(--font-sym); }
a, button, summary, select, label { touch-action: manipulation; }
button, summary, select, .check, label.btn { cursor: pointer; }

/* barra superior */
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px;
  padding: 16px var(--gutter); max-width: 1180px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.6rem var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.03em;
}
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.brand-mark .planet { fill: var(--rose); stroke: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; align-items: center; }
.top nav #nav-links { display: flex; flex-wrap: wrap; gap: 4px; }
.top nav #nav-links[hidden], .top nav .logout[hidden] { display: none; }
.top nav a {
  color: var(--muted); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 500;
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px; transition: color .15s, background-color .15s;
}
.top nav a:hover { color: var(--ink); background: var(--line-soft); }
.top nav a[aria-current='page'] { background: var(--ink); color: var(--paper); }
.count { font-size: .8rem; background: var(--rose); color: var(--on-rose); border-radius: 999px; padding: 0 8px; min-width: 20px; text-align: center; font-weight: 600; }
.logout { font: 500 1rem var(--font-body); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.logout:hover { color: var(--ink); background: var(--line-soft); }

main { max-width: 1180px; margin: 0 auto; padding: 24px var(--gutter) 64px; outline: none; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 32px; color: var(--muted); font-size: .9rem; }

.page-head { display: grid; gap: 12px; margin: 8px 0 32px; max-width: 60ch; }
.page-head p { color: var(--muted); font-size: 1.1rem; }

/* superfícies: só onde há conteúdo para guardar */
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; }
.panel.lift, .form.panel, .score-box { box-shadow: var(--shadow); }
.block { display: grid; gap: 16px; padding-top: 24px; margin-top: 32px; border-top: 1px solid var(--line); align-content: start; }
.stack { display: grid; gap: 16px; }

/* formulários */
.form { display: grid; gap: 20px; align-content: start; }
.field { display: grid; gap: 8px; }
.field label, .field .label { font-weight: 600; }
.hint { color: var(--muted); font-size: .92rem; }
input[type='text'], input[type='password'], input[type='date'], input[type='time'], input[type='number'], select {
  font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 14px; min-height: 48px; width: 100%;
  transition: border-color .15s, background-color .15s;
}
input:hover, select:hover { border-color: var(--muted); }
input:disabled { opacity: .5; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 12px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--rose); }
.btn {
  font: 600 1rem var(--font-body); border: 0; border-radius: var(--radius-sm); padding: 12px 20px; min-height: 48px;
  background: var(--ink); color: var(--paper); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, background-color .15s, border-color .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); filter: brightness(.92); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.love { background: var(--rose); color: var(--on-rose); box-shadow: 0 8px 20px -10px var(--rose); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { filter: none; background: var(--line-soft); }
.btn.danger { background: transparent; color: var(--rose); border: 1.5px solid var(--rose); }
.btn.danger:hover { filter: none; background: var(--rose-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.error { color: #b3123f; background: var(--rose-soft); border-radius: var(--radius-sm); padding: 12px 16px; font-weight: 500; }
:root[data-theme='dark'] .error { color: #ffb3c9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .error { color: #ffb3c9; } }
.picked { color: var(--teal); font-weight: 600; }
.field-error { color: #b3123f; font-weight: 500; font-size: .92rem; }
:root[data-theme='dark'] .field-error { color: #ffb3c9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .field-error { color: #ffb3c9; } }
input[aria-invalid='true'] { border-color: #b3123f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) input[aria-invalid='true'] { border-color: var(--rose); } }
:root[data-theme='dark'] input[aria-invalid='true'] { border-color: var(--rose); }
.pass-wrap { position: relative; display: grid; }
.pass-wrap input { padding-right: 96px; }
.toggle-pass { position: absolute; top: 4px; right: 4px; bottom: 4px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--teal); font: 600 .95rem var(--font-body); }
.toggle-pass:hover { background: var(--teal-soft); }
.results { list-style: none; margin: 0; padding: 0; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.results button { width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 12px 16px; min-height: 48px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.results li:last-child button { border-bottom: 0; }
.results button:hover { background: var(--teal-soft); }
details.manual { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: 8px 16px; }
details.manual summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
details.manual .form { margin-top: 12px; }
.form.login { max-width: 400px; }

/* novo mapa */
.layout-new { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .layout-new { grid-template-columns: 380px 1fr; gap: 56px; } }
.layout-new.has-result { grid-template-columns: 1fr; gap: 48px; }
.layout-new.has-result > .form.panel { max-width: 560px; }
.empty { color: var(--muted); display: grid; gap: 16px; justify-items: start; padding: 32px; }
.empty h2 { color: var(--ink); }
.sky { display: grid; gap: 24px; justify-items: center; text-align: center; }
.sky .wheel { max-width: 460px; opacity: .92; }
.sky-text { display: grid; gap: 8px; max-width: 46ch; }
.sky-text p { color: var(--muted); }

/* mapa: roda de um lado, leitura do outro */
.chart-layout { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) {
  .chart-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
  .chart-visual { position: sticky; top: 16px; }
}
.chart-head { display: grid; gap: 8px; }
.chart-head .meta { color: var(--muted); }
.chart-info > .trio, .chart-info > .notice { margin-top: 24px; }
.trio { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.trio li { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'g s' 'g l'; column-gap: 12px; align-items: center; color: var(--ink); }
.trio-glyph { grid-area: g; font-size: 2.4rem; line-height: 1; color: currentColor; }
.trio li.el-fogo .trio-glyph { color: var(--fogo); } .trio li.el-terra .trio-glyph { color: var(--terra); }
.trio li.el-ar .trio-glyph { color: var(--ar); } .trio li.el-agua .trio-glyph { color: var(--agua); }
.trio-sign { grid-area: s; font: 600 1.2rem/1.2 var(--font-display); align-self: end; }
.trio-label { grid-area: l; color: var(--muted); font-size: .92rem; align-self: start; }
.lead { font-size: 1.1rem; max-width: 62ch; margin-top: 20px; }
.score-box .lead { margin-top: 0; text-align: center; color: var(--muted); }
.howto { margin-top: 20px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px 16px; background: var(--surface); }
.howto summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.howto dl { margin: 0 0 12px; display: grid; gap: 12px; max-width: 62ch; }
.howto dt { font-weight: 600; }
.howto dd { margin: 2px 0 0; color: var(--muted); }
.placement { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); max-width: 66ch; }
.placement:last-child { border-bottom: 0; padding-bottom: 0; }
.placement h4 { font: 600 1.15rem/1.25 var(--font-display); letter-spacing: -0.015em; margin: 0; }
.placement-pos { font: 500 .92rem var(--font-body); color: var(--muted); margin-left: 8px; white-space: nowrap; }
.placement-role { color: var(--teal); font-size: .92rem; font-weight: 600; }
.placement-extra { color: var(--muted); font-size: .95rem; }
.balance { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 420px; }
.balance li { display: grid; grid-template-columns: 56px 1fr 24px; gap: 12px; align-items: center; }
.balance .num { font-weight: 700; text-align: right; }
.read-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 62ch; }
.read-list li { padding-left: 16px; border-left: 3px solid var(--teal-soft); }

.wheel-wrap { display: grid; place-items: center; }
.wheel { width: 100%; max-width: 580px; height: auto; display: block; }
.wheel text { font-family: var(--font-sym); text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.wheel .sign-cell { stroke: var(--line); stroke-width: 1; fill-opacity: .14; }
.wheel .el-fogo { fill: var(--fogo); } .wheel .el-terra { fill: var(--terra); }
.wheel .el-ar { fill: var(--ar); } .wheel .el-agua { fill: var(--agua); }
.wheel text.sign-glyph { font-size: 22px; font-weight: 600; }
.wheel .deg { stroke: var(--muted); stroke-width: .8; }
.wheel .ring { fill: none; stroke: var(--line); stroke-width: 1.2; }
.wheel .ring.disc { fill: var(--surface); }
.wheel .cusp { stroke: var(--line); stroke-width: 1; }
.wheel .cusp.major { stroke: var(--ink); stroke-width: 1.6; }
.wheel text.house-num { font: 500 11px var(--font-body); fill: var(--muted); }
.wheel text.angle { font: 700 14px var(--font-body); fill: var(--ink); }
.wheel text.glyph { font-size: 25px; }
.wheel text.glyph.pb { fill: var(--rose); }
.wheel text.retro { font-size: 11px; fill: var(--muted); }
.wheel .tick { stroke: var(--ink); stroke-width: 1.4; } .wheel .tick.pb { stroke: var(--rose); }
.wheel .asp { stroke-width: 1; opacity: .55; stroke-linecap: round; }
.wheel .asp-trine, .wheel .asp-sextile { stroke: var(--teal); }
.wheel .asp-square, .wheel .asp-opposition { stroke: var(--rose); }
.wheel .asp-conjunction { stroke: var(--ink); stroke-dasharray: 3 3; }
.wheel .dot { fill: var(--muted); }
.wheel .dot-sun { fill: var(--rose); } .wheel .dot-moon { fill: var(--teal); }
.wheel .dot-venus, .wheel .dot-mars { fill: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: .92rem; justify-content: center; margin-top: 12px; }
.legend i { display: inline-block; width: 20px; height: 3px; vertical-align: middle; margin-right: 8px; border-radius: 2px; }

.cols { display: grid; gap: 0 48px; align-items: start; }
@media (min-width: 760px) { .cols.two { grid-template-columns: 1fr 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: .96rem; }
th { text-align: left; font-weight: 600; color: var(--muted); }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.num { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.notice { background: var(--teal-soft); border-radius: var(--radius-sm); padding: 12px 16px; max-width: 62ch; }
.asp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.asp-list li { border-left: 3px solid var(--teal); padding: 2px 0 2px 16px; max-width: 70ch; }
.asp-list li.tense { border-left-color: var(--rose); }
.asp-list b { font-weight: 600; }
.asp-list small { color: var(--muted); }

/* meus mapas */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; align-items: center; }
.toolbar input[type='text'] { max-width: 360px; }
.toolbar .btn-row { margin-left: auto; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { display: grid; gap: 20px; align-content: start; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line); }
.card-top { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; }
.card-wheel .wheel { max-width: 88px; }
.wheel.mini .sign-cell { fill-opacity: .3; }
.wheel.mini .ring { stroke: var(--muted); }
.card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.card .meta { color: var(--muted); font-size: .92rem; }
.card .trio { gap: 8px 20px; }
.card .trio-glyph { font-size: 1.6rem; }
.card .trio-sign { font-size: 1rem; }
.card .trio-label { font-size: .85rem; }

/* compatibilidade */
.pick { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 32px; }
@media (min-width: 640px) { .pick { grid-template-columns: 1fr 1fr; } }
.score-box { display: grid; gap: 24px; justify-items: center; text-align: center; padding: 40px 24px; }
.venn { width: 100%; max-width: 460px; height: auto; }
.venn .a { fill: var(--teal); fill-opacity: .5; stroke: var(--teal); stroke-width: 2; } .venn .b { fill: var(--rose); fill-opacity: .5; stroke: var(--rose); stroke-width: 2; }
.venn text { font-family: var(--font-display); fill: var(--ink); text-anchor: middle; }
.venn .score { font-size: 54px; font-weight: 700; letter-spacing: -0.03em; } .venn .name { font-size: 14px; font-family: var(--font-body); font-weight: 600; }
.verdict { font: 600 1.7rem/1.15 var(--font-display); letter-spacing: -0.025em; }
.bars { display: grid; gap: 20px 40px; width: 100%; max-width: 720px; text-align: left; margin-top: 8px; }
@media (min-width: 640px) { .bars { grid-template-columns: 1fr 1fr; } }
.bar-head { display: flex; justify-content: space-between; font-weight: 600; }
.bar-head .num { font: 700 1.1rem var(--font-display); }
.bars .hint { margin-bottom: 8px; }
.bar { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--rose)); border-radius: 999px; transition: width .4s ease-out; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved-list li { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 16px; background: var(--surface); }
details.panel summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: var(--radius-sm); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* um único momento de movimento: a roda do mapa entra ao ser gerada ou aberta */
@keyframes wheel-in { from { opacity: 0; transform: rotate(-10deg) scale(.96); } to { opacity: 1; transform: none; } }
.chart-visual .wheel { animation: wheel-in .4s ease-out both; transform-origin: center; }

@media (prefers-reduced-motion: reduce) {
  .chart-visual .wheel { animation: none; }
  .bar i, .toast, .card, .btn, .top nav a { transition: none; }
}
@media (max-width: 560px) {
  .top { position: relative; gap: 4px; }
  .top nav { margin-left: 0; width: 100%; }
  .top nav #nav-links { flex: 1; flex-wrap: nowrap; justify-content: space-between; }
  .top nav a { padding: 8px 8px; font-size: .92rem; gap: 6px; }
  .logout { position: absolute; top: 16px; right: var(--gutter); }
  .panel { padding: 20px 16px; }
  .row { gap: 12px; }
}
