/* ============================================================
   HomeMatch — design system + themed hero + results
   Time-of-day palette inspired by the Catch My Train widget.
   ============================================================ */
:root {
  --purple: #7156A5;
  --purple-deep: #4a3a73;
  --ink: #1b2440;
  --paper: #fbf9f5;
  --card: #ffffff;
  --line: #e7e1d6;
  --muted: #6b7280;
  --good: #1f9d63;
  --mid: #d99a23;
  --bad: #d9362b;
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(27,36,64,.05), 0 4px 14px -8px rgba(27,36,64,.18);
  --shadow: 0 2px 6px rgba(27,36,64,.06), 0 24px 50px -22px rgba(27,36,64,.30);
  --fdisplay: "Fraunces", Georgia, serif;
  --fbody: "Inter", system-ui, -apple-system, sans-serif;
  /* theme defaults (day) */
  --sky-top: #BFE0F8; --sky-bottom: #EAF4FE;
  --scene-ink: #27305A; --hill: #cfe6cf; --hill-2:#bcdcc0;
  --building: #8ea3c9; --body: #ffffff; --window: #ffd66b; --bogie: #39406B;
  --rail: #9aa0bf; --tie: #b9bcd6; --accent: #5A43A0; --celestial:#fff3b0; --star:transparent;
  --hero-text:#1B2440;
}

body[data-theme="dawn"] {
  --sky-top:#FFD9A8; --sky-bottom:#FFEFD9; --scene-ink:#5C4633; --hill:#e8c79a; --hill-2:#dcb27d;
  --building:#caa079; --body:#ffffff; --window:#ffcf7a; --bogie:#5C4633; --rail:#b08968; --tie:#cda47e;
  --accent:#A4552E; --celestial:#FFE0B0; --star:transparent; --hero-text:#3A2A45;
}
body[data-theme="day"] {
  --sky-top:#BFE0F8; --sky-bottom:#EAF4FE; --scene-ink:#27305A; --hill:#cfe6cf; --hill-2:#bcdcc0;
  --building:#9bb0d6; --body:#ffffff; --window:#ffd66b; --bogie:#39406B; --rail:#9aa0bf; --tie:#c4c7de;
  --accent:#5A43A0; --celestial:#fff3b0; --star:transparent; --hero-text:#1B2440;
}
body[data-theme="dusk"] {
  --sky-top:#3E2B63; --sky-bottom:#C75B39; --scene-ink:#2A1830; --hill:#7a4a55; --hill-2:#693f4d;
  --building:#5a3a52; --body:#F7EFE6; --window:#ffd08a; --bogie:#2A1830; --rail:#e8b393; --tie:#9c6f72;
  --accent:#FFC9A3; --celestial:#ffd9b0; --star:transparent; --hero-text:#fff;
}
body[data-theme="night"] {
  --sky-top:#171030; --sky-bottom:#2C1F55; --scene-ink:#110C24; --hill:#2a2150; --hill-2:#231b45;
  --building:#2c2358; --body:#EFECF9; --window:#ffe08a; --bogie:#110C24; --rail:#6f659c; --tie:#3a3270;
  --accent:#B9ABE0; --celestial:#f2efe0; --star:#ffffff; --hero-text:#fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--fbody); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ===================== HERO ===================== */
.hero { position: relative; height: 100svh; min-height: 620px; overflow: hidden; isolation: isolate; }
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); transition: background 1.2s ease; z-index: 0; }
.celestial { position: absolute; top: 12%; right: 16%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--celestial), rgba(255,255,255,0) 72%);
  box-shadow: 0 0 80px 30px var(--celestial); opacity: .9; z-index: 1; animation: float 9s ease-in-out infinite; }
@keyframes float { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-14px);} }
.stars { position: absolute; inset: 0 0 40% 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, var(--star), transparent),
    radial-gradient(1.2px 1.2px at 70% 20%, var(--star), transparent),
    radial-gradient(1.6px 1.6px at 45% 12%, var(--star), transparent),
    radial-gradient(1.1px 1.1px at 85% 38%, var(--star), transparent),
    radial-gradient(1.3px 1.3px at 33% 48%, var(--star), transparent),
    radial-gradient(1.2px 1.2px at 60% 42%, var(--star), transparent);
  opacity: .9; }

