/* Night sky: dark navy surfaces, warm amber "bulb" accent. Dark only. */
:root {
  --bg: #0a1222;
  --surface: #121d33;
  --surface-2: #0f192d;
  --fg: #eef2fa;
  --muted: #9aa9c6;
  --line: #22314f;
  --accent: #ffb648;
  --accent-fg: #1d1304;
  --link: #ffcd7a;
  --heart: #ff7a7a;
  --chip: #1a2844;
  --chip-fg: #cfd9ee;
  --field: #0f192d;
  --bar: #070d19;
  --ok: #7fe0a6;
  --danger: #ff9a9a;
  --glow: 0 0 22px rgba(255, 182, 72, .35);
  --r-btn: 12px;
  --r-card: 14px;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: 16px;
  --maxw: 1200px;
  --tabbar-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.55 var(--font-body); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; text-wrap: balance; color: var(--fg); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 2001; background: var(--accent); color: var(--accent-fg); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.site-header { position: sticky; top: 0; z-index: 1000; background: var(--bar); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.site-header-inner { max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font: 800 1.25rem/1 var(--font-display); letter-spacing: -.015em; color: var(--fg); text-decoration: none; white-space: nowrap; min-height: 44px; }
.wordmark .bulb { width: 11px; height: 15px; border-radius: 50% 50% 45% 45%; background: var(--accent); box-shadow: var(--glow); }
.primary-nav { display: flex; gap: 18px; white-space: nowrap; }
@media (max-width: 1199px) { .primary-nav { gap: 14px; } .site-header-inner { gap: 14px; } }
.primary-nav a { color: var(--fg); opacity: .8; text-decoration: none; font-weight: 600; padding: 10px 0; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { opacity: 1; }
.primary-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.header-spacer { flex: 1; }
.site-search { display: flex; flex: 0 1 260px; min-width: 150px; }
.site-search input { width: 100%; height: 40px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--field); color: var(--fg); padding: 0 12px 0 36px; font: inherit; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa9c6' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 18px; }
.account-area { display: flex; align-items: center; gap: 8px; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; box-shadow: 0 12px 30px rgba(0,0,0,.45); z-index: 1001; }
.account-menu-list a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 600; }
.account-menu-list a:hover { background: var(--chip); }
.icon-btn { display: none; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--fg); cursor: pointer; }
.icon-btn .icon { width: 22px; height: 22px; }
.mobile-search { display: none; padding: 0 var(--gutter) 12px; }
.mobile-search input { width: 100%; height: 44px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--field); color: var(--fg); padding: 0 12px; font: inherit; }
.site-header.search-open .mobile-search { display: block; }
@media (max-width: 1023px) {
  .primary-nav, .site-search, .account-area { display: none; }
  .icon-btn { display: grid; }
}
.site-main { max-width: var(--maxw); margin: 0 auto; padding: 20px var(--gutter) 48px; }
.page-aside { margin-top: 24px; }
.site-footer { border-top: 1px solid var(--line); background: var(--bar); }
.site-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 18px var(--gutter); display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--fg); }
.site-footer .wordmark { font-size: 1rem; min-height: 44px; color: var(--fg); }
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--bar); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 64px; min-height: 48px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (max-width: 639px) {
  .tabbar { display: flex; }
  .site-main { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}
/* Phone menu: a native <dialog> gives focus trapping and Esc for free */
.menu-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--fg); padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.menu-sheet::backdrop { background: rgba(2, 6, 14, .7); }
.menu-sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.menu-sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-sheet .item { display: flex; align-items: center; gap: 12px; min-height: 46px; font-weight: 600; color: var(--fg); text-decoration: none; }
.menu-sheet .item .icon { color: var(--muted); }
.menu-sheet .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 12px 0 4px; }
.menu-sheet .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* Lightbox (moved from the old style.php, unchanged) */
.cool-lightbox { display: none; position: fixed; inset: 0; z-index: 2000; background-color: rgba(0,0,0,0.92); align-items: center; justify-content: center; }
.cool-lightbox.cool-lightbox-open { display: flex; }
body.cool-lightbox-active { overflow: hidden; }
.cool-lightbox-content { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 56px 64px; box-sizing: border-box; }
img.cool-lightbox-img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); cursor: zoom-out; }
iframe.cool-lightbox-video { display: block; border: 0; width: min(calc(100vw - 128px), calc((100vh - 112px) * 16 / 9)); height: min(calc(100vh - 112px), calc((100vw - 128px) * 9 / 16)); border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); background: #000; }
.cool-lightbox-close { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; padding: 0; border: 2px solid rgba(255,255,255,0.7); border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; font-size: 28px; line-height: 38px; text-align: center; cursor: pointer; }
.cool-lightbox-close:hover, .cool-lightbox-close:focus { background: rgba(255,255,255,0.25); border-color: #fff; outline: none; }
.cool-lightbox-hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.55); font-size: 12px; pointer-events: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-prev { left: 12px; }
.lb-prev .icon { transform: rotate(90deg); }
.lb-next { right: 12px; }
.lb-next .icon { transform: rotate(-90deg); }
.lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-size: 13px; }
@media (max-width: 639px) {
  .cool-lightbox-content { padding: 56px 8px; }
  iframe.cool-lightbox-video { width: calc(100vw - 16px); height: calc((100vw - 16px) * 9 / 16); }
  .lb-nav { top: auto; bottom: 8px; transform: none; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid transparent; font: 700 15px/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-pri { background: var(--accent); color: var(--accent-fg); box-shadow: var(--glow); }
.btn-pri:hover { color: var(--accent-fg); filter: brightness(1.05); }
.btn-sec { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn-sec:hover { color: var(--fg); border-color: var(--muted); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--chip); color: var(--chip-fg); font-size: 13px; font-weight: 600; text-decoration: none; border: 0; }
a.chip:hover, button.chip:hover { color: var(--fg); background: #22355a; }
.chip.is-on { background: var(--accent); color: var(--accent-fg); }
/* ---- Panels: new look for the old class names, too ---- */
.panel, .cool-white-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin: 0 0 16px; }
@media (max-width: 639px) { .panel, .cool-white-card { padding: 16px; } }
h2.cool-section, h2.cool-title { font-size: 1.35rem; color: var(--fg); margin: 0 0 .6em; }
.BlockHeader { font: 700 12px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.cool-menu-ul { list-style: none; padding: 0; margin: 0; display: grid; }
.cool-menu-ul a { display: flex; align-items: center; min-height: 44px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.subnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--chip); color: var(--chip-fg); text-decoration: none; font-weight: 600; }
.subnav a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); }
.hscroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; }
.hscroll > .chip { min-height: 44px; padding: 0 14px; font-size: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Old tag links become chips ---- */
a.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; margin: 0 4px 6px 0; border-radius: 999px; background: var(--chip); color: var(--chip-fg); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.tag:hover { background: #22355a; color: var(--fg); }

/* ---- Messages ---- */
.error { color: var(--danger); }
.note, .vote { color: var(--ok); font-weight: 700; }
.notice { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); margin: 0 0 16px; }
.notice .icon { color: var(--muted); margin-top: 1px; }
.notice b { display: block; }
.notice-error { border-color: rgba(255,122,122,.45); background: rgba(255,122,122,.08); }
.notice-error .icon { color: var(--heart); }
.notice-ok { border-color: rgba(127,224,166,.45); background: rgba(127,224,166,.08); }
.nudge { border-color: rgba(255,182,72,.4); background: rgba(255,182,72,.08); }
.nudge .icon { color: var(--accent); }
.closed-note { border-color: rgba(255,122,122,.4); background: rgba(255,122,122,.08); }
.closed-note .icon { color: var(--heart); }
.notice .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px dashed var(--line); color: var(--muted); }
.pill-closed { border-style: solid; border-color: rgba(255,122,122,.45); color: #ffb3b3; }
.empty-state { text-align: center; padding: 32px 16px; }
.empty-state p { color: var(--muted); }

/* ---- Running text ---- */
.prose { max-width: 70ch; font-size: 16px; line-height: 1.65; }
.prose li { margin-bottom: .4em; }
.prose h2, .prose h3 { margin-top: 1.4em; }
/* Text pages (About, FAQ, Terms, Attribution): the card spans the page. */
.cool-white-card.prose { max-width: none; }
.prose .icon { width: 18px; height: 18px; vertical-align: -3px; }
.prose [id] { scroll-margin-top: 84px; }
.faq-heart-on { color: var(--heart); }
.faq-heart-on .icon { fill: currentColor; }

/* ---- Forms (applies to old markup too) ---- */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=search], input:not([type]), select, textarea {
  min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); color: var(--fg); font: inherit; font-size: 16px; max-width: 100%; }
