:root {
  --font: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --ink: #141414;
  --ink-2: #3d3d3d;
  --muted: #777;
  --line: #e4e1dc;
  --paper: #f6f4f0;
  --bg: #ffffff;
  --gold: #d6a24e;
  --gold-soft: #f1d8a8;
  --blue: #4f6d9e;
  --night: #1e2533;
  --day: #f5efe3;
  --rain: #5d8fd1;
  --shade: #9aa1ab;
  --radius: 2px;
  --wrap: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 84px; gap: 24px; }
.logo { display: flex; align-items: center; }
.logo img { height: 58px; width: auto; display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 38px; }
.main-nav a {
  text-decoration: none; text-transform: uppercase;
  font-size: 13px; letter-spacing: 0.14em; font-weight: 500;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; position: relative; }
.menu-toggle span:not(.sr) { display: block; height: 1.5px; background: var(--ink); margin: 6px 0; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

h1, h2, h3 { font-weight: 400; letter-spacing: 0.02em; margin: 0; }
h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 300; line-height: 1.1; }
h2 { font-size: 20px; margin-bottom: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--muted); margin: 0 0 4px; }

.intro { padding-top: 56px; padding-bottom: 32px; }
.lead { max-width: 760px; color: var(--ink-2); font-size: 16px; margin: 18px 0 32px; font-weight: 300; }

