:root {
  --ink: #2b1a12;
  --ink-2: #4a3324;
  --cream: #f6efe2;
  --paper: #fffcf6;
  --amber: #c9701f;
  --amber-dark: #a85916;
  --foam: #f4ecd9;
  --gold: #e8ac2e;
  --muted: #7d6c5c;
  --line: #e4d9c6;
  --shadow: 0 20px 60px rgba(43, 26, 18, .14);
  --radius: 22px;
}
* { box-sizing: border-box; }
input::placeholder, textarea::placeholder { color: #a8998a; opacity: 1; }
html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
body { margin: 0; min-height: 100vh; background: var(--cream); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; z-index: -1; }
.ambient-one { width: 360px; height: 360px; background: #f0c98a55; right: -140px; top: -160px; }
.ambient-two { width: 340px; height: 340px; background: #c98a5555; left: -180px; bottom: -180px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 25px; font-weight: 850; letter-spacing: -1px; }
.brand-light { color: white; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--amber); color: white; font-family: Georgia, serif; font-style: italic; font-size: 22px; box-shadow: 0 7px 18px #0003; }
.eyebrow { font-size: 11px; font-weight: 850; letter-spacing: 1.8px; margin: 0 0 10px; color: inherit; }
.amber-text { color: var(--amber); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.03em; }
h1 { font-size: clamp(34px, 4vw, 56px); line-height: 1.03; }
h2 { font-size: 28px; margin-bottom: 8px; }
h3 { font-size: 20px; }
.muted { color: var(--muted); }

/* ---------- Auth ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(440px, .85fr); }
.auth-story { position: relative; overflow: hidden; padding: 48px clamp(48px, 7vw, 110px); display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(150deg, #2b1a12, #7a4520 65%, #c9701f); }
.auth-story:after { content: ""; position: absolute; width: 75%; aspect-ratio: 1; border: 1px solid #fff3; border-radius: 50%; right: -30%; bottom: -42%; box-shadow: 0 0 0 70px #fff1, 0 0 0 140px #fff1; }
.story-copy { position: relative; z-index: 1; max-width: 650px; }
.story-copy h1 { font-size: clamp(44px, 5.5vw, 70px); margin: 0 0 24px; }
.story-copy > p:last-child { font-size: 18px; line-height: 1.7; max-width: 540px; color: #f1e6d6; }
.story-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; padding: 20px 24px; border: 1px solid #fff3; border-radius: 18px; background: #fff1; backdrop-filter: blur(12px); max-width: 500px; }
.story-card strong, .story-card small { display: block; }
.story-card small { color: #f1e6d6; margin-top: 4px; }
.mug-stack { display: flex; }
.mug-stack span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 13px; border: 2px solid #7a4520; margin-left: -12px; }
.mug-stack span:first-child { margin-left: 0; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 420px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; }
.mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 850; font-size: 20px; margin-bottom: 30px; }
.mobile-brand .brand-mark { background: var(--amber); }
.form-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 750; color: var(--ink-2); }
.field input, .field textarea, .field select { padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); font-size: 15px; }
/* A grid item's implicit `min-width: auto` resolves to the content's intrinsic width, and a bare
   <input> reports ~229px (its default size=20). Two of those side by side held a 472px floor that
   propagated all the way up and forced the whole dialog to scroll sideways on a phone. min-width: 0
   lets the field actually shrink; the inputs are width-constrained by the grid track instead. */
.field { min-width: 0; }
.field input, .field textarea, .field select { min-width: 0; max-width: 100%; }

/* Two fields side by side, stacking on narrow screens. */
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-pair { grid-template-columns: 1fr; } }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--amber); }
.field textarea { resize: vertical; min-height: 90px; font-family: inherit; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 13px; padding: 13px 20px; font-weight: 800; font-size: 14.5px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.button:active { transform: scale(.98); }
.button.primary { background: var(--amber); color: white; box-shadow: 0 10px 24px #c9701f4d; }
.button.primary:hover { background: var(--amber-dark); }
.button.secondary { background: var(--foam); color: var(--ink); }
.button.secondary:hover { background: #ecdfc7; }
.button.ghost { background: transparent; color: var(--ink-2); }
.button.danger { background: #fbe4de; color: #9b3223; }
.button.danger:hover { background: #f6d0c5; }
.button.wide { width: 100%; }
.button:disabled { opacity: .6; cursor: default; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--foam); color: var(--ink); cursor: pointer; font-size: 17px; }
.icon-button:hover { background: #ecdfc7; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .mobile-brand { display: flex; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 24px 18px; }
  .auth-card { padding: 28px 22px; }
}

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 16px 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-search { flex: 1; max-width: 480px; position: relative; }
.topbar-search input { width: 100%; padding: 12px 16px 12px 40px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--cream); font-size: 14.5px; }
.topbar-search input:focus { outline: none; border-color: var(--amber); background: var(--paper); }
.topbar-search .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-action-group { display: flex; align-items: center; gap: 10px; }
.section-tabs { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--foam); flex-shrink: 0; }
.section-tab { border: 0; border-radius: 9px; padding: 9px 16px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 800; cursor: pointer; }
.section-tab.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 12px rgba(43, 26, 18, .12); }
.section-tab:hover:not(.active) { color: var(--ink-2); }
.view-switch { display: flex; padding: 4px; border-radius: 12px; background: var(--foam); flex-shrink: 0; }
.view-switch-button, .layout-button { display: grid; place-items: center; min-width: 38px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; line-height: 1; }
.view-switch-button.active, .layout-button.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 12px rgba(43, 26, 18, .12); }
.view-switch-button:hover:not(.active), .layout-button:hover:not(.active) { color: var(--ink-2); }
/* Word labels rather than glyphs, so min-width gives way to horizontal padding and each button
   sizes to its own text. */
