/* Benji Beagle(TM) styles. Copyright (c) 2026 the Benji Beagle owner. All rights reserved.
   Colors are sampled from SJ Rock's Benji drawing. */
:root {
  --navy: #343852; --navy-2: #454a6b; --tan: #B0704E; --tan-d: #94593b; --blush: #E9C4A8;
  --cream: #FBF5EC; --grass: #5E9E2C; --red: #B3402F;
  --bg: #F6F1EA; --card: #FFFFFF; --ink: #23263A; --muted: #6C6459; --line: #E5DBCD; --soft: #F1E9DE;
  --focus: #B0704E;
  --name: #343852; --name2: #B0704E; --tagline: #343852; --btn: #343852; --btn-hover: #454a6b; --btn-ink: #FBF5EC;
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(35,38,58,.06), 0 4px 14px rgba(35,38,58,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* dark mode: Benji's navy, with cream and warm tan lettering */
    --bg: #262A40; --card: #343852; --ink: #FBF5EC; --muted: #D3CABD; --line: #4D5276; --soft: #3F4463;
    --navy: #FBF5EC; --navy-2: #FFFFFF; --tan: #EFAE86; --tan-d: #F3BE9C; --cream: #343852; --grass: #9BD86A; --red: #FF9C8A;
    --name: #FBF5EC; --name2: #EFAE86; --tagline: #E9C4A8; --btn: #C77D55; --btn-hover: #D88D64; --btn-ink: #FFFFFF; --mark: rgba(239,174,134,.38);
    --focus: #EFAE86; --shadow: 0 2px 10px rgba(0,0,0,.25); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: 1.45rem; }
p { margin: 0; }
a { color: var(--tan-d); }
button, input, textarea, select { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: 10px; }
.center { justify-content: center; }
.center-text { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.msg { color: var(--red); font-weight: 600; min-height: 1.2em; font-size: .95rem; }
.msg.ok { color: var(--grass); }

/* brand */
.brand { font-family: var(--display); font-weight: 700; color: var(--name); font-size: 2.2rem; letter-spacing: -.01em; }
.brand span { color: var(--name2); }
.tagline { font-weight: 700; color: var(--tagline); font-size: 1.05rem; margin-top: -4px; }
.brand.stacked { font-size: 2.6rem; line-height: 1.05; text-align: center; }
.brand.stacked span { display: block; }
.lockup-dog { width: 170px; height: auto; align-self: center; }
.brand.sm { font-size: 1.25rem; white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid transparent; background: var(--soft); color: var(--ink); font-weight: 700; cursor: pointer;
  text-decoration: none; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { background: var(--btn-hover); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--red); border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--soft); }

/* full-screen steps */
.screen { min-height: 100%; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.panel { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 28px 24px; width: 100%; max-width: 620px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: left; }
.panel.narrow { max-width: 440px; }
.panel h2 { text-align: center; }
.panel > .muted { text-align: center; }
.lockup { width: 220px; align-self: center; }
.head-badge { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #343852; align-self: center; border: 4px solid var(--blush); }
.boot-dog { width: min(260px, 60vw); height: auto; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.dots { display: flex; gap: 6px; } .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--tan); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { opacity: .2; } }
input.big { font-size: 1.15rem; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--tan); background: var(--bg); color: var(--ink); text-transform: uppercase; text-align: center; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; }
.choice:hover { border-color: var(--tan); background: var(--soft); }
.choice b { display: block; font-size: 1.05rem; }
.choice small { display: block; color: var(--muted); font-size: .9rem; line-height: 1.4; margin-top: 2px; }
.ch-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-family: var(--display); font-size: 1.2rem; }
.ch-ico.g { background: #4f7fd9; } .ch-ico.d { background: #2563c9; } .ch-ico.f { background: #B0704E; } .ch-ico.t { background: #7d8a6a; }

/* top bar */
#main { min-height: 100%; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: #343852; color: #FBF5EC; padding-top: env(safe-area-inset-top); }
.top-in { display: flex; gap: 14px; align-items: center; max-width: 1100px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo img { border-radius: 10px; }
.top .brand { color: #FBF5EC; } .top .brand span { color: #E9C4A8; }
.searchbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: #FBF5EC; color: #23263A; border-radius: 999px; padding: 0 16px; height: 46px; }
.searchbox svg { color: #6C6459; }
.searchbox { padding-right: 5px; }
.fetch { flex: none; height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: #343852; color: #FBF5EC; font-weight: 800; cursor: pointer; letter-spacing: .02em; }
.fetch:hover { background: #454a6b; }
.fetch.howl { animation: howl .5s ease-out; }
@keyframes howl { 30% { transform: scale(1.12) rotate(-3deg); background: #B0704E; } }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1.05rem; color: #23263A; }
.searchbox:focus-within { outline: 3px solid #E9C4A8; }
.top .btn.primary { background: #B0704E; color: #fff; }
.top .btn.primary:hover { background: #94593b; }
.status { position: absolute; right: 16px; bottom: -30px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--card); color: var(--muted); box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; pointer-events: none; }
.status.show { opacity: 1; } .status.ok { color: var(--grass); } .status.err { color: var(--red); }

.tabs { display: flex; gap: 4px; max-width: 1100px; width: 100%; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--navy); box-shadow: var(--shadow); }
#view { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); outline: none; display: flex; flex-direction: column; gap: 16px; }

/* results */
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bar .count { font-weight: 700; color: var(--muted); margin-right: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1.5px solid var(--line); padding: 4px 6px 4px 12px; border-radius: 99px; font-size: .9rem; font-weight: 600; }
.chip button { border: 0; background: var(--soft); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chip button svg { width: 14px; height: 14px; }
select.sel { height: 36px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); padding: 0 12px; font-weight: 600; max-width: 200px; }
.list { display: grid; gap: 10px; }
.card { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; background: var(--card); border-radius: var(--r); padding: 10px 14px 10px 10px; box-shadow: var(--shadow); cursor: pointer; border: 1.5px solid transparent; text-align: left; width: 100%; }
.card:hover { border-color: var(--blush); }
.thumb { width: 76px; height: 76px; border-radius: 10px; background: var(--soft) center/cover no-repeat; display: grid; place-items: center; overflow: hidden; }
.thumb.none::after { content: ""; width: 34px; height: 34px; background: url(../img/pin-mark.webp) center/contain no-repeat; opacity: .55; }
.card h3 { font-family: var(--body); font-size: 1.08rem; color: var(--ink); font-weight: 800; }
.trail { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--tan-d); font-weight: 700; font-size: .92rem; }
.trail .sep { color: var(--muted); font-weight: 400; }
.card .desc { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .val { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
mark { background: var(--mark, #F6DFC9); color: inherit; border-radius: 3px; padding: 0 1px; }
.more { align-self: center; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 30px 10px; }
.empty img { width: 180px; height: auto; }
.empty img.round { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #343852; border: 4px solid var(--blush); }
.empty p { max-width: 44ch; color: var(--muted); }

/* browse */
.tree { display: grid; gap: 12px; }
.home { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.home > summary, .room > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.home > summary::-webkit-details-marker, .room > summary::-webkit-details-marker { display: none; }
.home > summary { padding: 14px 16px; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--navy); }
.home > summary .n, .room > summary .n { margin-left: auto; font-family: var(--body); font-size: .85rem; color: var(--muted); font-weight: 700; }
.caret { transition: transform .15s; color: var(--muted); }
details[open] > summary .caret { transform: rotate(90deg); }
.room { border-top: 1px solid var(--line); }
.room > summary { padding: 12px 16px 12px 28px; font-weight: 800; }
.locs { padding: 0 16px 12px 52px; display: flex; flex-wrap: wrap; gap: 8px; }
.loc { border: 1.5px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 12px; font-weight: 600; cursor: pointer; font-size: .92rem; }
.loc:hover { border-color: var(--tan); }
.loc b { color: var(--tan-d); margin-left: 4px; }

/* report & settings */
.card-block { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.card-block h3 { font-size: 1.15rem; }
.tbl-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl tr.sub td { font-weight: 800; background: var(--soft); }
.tbl tr.hd td { font-family: var(--display); font-weight: 700; color: var(--navy); font-size: 1.05rem; padding-top: 18px; border-bottom: 2px solid var(--line); }
.tbl tr.grand td { font-weight: 800; font-size: 1.05rem; border-top: 2px solid var(--navy); }
.big-total { font-family: var(--display); font-size: 2rem; color: var(--navy); font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.about { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.about img { width: 150px; }
.fine { font-size: .85rem; color: var(--muted); }

/* sheets (dialogs) */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog.sheet.small { width: min(420px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(27,29,41,.55); }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 20px; }
.sheet-body { padding: 8px 20px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9rem; min-width: 0; }
.fld.full { grid-column: 1 / -1; }
.fld > span { display: block; }
.fld em { font-style: normal; font-weight: 600; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.fld input, .fld textarea { font-weight: 400; font-size: 1rem; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); resize: vertical; min-width: 0; }
.fld input:focus, .fld textarea:focus { border-color: var(--tan); outline: none; }
.ph-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--soft) center/cover no-repeat; }
.ph button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(27,29,41,.75); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ph button svg { width: 16px; height: 16px; }
.ph-empty { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }

/* detail */
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 14px; }
.gallery img { height: min(46vh, 340px); width: auto; max-width: 100%; border-radius: 14px; scroll-snap-align: start; object-fit: contain; background: var(--soft); }
.gallery .loading { height: 200px; min-width: 200px; border-radius: 14px; background: var(--soft); }
.where { display: flex; gap: 12px; align-items: center; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.where img { width: 40px; height: 40px; flex: none; }
.where .trail { font-size: 1.1rem; color: var(--navy); }
.where small { display: block; color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: #23263A; color: #FBF5EC; padding: 10px 18px; border-radius: 12px; font-weight: 700; opacity: 0; transition: .25s; z-index: 100; max-width: calc(100vw - 32px); pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: #8d2b1f; }

/* phones */
@media (max-width: 700px) {
  .brand.sm { display: none; }
  .top-in { gap: 10px; }
  .add span { display: none; }
  .fetch { padding: 0 12px; }
  .add { width: 46px; padding: 0; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); margin: 0; max-width: none; }
  .tabs button { flex-direction: column; gap: 2px; font-size: .75rem; padding: 6px 10px; border-radius: 12px; }
  .tabs button.on { box-shadow: none; background: var(--soft); }
  #view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .card { grid-template-columns: 64px 1fr; }
  .thumb { width: 64px; height: 64px; }
  .card .val { grid-column: 2; justify-self: start; font-size: .92rem; }
  .grid2 { grid-template-columns: 1fr; }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: 1fr; gap: 0 0; } .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .boot-dog, .dots i { animation: none; } * { transition: none !important; } }

/* printing the report */
@media print {
  body { background: #fff; }
  .top, .tabs, .no-print, #toast { display: none !important; }
  #view { padding: 0; max-width: none; }
  .card-block { box-shadow: none; padding: 0; break-inside: avoid; }
  details { display: block; } details > * { display: block !important; }
}
