/* Рабочие стили инструмента. Дизайн виджета будет отдельно, здесь только чтобы всё читалось. */
:root {
  --bg: #faf8f4; --card: #fff; --ink: #1d1b19; --muted: #77716a; --line: #e4dfd7; --line2: #cfc8bd;
  --accent: #b5361f; --me: #efe9df;
  --fire: #f6dfd5; --earth: #e5ebd8; --air: #f1ecd6; --water: #dbe6ef;
  --blue: #2f6db3; --red: #c2412d; --green: #3d8a55;
  --blue-bg: #d7e4f4; --red-bg: #f4d9d2; --gold-bg: #f3e6c4; --grey-bg: #e9e5df;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sym: "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "DejaVu Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413; --card: #1f1d1b; --ink: #eeeae4; --muted: #9d968d; --line: #34302c; --line2: #4a4540;
    --accent: #ef7a5f; --me: #2b2825;
    --fire: #3d2722; --earth: #2a3122; --air: #36321f; --water: #1f2b36;
    --blue: #7aa8e0; --red: #ef7a5f; --green: #7cc192;
    --blue-bg: #22344a; --red-bg: #4a2a22; --gold-bg: #45391d; --grey-bg: #2e2b28;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-bottom: 80px; } /* scrollIntoView не прячет сообщение под строкой вопроса */
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--ui); }
header, main, footer, #ask { max-width: 720px; margin: 0 auto; padding: 0 16px; }
header h1 { margin: 24px 0 0; font-size: 26px; }
header p { margin: 0 0 16px; color: var(--muted); }
footer { color: var(--muted); font-size: 12px; padding-bottom: 32px; }
.small { font-size: 13px; color: var(--muted); }
button { font: inherit; cursor: pointer; }

/* лента */
#feed { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin: 0; }
.msg.me { align-self: flex-end; background: var(--me); border-color: transparent; }
.msg.viz, .msg.form { max-width: 100%; width: 100%; }
.msg.typing { color: var(--muted); }
.msg.error { border-color: var(--accent); }
.msg.note { align-self: center; background: none; border: 0; color: var(--muted); font-size: 13px; text-align: center; }
.stage h3 { margin: 18px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.stage { background: none; border: 0; padding: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; background: none; border: 0; padding: 0; max-width: 100%; }
.choices button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); }
.choices button.next { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#ask { position: sticky; bottom: 0; display: flex; gap: 8px; padding-top: 10px; padding-bottom: 12px; background: var(--bg); }
#ask input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); font: inherit; }
#ask button { padding: 10px 16px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); }
#ask button:disabled { opacity: .4; }

/* форма данных */
.data { display: grid; gap: 12px; }
.data label { display: grid; gap: 4px; font-size: 14px; }
.data fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14px; }
.data fieldset label { display: flex; gap: 8px; align-items: center; }
.data legend { padding: 0; margin-bottom: 4px; }
.data input:not([type=radio]) { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); max-width: 320px; }
.data input:disabled { opacity: .4; }
.city { position: relative; }
.sugg { display: grid; max-width: 420px; }
.sugg button { text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); color: var(--ink); }
.sugg button:hover, .sugg button:focus { background: var(--me); }
.sugg .none { color: var(--muted); padding: 6px 0; }
.plaque { font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: 8px; background: var(--grey-bg); }
.err { color: var(--accent); font-size: 14px; min-height: 1em; }
.data > button { justify-self: start; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); }