.layout-button { min-width: auto; padding: 0 13px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.avatar { display: grid; place-items: center; border-radius: 50%; color: white; font-weight: 800; letter-spacing: -.02em; flex-shrink: 0; }
.avatar-button { border: none; cursor: pointer; width: 42px; height: 42px; font-size: 15px; }
.avatar-menu-wrap { position: relative; }
.avatar-menu { position: absolute; right: 0; top: 50px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); min-width: 210px; padding: 8px; z-index: 30; }
.avatar-menu button { width: 100%; text-align: left; background: transparent; border: none; padding: 11px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.avatar-menu button:hover { background: var(--foam); }
.avatar-menu .menu-divider { height: 1px; background: var(--line); margin: 6px 4px; }
.avatar-menu .menu-role { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); padding: 6px 12px 2px; text-transform: uppercase; }

.main-scroll { flex: 1; overflow-y: auto; padding: 28px; }
.main-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.main-header h2 { margin: 0; }
.main-header-meta { display: flex; align-items: center; gap: 14px; }
.brewery-count { color: var(--muted); font-weight: 700; font-size: 14px; }
.location-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The column count is a MAXIMUM, not a fixed width — the ladder below still governs, or the widest
   setting would render 100px cards on a laptop.
   Set on <body> rather than the grid itself so one control covers the breweries grid and a trail's
   brewery grid, which share this class. The table layout has its own ladder immediately below. */
.brewery-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
@media (max-width: 1400px) { .brewery-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1150px) { .brewery-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .brewery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .brewery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .brewery-grid { grid-template-columns: 1fr; } }

/* The full ladder is repeated, not just the wide end. `body.layout-table .brewery-grid` (0,2,1)
   outranks `.brewery-grid` (0,1,0), so it wins at EVERY width — stopping at 1150px would leave the
   base rules for 900/700/460 permanently overridden and put 4 columns of 66px cards on a phone.
   The breakpoints differ from the portrait ladder because a table card wants ~340px minimum rather
   than ~150px; each band's narrow edge lands at 346-348px. Descending max-width order matters:
   these share one specificity, so at 1000px the 1150 rule only wins by coming later.
   Capped at 3 rather than 4: wider cards fit their tags on fewer wrapped lines, so each row is
   shorter and more breweries land on a screen — condensed vertically, not horizontally. */
body.layout-table .brewery-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1150px) { body.layout-table .brewery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 780px)  { body.layout-table .brewery-grid { grid-template-columns: 1fr; } }
/* The action group wraps too, not just the topbar. `Grid`/`Table` as words is wider than the icon
   pair it replaced, and without this the group overflows the bar on a phone rather than letting
   "Add brewery" drop to its own line. */
@media (max-width: 600px)  { .topbar { padding: 14px 16px; flex-wrap: wrap; } .topbar-actions, .topbar-action-group { flex-wrap: wrap; } .main-scroll { padding: 18px; } }

