:root {
  --night: #121a33;
  --night-2: #1d2a52;
  --wine: #8c2335;
  --gold: #c9a227;
  --gold-soft: #f3e6b8;
  --bg: #f6f1e8;
  --card: #ffffff;
  --ink: #1d2230;
  --muted: #646b7a;
  --line: #e4dccd;
  --chip: #efe8da;
  --ok: #23804e;
  --ok-bg: #e2f3e9;
  --blue: #2c5aa0;
  --blue-bg: #e3ecf9;
  --amber: #a8650c;
  --amber-bg: #fcefd6;
  --grey: #80868f;
  --grey-bg: #eeeeee;
  --bad: #b42318;
  --bad-bg: #fde7e4;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 4px 14px rgba(20, 20, 40, .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabs-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1424; --card: #182039; --ink: #ecebe6; --muted: #a3a9b8; --line: #2a3456; --chip: #232d4d;
    --ok-bg: #173a29; --blue-bg: #1b2b4d; --amber-bg: #3d2c10; --grey-bg: #2a2f3b; --bad-bg: #4a1c19;
    --ok: #5cc98d; --blue: #86aef0; --amber: #f0b45a; --grey: #a5abb5; --bad: #ff8a7d;
    --gold-soft: #3a3214; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1424; --card: #182039; --ink: #ecebe6; --muted: #a3a9b8; --line: #2a3456; --chip: #232d4d;
  --ok-bg: #173a29; --blue-bg: #1b2b4d; --amber-bg: #3d2c10; --grey-bg: #2a2f3b; --bad-bg: #4a1c19;
  --ok: #5cc98d; --blue: #86aef0; --amber: #f0b45a; --grey: #a5abb5; --bad: #ff8a7d;
  --gold-soft: #3a3214; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
body.noscroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--serif); margin: 0; font-weight: 600; letter-spacing: .1px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
small { color: var(--muted); }