/* clouds */
.clouds { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cloud { position: absolute; background: #fff; border-radius: 100px; opacity: .82; filter: blur(.3px); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.c1 { width: 120px; height: 30px; top: 16%; left: -20%; animation: drift 58s linear infinite; }
.c2 { width: 80px; height: 22px; top: 28%; left: -20%; animation: drift 78s linear infinite; animation-delay: -20s; }
.c3 { width: 150px; height: 36px; top: 9%; left: -30%; animation: drift 96s linear infinite; animation-delay: -50s; opacity:.7; }
.cloud::before { width: 50%; height: 180%; top: -55%; left: 12%; }
.cloud::after  { width: 38%; height: 150%; top: -38%; right: 14%; }
body[data-theme="night"] .cloud, body[data-theme="dusk"] .cloud { opacity: .25; }
@keyframes drift { to { transform: translateX(140vw); } }

/* ----- scene band (house + railway + train) ----- */
.scene { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; min-height: 280px; z-index: 2; overflow: hidden; }
.skyline { position: absolute; bottom: 33%; left: 0; right: 0; height: 120px; opacity: .5;
  background:
    linear-gradient(var(--scene-ink),var(--scene-ink)) 2% 100%/26px 70px no-repeat,
    linear-gradient(var(--scene-ink),var(--scene-ink)) 8% 100%/34px 110px no-repeat,
    linear-gradient(var(--scene-ink),var(--scene-ink)) 15% 100%/22px 60px no-repeat,
    linear-gradient(var(--scene-ink),var(--scene-ink)) 80% 100%/30px 90px no-repeat,
    linear-gradient(var(--scene-ink),var(--scene-ink)) 88% 100%/40px 130px no-repeat,
    linear-gradient(var(--scene-ink),var(--scene-ink)) 95% 100%/24px 70px no-repeat; }
.hill { position: absolute; bottom: 28%; left: -5%; right: -5%; height: 220px; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(180deg, var(--hill), var(--hill-2)); }

/* house */
.house { position: absolute; bottom: 30%; left: 58%; width: 168px; z-index: 2; transform: translateX(-50%); }
.house .walls { position: relative; height: 112px; background: var(--body); border-radius: 6px 6px 4px 4px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.06); }
.house .roof { position: absolute; bottom: 100%; left: -14px; width: 0; height: 0; border-left: 98px solid transparent; border-right: 98px solid transparent; border-bottom: 58px solid var(--accent); margin-bottom: -2px; filter: brightness(.95); }
.house .chimney { position: absolute; bottom: 122px; right: 26px; width: 18px; height: 34px; background: var(--accent); border-radius: 3px 3px 0 0; filter: brightness(.8); z-index:-1; }
.house .window { position: absolute; top: 22px; width: 38px; height: 38px; background: var(--window); border-radius: 5px; box-shadow: 0 0 0 4px var(--body), 0 0 22px var(--window); animation: glow 4s ease-in-out infinite; }
.house .w-left { left: 24px; } .house .w-right { right: 24px; animation-delay: -2s; }
.house .door { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 38px; height: 56px; background: var(--accent); border-radius: 20px 20px 3px 3px; opacity: .9; }
@keyframes glow { 0%,100%{ filter: brightness(1);} 50%{ filter: brightness(1.18);} }
.house .tree { position: absolute; bottom: 0; left: -42px; width: 30px; height: 30px; border-radius: 50%; background: var(--hill-2);
  box-shadow: 0 18px 0 -3px var(--hill-2), -2px 8px 0 0 var(--hill); }
.house .tree::after { content:""; position:absolute; bottom:-26px; left:13px; width:5px; height:30px; background: var(--bogie); opacity:.5; }
.smoke { position: absolute; bottom: 100%; left: 4px; width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.7); opacity: 0; animation: puff 3.4s ease-out infinite; }
.smoke.s2 { left: 6px; animation-delay: 1.7s; }
@keyframes puff { 0%{ transform: translateY(0) scale(.6); opacity: 0;} 25%{ opacity:.6;} 100%{ transform: translateY(-46px) scale(1.7); opacity: 0;} }