.brewery-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column; }
.brewery-card:hover { transform: translateY(-3px); box-shadow: 0 26px 70px rgba(43,26,18,.2); }
.brewery-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.brewery-logo { aspect-ratio: 1; width: 100%; background: var(--foam); display: grid; place-items: center; background-size: cover; background-position: center; position: relative; }
.brewery-logo .logo-fallback { font-family: Georgia, serif; font-style: italic; font-size: 44px; color: var(--amber); font-weight: 700; }
.brewery-card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.brewery-card-body h3 { font-size: 17px; line-height: 1.25; }
.brewery-card-address { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.card-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.rating-pill { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: var(--foam); color: var(--ink-2); font-weight: 800; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; }
.rating-pill .rating-value { color: var(--amber-dark); }
.rating-pill.unrated { color: var(--muted); }
.distance-pill { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; background: #dce9e6; color: var(--ink-2); font-weight: 750; font-size: 12px; padding: 5px 11px; border-radius: 999px; }

/* ---------- Table layout ---------- */
/* body.layout-table turns the same card markup sideways: logo left, name upper-right, tags below.
   renderBreweryCard is untouched — one markup shape, two stylesheets' worth of geometry — so
   toggling never re-renders a card or drops a listener. Every rule below is prefixed
   body.layout-table on purpose: the Grid layout must render exactly as it did before. */
/* flex-start rather than .trail-card's center: the name belongs at the top, and a wrapped tag row
   makes the body far taller than the logo, so centring would float the logo mid-card. */
body.layout-table .brewery-card { flex-direction: row; align-items: flex-start; gap: 14px; padding: 16px; }
/* flex-shrink: 0 is load-bearing — the base rule's width: 100% resolves against the card, so the
   logo would otherwise be squeezed. Both dimensions definite makes the base aspect-ratio inert.
   `background` is deliberately not re-declared: the shorthand would reset the background-image
   that renderBreweryCard sets inline. */
body.layout-table .brewery-logo { width: 68px; height: 68px; flex-shrink: 0; border-radius: 16px; }
body.layout-table .brewery-logo .logo-fallback { font-size: 26px; }
/* min-width: 0 for the same reason .trail-card-body has it — a flex item's default min-width: auto
   refuses to shrink below min-content, and .brewery-card's overflow: hidden would then clip a long
   address mid-glyph instead of wrapping it. */
body.layout-table .brewery-card-body { flex: 1; min-width: 0; padding: 0; flex-direction: row; flex-wrap: wrap; column-gap: 6px; row-gap: 8px; }
/* The global `h1, h2, h3, p` rule only zeroes margin-top, so the h3 still carries the UA's 1em
   bottom margin. Invisible in the portrait card; here it double-counts against row-gap.
   overflow-wrap: anywhere rather than break-word — only `anywhere` reduces the min-content
   contribution, which is what actually lets the flex item shrink. */
body.layout-table .brewery-card-body h3 { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
body.layout-table .brewery-card-address { flex-basis: 100%; overflow-wrap: anywhere; }
/* display: contents dissolves the wrappers so rating/hours/distance and the visit control land on
   one wrapping line under the name, without renderBreweryCard emitting different markup per layout.
   Safe here specifically: these are role-less <div>s with no background, border, or listener of
   their own. The card's click handler and the visit buttons' stopPropagation both ride DOM
   bubbling, which follows the tree, not the boxes. */
body.layout-table .card-pills { display: contents; }
/* Deliberately NOT display: contents — .card-visitors' avatars overlap via margin-left: -8px and
   need a real flex context of their own. flex-basis: 100% drops them onto their own line. */
body.layout-table .card-visitors,
body.layout-table .card-visitors-count { flex-basis: 100%; margin-top: 0; }

/* A 375px phone leaves a 324px card; 68px of logo is too much of it. */
@media (max-width: 480px) {
  body.layout-table .brewery-card { gap: 12px; padding: 14px; }
  body.layout-table .brewery-logo { width: 52px; height: 52px; }
  body.layout-table .brewery-logo .logo-fallback { font-size: 20px; }
}

/* ---------- Time board ---------- */
/* A third layout over the same brewery list: one row each, a bar showing when that brewery is open
   on ONE day. Rows are self-contained two-column grids rather than cells of one big grid, so a row
   can be a single clickable, focusable element. The name column is sticky because a 20-hour axis
   needs horizontal scroll on anything narrower than a desktop. */
.time-board { --time-name-col: 168px; --time-hours: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 0 10px; }
.time-day { margin: 0 18px 12px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.time-day .today { color: var(--amber-dark); }
.time-scroll { overflow-x: auto; overflow-y: hidden; }
.time-inner { width: 100%; min-width: calc(var(--time-name-col) + var(--time-hours) * 64px); }
.time-rows { position: relative; }

.time-row { display: grid; grid-template-columns: var(--time-name-col) 1fr; align-items: center; }
.time-row:not(.time-head) { cursor: pointer; }
.time-row:not(.time-head):hover, .time-row:not(.time-head):hover .time-name { background: var(--foam); }
.time-row:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }

/* Sticky against .time-scroll, and opaque, or the bars would slide under the names. */
.time-name { position: sticky; left: 0; z-index: 2; background: var(--paper); padding: 0 14px 0 18px; font-size: 13.5px; font-weight: 750; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.time-head { border-bottom: 1px solid var(--line); }
.time-axis { position: relative; height: 30px; }
/* Labels sit just right of their line rather than centred on it — centring clips the first one
   against the sticky name column. The final tick is the exception and hangs to the left. */
.time-tick-label { position: absolute; top: 9px; padding-left: 6px; font-size: 11px; font-weight: 750; color: var(--muted); white-space: nowrap; }
.time-tick-label.midnight { color: var(--ink-2); font-weight: 800; }
.time-tick-label.last { padding-left: 0; padding-right: 6px; transform: translateX(-100%); }

.time-lane { position: relative; height: 44px; }
.time-bar { position: absolute; top: 9px; height: 26px; min-width: 6px; display: flex; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--amber); color: #fff; font-size: 11.5px; font-weight: 800; white-space: nowrap; overflow: hidden; box-shadow: 0 4px 12px #c9701f40; }
.time-row:hover .time-bar { background: var(--amber-dark); }
.time-note { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 750; color: var(--muted); }

/* Gridlines and the moment marker in ONE layer spanning the full row width — see timeOverlay()'s
   comment for why they can't be a repeating background per lane. Above the bars so the marker stays
   visible where it crosses one; the gridlines are faint enough not to fight them. */
.time-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.time-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .7; }
.time-gridline.midnight { background: var(--ink-2); opacity: .3; width: 2px; }
.time-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber-dark); }
.time-now::before { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber-dark); }