/* ---------- Cabecera ---------- */
.top {
  position: relative; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 80% -20%, #3b2b5e 0%, var(--night-2) 40%, var(--night) 100%);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 22px;
}
.sky::before {
  content: ""; position: absolute; inset: 0; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 60%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 25%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 50%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 80%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 85%, #fff 50%, transparent 51%);
}
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; color: rgba(201, 162, 39, .28); }
.top-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 900px; margin: 0 auto; }
.brand h1 { font-size: 26px; line-height: 1.1; }
.brand h1 span { color: var(--gold); }
.brand p { margin: 2px 0 0; color: #c9cde0; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.sync { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 99px; padding: 5px 10px; font-size: 12px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.sync.ok i { background: #49d17d; } .sync.pending i, .sync.syncing i { background: #f0b45a; } .sync.offline i { background: #9aa3b5; } .sync.error i { background: #ff6b5e; }
.pill { background: var(--gold); color: #201a05; border: 0; border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; }
.icon { background: transparent; border: 0; width: 36px; height: 36px; border-radius: 10px; font-size: 20px; line-height: 1; display: inline-grid; place-items: center; cursor: pointer; }
.icon.light { color: #fff; background: rgba(255,255,255,.1); }

/* ---------- Pestañas ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 18px rgba(0,0,0,.06);
}
.tabs button { background: none; border: 0; padding: 8px 0 7px; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); font-size: 10.5px; cursor: pointer; min-width: 0; }
.tabs button i { font-style: normal; font-size: 20px; filter: grayscale(.6); opacity: .75; }
.tabs button.on { color: var(--wine); font-weight: 600; }
:root[data-theme="dark"] .tabs button.on { color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button.on { color: var(--gold); } }
.tabs button.on i { filter: none; opacity: 1; }

/* ---------- Estructura ---------- */
main { max-width: 900px; margin: 0 auto; padding: 14px 16px 24px; outline: none; }
.sec { margin: 18px 0 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sec h2 { font-size: 20px; }
.sec h3 { font-size: 17px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 10px 0; }
.card h3 { font-size: 17px; margin-bottom: 6px; }
.card.hl { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, var(--shadow); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.sp { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .grid2.stack { grid-template-columns: 1fr; } }
.lead { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
p { margin: 6px 0; }
ul.clean { list-style: none; padding: 0; margin: 6px 0; }
ul.clean li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
ul.clean li:last-child { border-bottom: 0; }

.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--wine); color: #fff; border-color: var(--wine); }
.btn.gold { background: var(--gold); color: #201a05; border-color: var(--gold); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 9px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; }
.add { width: 100%; justify-content: center; border-style: dashed; color: var(--wine); background: transparent; padding: 12px; margin: 8px 0; }

.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); color: var(--ink); border-radius: 99px; padding: 2px 9px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--night); color: #fff; }
:root[data-theme="dark"] .chip.on { background: var(--gold); color: #1d1a0e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--gold); color: #1d1a0e; } }
.chip.tg { cursor: pointer; background: transparent; border-color: var(--line); color: var(--muted); }
.chip.tg.on { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }

.pb { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; white-space: nowrap; vertical-align: middle; }
.pb-confirmado { background: var(--ok-bg); color: var(--ok); }
.pb-orientativo { background: var(--amber-bg); color: var(--amber); }
.pb-pendiente { background: var(--grey-bg); color: var(--grey); }
.e { color: var(--muted); font-size: .9em; white-space: nowrap; }
.m { white-space: nowrap; }

.alert { border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.warn { background: var(--amber-bg); color: var(--amber); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--blue-bg); color: var(--blue); }

/* ---------- Agenda ---------- */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.daychip { position: relative; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 9px; cursor: pointer; box-shadow: var(--shadow); min-width: 0; }
.daychip b { display: block; font-size: 12px; color: var(--wine); text-transform: uppercase; letter-spacing: .4px; }
.daychip span { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.daychip small { font-size: 11px; }
.daychip.on { background: var(--night); color: #fff; border-color: var(--night); }
.daychip.on b { color: var(--gold); }
.daychip.on small { color: #c5cbe0; }
.daychip .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
@media (max-width: 420px) { .daychip span { font-size: 13px; } }

.dayhead { margin-top: 14px; }
.dayhead h2 { font-size: 23px; }
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode button { border: 0; background: var(--card); padding: 6px 10px; font-size: 12.5px; cursor: pointer; }
.mode button.on { background: var(--wine); color: #fff; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 6px 0; }
.stats b { color: var(--ink); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin: 8px 0 2px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; background: var(--c); }

.tl { position: relative; margin: 10px 0 0; }
.item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: start; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--amber)); border-radius: 12px; padding: 10px 8px 10px 10px; box-shadow: var(--shadow); margin: 0; }
.item .time b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.item .time small { display: block; font-variant-numeric: tabular-nums; }
.item .body { cursor: pointer; min-width: 0; }
.item .ttl { font-weight: 600; line-height: 1.3; }
.item .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.item .note { font-size: 13px; color: var(--muted); margin: 5px 0 0; white-space: pre-line; }
.item .booking { font-size: 13px; margin: 5px 0 0; white-space: pre-line; background: var(--blue-bg); color: var(--blue); padding: 4px 7px; border-radius: 7px; }
.item .ord { display: flex; flex-direction: column; gap: 2px; }
.item .ord button { border: 1px solid var(--line); background: var(--bg); border-radius: 7px; width: 30px; height: 26px; font-size: 11px; cursor: pointer; color: var(--muted); }
.st-confirmado { --c: var(--ok); } .st-reservado { --c: var(--blue); } .st-pendiente { --c: var(--amber); }
.st-opcional { --c: var(--grey); border-left-style: dashed; } .st-hecho { --c: var(--ok); opacity: .7; }
.st-descartado { --c: var(--grey); opacity: .55; } .st-descartado .ttl { text-decoration: line-through; }
.item .checks { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 5px; margin-top: -2px; }
.item .checks label { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 7px 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.item .checks label.done { background: var(--ok-bg); border-color: transparent; color: var(--ok); font-weight: 600; }
.item .checks input { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.item.now { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.item.flag { box-shadow: 0 0 0 2px var(--bad), var(--shadow); }
.link { display: flex; align-items: center; gap: 8px; padding: 5px 0 5px 22px; font-size: 12.5px; color: var(--muted); position: relative; }
.link::before { content: ""; position: absolute; left: 30px; top: 0; bottom: 0; border-left: 2px dotted var(--line); }
.link span { background: var(--bg); position: relative; padding: 1px 6px; border-radius: 6px; margin-left: 16px; }
.link.gap span { color: var(--ok); background: var(--ok-bg); }
.link.bad span { color: var(--bad); background: var(--bad-bg); font-weight: 600; }
.link.tight span { color: var(--amber); background: var(--amber-bg); }
.link.spacer { height: 8px; padding: 0; }

.plan { background: linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%); color: #fff; border: 0; }
.plan h3 { color: var(--gold); }
.plan .muted, .plan small { color: #c5cbe0; }
.plan .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin-top: 6px; }
.plan .kv dt { color: #c5cbe0; }
.plan .kv dd { margin: 0; font-weight: 600; }
.plan .alert.ok { background: rgba(73, 209, 125, .15); color: #8ee6b1; }
.plan .alert.warn { background: rgba(240, 180, 90, .15); color: #f6cb8a; }
.plan .alert.bad { background: rgba(255, 107, 94, .16); color: #ffb0a7; }
.plan .alert.info { background: rgba(134, 174, 240, .15); color: #bcd2f7; }

/* ---------- Sitios ---------- */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.place { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.place .ph { position: relative; height: 118px; display: grid; place-items: center; background: linear-gradient(135deg, hsl(var(--h) 45% 32%), hsl(calc(var(--h) + 40) 50% 22%)); color: #fff; }
.place .ph img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.place .ph .big { font-size: 46px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.place .ph .badges { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.place .ph .badges .chip { background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(4px); }
.place .pbody { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.place h4 { font-size: 18px; }
.addr { font-size: 13px; color: var(--muted); margin: 0; }
.stars { display: inline-flex; gap: 1px; }
.stars button { background: none; border: 0; font-size: 20px; padding: 0 1px; cursor: pointer; color: var(--line); line-height: 1; }
.stars button.on { color: var(--gold); }
.thumbs { display: flex; gap: 6px; overflow-x: auto; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; background: var(--chip); flex: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp th, .cmp td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp th { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp td.n, .cmp th.n { text-align: right; font-variant-numeric: tabular-nums; }
.cmp tr.out td { opacity: .5; }
.cmp tr.sel td { background: var(--gold-soft); }
.tblwrap { overflow-x: auto; }

/* ---------- Mapa ---------- */
#map { height: 56vh; min-height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: #e8e2d4; z-index: 1; }
.pin { display: grid; place-items: center; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-size: 15px; background: var(--pc, #555); }
.pin-hotel { --pc: #8c2335; } .pin-food { --pc: #d9822b; } .pin-sight { --pc: #2c5aa0; } .pin-bath { --pc: #1a9aa0; }
.pin-locker { --pc: #6b4fa0; } .pin-stop { --pc: #3d4452; } .pin-airport { --pc: #121a33; } .pin-night { --pc: #b0356b; }
.pin.sel { outline: 3px solid var(--gold); }
.leaflet-popup-content { font: 13.5px/1.4 var(--sans); }
.leaflet-popup-content b { font-size: 14.5px; }
.pop-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pop-actions button { border: 1px solid #ccc; background: #fff; border-radius: 7px; padding: 3px 8px; font-size: 12px; cursor: pointer; color: #222; }
.dist { font-size: 14px; }
.dist b { font-size: 17px; }
.field-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- Transporte ---------- */
.route { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); position: relative; }
.route.rec { border: 2px solid var(--ok); }
.route .tag { position: absolute; top: -10px; right: 10px; background: var(--ok); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.route h4 { font-size: 17px; }
.big-n { font-size: 26px; font-weight: 700; font-family: var(--serif); }
.segs { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
.segs li { display: grid; grid-template-columns: 44px 1fr 56px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.segs li:last-child { border-bottom: 0; }
.segs input { width: 52px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); text-align: right; }
.segs .cv { font-size: 11px; font-weight: 600; }
.segs .cv.y { color: var(--ok); } .segs .cv.n { color: var(--bad); }
.meter { height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.meter.warn i { background: var(--amber); } .meter.bad i { background: var(--bad); }
.check { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--wine); }

/* ---------- Gastos ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.tile small { display: block; font-size: 12px; }
.tile b { display: block; font-size: 17px; overflow-wrap: anywhere; font-family: var(--serif); line-height: 1.2; margin-top: 2px; }
.tile .e { display: block; white-space: normal; }
.exp { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.exp:last-child { border-bottom: 0; }
.exp .t { font-weight: 600; cursor: pointer; }
.exp .r { text-align: right; font-size: 13px; }
.exp .sub { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.exp input.real { width: 104px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); text-align: right; }
.bar { height: 6px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--gold); }
.bar.over i { background: var(--bad); }

/* ---------- Diario ---------- */
.entry { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; margin: 10px 0; }
.entry h4 { font-size: 16px; }
.entry p { white-space: pre-line; }

/* ---------- Formularios / hoja ---------- */
label.f { display: block; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
label.f > span { display: block; margin-bottom: 3px; font-weight: 500; }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea, .in {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 16px;
}
.f textarea { min-height: 70px; resize: vertical; }
.f .multi { display: flex; flex-wrap: wrap; gap: 6px; }
.f .multi label { display: inline-flex; align-items: center; gap: 5px; background: var(--chip); padding: 5px 9px; border-radius: 99px; color: var(--ink); font-size: 13px; }
.f.cb { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.f.cb input { width: 20px; height: 20px; accent-color: var(--wine); }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 10px; }
.sheet { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10, 12, 25, .5); }
.sheet-panel { position: relative; background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-actions { display: flex; gap: 8px; align-items: center; position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); background: var(--card); padding: 12px 0 4px; margin-top: 6px; border-top: 1px solid var(--line); }
.sheet-actions span { flex: 1; }
.photo-full { width: 100%; border-radius: 12px; display: block; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--night); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 3000; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 24px 0 8px; }

/* ---------- Apps ---------- */
.app-head { display: flex; align-items: center; gap: 12px; }
.app-head > div { flex: 1; }
.app-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(135deg, var(--night-2), var(--night)); flex: none; }
.app-todo { background: var(--bg); border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.app-todo small { font-weight: 600; text-transform: uppercase; letter-spacing: .4px; font-size: 11px; }
.app .actions .btn.primary { padding: 9px 16px; }
