/* The Manhattan Diaries — Noir Satin, jen tmavý režim */
:root {
  --black: #000000;
  --obsidian: #080809;
  --surface: #0D0D0F;
  --surface-2: #151517;
  --surface-3: #1c1b1e;
  --border: #29272A;
  --border-soft: #1f1e21;
  --ruby: #410000;
  --ruby-hi: #7a1f24;
  --ruby-ink: #f3d9d6;
  --emerald: #002B18;
  --emerald-hi: #1f6b4a;
  --emerald-ink: #d3efe2;
  --amethyst: #280040;
  --amethyst-hi: #6a3d8f;
  --amethyst-ink: #eadcf6;
  --gold: #C6A66A;
  --gold-soft: #D9C397;
  --pearl: #F2EEE8;
  --silver: #A39FA4;
  --muted: #8a868c;
  --danger: #e07a6e;
  --ok: #7fc7a1;
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--black); color: var(--pearl); }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.1; }
h2 { font-size: 24px; line-height: 1.15; }
h3 { font-size: 19px; line-height: 1.2; }
.muted { color: var(--silver); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  display: none; width: 248px; flex-shrink: 0; border-right: 1px solid var(--border-soft);
  background: var(--obsidian); padding: 26px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand .t { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.05; color: var(--pearl); }
.brand .s { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }
.brand .x { font-family: var(--serif); font-style: italic; color: var(--silver); font-size: 15px; margin-top: 2px; }
.side-nav { margin-top: 28px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--silver); font-size: 14px; text-decoration: none;
}
.side-nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.side-nav a:hover { background: var(--surface-2); color: var(--pearl); }
.side-nav a.active { background: var(--surface-2); color: var(--pearl); box-shadow: inset 2px 0 0 var(--gold); }
.side-nav .sep { height: 1px; background: var(--border-soft); margin: 10px 4px; }
.side-foot { margin-top: 24px; font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(0,0,0,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-soft);
}
.topbar .t { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.topbar .s { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-dot.ok { background: var(--ok); }
.sync-dot.busy { background: var(--gold); }
.sync-dot.off { background: var(--danger); }
.view { padding: 18px 16px calc(var(--nav-h) + 28px + var(--safe-b)); max-width: 980px; margin: 0 auto; }
.view.full { max-width: none; padding: 0; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex;
  background: rgba(8,8,9,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-soft); padding-bottom: var(--safe-b);
}
.bottom-nav a {
  flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 11px; text-decoration: none;
}
.bottom-nav a svg { width: 21px; height: 21px; }
.bottom-nav a.active { color: var(--gold); }

@media (min-width: 900px) {
  .sidebar { display: block; }
  .bottom-nav { display: none; }
  .topbar .brandmini { display: none; }
  .view { padding: 28px 32px 48px; }
}

/* ---------- Components ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px;
}
.card.tight { padding: 12px 14px; }
.card + .card { margin-top: 12px; }
.card-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-h h2, .card-h h3 { flex: 1; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.grid { display: grid; gap: 12px; }
.grid > * { min-width: 0; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: 1fr 1fr 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--pearl);
  cursor: pointer; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn.gold { background: var(--gold); color: #120d04; border-color: var(--gold); font-weight: 600; }
.btn.gold:hover { background: var(--gold-soft); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.small { width: 32px; }
.btn.danger { color: var(--danger); }
.btn.on { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: .45; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--border); background: var(--surface); color: var(--silver); cursor: pointer; white-space: nowrap;
  user-select: none;
}
.chip.on { color: var(--pearl); border-color: var(--gold); background: var(--surface-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; border: 1px solid var(--border);
  color: var(--silver); white-space: nowrap;
}
.tag.ruby { background: var(--ruby); color: var(--ruby-ink); border-color: var(--ruby-hi); }
.tag.emerald { background: var(--emerald); color: var(--emerald-ink); border-color: var(--emerald-hi); }
.tag.amethyst { background: var(--amethyst); color: var(--amethyst-ink); border-color: var(--amethyst-hi); }
.tag.gold { color: var(--gold); border-color: rgba(198,166,106,.5); }
.tag.warn { color: var(--danger); border-color: rgba(224,122,110,.5); }
.tag.ok { color: var(--ok); border-color: rgba(127,199,161,.45); }

.list { display: flex; flex-direction: column; }
.li {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--border-soft);
}
.li:last-child { border-bottom: 0; }
.li .main-col { flex: 1; min-width: 0; }
.li .title { font-weight: 500; }
.li .sub { font-size: 13px; color: var(--silver); }
.li.click { cursor: pointer; }
.li.click:hover .title { color: var(--gold-soft); }
.li.done .title { text-decoration: line-through; color: var(--muted); }

.check {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; border: 1.5px solid var(--border);
  background: transparent; cursor: pointer; display: grid; place-items: center; margin-top: 1px; padding: 0;
}
.check.on { background: var(--gold); border-color: var(--gold); }
.check.on::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #120d04; border-bottom: 2px solid #120d04; transform: rotate(-45deg) translate(1px, -1px); }

input[type=text], input[type=search], input[type=number], input[type=date], input[type=time], input[type=url], input[type=password], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--obsidian); color: var(--pearl); outline: none; font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
label.f { display: block; font-size: 12px; color: var(--silver); margin: 12px 0 5px; letter-spacing: .02em; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 13px; color: var(--silver); cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--pearl); box-shadow: inset 0 -2px 0 var(--gold); }

.kpi { font-family: var(--serif); font-size: 38px; line-height: 1; font-weight: 600; }
.kpi-sub { font-size: 12px; color: var(--silver); letter-spacing: .04em; }

.empty { padding: 26px 12px; text-align: center; color: var(--silver); }
.note-box { border-left: 2px solid var(--gold); padding: 8px 12px; background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 13.5px; }
.warn-box { border-left: 2px solid var(--danger); padding: 8px 12px; background: #1a0d0c; border-radius: 0 10px 10px 0; font-size: 13.5px; }

/* ---------- Hero ---------- */
.hero { padding: 6px 0 18px; }
.hero .eyebrow { margin-bottom: 8px; }
.hero h1 { font-size: 38px; }
.hero .tagline { font-family: var(--serif); font-style: italic; color: var(--silver); font-size: 18px; margin-top: 4px; }
.clocks { display: flex; gap: 18px; margin-top: 14px; font-size: 13px; color: var(--silver); }
.clocks b { color: var(--pearl); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Weather ---------- */
.wx-days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.wx-days::-webkit-scrollbar { display: none; }
.wx-day { min-width: 74px; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.wx-day.trip { border-color: rgba(198,166,106,.45); }
.wx-day .d { font-size: 11px; color: var(--silver); }
.wx-day .i { font-size: 20px; margin: 4px 0; color: var(--gold-soft); }
.wx-day .t { font-size: 13px; font-variant-numeric: tabular-nums; }
.wx-day .p { font-size: 11px; color: var(--silver); }
.wx-now { display: flex; align-items: center; gap: 14px; }
.wx-now .big { font-family: var(--serif); font-size: 44px; line-height: 1; }

/* ---------- Map ---------- */
#mapwrap { position: fixed; inset: 0; z-index: 1; display: none; }
#mapwrap.show { display: block; }
#map { position: absolute; inset: 0; background: #0b0b0d; }
@media (min-width: 900px) { #mapwrap { left: 248px; } }
.map-ui {
  position: fixed; z-index: 30; left: 0; right: 0; top: calc(54px + var(--safe-t)); padding: 10px 12px 0;
  pointer-events: none;
}
@media (min-width: 900px) { .map-ui { left: 248px; } }
.map-ui > * { pointer-events: auto; }
.map-search { display: flex; gap: 8px; }
.map-search input { background: rgba(8,8,9,.92); backdrop-filter: blur(10px); }
.map-ui .chips { margin-top: 8px; }
.map-ui .chip { background: rgba(13,13,15,.92); backdrop-filter: blur(10px); }
.map-panel {
  margin-top: 8px; background: rgba(13,13,15,.96); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  max-height: 55vh; overflow-y: auto;
}
.leaflet-container { font-family: var(--sans); background: #0b0b0d; }
.leaflet-control-attribution { background: rgba(0,0,0,.6) !important; color: var(--muted) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--silver) !important; }
.leaflet-control-zoom a { background: var(--surface-2) !important; color: var(--pearl) !important; border-color: var(--border) !important; }
.leaflet-bottom { bottom: calc(var(--nav-h) + var(--safe-b)); }
@media (min-width: 900px) { .leaflet-bottom { bottom: 0; } }
.pin {
  width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.85);
  box-shadow: 0 0 0 1px rgba(242,238,232,.25), 0 1px 4px rgba(0,0,0,.6);
}
.pin.sel { transform: scale(1.5); box-shadow: 0 0 0 2px var(--gold), 0 1px 6px rgba(0,0,0,.8); }
.pin.visited { opacity: .45; }
.pin-hotel {
  width: 20px; height: 20px; transform: rotate(45deg); background: var(--gold); border: 2px solid #000;
  box-shadow: 0 0 0 1px var(--gold-soft), 0 0 14px rgba(198,166,106,.6);
}
.pin-me { width: 16px; height: 16px; border-radius: 50%; background: #5aa9ff; border: 3px solid #fff; box-shadow: 0 0 10px rgba(90,169,255,.8); }
.pin-num {
  width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #120d04; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #000;
}

/* ---------- Sheet ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(24px + var(--safe-b)); animation: up .18s ease-out;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 12px; }
@media (min-width: 900px) {
  .sheet { left: auto; right: 20px; top: 20px; bottom: 20px; width: 440px; max-height: none; border-radius: 18px; border: 1px solid var(--border); }
  .sheet .grab { display: none; }
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .close { position: sticky; top: 0; float: right; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13.5px; margin-top: 12px; }
.kv .k { color: var(--silver); }
.pref-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pref-row .who { width: 56px; font-size: 13px; }

/* ---------- Days ---------- */
.day-card { cursor: pointer; }
.day-card .date { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.day-card .dow { font-size: 12px; color: var(--silver); text-transform: uppercase; letter-spacing: .12em; }
.day-card.today { border-color: var(--gold); }
.item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); align-items: flex-start; }
.item:last-child { border-bottom: 0; }
.item .time { width: 50px; flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--gold-soft); font-size: 13.5px; padding-top: 2px; }
.item .body { flex: 1; min-width: 0; }
.item .acts { display: flex; gap: 4px; flex-shrink: 0; }
.item.locked .time { color: var(--gold); }
.item.done .ttl { text-decoration: line-through; color: var(--muted); }
.item .ttl { font-weight: 500; }
.item.alt { opacity: .75; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + var(--safe-b)); background: var(--surface-3); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 999px; display: flex; gap: 12px; align-items: center; font-size: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.6); max-width: calc(100vw - 32px);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(ellipse at 50% 0%, rgba(65,0,0,.35), transparent 60%), var(--black); }
.login .box { width: 100%; max-width: 380px; text-align: center; }
.login h1 { font-size: 42px; }
.login .s { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 10px; }
.login .x { font-family: var(--serif); font-style: italic; color: var(--silver); font-size: 19px; margin: 4px 0 30px; }
.login .line { width: 48px; height: 1px; background: var(--gold); margin: 22px auto; }

.md h3 { margin: 18px 0 6px; }
.md p { margin: 8px 0; }
.md ul { margin: 6px 0; padding-left: 20px; }
.md li { margin: 3px 0; }
.allergy-card { background: var(--pearl); color: #111; border-radius: 16px; padding: 22px; font-size: 18px; line-height: 1.45; }
.allergy-card h2 { color: #111; font-size: 26px; margin-bottom: 10px; }
.allergy-card .big { font-weight: 700; font-size: 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--border-soft); text-align: left; }
table.t th { color: var(--silver); font-weight: 500; font-size: 12px; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); }
.bar.over > i { background: var(--danger); }

.day-grid { display: grid; gap: 12px; }
.day-grid > * { min-width: 0; }
@media (min-width: 1180px) { .day-grid { grid-template-columns: 1.6fr 1fr; } }
@media (max-width: 699px) { .item .acts .mv { display: none; } }