.time-empty-note { margin: 0 18px 8px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 700px) { .time-board { --time-name-col: 132px; } .time-name { padding-left: 14px; } }

/* ---------- Filter bar ---------- */
.filter-bar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 14px 16px; margin-bottom: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px; background: var(--paper); color: var(--ink-2); font-size: 13px; font-weight: 800; cursor: pointer; }
.filter-pill:hover { border-color: #d8c7ab; }
.filter-pill.active { background: var(--amber); border-color: var(--amber); color: white; box-shadow: 0 6px 16px #c9701f40; }
.filter-field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-field select, .filter-field input { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 600; text-transform: none; letter-spacing: normal; }
.filter-field select:focus, .filter-field input:focus { outline: none; border-color: var(--amber); }
.filter-clear { border: none; background: transparent; color: var(--amber-dark); font-size: 12.5px; font-weight: 800; cursor: pointer; padding: 9px 4px; margin-left: auto; }
.filter-clear:hover { text-decoration: underline; }

/* ---------- Hours ---------- */
.hours-pill { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.hours-pill.open { background: #dbeee2; color: #24603f; }
.hours-pill.closed { background: #f0e6e2; color: #8a4132; }
.hours-pill.unknown { background: var(--foam); color: var(--muted); }
.detail-hours { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13.5px; }
.detail-hours .hours-day { font-weight: 750; color: var(--ink-2); }
.detail-hours .hours-value { color: var(--muted); }
.detail-hours .today { color: var(--amber-dark); font-weight: 800; }
.detail-hours-updated { margin: 12px 0 0; font-size: 12px; }
.brewery-dialog { max-width: 1000px; }
.brewery-form-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 28px; align-items: start; }
@media (max-width: 860px) { .brewery-form-columns { grid-template-columns: 1fr; } }
/* Both columns need min-width: 0 for the same reason .field does — the single-column layout below
   860px is still a grid track, and an unshrinkable child would otherwise widen the whole dialog. */
.brewery-form-details { min-width: 0; }
.brewery-form-hours { min-width: 0; border-left: 1px solid var(--line); padding-left: 28px; }
@media (max-width: 860px) { .brewery-form-hours { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; } }
.hours-editor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hours-editor-head h3 { margin: 0; }
.hours-copy { padding: 4px 8px; font-size: 11.5px; }
.hours-updated-note { margin: 6px 0 14px; font-size: 11.5px; }
.hours-editor { display: flex; flex-direction: column; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 26px; align-items: center; gap: 8px; }
.hours-row-day { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.hours-copy-down { width: 26px; height: 26px; border: none; border-radius: 8px; background: var(--foam); color: var(--ink-2); font-size: 13px; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.hours-copy-down:hover { background: #ecdfc7; color: var(--ink); }
.hours-copy-down-spacer { width: 26px; height: 26px; }

/* One field per day — the whole range is a single target. Two dropdowns per row was the tedium. */
.hours-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.hours-field:hover { border-color: #d8c7ab; }
.hours-field:focus-visible { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px #c9701f33; }
.hours-field.is-open { border-color: var(--amber); background: #fdf6ec; }
.hours-field-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hours-field-icon { flex-shrink: 0; width: 15px; height: 15px; color: var(--muted); }
.hours-field.is-unset { border-style: dashed; color: var(--muted); font-weight: 650; }
.hours-field.is-closed .hours-field-text { color: var(--muted); }
.hours-field.is-partial .hours-field-text { color: var(--amber-dark); }

/* ---------- Hours picker ---------- */
/* No `display` in this rule on purpose: it would beat the UA's
   [popover]:not(:popover-open) { display: none } and pin the panel permanently open.
   Positioned from JS against the viewport — top-layer membership is what lets it escape
   .modal-body's overflow-y: auto instead of being clipped by it. */
.hours-picker { position: fixed; inset: auto; margin: 0; width: 320px; max-width: calc(100vw - 16px); padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.hours-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hours-picker-head h4 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 15px; letter-spacing: -.02em; }
.hours-picker-closed { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 750; color: var(--muted); white-space: nowrap; cursor: pointer; }
.hours-picker-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hours-picker-group { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hours-picker-label { font-size: 10.5px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hours-picker-controls { display: flex; align-items: center; gap: 3px; }
.hours-num-wrap { position: relative; flex: 0 0 42px; display: block; }
.hours-num { width: 100%; height: 46px; padding: 0 0 6px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--foam); color: var(--ink); font-size: 20px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; }
.hours-num:focus { outline: none; border-color: var(--amber); background: var(--paper); box-shadow: 0 0 0 3px #c9701f33; }
.hours-num:disabled { opacity: .5; cursor: default; }
/* The affordance for "this also opens a list". Sits under the digits — the box is 46px tall and the
   glyphs are ~20px, so the bottom strip is free. pointer-events: none keeps the whole box a single
   click target rather than splitting it into type-here and pick-here halves. */
.hours-num-caret { position: absolute; left: 50%; bottom: 5px; width: 0; height: 0; margin-left: -3.5px; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid var(--muted); pointer-events: none; }
.hours-num:disabled + .hours-num-caret { opacity: .4; }
.hours-num:focus + .hours-num-caret { border-top-color: var(--amber); }

/* Zero until a list opens, then set to the list's height in JS so the panel grows around it rather
   than letting it hang over the Clear/Done row. */
.hours-options-space { height: 0; }

/* Positioned against .hours-picker, which is fixed and the nearest positioned ancestor. Hours
   render as a 3x4 grid: all twelve visible at once beats scrolling a 12-item list inside a panel
   this size. */
.hours-options { position: absolute; z-index: 2; display: grid; grid-template-columns: 1fr; gap: 3px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.hours-options[hidden] { display: none; }
.hours-options.is-hours { grid-template-columns: repeat(3, 34px); }
.hours-option { min-width: 34px; padding: 6px 8px; border: none; border-radius: 7px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 750; text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; }
.hours-option:hover { background: var(--foam); }
.hours-option[aria-selected="true"] { background: var(--amber); color: #fff; }
.hours-colon { font-size: 18px; font-weight: 800; color: var(--ink-2); }
.hours-meridiem { display: flex; flex-direction: column; margin-left: 5px; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.hours-meridiem-button { border: none; background: var(--paper); color: var(--muted); font-size: 10.5px; font-weight: 850; line-height: 1.35; padding: 4px 6px; cursor: pointer; }
.hours-meridiem-button + .hours-meridiem-button { border-top: 1.5px solid var(--line); }
.hours-meridiem-button[aria-checked="true"] { background: var(--amber); color: #fff; }
.hours-meridiem-button:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.hours-meridiem[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.hours-picker-note { margin: 10px 0 0; min-height: 16px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.hours-picker-note.warn { color: var(--amber-dark); }
.hours-picker-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.hours-picker-actions .spacer { margin-right: auto; }
.hours-picker-action { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.hours-picker.is-closed-day .hours-picker-groups { opacity: .45; }

/* Narrow or short viewports get a bottom sheet: on a 620px-tall window a flipped panel would land
   on top of the row it belongs to. positionHoursPicker adds .as-sheet and clears the inline
   top/left it would otherwise have set, so these rules win. */
@media (max-width: 560px), (max-height: 519px) {
  .hours-picker.as-sheet { left: 8px; right: 8px; bottom: 8px; top: auto; width: auto; max-width: none; padding: 16px; border-radius: 18px; }
  .hours-picker.as-sheet .hours-picker-groups { grid-template-columns: 1fr; gap: 14px; }
  .hours-picker.as-sheet .hours-num-wrap { flex-basis: 48px; }
  .hours-picker.as-sheet .hours-num { height: 52px; font-size: 22px; }
}

/* ---------- Trails board ---------- */
/* A distinct class from .trail-tab-button/.section-tab, deliberately — those two are each scoped
   to their own click handler by class name, and sharing a class would pull this toggle into logic
   meant for a different control (see the trail-detail tabs' own note above). */
.visibility-toggle { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--foam); flex-shrink: 0; }
.visibility-toggle-button { border: 0; border-radius: 9px; padding: 8px 14px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.visibility-toggle-button.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 12px rgba(43, 26, 18, .12); }
.visibility-toggle-button:hover:not(.active) { color: var(--ink-2); }

.trail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .trail-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .trail-grid { grid-template-columns: 1fr; } }
.trail-card { display: flex; gap: 16px; align-items: center; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.trail-card:hover { transform: translateY(-3px); box-shadow: 0 26px 70px rgba(43,26,18,.2); }
.trail-card:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.trail-card-logo { width: 68px; height: 68px; border-radius: 16px; background: var(--foam) center/cover no-repeat; display: grid; place-items: center; flex-shrink: 0; font-family: Georgia, serif; font-style: italic; font-size: 26px; color: var(--amber); font-weight: 700; }
.trail-card-body { min-width: 0; flex: 1; }
.trail-card-body h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.25; }
.trail-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.status-badge.active { background: #dbeee2; color: #24603f; }
.status-badge.upcoming { background: #fdeccd; color: #8a5a12; }
.status-badge.ended { background: #e8e2d8; color: var(--muted); }
.visibility-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--foam); color: var(--ink-2); }
.trail-brewery-count { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #e4ecf5; color: #33506e; }

/* ---------- Trail dialog (details + brewery picker) ---------- */
.trail-dialog { max-width: 1080px; }
.trail-form-columns { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .trail-form-columns { grid-template-columns: 1fr; } }
.trail-form-details { min-width: 0; }
.trail-form-picker { min-width: 0; border-left: 1px solid var(--line); padding-left: 28px; }
@media (max-width: 860px) { .trail-form-picker { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; } }
.picker-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.picker-header h3 { margin: 0; }
.picker-count { font-size: 12.5px; font-weight: 800; color: var(--amber-dark); }
.picker-toolbar { display: flex; align-items: center; gap: 10px; margin: 12px 0 14px; }
.picker-search { flex: 1; max-width: none; }
.picker-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.picker-tile { position: relative; text-align: left; padding: 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.picker-tile:hover { border-color: #d8c7ab; }
.picker-tile.selected { border-color: var(--amber); background: #fdf6ec; }
.picker-tile-logo { width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--foam) center/cover no-repeat; display: grid; place-items: center; font-family: Georgia, serif; font-style: italic; font-size: 22px; color: var(--amber); }
.picker-tile-name { font-size: 12.5px; font-weight: 750; line-height: 1.3; }
.picker-tile-address { font-size: 11px; color: var(--muted); line-height: 1.3; }
.picker-tile-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: white; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.picker-map-board { height: 46vh; }
/* The wrap must carry a definite height of its own: .brewery-map's `height: 100%` resolves against
   it, not against the board, so leaving the wrap at auto height collapses the map to 0px. */
.picker-map-board .brewery-map-wrap, .picker-map-board .brewery-map { height: 100%; }
.picker-empty { grid-column: 1 / -1; padding: 40px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.brewery-map-marker.selected { border-color: var(--amber); box-shadow: 0 0 0 4px #c9701f66, 0 4px 14px rgba(43, 26, 18, .35); }

/* ---------- Trail detail page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; padding: 4px 0; margin-bottom: 12px; }
.back-link:hover { color: var(--amber-dark); }
.trail-page-header { display: flex; align-items: flex-start; gap: 20px; padding: 22px 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.trail-page-logo { width: 96px; height: 96px; border-radius: 20px; background: var(--foam) center/cover no-repeat; display: grid; place-items: center; flex-shrink: 0; font-family: Georgia, serif; font-style: italic; font-size: 34px; color: var(--amber); font-weight: 700; }
.trail-page-heading { flex: 1; min-width: 0; }
.trail-page-heading h2 { margin: 0 0 10px; font-size: 32px; }
.trail-page-dates { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.trail-page-actions { display: flex; gap: 8px; flex-shrink: 0; }
.trail-page-description { margin: 18px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); max-width: 70ch; }
.trail-page-subhead { margin-top: 30px; align-items: center; }
.trail-page-subhead h3 { margin: 0; }
@media (max-width: 700px) {
  .trail-page-header { flex-wrap: wrap; gap: 14px; padding: 18px; }
  .trail-page-logo { width: 72px; height: 72px; font-size: 26px; }
  .trail-page-heading h2 { font-size: 25px; }
  .trail-page-actions { width: 100%; }
}

/* ---------- Trail detail tabs ---------- */
/* A distinct class from the topbar's .section-tab, deliberately — sharing that class would also
   pull in the topbar's own click handler and active-class logic (both scoped to ".section-tab"),
   which stomps on this one the moment two elements happen to match its comparison. */
.trail-tabs { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--foam); width: fit-content; margin: 22px 0 6px; }
.trail-tab-button { border: 0; border-radius: 9px; padding: 9px 16px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 800; cursor: pointer; }
.trail-tab-button.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 12px rgba(43, 26, 18, .12); }
.trail-tab-button:hover:not(.active) { color: var(--ink-2); }

/* ---------- Trail people (membership) ---------- */
.trail-people-section { margin-top: 8px; }
.people-list { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.people-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.people-row:last-child { border-bottom: none; }
.people-row .avatar { width: 34px; height: 34px; font-size: 12.5px; }
.people-name-wrap { min-width: 0; flex: 1; }
.people-name { font-weight: 750; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.people-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.people-pending-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #fdeccd; color: #8a5a12; }
.people-expired-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #ece7e2; color: #6d635a; }
.people-creator-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--foam); color: var(--ink-2); }
.people-permission-select { padding: 7px 10px; border-radius: 9px; border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 700; background: var(--paper); }
.people-remove-button { border: none; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 15px; flex-shrink: 0; }
.people-remove-button:hover { background: #fbe4de; color: #9b3223; }
.people-copy-invite-button { border: none; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 15px; flex-shrink: 0; }
.people-copy-invite-button:hover { background: #e6efe4; }

/* ---------- Visit tracking ---------- */
.visit-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: #dbeee2; color: #24603f; font-weight: 800; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: none; cursor: pointer; }
.visit-chip:hover { background: #c9e6d2; }
.visit-mark-button { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: var(--foam); color: var(--ink-2); font-weight: 800; font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1.5px dashed var(--line); cursor: pointer; }
.visit-mark-button:hover { border-color: #d8c7ab; color: var(--ink); }
.participant-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #e4ecf5; color: #33506e; }
.joined-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #dbeee2; color: #24603f; }
.group-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: #ede4f3; color: #5b3a72; }
.trail-page-copied-from { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.card-visitors-count { margin-top: 2px; font-size: 12px; font-weight: 750; color: var(--muted); }
.card-visitors { display: flex; align-items: center; margin-top: 2px; }
.card-visitors .avatar { width: 22px; height: 22px; font-size: 9px; margin-left: -8px; border: 2px solid var(--paper); }
.card-visitors .avatar:first-child { margin-left: 0; }
.visit-filter-members { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.visit-member-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--paper); font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.visit-member-chip.active { background: var(--amber); border-color: var(--amber); color: white; }
.map-marker-visited { background: #2f8f5b !important; border-color: white !important; color: white !important; font-size: 20px !important; }
.visit-status-yes { color: #24603f; font-weight: 750; }
.visit-status-no { color: var(--muted); }
.people-row-clickable { cursor: pointer; }
.people-row-clickable:hover { background: var(--foam); border-radius: 12px; }
.people-row-clickable:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; border-radius: 12px; }

/* ---------- Map view ---------- */
.brewery-map-wrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(43, 26, 18, .08); }
.brewery-map { width: 100%; height: min(68vh, 620px); }
.brewery-map-note { margin: 10px 2px 0; font-size: 12px; }
/* Mapbox markers are absolutely positioned by the library; these only style the button inside. */
.brewery-map-marker { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 3px solid white; border-radius: 13px; background-color: var(--foam); background-size: cover; background-position: center; cursor: pointer; box-shadow: 0 4px 14px rgba(43, 26, 18, .35); font-family: Georgia, serif; font-style: italic; font-size: 17px; font-weight: 700; color: var(--amber); transition: transform .15s; }
.brewery-map-marker:hover { transform: scale(1.08); }
.brewery-map-cluster { display: flex; align-items: center; justify-content: center; padding: 0; border: 3px solid white; border-radius: 50%; background: var(--amber); color: white; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 4px 14px rgba(43, 26, 18, .35); transition: transform .15s; }
.brewery-map-cluster:hover { transform: scale(1.08); }
.map-notice { text-align: center; padding: 70px 20px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.map-notice span { font-size: 40px; display: block; margin-bottom: 12px; }
.map-notice h4 { font-family: Georgia, "Times New Roman", serif; font-size: 20px; color: var(--ink); margin: 0 0 8px; }
.map-notice p { margin: 0; max-width: 460px; margin-inline: auto; font-size: 13.5px; line-height: 1.6; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 14px; }
.empty-state h3 { color: var(--ink); }
.empty-state .button { margin-top: 16px; }

/* ---------- Dialogs ---------- */
dialog { border: none; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); max-width: 640px; width: calc(100vw - 40px); background: var(--paper); }
dialog::backdrop { background: rgba(43, 26, 18, .45); backdrop-filter: blur(2px); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 22px; }
.modal-close { border: none; background: var(--foam); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.modal-body { padding: 24px 28px; max-height: 70vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 28px; border-top: 1px solid var(--line); }
.modal-footer .spacer { margin-right: auto; }

/* ---------- Rating slider ---------- */
.rating-field { display: flex; flex-direction: column; gap: 10px; }
.rating-row { display: flex; align-items: center; gap: 14px; }
.rating-bubble { min-width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--foam); color: var(--amber-dark); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.rating-bubble.unset { color: var(--muted); font-size: 15px; }
input[type="range"].rating-slider { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; border-radius: 999px; background: linear-gradient(to right, var(--amber) 0%, var(--amber) var(--fill, 0%), var(--line) var(--fill, 0%), var(--line) 100%); cursor: pointer; }
input[type="range"].rating-slider.unset { background: var(--line); }
input[type="range"].rating-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); border: 3px solid white; box-shadow: 0 3px 10px #0003; cursor: pointer; }
input[type="range"].rating-slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--amber); border: 3px solid white; box-shadow: 0 3px 10px #0003; cursor: pointer; border: none; }
.rating-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 700; padding: 0 2px; }
.rating-clear { align-self: flex-start; }

/* ---------- Place picker ---------- */
.place-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.place-clear { background: transparent; border: none; color: var(--amber-dark); font-weight: 800; font-size: 12.5px; cursor: pointer; padding: 4px; }
.place-picker-copy { font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; }
.place-search-wrap { position: relative; }
.place-search-wrap input { width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper); font-size: 14.5px; }
.place-search-wrap input:focus { outline: none; border-color: var(--amber); }
.place-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); z-index: 5; max-height: 260px; overflow-y: auto; }
.place-results button { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.place-results button:last-child { border-bottom: none; }
.place-results button:hover { background: var(--foam); }
.place-results button span { display: block; font-weight: 750; font-size: 14px; }
.place-results button small { color: var(--muted); font-size: 12px; }
.place-results p { padding: 12px 14px; margin: 0; color: var(--muted); font-size: 13px; }
.place-selection { margin-top: 14px; padding: 12px 14px; border-radius: 13px; background: var(--foam); }
.place-selection strong { display: block; font-size: 14.5px; }
.place-selection small { color: var(--muted); }
.place-map { display: block; margin-top: 10px; position: relative; border-radius: 13px; overflow: hidden; text-decoration: none; }
.place-map img { display: block; width: 100%; height: 160px; object-fit: cover; }
.place-map span { position: absolute; right: 10px; bottom: 10px; background: #fffdf8ee; color: var(--ink); font-size: 11.5px; font-weight: 800; padding: 5px 9px; border-radius: 8px; }
.place-empty { margin-top: 14px; padding: 14px; border-radius: 13px; background: var(--foam); color: var(--muted); font-size: 13px; }

/* ---------- Logo picker ---------- */
.logo-picker-row { display: flex; align-items: center; gap: 16px; }
.logo-picker-button { width: 84px; height: 84px; border-radius: 16px; border: 2px dashed var(--line); background: var(--foam) center/cover no-repeat; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 24px; flex-shrink: 0; }
.logo-picker-button.has-image { border-style: solid; color: transparent; }
.logo-picker-copy { font-size: 12.5px; color: var(--muted); }

/* ---------- Detail dialog ---------- */
.detail-dialog { max-width: 980px; }
.detail-columns { display: grid; grid-template-columns: 1fr 320px; gap: 8px 32px; align-items: start; }
.detail-left { min-width: 0; }
.detail-right { min-width: 0; border-left: 1px solid var(--line); padding-left: 32px; }
@media (max-width: 760px) {
  .detail-columns { grid-template-columns: 1fr; }
  .detail-right { border-left: none; padding-left: 0; padding-top: 20px; margin-top: 6px; border-top: 1px solid var(--line); }
}
.detail-hero { display: flex; gap: 18px; align-items: center; }
.detail-logo { width: 76px; height: 76px; border-radius: 16px; background: var(--foam) center/cover no-repeat; display: grid; place-items: center; flex-shrink: 0; }
.detail-logo .logo-fallback { font-family: Georgia, serif; font-style: italic; font-size: 30px; color: var(--amber); }
.detail-heading h2 { margin: 0 0 4px; }
.detail-address { color: var(--muted); font-size: 13.5px; }
.detail-description { margin-top: 16px; font-size: 14px; line-height: 1.6; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.detail-links a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--foam); color: var(--ink-2); text-decoration: none; font-size: 12.5px; font-weight: 750; }
.detail-links a:hover { background: #ecdfc7; }
.detail-section { margin-top: 26px; }
.detail-section h3 { margin-bottom: 10px; }
.rater-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rater-row:last-child { border-bottom: none; }
.rater-row .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.rater-name { font-weight: 750; font-size: 13.5px; flex: 1; }
.rater-rating { font-weight: 800; color: var(--amber-dark); }
.rater-date { color: var(--muted); font-size: 11.5px; }

/* ---------- Comments (detail-right column) ---------- */
.detail-right h3 { margin-top: 0; }
.comment-form textarea { width: 100%; min-height: 84px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper); font-family: inherit; font-size: 13.5px; resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: var(--amber); }
.comment-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.comments-list { margin-top: 22px; }
.comment-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-row:last-child { border-bottom: none; }
.comment-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-row-head .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.comment-name { font-weight: 750; font-size: 12.5px; flex: 1; }
.comment-date { color: var(--muted); font-size: 11px; }
.comment-body { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; }
.comments-empty { color: var(--muted); font-size: 13px; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--foam); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb .gallery-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 8px; border: none; background: #2b1a12cc; color: white; font-size: 13px; cursor: pointer; display: grid; place-items: center; }
.gallery-add { border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); cursor: pointer; background: var(--foam); font-size: 22px; }

.lightbox-dialog { max-width: 900px; background: var(--ink); }
.lightbox-body { position: relative; display: grid; place-items: center; min-height: 60vh; padding: 0; }
.lightbox-body img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: #fff2; border: none; color: white; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }
.lightbox-close { position: absolute; top: 14px; right: 14px; background: #fff2; border: none; color: white; width: 38px; height: 38px; border-radius: 50%; font-size: 16px; cursor: pointer; }

/* ---------- Admin users ---------- */
.users-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.users-table th { text-align: left; padding: 10px 8px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.users-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.users-table .user-name-cell { display: flex; align-items: center; gap: 10px; }
.users-table .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.users-table select { padding: 7px 10px; border-radius: 9px; border: 1.5px solid var(--line); font-size: 13px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px); background: var(--ink); color: white; padding: 13px 22px; border-radius: 13px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 100; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #9b3223; }

/* ---------- Profile ---------- */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.profile-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.profile-preview .avatar { width: 56px; height: 56px; font-size: 19px; }