textarea { min-height: 120px; width: 100%; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=submit], button:not(.btn):not([role=tab]):not(.icon-btn):not(.chip):not(.fav-btn):not(.cool-lightbox-close):not(.lb-nav) {
  min-height: 44px; padding: 0 16px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 700 15px var(--font-body); cursor: pointer; }
input[type=submit] { background: var(--accent); color: var(--accent-fg); border-color: transparent; box-shadow: var(--glow); }
input[type=file] { color: var(--muted); font: inherit; max-width: 100%; }
input.account, select.account { width: 100%; max-width: 420px; }
textarea.account { width: 100%; }
.form-stack { display: grid; gap: 16px; max-width: 460px; }
.field-row { display: grid; gap: 6px; }
.field-row > label, .field-label { font-weight: 700; font-size: 14px; }
.field-row input:not([type=checkbox]):not([type=radio]), .field-row select, .field-row textarea { width: 100%; }
.field-msg { font-size: 13px; color: var(--muted); min-height: 1em; }
.field-msg.is-ok { color: var(--ok); }
.req { color: var(--accent); font-weight: 700; }
.fine-print { font-size: 13px; color: var(--muted); line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; }
.data-table, table.simple, table.device { width: 100%; font-size: 14px; }
.data-table th, .data-table td, table.simple th, table.simple td, table.device th, table.device td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th, table.simple th, table.device th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
table.full { width: 100%; }
table.full th { text-align: left; padding: 8px 12px 8px 0; vertical-align: top; width: 140px; }
table.full td { padding: 6px 0; }
@media (max-width: 639px) {
  table.full, table.full tbody, table.full tr, table.full th, table.full td { display: block; width: 100%; }
  table.full th { padding-bottom: 2px; }
}
.notice .actions .btn { min-height: 44px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1023px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .card-grid { grid-template-columns: 1fr; } }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.dcard-media { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.dcard-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dcard-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.card-title { font-size: 1.05rem; line-height: 1.25; margin: 0; }
.card-title a { color: var(--fg); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--muted); }
.card-meta b { color: var(--fg); }
.card-meta .votes { color: var(--heart); }
.card-meta .votes .icon { width: 13px; height: 13px; fill: currentColor; stroke: none; vertical-align: -1px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.card-tags .chip { min-height: 26px; font-size: 12px; padding: 0 10px; }
.chip-dist { position: absolute; left: 10px; bottom: 10px; background: var(--accent); color: var(--accent-fg); min-height: 26px; }
.fav-btn { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fav-btn.is-on { color: var(--heart); }
.fav-btn.is-on .icon { fill: currentColor; }
.dcard.is-closed, .lcard.is-closed { opacity: .7; }
.lcard { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); min-width: 0; }
.lcard-media { display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #000; }
.lcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcard .card-title { font-size: .98rem; }
.list-col { display: grid; gap: 10px; }
/* Filter bar and pager (Displays page) */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar select { min-height: 44px; font-size: 14px; font-weight: 600; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 22px 0 6px; }
.pager-btn { min-width: 44px; min-height: 44px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-weight: 700; }
.pager-btn.is-current { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.pager-btn.is-disabled { opacity: .4; }

/* ---- Home ---- */
.hero { position: relative; padding: 28px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); margin-bottom: 10px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }
.hero-bulbs { display: flex; gap: 16px; margin-bottom: 14px; }
.hero-bulbs i { width: 10px; height: 14px; border-radius: 50% 50% 45% 45%; display: block; }
.hero-bulbs i:nth-child(1) { background: #ff6b6b; box-shadow: 0 0 12px #ff6b6b; }
.hero-bulbs i:nth-child(2), .hero-bulbs i:nth-child(5) { background: #ffb648; box-shadow: 0 0 12px #ffb648; }
.hero-bulbs i:nth-child(3) { background: #6fdc9a; box-shadow: 0 0 12px #6fdc9a; }
.hero-bulbs i:nth-child(4) { background: #7fb2ff; box-shadow: 0 0 12px #7fb2ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero-search { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; }
.hero-search input { flex: 1; min-width: 0; min-height: 52px; }
.hero-search .btn { min-height: 52px; }
@media (max-width: 639px) { .hero-actions .btn-lg { width: 100%; } }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; }
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; }
/* ---- Display page ---- */
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--link); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.single-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1023px) { .single-grid { grid-template-columns: 1fr; } }
.gallery-main { position: relative; border-radius: var(--r-card); overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.gallery-main a, .gallery-main img { display: block; width: 100%; height: 100%; }
.gallery-main img { object-fit: cover; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.gallery-strip { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; padding-bottom: 4px; }
.gallery-strip a { flex: none; position: relative; width: 140px; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #000; }
.gallery-strip img { width: 100%; height: 100%; object-fit: cover; }
.gallery-strip a.is-video .icon { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: rgba(255,255,255,.92); color: #111; fill: #111; stroke: none; }
.info-panel { display: grid; gap: 12px; margin: 0; }
.info-panel h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); margin: 0; }
.info-panel .sub { color: var(--muted); margin: -6px 0 0; }
.info-panel .card-meta { font-size: 14px; }
.info-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-actions .btn-block { grid-column: 1 / -1; }
.fav-text.is-on { color: var(--heart); }
.fav-text.is-on .icon { fill: currentColor; }
.info-panel .addr { margin: 0; font-size: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.info-panel .minor { display: flex; gap: 16px; margin: 0; }
.info-panel .minor a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.single-about { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 22px; margin-top: 24px; }
@media (max-width: 1023px) { .single-about { grid-template-columns: 1fr; } }
.chip-row .tag { margin: 0; }
@media (max-width: 1023px) {
  .single-grid { display: flex; flex-direction: column; }
  .gallery { display: contents; }
  .gallery-main { order: 1; }
  .info-panel { order: 2; }
  .gallery-strip { order: 3; margin-top: 0; }
}
.single-grid > *, .gallery > *, .single-about > * { min-width: 0; max-width: 100%; }
.gallery-strip { max-width: 100%; }
.single-about .chip-row a.tag { min-height: 44px; padding: 0 14px; }
@media (max-width: 1023px) { .single-grid { align-items: stretch; } }
#map_canvas.minimap { height: 180px; }
/* ---- Tags ---- */
.tags-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1023px) { .tags-layout { grid-template-columns: 1fr; } }
.tag-group + .tag-group { margin-top: 16px; }
.tag-group-title { font: 700 12px/1.4 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.chip-btn { min-height: 44px; padding: 0 14px; font-size: 14px; cursor: pointer; }
.selected-bar { position: sticky; top: 64px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; background: var(--bg); }
/* ---- Sign in / register ---- */
.auth-card { max-width: 460px; margin: 16px auto; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .form-stack { margin-top: 12px; }
.btn-block { width: 100%; }
/* ---- Edit ---- */
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 1023px) { .edit-layout { grid-template-columns: 1fr; } }
.edit-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.edit-tabs [role=tab] { min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; background: none; color: var(--muted); font: 700 15px var(--font-body); cursor: pointer; }
.edit-tabs [role=tab][aria-selected="true"] { color: var(--fg); box-shadow: inset 0 -3px 0 var(--accent); }
.edit-form { max-width: 640px; }
.field-pair { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.check-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 999px; background: var(--chip); font-weight: 600; font-size: 14px; }
.sticky-save { position: sticky; bottom: 0; z-index: 3; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
@media (max-width: 639px) { .sticky-save { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); } }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 12px; }
.photo-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); display: grid; }
.photo-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo-opts { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 13px; }
.photo-opts label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.add-tile { border-style: dashed; place-items: center; text-align: center; gap: 6px; padding: 12px; color: var(--muted); min-height: 150px; cursor: pointer; }
.add-tile input[type=file] { width: 100%; font-size: 12px; }
.video-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.video-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 96px; gap: 10px; align-items: center; }
.video-preview { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; }
@media (max-width: 639px) { .video-row { grid-template-columns: 1fr 1fr; } .video-row input { grid-column: 1 / -1; } }
/* ---- Account / profile ---- */
.fav-list { display: grid; gap: 10px; margin: 12px 0; }
.fav-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.fav-points { display: grid; gap: 4px; justify-items: start; }
.fav-points input { width: 80px; }
.singleThumb { border-radius: 6px; margin: 2px; }
del { color: var(--danger); }
ins { color: var(--ok); text-decoration: none; }

/* ---- Website tools ---- */
.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tool-card { display: flex; gap: 14px; align-items: flex-start; margin: 0; color: var(--fg); text-decoration: none; }
.tool-card:hover { border-color: var(--muted); color: var(--fg); }
.tool-card strong { display: block; font-size: 17px; margin-bottom: 4px; }
.tool-card .muted { display: block; font-size: 14px; line-height: 1.5; }
.tool-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--chip); color: var(--accent); }
.tool-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 12px; }
.tool-controls .field-row { flex: 1 1 220px; }
.tool-controls .field-row:has(#zoom) { flex: 0 0 120px; }
.check-row { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.tool-steps { padding-left: 1.4em; margin: 0; }
.tool-steps > li { margin-bottom: 20px; line-height: 1.6; }
.tool-steps > li:last-child { margin-bottom: 0; }
.tool-steps ul { margin: 8px 0; }
.tool-classes { margin-top: 8px; }
/* What the tool draws on someone else's site: show it on a light page. */
.tool-preview { background: #fff; color: #1a1a1a; border-radius: 12px; padding: 16px; margin: 12px 0 16px; overflow-x: auto; }
.tool-preview a { color: #0b4fa8; }
.tool-preview:empty { display: none; }
.tool-preview-center { text-align: center; }
.tool-preview-map { padding: 0; overflow: hidden; }
.tool-preview-map #mymap { width: 100%; height: 400px; }
@media (max-width: 639px) { .tool-preview-map #mymap { height: 320px; } }
#wrnDiv:empty { display: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.code-block { margin: 10px 0 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 14px; border-bottom: 1px solid var(--line); }
.code-label { font-size: 12px; color: var(--muted); }
.code-copy { min-height: 44px; background: transparent; }
.code-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.55; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; }
.code-block pre code { font-size: inherit; }
.tool-pill { margin: 0 0 6px; }

.map-page { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 140px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.map-side { border-right: 1px solid var(--line); padding: 14px; overflow-y: auto; display: grid; gap: 10px; align-content: start; background: var(--bg); }
.map-title { font-size: 1.3rem; margin: 0; }
.map-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.map-filters select { flex: 1 1 140px; }
.map-list .lcard.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.map-stage { position: relative; min-width: 0; }
#map_canvas { width: 100%; height: 100%; background: #0f1a30; }
.map-search { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 5; display: none; }
.map-search input { width: 100%; background: var(--surface); }
.map-list-toggle { position: absolute; right: 12px; top: 64px; z-index: 5; display: none; }
.map-legend { position: absolute; left: 12px; bottom: 24px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: calc(100% - 24px); padding: 6px 10px; border-radius: 10px; background: rgba(10,18,34,.9); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend .lg-a { background: var(--accent); box-shadow: 0 0 8px rgba(255,182,72,.8); }
.map-legend .lg-c { width: 14px; height: 14px; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,182,72,.25); }
.map-legend .lg-me { background: #5aa2ff; box-shadow: 0 0 0 3px rgba(90,162,255,.3); }
.map-legend input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lg-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.lg-switch::before { content: ""; width: 30px; height: 18px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); box-shadow: inset 2px 0 0 0 var(--muted); transition: box-shadow .15s; }
.map-legend input:checked + .lg-switch::before { background: var(--accent); box-shadow: inset 13px 0 0 0 var(--accent-fg); }
.map-legend input:focus-visible + .lg-switch { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.map-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); padding: 8px 14px 14px; box-shadow: 0 -10px 30px rgba(0,0,0,.45); }
.map-sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.map-pop { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--fg); font-family: var(--font-body); }
.map-pop img { width: 112px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.map-pop-body { display: grid; gap: 4px; }
.map-pop-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
/* Google's InfoWindow chrome, darkened */
.gm-style .gm-style-iw-c { background: var(--surface) !important; padding: 12px !important; border-radius: 12px !important; }
.gm-style .gm-style-iw-d { overflow: auto !important; }
.gm-style .gm-style-iw-tc::after { background: var(--surface) !important; }
.gm-style .gm-ui-hover-effect { filter: invert(1); }
.minimap { height: 180px; border-radius: 10px; overflow: hidden; }
@media (max-width: 639px) {
  .map-page { grid-template-columns: 1fr; height: calc(100vh - 56px - var(--tabbar-h) - env(safe-area-inset-bottom, 0px)); min-height: 420px; border: 0; border-radius: 0; margin: -20px calc(-1 * var(--gutter)) 0; }
  .site-main:has(.map-page) { padding-bottom: 0; }
  .map-side { display: none; position: absolute; inset: 0; z-index: 7; }
  .map-page.show-list .map-side { display: grid; }
  .map-page { position: relative; }
  .map-search, .map-list-toggle { display: block; }
  .map-list-toggle { display: inline-flex; }
  .map-legend { bottom: 12px; }
}
/* Phone: the List button stays reachable over the open list, and the pin
   sheet can be closed (it hides the legend only while it is open). */
.map-sheet .sheet-close { position: absolute; right: 8px; top: 6px; display: grid; font-size: 24px; color: var(--fg); }
.map-page.sheet-open .map-legend { display: none; }
@media (max-width: 639px) {
  .map-page.show-list .map-list-toggle { z-index: 8; }
  .map-page.show-list .map-side { padding-top: 64px; }
}

.cool-title {
   font-size:1.3em;
}

.cool-summary {
   margin:3px;
   border-style: solid;
   border-width: 2px;
}

.cool-image-div {
   width:92px;
}

.cool-row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.cool-desc-div {
    line-height: 95%;
}
.cool-title {
    margin-bottom: 2px;
}

.cool-vote {
   color: green;
   font-style: italic;
   font-size: .8em;
}

@media only screen and (min-width: 414px) {
  /* For mobile phones: */
  [class*="cool-summary"] {
      min-width: 380px;
  }
}

@media only screen and (max-width: 354px) {
  /* For mobile phones: */
  [class*="cool-desc-div"] {
      width:100%;
  }
  [class*="cool-summary"] {
      margin-top:15px;
      width:100%;
  }
}

@media only screen and (max-width: 818px) {
  [class*="cool-summary"] {
      border-style: none;
  }
}

