/* Black & yellow theme. Fixed palette (does not follow the Telegram theme on purpose). */
:root {
  --bg: #0b0b0b;
  --bg2: #171717;
  --bg3: #222222;
  --line: #2c2c2c;
  --text: #f4f4f4;
  --hint: #8e8e8e;
  --yellow: #ffd60a;
  --yellow-dim: #b89a00;
  --on-yellow: #111111;
  --danger: #ff5c5c;
  /* schedule: yellow = power on, grey = no power, stripes = possible outage */
  --on: var(--yellow);
  --off: #3a3a3a;
  --maybe: repeating-linear-gradient(135deg, var(--yellow) 0 4px, var(--off) 4px 8px);
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { padding: 12px 16px 40px; max-width: 720px; margin: 0 auto; }
h2 { font-size: 20px; font-weight: 800; margin: 14px 0 12px; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--hint); }
.small { font-size: 13px; }

.view { display: none; }
.view.active { display: block; }

/* ---------------------------------------------------------------- address list */
.cards { display: grid; gap: 10px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--yellow);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.card:active, .card:hover { background: var(--bg3); }
.card .title { font-weight: 700; }
.card .sub { color: var(--hint); font-size: 13px; margin-top: 2px; }
.card .status { margin-top: 8px; font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.off { background: var(--off); color: var(--text); }
.badge.ok { background: var(--yellow); color: var(--on-yellow); }
.badge.maybe { background: transparent; color: var(--yellow); box-shadow: inset 0 0 0 1.5px var(--yellow); }
.card .status { display: flex; align-items: center; gap: 10px; }
.card .status .badge { flex: none; }
.status-next { min-width: 0; }

.empty { text-align: center; padding: 28px 8px 8px; color: var(--hint); }

/* ---------------------------------------------------------------- buttons */
.btn { border: 0; border-radius: 12px; padding: 13px 16px; background: var(--yellow); color: var(--on-yellow);
  font: inherit; font-weight: 800; cursor: pointer; width: 100%; }
.btn:active { background: var(--yellow-dim); }
.btn.secondary { background: var(--bg3); color: var(--text); width: auto; font-weight: 600; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #5a2626; margin-top: 24px; font-weight: 600; }
.btn:disabled { background: var(--bg3); color: var(--hint); cursor: default; }
.add-btn { margin-top: 16px; }
.link { border: 0; background: none; color: var(--yellow); font: inherit; font-weight: 600; padding: 0; cursor: pointer; }
.back { margin-bottom: 4px; }

/* ---------------------------------------------------------------- address page */
.alert { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--danger);
  padding: 10px 12px; border-radius: 10px; margin: 10px 0; white-space: pre-line; }
.next { background: var(--bg2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; margin: 10px 0; }

.day { margin: 18px 0; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.day-head b { font-size: 15px; }
.bar { display: grid; grid-template-columns: repeat(24, 1fr); height: 30px; border-radius: 6px; overflow: hidden;
  position: relative; background: var(--off); }
.bar i { display: block; }
.bar .on, .c.on { background: var(--on); }
.bar .off, .c.off { background: var(--off); }
.bar .maybe, .c.maybe { background: var(--maybe); }
.bar i:nth-child(2n) { box-shadow: inset -1px 0 0 rgba(0, 0, 0, .45); }
.now-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px #000; }
.ticks { display: grid; grid-template-columns: repeat(12, 1fr); font-size: 11px; color: var(--hint); margin-top: 3px; }
.bars .ticks + .bar { margin-top: 8px; }
.ranges { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.ranges li { padding: 2px 0; display: flex; align-items: center; gap: 8px; }
/* Zigzag flow of intervals: off (left) -> on (right) -> off ... Row height / gap match FLOW_ROW / FLOW_GAP in app.js. */
.flow { display: grid; grid-template-columns: 1fr 56px 1fr; margin-top: 12px; font-size: 14px;
  font-variant-numeric: tabular-nums; }
.flow .left { grid-column: 1; justify-self: end; }
.flow .right { grid-column: 3; justify-self: start; }
/* The dot center sits 16.5px from the gap (11.5 padding + 5 radius): flowArrow() in app.js relies on it.
   Only the time gets outlined for the current interval, not the dot. */
.flow-item { align-self: center; display: flex; align-items: center; white-space: nowrap; padding-left: 11.5px; }
.flow-item.left { flex-direction: row-reverse; padding: 0 11.5px 0 0; }
.flow-item .t { padding: 3px 7px; border: 1.5px solid transparent; border-radius: 9px; }
.flow-item.now .t { border-color: var(--yellow); font-weight: 700; }
.flow-arrows { grid-column: 2; position: relative; }
.flow-arrow { position: absolute; left: 0; overflow: visible; }
.flow-arrow path { fill: none; stroke: #8e93a6; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow-arrow path:first-child { stroke-dasharray: 3 4; }
.ranges-head { font-size: 12px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .04em;
  grid-row: 1; padding: 0 10px 4px; }
.ranges-total { padding: 4px 10px 0; font-size: 13px; color: var(--hint); }
.ranges-total.right, .ranges-head.right { color: var(--yellow); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.off { background: #5c5c5c; }
.dot.maybe { background: var(--maybe); }
.dot.on { background: var(--on); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; white-space: nowrap; color: var(--hint); margin: 10px 0 18px; }
.legend .c { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend .c.off { background: #5c5c5c; }

.queue-row { margin: 4px 0 10px; }
.queue-row label { display: block; font-size: 13px; color: var(--hint); }
.queue-row select { margin-top: 4px; }
.queue-row p { margin: 6px 0 0; }
.queue-one { margin-top: 2px; font-weight: 700; color: var(--yellow); }

/* ---------------------------------------------------------------- add page */
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg-btn { flex: 1; border: 0; background: transparent; color: var(--hint); padding: 9px; border-radius: 9px;
  font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.active { background: var(--yellow); color: var(--on-yellow); }
#map { height: 300px; border-radius: var(--radius); margin-bottom: 8px; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

form label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 12px; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; outline: none; }
input::placeholder { color: #5f5f5f; }
input:focus, select:focus { border-color: var(--yellow); }
input:disabled, select:disabled { opacity: .45; }
/* Suggestions are part of the page flow so they never cover the button below. */
.ac-list { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; margin-top: 4px;
  max-height: 220px; overflow: auto; }
.ac-list:empty { display: none; }
.ac-list div { padding: 10px 12px; color: var(--text); cursor: pointer; font-size: 15px; border-bottom: 1px solid var(--line); }
.ac-list div:last-child { border-bottom: 0; }
.ac-list div:hover, .ac-list div.hl { background: var(--yellow); color: var(--on-yellow); }
#form-msg.err { color: var(--danger); }
#form-msg.ok { color: var(--yellow); }

.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; background: var(--yellow); color: var(--on-yellow);
  font-weight: 700; padding: 11px 14px; border-radius: 12px; text-align: center; z-index: 2000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }

/* Leaflet controls in the dark theme */
.leaflet-container { background: #1a1a1a; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--bg2); color: var(--yellow); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: rgba(0, 0, 0, .6) !important; color: var(--hint) !important; }
.leaflet-control-attribution a { color: var(--yellow) !important; }

/* ---------------------------------------------------------------- admin */
h3 { font-size: 16px; font-weight: 800; margin: 26px 0 8px; color: var(--yellow); }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.sm { padding: 7px 10px; font-size: 13px; }
.lock { font-size: 40px; margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--yellow); }
.stat span { font-size: 12px; color: var(--hint); }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0 12px; }
.inline-form input, .inline-form select { margin: 0; }
.inline-form .btn { grid-column: 1 / -1; }
.list { display: grid; gap: 8px; }
.row-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.row-item.dim { opacity: .55; }
.row-item .title { font-weight: 700; }
.row-item .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.link-box { margin-top: 6px; font: 12px/1.4 ui-monospace, Menlo, monospace; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; word-break: break-all; }
.danger-link { color: var(--danger); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.tag.y { background: var(--yellow); color: var(--on-yellow); }
.tag.r { background: #5a2626; color: #ffd0d0; }

/* ---------------------------------------------------------------- emoji tags */
.card-head { display: flex; align-items: center; gap: 12px; }
.card-text { min-width: 0; flex: 1; }
.em-big { font-size: 36px; line-height: 1; flex: none; width: 44px; text-align: center; }
.tag-btn { display: inline-block; margin: -4px 0 12px; font-size: 14px; }
.tag-row { margin: 4px 0 12px; }
.tag-row label { display: block; font-size: 13px; color: var(--hint); margin-bottom: 6px; }
.tag-pick { width: auto; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .6);
  display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; background: var(--bg2); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 16px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.chip.on { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 16%, var(--bg)); }
.chip-e { font-size: 26px; line-height: 1.1; }
.chip-n { font-size: 11px; color: var(--hint); }
.sheet-custom { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0 8px; }
.sheet-custom input { margin: 0; text-align: center; font-size: 18px; }
.sheet-custom .btn { width: auto; padding: 0 18px; }

/* ---------------------------------------------------------------- confirmation modal */
.sheet-backdrop.modal { align-items: center; padding: 16px; }
.modal-box { width: 100%; max-width: 380px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 16px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.modal-box p { margin: 0 0 16px; white-space: pre-line; line-height: 1.45; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-actions .btn { width: 100%; }
.btn.danger-fill { background: var(--danger); color: #fff; }

/* ---------------------------------------------------------------- day selector */
.day-select { display: flex; gap: 6px; overflow-x: auto; margin: 14px -16px 0; padding: 2px 16px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.day-select::-webkit-scrollbar { display: none; }
.day-chip { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 6px 8px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; }
.day-chip .dc-top { font-size: 12px; font-weight: 700; }
.day-chip .dc-num { font-size: 12px; color: var(--hint); }
.day-chip.past { opacity: .7; }
.day-chip.on { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); opacity: 1; }
.day-chip.on .dc-num { color: var(--on-yellow); }
.day-select + #d-days .day { margin-top: 12px; }

/* ---------------------------------------------------------------- "обновление" badge */
.sync { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2500; display: flex; align-items: center;
  gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line);
  color: var(--yellow); font-size: 12px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.sync i { width: 10px; height: 10px; border: 2px solid var(--yellow); border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Address page header: title + gear button that opens the address settings panel. */
.detail-head { display: flex; align-items: flex-start; gap: 10px; }
.detail-head h2 { flex: 1; min-width: 0; }
.icon-btn { flex: none; margin-top: 10px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--hint); cursor: pointer; }
.icon-btn.on { color: var(--on-yellow); background: var(--yellow); border-color: var(--yellow); }
.settings-panel { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg2);
  border: 1px solid var(--line); }
.settings-panel .tag-btn { margin: 0 0 10px; }
.settings-panel .queue-row { margin: 0; }

/* Data freshness under the schedule. */
.updated { margin: 14px 0 16px; padding: 4px 14px; border-radius: var(--radius); background: var(--bg2);
  border: 1px solid var(--line); font-size: 13px; }
.upd-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.upd-row + .upd-row { border-top: 1px solid var(--line); }
.upd-ico { width: 18px; text-align: center; flex: none; }
.upd-label { flex: 1; color: var(--hint); }
.upd-val { display: flex; align-items: center; gap: 7px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.live.on { background: var(--yellow); box-shadow: 0 0 0 0 rgba(255, 214, 10, .6); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 6px rgba(255, 214, 10, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0); } }

/* ================================================================ 🐒 Monkey version
   Same colors, just monkeys. Enabled per user by the admin: <html class="theme-monkey">.
   Only adds emoji through pseudo-elements, so the default design is untouched. Dot boxes keep their 10px size:
   the flow arrows in app.js are positioned against them. */
.theme-monkey body::after { content: "🐒"; position: fixed; right: -14px; bottom: -18px; font-size: 120px; opacity: .07;
  transform: rotate(-14deg); pointer-events: none; z-index: 0; }
.theme-monkey main { position: relative; z-index: 1; }
.theme-monkey #view-list > h2::after { content: " 🐒"; display: inline-block; animation: m-swing 2.4s ease-in-out infinite;
  transform-origin: 50% 0; }
.theme-monkey .add-btn::after { content: " 🍌"; }
.theme-monkey #list-empty p::before { content: "🙈"; display: block; font-size: 44px; margin-bottom: 8px; }
.theme-monkey .lock { font-size: 0; }
.theme-monkey .lock::after { content: "🙈"; font-size: 40px; }

/* Address cards: a monkey peeks over the top edge (see / hear / speak no evil, in turn). */
.theme-monkey .card { position: relative; }
.theme-monkey .card::after { content: "🙈"; position: absolute; top: -12px; right: 58px; font-size: 20px; transform: rotate(10deg); }
.theme-monkey .card:nth-child(3n + 2)::after { content: "🙉"; transform: rotate(-8deg); }
.theme-monkey .card:nth-child(3n)::after { content: "🙊"; }
.theme-monkey .badge.off::before { content: "🙈 "; }
.theme-monkey .badge.ok::before { content: "🍌 "; }

/* Schedule: a monkey climbs the "now" line; legend and flow get banana / see-no-evil markers. */
.now-face-wrap { display: none; }
.theme-monkey .now-face-wrap { display: block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }
.theme-monkey .now-face { display: block; }
.theme-monkey .legend span:nth-child(1)::after { content: " 🍌"; }
.theme-monkey .legend span:nth-child(2)::after { content: " 🙈"; }
.theme-monkey .legend span:nth-child(3)::after { content: " 🙊"; }
.theme-monkey .ranges-head.left::after { content: " 🙈"; }
.theme-monkey .ranges-head.right::after { content: " 🐵"; }
.theme-monkey .ranges-total.right::before { content: "🍌 "; }
.theme-monkey .flow .dot { position: relative; background: none; }
.theme-monkey .flow .dot::after { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 14px; }
.theme-monkey .flow .dot.on::after { content: "🍌"; }
.theme-monkey .flow .dot.off::after { content: "🙈"; }
.theme-monkey .flow .dot.maybe::after { content: "🙊"; }
.theme-monkey .flow-item.now .t::after { content: "🐒"; margin-left: 4px; display: inline-block; animation: m-swing 1.6s ease-in-out infinite;
  transform-origin: 50% 0; }

/* Freshness rows, sync badge, toast, confirm. */
.theme-monkey .upd-ico { font-size: 0; }
.theme-monkey .upd-row:nth-child(1) .upd-ico::after { content: "🌴"; font-size: 13px; }
.theme-monkey .upd-row:nth-child(2) .upd-ico::after { content: "🐒"; font-size: 13px; }
.theme-monkey .sync i { width: auto; height: auto; border: 0; animation: m-swing .7s ease-in-out infinite alternate;
  transform-origin: 50% 0; font-style: normal; }
.theme-monkey .sync i::before { content: "🐒"; font-size: 13px; }
.theme-monkey .toast::before { content: "🐒 "; }
.theme-monkey #confirm .modal-box::before { content: "🙊"; display: block; text-align: center; font-size: 38px; margin-bottom: 6px; }

@keyframes m-swing { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .theme-monkey * { animation: none !important; } }

/* Admin: who gets the monkey version. */
.theme-list { display: grid; gap: 6px; }
.theme-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg2);
  border: 1px solid var(--line); cursor: pointer; }
.theme-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--yellow); flex: none; }
.theme-row .grow { flex: 1; min-width: 0; }
.theme-row.on { border-color: var(--yellow); }
.theme-row .m { font-size: 18px; opacity: .25; transition: opacity .15s; }
.theme-row.on .m { opacity: 1; }

/* Admin: web app launches log. */
.opens-head { display: flex; gap: 8px; margin-bottom: 8px; }
.opens-head select { flex: 1; min-width: 0; }
.refresh-btn { flex: none; width: auto; display: flex; align-items: center; gap: 6px; padding: 0 14px; margin: 0; }
.refresh-btn.busy svg { animation: spin .8s linear infinite; }
.opens { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; }
.opens-day { font-size: 12px; font-weight: 700; color: var(--yellow); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 0 4px; }
.opens-row { display: flex; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.opens-day + .opens-row { border-top: 0; }
.opens-time { font-variant-numeric: tabular-nums; color: var(--hint); flex: none; width: 42px; }
.opens-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opens > p { margin: 10px 0 2px; }

/* Address settings button: a gear; in the monkey version a coconut with an embossed gear. Opening it knocks the
   top half off and a cocktail umbrella and straw drop in; closing plays it backwards. */
.icon-btn .coco { display: none; }
.theme-monkey .icon-btn .gear { display: none; }
.theme-monkey .icon-btn .coco { display: block; }
.theme-monkey #d-settings-btn, .theme-monkey #d-settings-btn.on { background: transparent; border-color: var(--line); overflow: visible; }
.theme-monkey #d-settings-btn.on { border-color: var(--yellow); }
.coco g { transform-box: view-box; }
.coco .cc-top { transform-origin: 20px 23px; transition: transform .35s cubic-bezier(.4, 0, .2, 1) .22s, opacity .3s ease .22s; }
.coco .cc-rim { opacity: 0; transition: opacity .15s ease .3s; }
.coco .cc-umbrella, .coco .cc-straw { opacity: 0; transform: translateY(-22px);
  transition: transform .25s ease-in, opacity .2s ease-in; }
.on .coco .cc-top { transform: translate(13px, -15px) rotate(48deg); opacity: 0; transition-delay: 0s, .1s; }
.on .coco .cc-rim { opacity: 1; transition-delay: .1s; }
.on .coco .cc-umbrella, .on .coco .cc-straw { opacity: 1; transform: none;
  transition: transform .45s cubic-bezier(.3, 1.5, .5, 1) .3s, opacity .15s ease .3s; }
.on .coco .cc-straw { transition-delay: .42s; }
@media (prefers-reduced-motion: reduce) { .coco g { transition: none !important; } }

/* Monkey version: the bar lets the face's Z-z-z rise above it (corners rounded on the cells instead). */
.theme-monkey .bar { overflow: visible; }
.theme-monkey .bar i:first-child { border-radius: 6px 0 0 6px; }
.theme-monkey .bar i:nth-of-type(24) { border-radius: 0 6px 6px 0; }

/* Sleeping monkey: the Z-z-z float up one after another. */
.mk-zzz text { animation: mk-z 2.4s ease-in-out infinite; opacity: 0; }
.mk-zzz .z2 { animation-delay: .5s; }
.mk-zzz .z3 { animation-delay: 1s; }
@keyframes mk-z { 0% { opacity: 0; transform: translateY(2px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .mk-zzz text { animation: none; opacity: 1; } }
.preview-link { display: inline-block; margin: 0 0 10px; font-size: 14px; }

/* Bell: messages for this address on / off. */
.detail-head .icon-btn + .icon-btn { margin-left: -2px; }
.notify-btn { color: var(--yellow); }
.notify-btn .slash { display: none; }
.notify-btn.muted { color: var(--hint); }
.notify-btn.muted .slash { display: inline; }
.notify-btn:active svg { transform: rotate(-14deg); }
.muted-mark { font-size: 14px; opacity: .8; }
/* Monkey version: ringing bell vs. 🙉 (hear no evil) when muted. */
.theme-monkey .notify-btn svg { display: none; }
.theme-monkey .notify-btn::after { content: "🔔"; font-size: 20px; line-height: 1; }
.theme-monkey .notify-btn.muted::after { content: "🙉"; }
.theme-monkey .muted-mark { font-size: 0; }
.theme-monkey .muted-mark::after { content: "🙉"; font-size: 14px; }
/* Bell on each address card in the list. */
.card-head .card-bell { flex: none; margin: 0 -4px 0 0; width: 38px; height: 38px; align-self: flex-start; }
.theme-monkey .card-head .card-bell::after { font-size: 18px; }

/* Admin tabs. */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 2px; padding: 4px;
  margin: 14px 0 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .8); }
.tab { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 8px 4px 7px; border: 0;
  border-radius: 10px; background: transparent; color: var(--hint); font: inherit; font-size: 11px; font-weight: 700; letter-spacing: -.01em;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .tab-ico { font-size: 17px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tab.active { background: var(--yellow); color: var(--on-yellow); }
.tab.active .tab-ico { filter: none; opacity: 1; }
.tab-pane > :first-child { margin-top: 0; }
.tab-pane h3:first-child { margin-top: 4px; }

/* Reminder lead times: square toggles. */
.lead-group { margin: 16px 0 6px; }
.lead-title { font-weight: 700; margin-bottom: 8px; }
.lead-chips { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.lead-chip { aspect-ratio: 1; min-width: 0; padding: 0; border-radius: 9px; border: 1.5px solid var(--line); background: var(--bg2);
  color: var(--hint); font: inherit; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .08s; }
.lead-chip:active { transform: scale(.92); }
.lead-chip.on { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.lead-sum { margin: 8px 0 0; font-size: 13px; color: var(--hint); min-height: 1.2em; }
#btn-reminders { margin-top: 10px; }
.opens-foot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.opens-foot .btn { margin-bottom: 4px; }
.reminders-foot { margin-top: 18px; }

/* Monkey version: savanna strip on the home screen (drawn by savanna.js). */
.savanna { display: none; }
.theme-monkey .savanna { display: block; width: 100%; height: 120px; margin: -2px 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #1c0f05; }
