/* Skyflip 2 - styles. Light is the default; dark via <html data-theme="dark|auto">; <html data-style="glass|standard">.
   Colours come from Settings > Appearance through assets/js/theme.js (CSS variables with -l = light / -d = dark). */

:root {
  --danger: #c0392b; --ok: #1f8f55; --warn: #b9770e;
  --radius: 16px; --radius-sm: 10px; --blur: 20px;
  --panel: var(--glass-l, rgba(255, 255, 255, .5));
  --panel-strong: var(--glass-strong-l, rgba(255, 255, 255, .78));
  --solid: var(--solid-l, #ffffff);
  --card: var(--card-l, rgba(255, 255, 255, .42));
  --soft: var(--soft-l, rgba(255, 255, 255, .26));
  --field: var(--field-l, rgba(255, 255, 255, .55));
  --text: var(--utext-l, var(--text-l, #1f1b16)); --text-2: var(--utext2-l, var(--text2-l, #51493e)); --text-3: var(--utext3-l, var(--text3-l, #756b5c));
  --line: var(--line-l, rgba(31, 27, 22, .13));
  --primary: var(--btn-l, #d6b46a); --primary-hover: var(--btn-hover-l, #c9a455);
  --primary-text: var(--btn-text-l, #1b1408);
  --primary-soft: var(--btn-soft-l, rgba(214, 180, 106, .45)); --primary-soft2: var(--btn-soft2-l, rgba(214, 180, 106, .7));
  --accent: var(--accent-l, #8a6a2f);
  --glass-border: rgba(255, 255, 255, .65);
  --shadow: 0 8px 32px rgba(31, 27, 22, .18), inset 0 1px 0 rgba(255, 255, 255, .55);
  --shadow-sm: 0 2px 10px rgba(31, 27, 22, .12);
  --photo-tint: rgba(255, 255, 255, 0);
  --bg-base-default: #d8d0c3;
  --font: "Halton Neue", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;     /* replaced by <style id="sf-font"> from Settings > Appearance */
}
html[data-theme="dark"] {
  --bg-base-default: #1a1612;
  --panel: var(--glass-d, rgba(31, 27, 22, .5)); --panel-strong: var(--glass-strong-d, rgba(31, 27, 22, .78));
  --solid: var(--solid-d, #1f1b16); --card: var(--card-d, rgba(31, 27, 22, .42)); --soft: var(--soft-d, rgba(31, 27, 22, .28));
  --field: var(--field-d, rgba(31, 27, 22, .55));
  --text: var(--utext-d, var(--text-d, #f3efe8)); --text-2: var(--utext2-d, var(--text2-d, #cfc8bc)); --text-3: var(--utext3-d, var(--text3-d, #a39a8b));
  --line: var(--line-d, rgba(255, 255, 255, .16));
  --primary: var(--btn-d, #b8913f); --primary-hover: var(--btn-hover-d, #caa24c); --primary-text: var(--btn-text-d, #1b1408);
  --primary-soft: var(--btn-soft-d, rgba(184, 145, 63, .45)); --primary-soft2: var(--btn-soft2-d, rgba(184, 145, 63, .7));
  --accent: var(--accent-d, #e6c67f);
  --glass-border: rgba(255, 255, 255, .15);
  --shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08); --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --photo-tint: rgba(0, 0, 0, .34);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg-base-default: #1a1612;
    --panel: var(--glass-d, rgba(31, 27, 22, .5)); --panel-strong: var(--glass-strong-d, rgba(31, 27, 22, .78));
    --solid: var(--solid-d, #1f1b16); --card: var(--card-d, rgba(31, 27, 22, .42)); --soft: var(--soft-d, rgba(31, 27, 22, .28));
    --field: var(--field-d, rgba(31, 27, 22, .55));
    --text: var(--utext-d, var(--text-d, #f3efe8)); --text-2: var(--utext2-d, var(--text2-d, #cfc8bc)); --text-3: var(--utext3-d, var(--text3-d, #a39a8b));
    --line: var(--line-d, rgba(255, 255, 255, .16));
    --primary: var(--btn-d, #b8913f); --primary-hover: var(--btn-hover-d, #caa24c); --primary-text: var(--btn-text-d, #1b1408);
    --primary-soft: var(--btn-soft-d, rgba(184, 145, 63, .45)); --primary-soft2: var(--btn-soft2-d, rgba(184, 145, 63, .7));
    --accent: var(--accent-d, #e6c67f);
    --glass-border: rgba(255, 255, 255, .15);
    --shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .08); --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --photo-tint: rgba(0, 0, 0, .34);
  }
}
/* Standard style: solid panels, no blur. Buttons and highlight colours still follow Settings. */
html[data-style="standard"] { --panel: #ffffff; --panel-strong: #ffffff; --solid: #ffffff; --card: #f7f4ee; --soft: #f1ede4; --field: #ffffff;
  --text: var(--utext-l, #1f1b16); --text-2: var(--utext2-l, #51493e); --text-3: var(--utext3-l, #756b5c); --line: rgba(31, 27, 22, .14); --glass-border: rgba(31, 27, 22, .08);
  --shadow: 0 6px 22px rgba(31, 27, 22, .14); --blur: 0px; }
html[data-style="standard"][data-theme="dark"] { --panel: #26211b; --panel-strong: #26211b; --solid: #26211b; --card: #2d2720; --soft: #342d25; --field: #1f1b16;
  --text: var(--utext-d, #f3efe8); --text-2: var(--utext2-d, #cfc8bc); --text-3: var(--utext3-d, #a39a8b); --line: rgba(255, 255, 255, .14); --glass-border: rgba(255, 255, 255, .08); --shadow: 0 6px 22px rgba(0, 0, 0, .5); }
@media (prefers-color-scheme: dark) {
  html[data-style="standard"][data-theme="auto"] { --panel: #26211b; --panel-strong: #26211b; --solid: #26211b; --card: #2d2720; --soft: #342d25; --field: #1f1b16;
    --text: var(--utext-d, #f3efe8); --text-2: var(--utext2-d, #cfc8bc); --text-3: var(--utext3-d, #a39a8b); --line: rgba(255, 255, 255, .14); --glass-border: rgba(255, 255, 255, .08); --shadow: 0 6px 22px rgba(0, 0, 0, .5); }
}

* { box-sizing: border-box; }
html { background: var(--bg-base, var(--bg-base-default)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text);
  font: 14px/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
::selection { background: var(--primary-soft); }
.grow { flex: 1 1 auto; }
.hide-sm { }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- background photo ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(var(--photo-tint), var(--photo-tint)), var(--bg-photo, none) center / cover no-repeat, var(--bg-base, var(--bg-base-default)); }
html:not(.has-photo) .bg { background: linear-gradient(135deg, #e8dcc4 0%, #c9b38a 45%, #8a6a2f 100%); }
html:not(.has-photo)[data-theme="dark"] .bg { background: linear-gradient(135deg, #2a231a 0%, #1a1612 60%, #0f0c09 100%); }
.bg-stage { position: absolute; inset: 0; }
.bg-layer { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; will-change: opacity, transform; }
.bg-layer.on, .bg-layer.off { transition: opacity var(--bg-dur, 1200ms) ease, transform var(--bg-dur, 1200ms) ease, filter var(--bg-dur, 1200ms) ease; }
.bg-layer.on { opacity: 1; z-index: 2; } .bg-layer.off { opacity: 0; z-index: 1; }
.bg-stage[data-t="slide"] .bg-layer.pre { transform: translateX(8%); }
.bg-stage[data-t="zoom"] .bg-layer.pre { transform: scale(1.18); }
.bg-stage[data-t="blur"] .bg-layer.pre { filter: blur(24px); }
.bg-layer.kb { animation: kb var(--bg-kb, 20s) ease-out forwards; }
@keyframes kb { from { transform: scale(1); } to { transform: scale(1.09); } }
.bg::after { content: ""; position: absolute; inset: 0; z-index: 3; background: var(--photo-tint); pointer-events: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5); box-shadow: var(--shadow-sm); }
.brand { display: flex; align-items: center; background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .7); border-radius: 12px; padding: 4px 12px; box-shadow: var(--shadow-sm); }
.brand img { height: 30px; width: auto; max-width: 42vw; display: block; }
/* two logos: the dark-theme one replaces the light one in the dark theme (only when there is no white backing behind it) */
.brand .logo-dark { display: none; }
html[data-theme="dark"] .brand.nobg .logo-light { display: none; }
html[data-theme="dark"] .brand.nobg .logo-dark { display: block; }
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 17px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.nav-link:hover { background: var(--primary-soft); }
.nav-link.is-active { background: var(--primary-soft2); }
.corner-group { display: flex; gap: 6px; }
.corner-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm); }
.corner-btn:hover { background: var(--primary-soft); }
.user-chip { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 4px; border-radius: 17px; text-decoration: none; color: var(--text);
  background: var(--primary-soft); border: 1px solid var(--glass-border); max-width: 240px; }
.user-chip:hover { background: var(--primary-soft2); }
.uc-av { overflow: hidden; flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--primary); color: var(--primary-text); }
.uc-tx { min-width: 0; line-height: 1.1; display: flex; flex-direction: column; }
.uc-tx b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .uc-tx small { font-size: 10px; opacity: .75; }

/* ---------- layout ---------- */
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 22px 16px 28px; }
.wrap.narrow { width: min(760px, 100%); }
.panel { background: var(--panel); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5); }
.panel-pad { padding: 18px 20px; }
.card { background: var(--card); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.foot { text-align: center; padding: 14px 16px 22px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); font-size: 12px; }
html[data-style="standard"] .foot { color: var(--text-3); text-shadow: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.page-title { font-size: 24px; font-weight: 700; } .page-sub { margin: 4px 0 0; color: var(--text-2); }
.head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; text-decoration: none; background: var(--primary); color: var(--primary-text); white-space: nowrap; }
.btn:hover { background: var(--primary-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-soft { background: var(--primary-soft); color: var(--text); border-color: var(--glass-border); } .btn-soft:hover { background: var(--primary-soft2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); } .btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; } .btn-danger:hover { background: #a93226; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 10px; }
.btn-icon { width: 34px; padding: 0; }
label.lbl { display: block; font-weight: 600; font-size: 12.5px; margin: 12px 0 5px; color: var(--text-2); }
.input, input[type=text], input[type=password], input[type=search], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); color: var(--text); outline: none; }
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.chk input { width: 17px; height: 17px; accent-color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 200px; min-width: 0; }
.hint { font-size: 12px; color: var(--text-3); margin: 4px 0 0; }
.err-line { color: var(--danger); font-size: 12.5px; margin-top: 4px; min-height: 1em; }
.notice { padding: 10px 14px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--glass-border); }
.notice.err { background: rgba(192, 57, 43, .18); border-color: rgba(192, 57, 43, .45); }
.notice.ok { background: rgba(31, 143, 85, .18); border-color: rgba(31, 143, 85, .45); }

/* ---------- tabs, badges, tables ---------- */
.tabs { display: flex; gap: 4px; padding: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs button { flex: none; border: 0; background: transparent; cursor: pointer; padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--text-2); }
.tabs button:hover { background: var(--primary-soft); }
.tabs button[aria-selected="true"] { background: var(--primary-soft2); color: var(--text); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--soft); border: 1px solid var(--line); }
.badge.ok { background: rgba(31, 143, 85, .2); border-color: rgba(31, 143, 85, .4); }
.badge.warn { background: rgba(185, 119, 14, .22); border-color: rgba(185, 119, 14, .45); }
.badge.bad { background: rgba(192, 57, 43, .2); border-color: rgba(192, 57, 43, .45); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 8px 12px; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--soft); }
.empty-note { padding: 28px 12px; text-align: center; color: var(--text-3); }

/* ---------- public home ---------- */
.hero { text-align: center; padding: 18px 0 6px; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .55); }
html[data-style="standard"] .hero { color: var(--text); text-shadow: none; }
.hero h1 { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -.01em; } .hero p { margin: 6px 0 0; font-size: 15px; opacity: .92; }
.finder { display: flex; gap: 10px; max-width: 560px; margin: 18px auto 10px; }
.finder .input-wrap { position: relative; flex: 1; } .finder .input-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.finder input { padding-left: 40px; min-height: 46px; border-radius: 23px; background: var(--panel-strong); box-shadow: var(--shadow-sm); }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; }
.chip { border: 1px solid var(--glass-border); background: var(--panel); color: var(--text); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.chip:hover { background: var(--primary-soft); } .chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.cat { margin-top: 22px; }
.cat-title { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border-radius: 99px; font-weight: 700; font-size: 15px; background: var(--panel); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); box-shadow: var(--shadow-sm); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 12px; }
.outlet { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); min-height: 74px;
  background: var(--panel); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5); transition: transform .15s ease, background .15s ease; }
.outlet:hover, .outlet:focus-visible { transform: translateY(-2px); background: var(--panel-strong); outline: none; }
.outlet .logo { flex: none; width: 50px; height: 50px; border-radius: 12px; background: rgba(255, 255, 255, .85); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #6b5a33; font-size: 20px; }
.outlet .logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.outlet .nm { font-weight: 700; line-height: 1.2; } .outlet .sub { font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.outlet .go { margin-left: auto; opacity: .5; }
.no-results { text-align: center; margin: 28px 0; padding: 20px; }

/* ---------- logo backing: "Show background behind the logo" off ---------- */
.outlet .logo.nobg, .venue .vlogo.nobg, .o-row .logo.nobg { background: transparent; box-shadow: none; color: var(--accent); }
.outlet .logo.nobg img, .venue .vlogo.nobg img, .o-row .logo.nobg img { padding: 0; }
.brand.nobg { background: transparent; border-color: transparent; box-shadow: none; padding-left: 4px; padding-right: 4px; }
.login-card img.lg.nobg { background: transparent; padding: 0; }
.login-card img.lg.logo-dark { display: none; }
html[data-theme="dark"] .login-card img.lg.nobg.logo-light { display: none; }
html[data-theme="dark"] .login-card img.lg.nobg.logo-dark { display: block; }

/* ---------- menu viewer ---------- */
.venue { display: flex; align-items: center; gap: 16px; padding: 16px 18px; flex-wrap: wrap; }
.venue .vlogo { flex: none; width: 92px; height: 92px; border-radius: 18px; background: rgba(255, 255, 255, .88); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 34px; color: #6b5a33; }
.venue .vlogo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.venue h1 { font-size: 24px; } .venue p { margin: 4px 0 0; color: var(--text-2); }
.venue .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
/* outlet pages use the same 1120px column as /manage and /settings (.wrap); tiles keep a book-friendly width and sit centred */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 300px)); justify-content: center; gap: 20px; margin-top: 16px; }
.tile { overflow: visible; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: transform .2s ease; }
.tile:hover { transform: translateY(-2px); }
.tile .cover { position: relative; border-radius: 12px; background: var(--soft); aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); cursor: pointer; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.tile .cover .ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-2);
  background: linear-gradient(160deg, var(--soft), var(--card)); font-size: 40px; pointer-events: none; }
.tile .cover .ph small { font-size: 12px; }
.tile .cover:not(.has-thumb):hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow); }
/* with a cover picture DearFlip draws the book itself (3D tilt on hover): give it room and do not clip it */
.tile .cover.has-thumb { aspect-ratio: auto; overflow: visible; background: none; border: 0; padding: 12px 22px 8px; display: block; perspective: 900px; }
.tile .cover.has-thumb ._df_thumb { width: 100% !important; max-width: 200px; height: auto !important; margin: 0 auto; display: block; }
/* DearFlip gives every thumbnail margin: 30px 15px 15px !important and a 140px default width. Together with width: 100% that pushed the cover
   15px past the right edge of its tile (cover flush right, uneven between tiles). Reset it, and give every cover the same book-shaped frame
   so tiles line up even when the cover pictures have different proportions. */
.tile .cover.has-thumb ._df_thumb, .tile .cover.has-thumb .df-popup-thumb { margin: 0 auto !important; padding: 0 !important; box-sizing: border-box; }
.tile .cover.has-thumb .df-book-wrapper { display: block; width: 100%; box-shadow: none; }
.tile .cover.has-thumb .df-book-cover { aspect-ratio: 5 / 7; width: 100%; box-shadow: 0 6px 14px rgba(31, 27, 22, .28); }
.tile .cover.has-thumb .df-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.tile .cover.has-thumb .df-popup-thumb, .tile .cover.has-thumb .df-book-wrapper { width: 100%; }
.tile .cover.has-thumb .df-book-cover { border-radius: 4px; }
.tile .cover.has-thumb img { width: 100%; height: auto; display: block; }
.tile .cover .flag { top: 4px; left: 6px; }
.tile .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tile .meta { justify-content: center; text-align: center; }
.tile .meta b { font-size: 17px; letter-spacing: .01em; } .tile .open { margin-top: auto; }
.tile .cover.has-thumb ._df_thumb { filter: drop-shadow(0 10px 14px rgba(61, 57, 53, .35)); }
.tile .flag { position: absolute; top: 8px; left: 8px; z-index: 5; }
.crumb { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: min(420px, 100%); padding: 26px 26px 22px; text-align: center; }
.login-card img.lg { max-width: 190px; max-height: 80px; margin: 0 auto 12px; display: block; background: rgba(255, 255, 255, .8); padding: 8px 14px; border-radius: 14px; }
.login-card h1 { font-size: 22px; } .login-card .sub { color: var(--text-2); margin: 4px 0 10px; }
.login-card form { text-align: left; }
.pw { position: relative; } .pw input { padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.login-card .btn { width: 100%; margin-top: 16px; min-height: 44px; }
.login-foot { margin: 16px 0 0; font-size: 12px; color: var(--text-3); }
.login-top { position: fixed; top: 12px; right: 14px; z-index: 5; }

/* ---------- staff console ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; } .stat b { display: block; font-size: 26px; line-height: 1.1; } .stat span { font-size: 12px; color: var(--text-2); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.box { padding: 14px 16px; } .box h3 { font-size: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); } .list li:first-child { border-top: 0; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 6px; }
.bars .bar { flex: 1; background: var(--primary); border-radius: 5px 5px 2px 2px; min-height: 3px; position: relative; opacity: .9; } .bars .bar:hover { opacity: 1; }
.bars-x { display: flex; gap: 5px; font-size: 10px; color: var(--text-3); } .bars-x span { flex: 1; text-align: center; overflow: hidden; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .toolbar .input-wrap { flex: 1 1 220px; }
.o-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.o-row:first-child { border-top: 0; } .o-row:hover { background: var(--soft); }
.o-row .logo { width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .85); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #6b5a33; flex: none; }
.o-row .logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.o-row .nm { font-weight: 700; } .o-row .sub { font-size: 12px; color: var(--text-2); }
.cat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; background: var(--soft); border-radius: 10px; margin-top: 10px; }
.menu-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-top: 8px; flex-wrap: wrap; }
.menu-card .th { width: 46px; height: 60px; border-radius: 8px; background: var(--soft) center / cover no-repeat; border: 1px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.menu-card .info { flex: 1 1 180px; min-width: 0; } .menu-card .info b { display: block; }
.menu-card .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; background: var(--soft); transition: background .15s, border-color .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--primary-soft); }
.drop i { font-size: 28px; color: var(--accent); }
.progress { height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 10px; } .progress i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); display: inline-block; } .dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(31, 143, 85, .25); }
.chk-list { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; padding: 6px 10px; background: var(--field); }
.chk-list .chk { display: flex; padding: 5px 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.bg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bg-thumbs .it { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--soft) center / cover; }
.bg-thumbs .it button { position: absolute; top: 5px; right: 5px; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 150px; overflow: auto; margin-top: 6px; }
.icon-pick button { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); cursor: pointer; font-size: 16px; }
.icon-pick button[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); }
.sec { padding: 4px 4px 14px; } .sec + .sec { border-top: 1px solid var(--line); padding-top: 16px; } .sec h3 { font-size: 15px; margin-bottom: 4px; }

/* ---------- modal, toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 5, .5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow: auto; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal { width: min(640px, 100%); background: var(--panel-strong); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: auto 0;
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5); }
.modal.sm { width: min(440px, 100%); } .modal.lg { width: min(860px, 100%); }
.modal h2 { font-size: 18px; margin-bottom: 4px; } .modal .foot-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200; transition: opacity .2s, transform .2s;
  background: var(--solid); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); max-width: min(92vw, 460px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { border-color: var(--danger); } .toast.ok { border-color: var(--ok); }

html.restyle *, html.restyle *::before { transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease !important; }

@media (prefers-reduced-motion: reduce) { .bg-layer.kb { animation: none; } .outlet { transition: none; } }

/* ---------- avatars ---------- */
.uc-av img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar { overflow: hidden; }
.av-edit { position: relative; display: inline-flex; cursor: pointer; border-radius: 50%; flex: none; }
.av-edit .avatar { box-shadow: var(--shadow-sm); }
.av-cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-text); display: flex; align-items: center; justify-content: center; font-size: 12px; border: 2px solid var(--solid); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 32px; align-items: start; }
.profile-id { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.profile-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.profile-card h3 { font-size: 14px; margin: 14px 0 0; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } .profile-actions .btn { width: 100%; } }
/* Settings: logo previews + font preview */
.lg-prev { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.lg-prev.light { background: #efe9dd; } .lg-prev.dark { background: #1f1b16; }
.lg-prev img { max-height: 44px; max-width: 100%; }
.font-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); } .font-row:first-of-type { border-top: 0; }
.font-row .nm { flex: 1 1 140px; font-weight: 600; }
.font-sample { margin: 10px 0 0; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--field); font-size: 18px; line-height: 1.35; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  html { scroll-padding-top: 64px; }
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; }                                   /* stops iOS zooming into fields */
  .staff-link { display: none !important; }                                       /* guests do not need the staff link on a phone */
  /* backdrop-filter would make the fixed bottom bar position itself inside the top bar */
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel-strong); padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 8px; }
  .brand { padding: 3px 9px; } .brand img { height: 24px; }
  .nav:not(.is-staff) { display: none; }
  /* signed-in staff get a bottom tab bar */
  .nav.is-staff { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; justify-content: space-around; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--panel-strong); border-top: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(var(--blur)) saturate(1.5); backdrop-filter: blur(var(--blur)) saturate(1.5); }
  .nav.is-staff .nav-link { flex-direction: column; gap: 2px; height: auto; padding: 6px 4px; flex: 1; border-radius: 12px; font-size: 10.5px; line-height: 1.1; }
  .nav.is-staff .nav-link i { font-size: 17px; } .nav.is-staff .nav-link span { display: block; }
  body.staff { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } body.staff .foot { display: none; }
  .user-chip { padding: 0; width: 34px; justify-content: center; background: transparent; border: 0; } .uc-tx { display: none; }
  .wrap { padding: 12px 12px 20px; }
  .hero { padding-top: 6px; } .hero h1 { font-size: 28px; } .hero p { font-size: 14px; }
  .finder { margin: 12px auto 8px; } .finder input { min-height: 44px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 4px -12px; padding: 4px 12px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 7px 14px; }
  .cat { margin-top: 16px; } .cat-title { font-size: 14px; padding: 6px 13px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .outlet { flex-direction: column; text-align: center; padding: 12px 8px 10px; gap: 6px; min-height: 0; }
  .outlet .logo { width: 56px; height: 56px; } .outlet .nm { font-size: 13.5px; } .outlet .go { display: none; } .outlet .sub { justify-content: center; font-size: 11.5px; }
  .venue { flex-direction: column; text-align: center; padding: 16px 14px; gap: 10px; } .venue .vlogo { width: 84px; height: 84px; }
  .venue h1 { font-size: 20px; } .venue .actions { margin: 0; width: 100%; justify-content: center; }
  .venue .actions .btn:not(.btn-icon) { flex: 1 1 auto; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .tile { padding: 10px 10px 12px; gap: 10px; } .tile .meta b { font-size: 15px; }
  .tile .open { min-height: 38px; font-size: 13px; padding: 0 10px; } .tile .cover.has-thumb { padding: 2px 0 0; }
  .tile .cover.has-thumb ._df_thumb { max-width: none; }
  /* an odd last tile sits centred, at exactly the same size as the others */
  .tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 6px); justify-self: center; }
  /* tables become cards */
  .tbl.stack thead { display: none; } .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: block; padding: 10px 4px; border-top: 1px solid var(--line); } .tbl.stack tr:first-child { border-top: 0; }
  .tbl.stack td { display: block; border: 0; padding: 2px 8px; } .tbl.stack tr:hover td { background: none; } .tbl.stack td:last-child { text-align: left !important; padding-top: 6px; }
  .panel-pad { padding: 14px 14px; } .page-title { font-size: 21px; }
  .stats { grid-template-columns: repeat(2, 1fr); } .stat b { font-size: 22px; } .cols { grid-template-columns: 1fr; }
  .toolbar > * { flex: 1 1 100%; } .toolbar .btn { width: 100%; }
  .o-row { flex-wrap: wrap; } .o-row .grow { flex: 1 1 60%; min-width: 0; } .o-row .sub { word-break: break-all; }
  .menu-card .btns { width: 100%; } .menu-card .btns .btn { flex: 1 1 auto; }
  /* dialogs slide up from the bottom like a sheet */
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal.sm, .modal.lg { width: 100%; margin: 0; border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .modal .foot-row .btn { flex: 1 1 auto; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body:not(.staff) .toast { bottom: calc(22px + env(safe-area-inset-bottom)); }
  .login-card { padding: 22px 18px; }
}
@media (max-width: 380px) { .grid, .tiles { gap: 8px; } .outlet .logo { width: 48px; height: 48px; } }

/* ---------- outlet logo editor (Manage > outlet > details) ---------- */
.seg { display: flex; gap: 18px; margin: 8px 0 10px; }
.logo-edit { display: flex; gap: 14px; align-items: flex-start; }
.logo-edit .grow { min-width: 0; }
.logo-edit .logo { flex: none; border-radius: 16px; background: rgba(255, 255, 255, .88); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #6b5a33; }
.logo-edit .logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-edit .logo.nobg { background: transparent; color: var(--accent); border-style: dashed; }
.logo-edit .logo.nobg img { padding: 0; }
@media (max-width: 760px) { .logo-edit { flex-direction: column; } }