/* railway track (foreground) */
.track { position: absolute; bottom: 19%; left: 0; right: 0; height: 26px; z-index: 3; }
.track .rail { position: absolute; bottom: 6px; left: 0; right: 0; height: 5px; background: var(--rail); box-shadow: 0 9px 0 var(--rail); border-radius: 3px; }
.track .ties { position: absolute; bottom: 2px; left: 0; right: 0; height: 16px;
  background: repeating-linear-gradient(90deg, var(--tie) 0 8px, transparent 8px 34px); opacity: .9; }

/* the train */
.train-run { position: absolute; bottom: 19%; left: 0; right: 0; height: 92px; z-index: 4; pointer-events: none; }
.train { position: absolute; bottom: 6px; left: 0; display: flex; align-items: flex-end; gap: 8px; transform: translateX(-460px); animation: ride 11s linear infinite; }
@keyframes ride { from { transform: translateX(-460px);} to { transform: translateX(calc(100vw + 120px)); } }
.loco, .car { position: relative; }
.loco-body, .car-body { display: flex; align-items: center; gap: 7px; padding: 0 14px; height: 56px; background: var(--body);
  border-radius: 16px 22px 10px 10px; box-shadow: inset 0 -10px 0 rgba(0,0,0,.07), var(--shadow-sm); }
.car-body { border-radius: 12px; width: 150px; }
.loco-body { width: 132px; border-radius: 28px 16px 10px 10px; }
.loco-body .cab { position: absolute; left: 10px; top: 10px; width: 30px; height: 22px; background: var(--window); border-radius: 12px 6px 6px 6px; box-shadow: 0 0 12px var(--window); }
.win { width: 16px; height: 18px; background: var(--window); border-radius: 4px; box-shadow: 0 0 10px var(--window); animation: glow 3s ease-in-out infinite; }
.loco-body .win:nth-child(2){ animation-delay:-.5s;} .car-body .win:nth-child(3){ animation-delay:-1s;}
.roundel { position: absolute; right: 12px; top: 14px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid var(--accent); }
.roundel::after { content:""; position:absolute; left:-6px; top:6px; width:32px; height:5px; background: var(--accent); border-radius:3px; }
.wheels { display: flex; justify-content: space-around; padding: 0 14px; margin-top: -8px; }
.wheel { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--bogie); border: 3px solid rgba(255,255,255,.35); animation: spin .85s linear infinite; }
.wheel::after { content:""; position:absolute; width:2px; height:8px; background: rgba(255,255,255,.5); left:50%; top:3px; transform-origin:bottom; }
@keyframes spin { to { transform: rotate(360deg);} }

/* hero content overlay */
.hero-content { position: relative; z-index: 6; height: 100%; display: flex; flex-direction: column; width: min(1080px, 92vw); margin: 0 auto; padding-top: 26px; }
.topbar { display: flex; align-items: baseline; gap: 10px; }
.brand { font-family: var(--fdisplay); font-weight: 600; font-size: 1.5rem; color: var(--hero-text); display: inline-flex; align-items: center; gap: 9px; }
.brand-roundel { width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--accent); position: relative; display: inline-block; }
.brand-roundel::after { content:""; position:absolute; left:-5px; top:5px; width:28px; height:4px; background: var(--accent); border-radius:3px; }
.brand-sub { color: var(--hero-text); opacity: .65; font-size: .9rem; }
.hero-copy { margin-top: 5vh; max-width: 640px; }
.hero-copy h1 { font-family: var(--fdisplay); font-weight: 500; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 16px; color: var(--hero-text); }
.hero-copy h1 em { font-style: italic; color: var(--accent); }
.hero-copy p { font-size: clamp(1rem, 2.2vw, 1.25rem); line-height: 1.5; color: var(--hero-text); opacity: .82; margin: 0; max-width: 54ch; }