/* колесо */
.colleagues { font-size: 14px; }
.wheel { display: block; width: 100%; max-width: 560px; margin: 4px auto; }
.wheel text { text-anchor: middle; dominant-baseline: central; fill: var(--ink); font-family: var(--sym); }
.wheel .sign { stroke: var(--line2); stroke-width: 1; }
.wheel .el0 { fill: var(--fire); } .wheel .el1 { fill: var(--earth); } .wheel .el2 { fill: var(--air); } .wheel .el3 { fill: var(--water); }
.wheel .sg { font-size: 22px; }
.wheel .tick { stroke: var(--line2); stroke-width: .7; }
.wheel .cusp { stroke: var(--line2); stroke-width: 1; }
.wheel .axis { stroke: var(--ink); stroke-width: 2; }
.wheel .ax { font: 600 13px var(--ui); }
.wheel .ax.hl, .wheel .hn.hl { fill: var(--accent); }
.wheel .axis.hl { stroke: var(--accent); }
.wheel .hn { font: 11px var(--ui); fill: var(--muted); }
.wheel .ring { fill: none; stroke: var(--line2); }
.wheel .hl-house { fill: var(--accent); fill-opacity: .13; }
.wheel .asp { stroke-width: 1.4; cursor: pointer; }
.wheel .asp.trine, .wheel .asp.sextile { stroke: var(--blue); }
.wheel .asp.square, .wheel .asp.opp { stroke: var(--red); }
.wheel .asp.quincunx { stroke: var(--green); stroke-dasharray: 4 3; }
.wheel .pl { cursor: pointer; }
.wheel .pg { font-size: 21px; }
.wheel .pd { font: 11px var(--ui); fill: var(--muted); }
.wheel .pt { stroke: var(--ink); stroke-width: 1.6; }
.wheel .lead { stroke: var(--muted); stroke-width: .6; }
.wheel .dot { fill: var(--ink); }
.wheel .pl.hl .pg { fill: var(--accent); font-weight: 700; }
.wheel .pl.hl .pt, .wheel .pl.hl .dot { stroke: var(--accent); fill: var(--accent); }
.wheel .dim { opacity: .2; }
.wheel .note { font: 13px var(--ui); fill: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--grey-bg); font-family: var(--sym), var(--ui); }

/* стихии и кресты */
.balance { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0; }
.balance h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.bar { display: grid; grid-template-columns: 9em 1fr 1.5em; gap: 6px; align-items: center; font-size: 13px; }
.bar i { height: 8px; border-radius: 4px; background: var(--grey-bg); overflow: hidden; }
.bar u { display: block; height: 100%; background: var(--ink); }
.bar.el0 u { background: var(--red); } .bar.el1 u { background: var(--green); } .bar.el2 u { background: #c49a2c; } .bar.el3 u { background: var(--blue); }
.bar b { text-align: right; font-weight: 600; }
@media (max-width: 520px) { .balance { grid-template-columns: 1fr; } }

/* таблицы */
.tables summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.tables table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
.tables td, .tables th { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tables th { color: var(--muted); font-weight: 500; }
.tables .g { font-family: var(--sym); white-space: nowrap; }

/* шкала 2027 */
.timeline { font-size: 13px; }
.trow { display: grid; grid-template-columns: 7.2em 1fr; align-items: center; min-height: 26px; border-bottom: 1px solid var(--line); }
.tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; font-family: var(--sym), var(--ui); }
.tt { position: relative; height: 24px; background: linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / calc(100% / 12) 100%; }
.months .tt { display: flex; background: none; }
.mon { flex: 1; font-size: 11px; color: var(--muted); text-align: center; }
@media (max-width: 520px) { .mon:nth-child(even) { visibility: hidden; } }
.span { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; font-size: 11px; line-height: 16px; padding: 0 4px; white-space: nowrap; overflow: hidden; cursor: pointer; background: var(--grey-bg); }
.span.retro { background: var(--grey-bg); }
.span.jup { background: var(--gold-bg); }
.span.sat { background: var(--grey-bg); }
.span.trine, .span.sextile { background: var(--blue-bg); }
.span.square, .span.opp { background: var(--red-bg); }
.span.conj { background: var(--gold-bg); }
.exact { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ink); }
.ecl { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); cursor: pointer; }
.ecl.sol { background: var(--ink); }
.ecl.hit { box-shadow: 0 0 0 3px var(--accent); }
.calm { font-size: 12px; color: var(--muted); line-height: 24px; }
.tip { min-height: 1.2em; }

/* таро */
.fan { display: grid; grid-template-columns: repeat(11, 1fr); gap: 5px; max-width: 100%; width: 100%; }
.back { aspect-ratio: 1 / 1.73; border-radius: 5px; border: 1px solid var(--line2); background: repeating-linear-gradient(45deg, var(--accent) 0 3px, var(--card) 3px 7px); transition: transform .15s; padding: 0; }
.back:hover, .back:focus { transform: translateY(-6px); }
.card figure { margin: 0; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.card img { width: 220px; height: auto; border-radius: 8px; animation: flip .6s ease-out; }
.card figcaption { display: grid; gap: 4px; max-width: 320px; }
.card figcaption b { font-size: 22px; }
.card small { color: var(--muted); }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .card img { animation: none; } .back { transition: none; } }