.search { display: grid; grid-template-columns: minmax(0, 1fr) 180px 230px auto; gap: 14px; align-items: end; }
.field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid #cfcac3; border-radius: var(--radius); background: #fff;
  font-size: 15px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 26px; border-radius: var(--radius);
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--ink); transition: background .2s, color .2s;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-line { background: #fff; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-small { height: 38px; padding: 0 16px; font-size: 11px; }
.btn[disabled] { opacity: .5; cursor: wait; }

.status { min-height: 24px; margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.status.error { color: #a33; }
.alt-results { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.alt-results button { background: var(--paper); border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; cursor: pointer; border-radius: var(--radius); text-align: left; }
.alt-results button:hover { border-color: var(--ink); }

.results { padding-bottom: 40px; }
.place-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; border-top: 1px solid var(--line); padding: 24px 0; flex-wrap: wrap; }
.place-name { font-size: 22px; margin: 0; font-weight: 400; }
.place-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.grid-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.ranking-panel { margin-top: 24px; }

.map-box { position: relative; height: 620px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-tint { position: absolute; inset: 0; pointer-events: none; transition: background .3s; }
.map-hint {
  position: absolute; left: 12px; top: 12px; max-width: 330px;
  background: rgba(255, 255, 255, 0.94); padding: 10px 12px; font-size: 12px; line-height: 1.45;
  border: 1px solid var(--line); pointer-events: none;
}
.map-hint { pointer-events: auto; padding-right: 30px; }
.hint-close { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); }
.hint-close:hover { color: var(--ink); }
.map-tools { position: absolute; right: 10px; bottom: 34px; display: flex; flex-direction: column; gap: 6px; }
.map-btn { width: 38px; height: 38px; background: #fff; border: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.map-btn:hover { border-color: var(--ink); }
.maplibregl-ctrl-attrib { font-size: 10px; }

.pin {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.35);
  cursor: grab;
}

.timebar { border: 1px solid var(--line); border-top: 0; padding: 14px 16px 12px; background: #fff; }
.time-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.play { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink); background: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.play:hover { background: var(--ink); color: #fff; }
.time-now { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.time-big { font-size: 28px; font-weight: 300; font-variant-numeric: tabular-nums; }
.time-info { font-size: 13px; color: var(--ink-2); }

#time-range { width: 100%; margin: 4px 0 6px; accent-color: var(--ink); height: 22px; }
.daybar { height: 46px; cursor: pointer; }
.daybar svg { display: block; width: 100%; height: 46px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 8px; margin-right: 5px; vertical-align: 0; border: 1px solid rgba(0,0,0,.08); }
.lg-night { background: var(--night); } .lg-blue { background: var(--blue); } .lg-golden { background: var(--gold); }
.lg-day { background: var(--day); } .lg-cloud { background: #8f959e; } .lg-rain { background: var(--rain); }

.panel { border: 1px solid var(--line); padding: 20px; background: #fff; }
.side-col { display: grid; gap: 24px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.empty { font-size: 13px; color: var(--muted); margin: 0; }

.sun-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 16px; font-size: 14px; }
.sun-list dt { color: var(--muted); }
.sun-list dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sunpath svg { display: block; width: 100%; height: auto; max-width: 300px; margin: 0 auto; }

.wx-summary { font-size: 14px; margin: 0 0 12px; }
.wx-score { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wx-score b { font-size: 30px; font-weight: 300; }
.wx-score span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.wx-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wx-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 4px 6px; border-bottom: 1px solid var(--line); }
.wx-table td { padding: 4px; border-bottom: 1px solid #f0eeea; }
.wx-table tr.now td { background: #faf6ee; }
.wx-scroll { max-height: 300px; overflow: auto; }
.clim-bars { display: grid; gap: 8px; margin: 8px 0 12px; }
.clim-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.clim-row .bar { height: 8px; background: var(--paper); position: relative; }
.clim-row .bar i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.clim-row b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.ranking { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-template-columns: repeat(16, minmax(44px, 1fr)); gap: 6px; overflow-x: auto; }
.ranking button {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 1px solid transparent; padding: 6px 2px; cursor: pointer; font-size: 12px;
}
.ranking button:hover { border-color: var(--line); }
.ranking li.active button { border-color: var(--ink); }
.ranking .r-score { font-variant-numeric: tabular-nums; font-size: 12px; }
.ranking .r-bar { width: 14px; height: 90px; background: var(--paper); position: relative; }
.ranking .r-bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--gold); }
.ranking li.top .r-bar i { background: var(--ink); }
.ranking .r-wd { color: var(--muted); font-size: 11px; line-height: 1; }
.ranking .r-date { font-variant-numeric: tabular-nums; line-height: 1; }

.facade { border-top: 1px solid var(--line); padding: 12px 0; }
.facade:first-child { border-top: 0; padding-top: 0; }
.facade-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.facade-head b { font-weight: 500; font-size: 14px; }
.facade-tag { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 600; margin-right: 8px; }
.facade-remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; }
.facade svg { display: block; width: 100%; height: 14px; margin: 8px 0 6px; }
.facade p { margin: 0; font-size: 13px; color: var(--ink-2); }

.orient { width: 100%; border-collapse: collapse; font-size: 13px; }
.orient td { padding: 6px 0; border-bottom: 1px solid #f0eeea; vertical-align: top; }
.orient td:first-child { color: var(--muted); padding-right: 12px; white-space: nowrap; }
.orient td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.plan-panel { margin-top: 24px; }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-head h2 { margin: 0; }
.plan-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-panel .note { margin-top: 8px; }
.plan-table-wrap { overflow-x: auto; }
.plan { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.plan th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px; border-bottom: 1px solid var(--line); }
.plan td { padding: 4px 6px; border-bottom: 1px solid #f0eeea; }
.plan input { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 6px; border-radius: var(--radius); font-size: 13.5px; }
.plan input:hover { border-color: var(--line); }
.plan input:focus { outline: none; border-color: var(--ink); background: #fff; }
.plan input.t { width: 70px; font-variant-numeric: tabular-nums; }
.plan .del { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 8px; }
.plan .del:hover { color: var(--ink); }

.disclaimer { font-size: 12px; color: var(--muted); margin: 20px 0 0; max-width: 900px; line-height: 1.55; }

.workshop { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; margin-top: 24px; }
.workshop-inner { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.workshop h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 300; margin: 0 0 10px; }
.workshop p { margin: 0; max-width: 640px; color: var(--ink-2); }

.site-footer { padding: 36px 0 44px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 18px; }
.footer-links a { text-decoration: none; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; }
.footer-links a:hover { text-decoration: underline; }
.credits { font-size: 11.5px; color: var(--muted); margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 18px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.busy { position: relative; }
.busy::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.55); }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .side-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .search { grid-template-columns: 1fr 1fr; }
  .field-address { grid-column: 1 / -1; }
  .search .btn { grid-column: 1 / -1; }
  .menu-toggle { display: block; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 24px 18px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a[aria-current="page"] { font-weight: 600; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .header-inner { min-height: 68px; }
  .logo img { height: 46px; }
  .intro { padding-top: 32px; }
  .side-col, .grid-lower { grid-template-columns: 1fr; }
  .map-box { height: 62vh; min-height: 380px; }
  .map-hint { right: 12px; max-width: none; font-size: 11.5px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .time-big { font-size: 24px; }
  .clim-row { grid-template-columns: 100px 1fr 36px; }
  .map-tools { bottom: 30px; }
}

@media (max-width: 520px) {
  .search { grid-template-columns: 1fr; }
}