/* search ticket */
.ticket { margin-top: 26px; margin-bottom: auto; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.6); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); width: min(720px, 100%); }
.ticket-row { display: flex; align-items: flex-end; gap: 12px; }
.tk-field { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tk-label { font-weight: 700; font-size: .82rem; color: var(--ink); }
.tk-field input { font: inherit; font-size: 1.05rem; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; transition: border-color .15s, box-shadow .15s; }
.tk-field input::placeholder { text-transform: none; letter-spacing: 0; color: #b8b2a6; }
.tk-field input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(113,86,165,.16); }
.tk-arrow { font-size: 1.4rem; color: var(--muted); padding-bottom: 12px; }
.tk-budget { margin-top: 12px; }
.tk-money { display: flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; padding: 0 12px; transition: border-color .15s, box-shadow .15s; }
.tk-money:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(113,86,165,.16); }
.tk-money > span { color: var(--muted); font-weight: 600; }
.tk-money input { border: none !important; box-shadow: none !important; padding: 13px 4px !important; text-transform: none !important; letter-spacing: 0 !important; width: 100%; font-size: 1.05rem; background: transparent; }
.tk-money input:focus { outline: none; }
.tk-pm { font-size: .85rem; }
.tk-money.sm { padding: 0 8px; } .tk-money.sm input { font-size: .95rem; padding: 9px 2px !important; }
.tk-beds { max-width: 150px; }
.tk-field select { font: inherit; font-size: 1.05rem; padding: 13px 12px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); cursor: pointer; }
.tk-field select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(113,86,165,.16); }
.budget-box { display: flex; gap: 10px; margin: 12px 0 4px; }
.bb-field { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.bb-field:last-child { flex: 0 0 84px; }
.bb-field > span { font-weight: 600; font-size: .82rem; }
.bb-field select { font: inherit; padding: 8px 8px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.budget-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-top: 7px; }
.budget-pill.in { background: rgba(31,157,99,.13); color: var(--good); }
.budget-pill.over { background: rgba(217,54,43,.12); color: var(--bad); }
.area-card.overbudget { opacity: .72; }
.mk-sug.over { background: #c98; }
.go { margin-top: 14px; width: 100%; font: inherit; font-weight: 700; font-size: 1.08rem; padding: 16px; border: none; border-radius: 14px; background: var(--purple); color: #fff; cursor: pointer; transition: transform .08s, background .2s, box-shadow .2s; box-shadow: 0 10px 24px -10px rgba(113,86,165,.7); }
.go:hover { background: var(--purple-deep); }
.go:active { transform: translateY(1px); }
.go:disabled { opacity: .75; cursor: progress; }
.err { color: var(--bad); font-weight: 600; margin: 12px 2px 0; text-align: center; }
@media (max-width: 560px) { .ticket-row { flex-direction: column; align-items: stretch; } .tk-arrow { display: none; } }

.scroll-cue { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 6; color: var(--hero-text); opacity: .7; font-size: .85rem; font-weight: 600; animation: bobcue 2s ease-in-out infinite; }
@keyframes bobcue { 0%,100%{ transform: translate(-50%,0);} 50%{ transform: translate(-50%,6px);} }

/* ===================== RESULTS ===================== */
.results { width: min(1180px, 94vw); margin: 0 auto; padding: 48px 0 60px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.results-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.map-wrap { grid-row: span 2; padding: 16px; }
.breakdown, .suggest { grid-column: 1 / -1; }
@media (max-width: 900px) { .results-grid { grid-template-columns: 1fr; } .map-wrap { grid-row: auto; } }

.map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.map-head h2 { font-family: var(--fdisplay); font-weight: 500; font-size: 1.35rem; margin: 0; }
.map-legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.map-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.lg-home { background: var(--purple); } .lg-sug { background: var(--good); } .lg-route { background: #d9362b; border-radius: 2px !important; height: 4px !important; width: 16px !important; }
#map { height: 560px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 900px) { #map { height: 420px; } }
.map-hint { font-size: .8rem; color: var(--muted); margin: 10px 4px 0; }
.leaflet-container { font-family: var(--fbody); background: #eef2f4; }

/* score card */
.score-card { display: flex; align-items: center; gap: 20px; }
.score-ring { position: relative; width: 116px; height: 116px; flex: none; }
.score-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--purple); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1), stroke .5s; }
.score-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--fdisplay); font-weight: 600; font-size: 2.3rem; }
.score-num i { font-style: normal; font-size: 1rem; color: var(--muted); align-self: flex-start; margin-top: 12px; }
.score-meta h2 { font-family: var(--fdisplay); font-weight: 500; font-size: 1.5rem; margin: 0 0 4px; }
.conf { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.conf.warn { color: var(--bad); }

/* priorities */
.pri-head { display: flex; justify-content: space-between; align-items: baseline; }
.priorities h3 { font-family: var(--fdisplay); font-weight: 500; font-size: 1.25rem; margin: 0; }
.link-btn { background: none; border: none; color: var(--purple); font: inherit; font-size: .82rem; cursor: pointer; font-weight: 600; }
.sliders { margin-top: 12px; display: flex; flex-direction: column; gap: 13px; }
.slider-top { display: flex; justify-content: space-between; align-items: center; }
.slider-label { font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.slider-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.slider-weight { font-size: .76rem; color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--line); cursor: pointer; margin-top: 5px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--purple); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--purple); border: 3px solid #fff; }
input[type=range].off::-webkit-slider-thumb { background: #c7c0b2; }
input[type=range].off::-moz-range-thumb { background: #c7c0b2; }

/* breakdown */
.breakdown h3, .suggest h3 { font-family: var(--fdisplay); font-weight: 500; font-size: 1.3rem; margin: 0 0 16px; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
@media (max-width: 620px) { .bars { grid-template-columns: 1fr; } }
.bar-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.bar-label { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 7px; }
.bar-label.dim { opacity: .38; }
.bar-track { background: var(--line); height: 24px; border-radius: 7px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; transition: width .7s cubic-bezier(.2,.8,.2,1), background .4s; }
.bar-meta { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; font-size: .76rem; }
.bar-stat { font-weight: 700; color: var(--ink); }
.bar-raw { color: var(--muted); }

/* suggestions */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; }
.area-card { border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: var(--paper); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.area-card:hover, .area-card.active { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--purple); }
.area-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.area-name { font-family: var(--fdisplay); font-weight: 600; font-size: 1.12rem; }
.area-borough { font-size: .76rem; color: var(--muted); }
.area-pct { font-family: var(--fdisplay); font-weight: 600; font-size: 1.5rem; }
.area-delta { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; display: inline-block; margin-top: 7px; }
.area-delta.up { background: rgba(31,157,99,.13); color: var(--good); }
.area-delta.down { background: rgba(217,54,43,.1); color: var(--bad); }
.area-strengths { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .72rem; background: #fff; border: 1px solid var(--line); padding: 3px 9px; border-radius: 99px; color: var(--muted); }
.chip b { color: var(--ink); }

/* map marker badges */
.mk { display: flex; align-items: center; justify-content: center; font: 700 12px var(--fbody); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); border-radius: 50%; }
.mk-home { background: var(--purple); width: 40px; height: 40px; font-size: 13px; border-radius: 50% 50% 50% 4px; }
.mk-sug { background: var(--good); width: 32px; height: 32px; }
.mk-work { background: var(--ink); width: 30px; height: 30px; border-radius: 7px; font-size: 14px; }
.mk-sug.dim { background: #9aa6a0; opacity: .85; }

/* sources */
.sources { margin-top: 34px; }
.sources h4 { font-family: var(--fdisplay); font-weight: 500; font-size: 1.15rem; margin: 0 0 14px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.src-grid > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); display: flex; flex-direction: column; gap: 2px; }
.src-grid b { font-size: .92rem; }
.src-grid span { font-size: .74rem; color: var(--purple); font-weight: 600; }
.src-grid em { font-size: .78rem; color: var(--muted); font-style: normal; }
.fineprint { font-size: .82rem; color: var(--muted); margin-top: 16px; font-style: italic; }

.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 8px; }

@media (prefers-reduced-motion: reduce) {
  .train, .wheel, .cloud, .celestial, .smoke, .win, .house .window, .scroll-cue { animation: none !important; }
  .train { transform: translateX(36vw); }
}
