/* ==========================================================================
   beermap — "Taproom Ledger": warm charcoal, cream ink, amber signal.
   Hairline rules, tight radii, grain. Dark default, light = paper.
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #0e0c0a;
  --card: #17140f;
  --card-alt: #1e1a14;
  --input: #26211a;
  --accent: #ffb300;
  --on-accent: #1a1200;
  --accent-dim: #7a5900;
  --text: #f4ecdc;
  --text-dim: #a89f8d;
  --danger: #ff6b6f;
  --success: #4cc46f;
  --border: #322b21;
  --nav-bg: rgba(18,15,11,0.94);
  --glass-bg: rgba(23,20,15,0.92);
  --glass-border: var(--border);
  --topbar-gradient: linear-gradient(180deg, rgba(14,12,10,0.85) 0%, rgba(14,12,10,0) 100%);
  --auth-glow: #1f1708;
  --pin-shadow: 0 2px 6px rgba(0,0,0,0.25);
  --pin-border: rgba(255,255,255,0.25);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .9  0 0 0 0 .7  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-height: 74px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur: 0.18s;
  --font-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  --bg: #f6f0e3;
  --card: #fffaf0;
  --card-alt: #f0e8d6;
  --input: #ebe2cd;
  --accent: #b36b00;
  --on-accent: #ffffff;
  --accent-dim: #e8c06a;
  --text: #1c1710;
  --text-dim: #5e5545;
  --danger: #c4282d;
  --success: #1f7a3a;
  --border: #d6cbb2;
  --nav-bg: rgba(255,250,240,0.94);
  --glass-bg: rgba(255,250,240,0.94);
  --glass-border: var(--border);
  --topbar-gradient: linear-gradient(180deg, rgba(246,240,227,0.88) 0%, rgba(246,240,227,0) 100%);
  --auth-glow: #f9e7b8;
  --pin-shadow: 0 2px 8px rgba(0,0,0,0.18);
  --pin-border: rgba(0,0,0,0.12);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .2  0 0 0 0 .15  0 0 0 0 .05  0 0 0 .08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

h1, h2, h3, .section-title, .pin-detail-name, .list-row-title, .pin-popup-beer {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* Keyboard focus: visible, high contrast, never on mouse/touch */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline-offset: 0; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 10000;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

a { color: var(--accent); text-decoration: none; }

::-webkit-scrollbar { width: 0; height: 0; }

img { max-width: 100%; display: block; }

/* -------------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------------- */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* -------------------------------------------------------------------------
   Auth screen
   ------------------------------------------------------------------------- */
#auth-screen {
  position: fixed;
  inset: 0;
  background: var(--grain), radial-gradient(ellipse 80% 50% at 0% 0%, var(--auth-glow) 0%, var(--bg) 70%);
  display: flex;
  flex-direction: column;
  padding: 32px 24px calc(32px + var(--safe-bottom));
  z-index: 500;
  overflow-y: auto;
}

.auth-brand {
  text-align: left;
  max-width: 380px;
  width: 100%;
  margin: auto auto 0;
  margin-bottom: 36px;
}

.auth-brand .logo-icon {
  margin-left: 0 !important;
  font-size: 56px;
  display: block;
  margin-bottom: 8px;
  width: 56px;
  height: 56px;

  /* 1. Define your two-tone gradient */
  background: linear-gradient(to bottom, var(--text) 38%, var(--accent) 38%);

  /* 2. Clip the background to the shape of the icon mask */
  -webkit-mask: url('/icons/lucide/beer.svg') no-repeat center / contain;
  mask: url('/icons/lucide/beer.svg') no-repeat center / contain;

  /* 3. Make the default text color transparent so the background shines through */
  color: transparent;

  margin-left: auto;
  margin-right: auto;
}

.auth-brand h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  margin: 0;
}

.auth-brand p {
  color: var(--text-dim);
  margin: 6px 0 0;
  font-size: 14px;
}

.auth-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
}

.auth-tabs {
  display: flex;
  background: var(--input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.auth-tab.active {
  background: var(--accent);
  color: var(--on-accent);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input, .field textarea, .field select {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

.field textarea { resize: none; min-height: 70px; }

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease), opacity var(--dur) var(--ease), background var(--dur) var(--ease);
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: var(--on-accent); width: 100%; }
.btn-secondary { background: var(--input); color: var(--text); width: 100%; }
.btn-danger { background: rgba(255, 90, 95, 0.14); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.auth-error {
  background: rgba(255, 90, 95, 0.12);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-error.show { display: block; }

.auth-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 16px;
}

/* Icon alignment fixes */
.icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}
/* Icon alignment fixes */
.icon-mask {
  user-select: none;
  pointer-events: none;
}

.nav-btn .icon-mask {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.nav-btn-add .icon-mask {
  width: 28px;
  height: 28px;
  color: var(--on-accent);
}

.search-pill .icon-mask {
  margin-right: 6px;
  opacity: 0.6;
}

/* -------------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------------- */
#top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: calc(14px + var(--safe-top)) 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  background: var(--topbar-gradient);
}

#top-bar > * { pointer-events: auto; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 19px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.12s var(--ease);
}
.icon-btn:active { transform: scale(0.92); }

.search-pill {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
  display: none;
}
.badge-dot.show { display: block; }

/* -------------------------------------------------------------------------
   Map
   ------------------------------------------------------------------------- */
#map-view {
  position: absolute;
  inset: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #111;
  z-index: 1;
}

.leaflet-container { background: #111 !important; font-family: inherit; }
.leaflet-control-attribution { display: none !important; }
.leaflet-control-zoom { display: none !important; }

.beer-pin {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid var(--pin-border);
  box-shadow: var(--pin-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.beer-pin span { transform: rotate(45deg); font-size: 15px; }

.user-location-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #4c8dff;
  border: 3px solid white;
  box-shadow: 0 0 0 6px rgba(76,141,255,0.25);
}

.locate-btn {
  position: absolute;
  right: 14px;
  bottom: calc(var(--nav-height) + 100px + var(--safe-bottom));
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
}

.locate-btn [data-icon="target"],
.locate-btn .icon-mask {
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-pin-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  z-index: 40;
  pointer-events: none;
  font-size: 34px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
  display: none;
}
.drop-pin-hint.show { display: block; }

/* -------------------------------------------------------------------------
   Bottom navigation
   ------------------------------------------------------------------------- */
#bottom-nav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
  flex: 1;
  justify-content: center;
}

.nav-btn .nav-icon { font-size: 21px; }
.nav-btn.active { color: var(--accent); }

.nav-btn-add {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin-top: -22px;
  box-shadow: 0 6px 18px rgba(255,179,0,0.4);
  border: 4px solid var(--bg);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
  position: relative;
}

.nav-btn-add [data-icon="plus"],
.nav-btn-add .icon-mask {
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn-add:active { transform: scale(0.94); }

/* -------------------------------------------------------------------------
   Sheets (sliding bottom panels)
   ------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 101;
  background: var(--grain), var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(105%);
  transition: transform 0.26s var(--ease);
  border: 1px solid var(--border);
  border-bottom: none;
  will-change: transform;
}
.sheet.show { transform: translateY(0); }

.sheet.sheet-full { max-height: 94vh; }

.sheet-handle {
  width: 38px; height: 5px;
  background: var(--border);
  border-radius: 4px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.sheet-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--input);
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-body {
  overflow-y: auto;
  padding: 16px 20px calc(24px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-footer {
  padding: 12px 20px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Cards / lists
   ------------------------------------------------------------------------- */
.card {
  background: var(--card-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

.list-row-main { flex: 1; min-width: 0; }
.list-row-title {
  font-weight: 700; font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row-sub {
  font-size: 12.5px; color: var(--text-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row > .btn,
.list-row > button {
  flex-shrink: 0;
  white-space: nowrap;
  width: auto;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 10px; }
.empty-state p { margin: 4px 0 0; font-size: 13.5px; }

/* -------------------------------------------------------------------------
   Segmented control / chips
   ------------------------------------------------------------------------- */
.segmented {
  display: flex;
  background: var(--input);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.segmented button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 9px 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.segmented button.active { background: var(--accent); color: var(--on-accent); }

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.chip {
  flex-shrink: 0;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* -------------------------------------------------------------------------
   Color swatches
   ------------------------------------------------------------------------- */
.color-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.color-swatch.active { border-color: white; transform: scale(1.12); }

/* -------------------------------------------------------------------------
   Pin popup (Leaflet)
   ------------------------------------------------------------------------- */
.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.leaflet-popup-content { margin: 0; width: 230px !important; }
.leaflet-popup-tip { background: var(--card); }

.pin-popup-photo {
  width: 100%; height: 120px;
  object-fit: cover;
  background: var(--input);
}
.pin-popup-body { padding: 12px 14px; }
.pin-popup-beer { font-weight: 800; font-size: 15px; }
.pin-popup-meta { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.pin-popup-user { color: var(--accent); font-weight: 600; font-size: 12.5px; margin-top: 6px; }
.pin-popup-stats {
  display: flex; gap: 12px; margin-top: 8px;
  font-size: 12px; color: var(--text-dim);
}
.pin-popup-open {
  margin-top: 10px;
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   Pin detail sheet
   ------------------------------------------------------------------------- */
.pin-detail-photo {
  width: 100%; height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--input);
  margin-bottom: 14px;
}
.pin-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pin-detail-name { font-weight: 800; font-size: 20px; }
.pin-detail-abv {
  background: var(--input); color: var(--accent);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.pin-detail-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 14px; line-height: 1.5; }

/* Dual-capture (BeReal-style) media: a main shot/clip with a smaller PIP
   shot/clip overlaid in the corner. Tapping the PIP swaps which one is "main". */
.dual-media { position: relative; }
.dual-media .dual-main {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.dual-media .dual-pip {
  position: absolute;
  left: 4%;
  bottom: 4%;
  width: 32%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  cursor: pointer;
  z-index: 2;
}

.pin-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.action-btn {
  flex: 1;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 0;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.action-btn.liked { color: var(--danger); border-color: rgba(255,90,95,0.4); background: rgba(255,90,95,0.08); }

.comment-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-bubble { flex: 1; }
.comment-user { font-weight: 700; font-size: 13px; }
.comment-text { font-size: 13.5px; margin-top: 2px; color: #e8e8ea; }
.comment-time { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.comment-delete { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; }

.comment-input-row {
  display: flex; gap: 8px; align-items: center;
}
.comment-input-row input {
  flex: 1;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.comment-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.visibility-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 12px; letter-spacing: 0.4px;
}
.visibility-badge.public { background: rgba(52,199,89,0.14); color: var(--success); }
.visibility-badge.friends { background: rgba(255,179,0,0.14); color: var(--accent); }
.visibility-badge.private { background: rgba(255,90,95,0.14); color: var(--danger); }

/* -------------------------------------------------------------------------
   Profile
   ------------------------------------------------------------------------- */
.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-header > div[style*="flex:1"] { min-width: 0; }
.profile-header > .btn,
.profile-header > .icon-btn { flex-shrink: 0; }
.profile-name {
  font-size: 20px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-sub {
  color: var(--text-dim); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.stat-clickable {
  cursor: pointer;
  transition: transform 0.12s var(--ease), border-color var(--dur) var(--ease);
}
.stat-clickable:active { transform: scale(0.96); }
.stat-clickable:hover { border-color: var(--accent); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.3px; }

.section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin: 18px 0 10px;
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pin-grid-item {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--input);
  position: relative;
  cursor: pointer;
}
.pin-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.pin-grid-item .no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* -------------------------------------------------------------------------
   Notification list
   ------------------------------------------------------------------------- */
.notif-item {
  display: flex; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: rgba(255,179,0,0.04); margin: 0 -20px; padding: 13px 20px; }
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--input);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-text { font-size: 13.5px; }
.notif-time { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

/* -------------------------------------------------------------------------
   Toast
   ------------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-alt);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  max-width: 85vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------------------------------------------------------------------------
   Loading
   ------------------------------------------------------------------------- */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------------------
   Misc form helpers
   ------------------------------------------------------------------------- */
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.muted { color: var(--text-dim); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }

.photo-upload {
  width: 100%; height: 140px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  background: var(--input);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}
.photo-upload img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.photo-upload .icon { font-size: 26px; margin-bottom: 4px; }

#media-preview-wrap {
  position: relative;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--input);
}
#media-preview-img, #media-preview-video {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
#btn-media-remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  z-index: 3;
}

.beer-suggestions {
  max-height: 160px;
  overflow-y: auto;
  background: var(--input);
  border-radius: var(--radius-sm);
  margin-top: -8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  display: none;
}
.beer-suggestions.show { display: block; }
.beer-suggestion-item {
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.beer-suggestion-item:last-child { border-bottom: none; }
.beer-suggestion-item:active { background: var(--card-alt); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}
.switch-row-label { font-size: 14px; font-weight: 600; }
.switch-row-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }

.toggle {
  width: 46px; height: 28px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform var(--dur) var(--ease);
}
.toggle.on::after { transform: translateX(18px); }

.label-scan-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-dim);
  transition: opacity 0.2s;
}
.label-scan-status.hidden { display: none; }
.label-scan-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}
.label-scan-status .label-scan-check {
  color: var(--accent);
  font-weight: 600;
}

@keyframes spin { to { transform: rotate(360deg); } }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  text-transform: uppercase;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.friend-req-actions { display: flex; gap: 8px; }
.friend-req-actions button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.friend-req-accept { background: rgba(52,199,89,0.14); color: var(--success); }
.friend-req-decline { background: rgba(255,90,95,0.14); color: var(--danger); }

.admin-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .auth-card { max-width: 380px; width: 100%; margin: 0 auto; }
  .sheet { max-width: 480px; margin: 0 auto; left: 0; right: 0; }
}

/* -------------------------------------------------------------------------
   In-app camera
   ------------------------------------------------------------------------- */
.sheet-camera {
  background: #000;
  border: none;
  border-radius: 0;
  max-height: 100vh;
  z-index: 200;
}
#camera-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}
#camera-video, #camera-preview-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  pointer-events: none; /* FIX: Don't block clicks to buttons */
}
#camera-video.mirrored, #camera-pip-img.mirrored { transform: scaleX(-1); }
#camera-canvas { display: none; }
#camera-review-pip { bottom: 130px; z-index: 8; }

#camera-pip-wrap {
  position: absolute;
  left: 14px;
  top: calc(84px + var(--safe-top));
  width: 96px; height: 128px;
  border-radius: 14px;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 5;
}
#camera-pip-img { position: static; width: 100%; height: 100%; object-fit: cover; }

#camera-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(rgba(0,0,0,0.55), transparent);
  z-index: 6;
}
#camera-top-bar .icon-btn {
  background: rgba(30,30,32,0.6);
  backdrop-filter: blur(6px);
}
.camera-mode-segmented {
  background: rgba(30,30,32,0.55);
  backdrop-filter: blur(6px);
}

#camera-dual-row {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 132px;
  z-index: 6;
}
#camera-dual-row .camera-dual-toggle-row {
  background: rgba(22,22,24,0.72);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
#camera-dual-row.hidden { display: none; }

#camera-status {
  position: absolute;
  top: calc(70px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,90,95,0.9);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  z-index: 6;
  display: flex; align-items: center; gap: 6px;
}
#camera-status .rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

#camera-bottom-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 24px calc(28px + var(--safe-bottom));
  display: flex; align-items: center; justify-content: center;
  gap: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  z-index: 6;
  pointer-events: auto; /* FIX: Ensure this layer captures clicks */
}
#btn-camera-shutter {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 4px solid #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
  z-index: 7; /* FIX: Ensure button is above gradient */
  position: relative;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
#camera-shutter-inner {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
#btn-camera-shutter.is-recording {
  border-color: var(--danger);
  background: rgba(255,90,95,0.2);
}
#btn-camera-shutter.is-recording #camera-shutter-inner {
  width: 29px; height: 29px;
  border-radius: 4px;
  background: var(--danger);
}
#camera-bottom-bar .btn { 
  flex-shrink: 0;
  z-index: 7; /* FIX: Ensure buttons are above gradient */
}
#btn-camera-retake, #btn-camera-use { 
  position: static; /* FIX: Changed from absolute for proper flex layout */
  z-index: 7;
  flex: 1;
  max-width: 120px;
}
#btn-camera-retake { margin-left: auto; }
#btn-camera-use { margin-right: auto; }

/* -------------------------------------------------------------------------
   Photo Viewer Modal (for enlarged pin photos)
   ------------------------------------------------------------------------- */
.photo-viewer-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.photo-viewer-backdrop.active {
  display: block;
}

.photo-viewer-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1001;
  padding: 0;
  margin: 0;
  background: rgba(0,0,0,0.98);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.photo-viewer-modal.active {
  display: flex;
}

.photo-viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

#photo-viewer-media {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#photo-viewer-media img, #photo-viewer-media video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.photo-viewer-close {
  position: absolute;
  top: var(--safe-top);
  right: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
}

.photo-viewer-close:active {
  background: rgba(255,255,255,0.35);
}

/* -------------------------------------------------------------------------
   Nomination lock
   ------------------------------------------------------------------------- */
.nominate-locked-hint {
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.nomination-reply-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,179,0,0.1);
  border: 1px solid rgba(255,179,0,0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.nomination-reply-banner .emoji { font-size: 22px; }

/* -------------------------------------------------------------------------
   Leaderboard
   ------------------------------------------------------------------------- */
.leaderboard-row.is-me { background: rgba(255,179,0,0.06); margin: 0 -20px; padding: 12px 20px; border-radius: 12px; }
.leaderboard-rank {
  width: 34px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
  color: var(--text-dim);
}

/* -------------------------------------------------------------------------
   Achievements
   ------------------------------------------------------------------------- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.achievement-badge {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
}
.achievement-badge.locked { opacity: 0.4; filter: grayscale(0.6); }
.achievement-badge.unlocked { border-color: var(--accent); background: rgba(255,179,0,0.08); }
.achievement-emoji { font-size: 26px; margin-bottom: 4px; }
.achievement-name { font-size: 10.5px; font-weight: 700; line-height: 1.25; }
.achievement-progress { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

.achievements-list { display: flex; flex-direction: column; gap: 10px; }
.achievement-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.achievement-row.locked { opacity: 0.55; }
.achievement-row.unlocked { border-color: var(--accent); background: rgba(255,179,0,0.08); }
.achievement-row-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
}
.achievement-row-icon .icon-mask {
  width: 24px;
  height: 24px;
}
.achievement-row-main { flex: 1; min-width: 0; }
.achievement-row-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.achievement-row-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.achievement-row-progress { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.achievement-row-bar { height: 5px; border-radius: 3px; background: var(--input); margin-top: 4px; overflow: hidden; }
.achievement-row-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.achievement-row-check { font-size: 18px; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   Video badge on grid thumbnails
   ------------------------------------------------------------------------- */
.pin-grid-video-badge {
  position: absolute; right: 6px; bottom: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.pin-grid-item { display: block; }

/* -------------------------------------------------------------------------
   Drinking graph
   ------------------------------------------------------------------------- */
.drinking-graph-wrap { margin-bottom: 20px; }
.drinking-graph-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 84px;
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px 6px;
}
.drinking-graph-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.drinking-graph-bar {
  width: 100%;
  max-width: 14px;
  border-radius: 4px 4px 2px 2px;
  background: var(--input);
  min-height: 3px;
}
.drinking-graph-bar.has-chug { background: var(--accent); }
.drinking-graph-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  padding: 0 2px;
}

/* -------------------------------------------------------------------------
   Map theme select (settings)
   ------------------------------------------------------------------------- */
.theme-select-row { margin-bottom: 18px; }

/* -------------------------------------------------------------------------
   Map theme — light overrides for chrome elements
   (now handled via CSS variables --glass-bg, --nav-bg, --topbar-gradient)
   ------------------------------------------------------------------------- */

/* -------------------------------------------------------------------------
   Streak badges
   ------------------------------------------------------------------------- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
}

.streak-badge.sober {
  background: rgba(52,199,89,0.2);
  color: var(--success);
}

/* -------------------------------------------------------------------------
   Streak detail
   ------------------------------------------------------------------------- */
.streak-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.streak-detail-card {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}
.streak-detail-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
}
.streak-detail-label {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}
.streak-detail-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.4;
}

/* -------------------------------------------------------------------------
   Star rating
   ------------------------------------------------------------------------- */
.star-rating {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.star-rating .star {
  font-size: 26px;
  cursor: pointer;
  color: var(--border);
  transition: color var(--dur) var(--ease), transform 0.12s var(--ease);
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.star-rating .star.active {
  color: var(--accent);
}
.star-rating .star:active {
  transform: scale(1.2);
}

/* -------------------------------------------------------------------------
   Game cards
   ------------------------------------------------------------------------- */
.game-card-active {
  border-color: var(--accent) !important;
  background: rgba(255,179,0,0.06) !important;
}

/* -------------------------------------------------------------------------
   Auth: divider, Google button, forgot password
   ------------------------------------------------------------------------- */
.auth-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 24px);
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.btn-google {
  background: var(--input);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.btn-google:hover {
  background: var(--card);
  border-color: var(--text-dim);
}

#btn-forgot-password {
  margin-top: 8px;
  font-size: 13px;
  padding: 6px;
}

/* -------------------------------------------------------------------------
   Account settings
   ------------------------------------------------------------------------- */
.settings-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--input);
  border-radius: var(--radius);
  margin-bottom: 6px;
}
.settings-account-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.settings-account-label .icon-mask {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  flex-shrink: 0;
}
.settings-account-title {
  font-weight: 600;
  font-size: 14px;
}
.settings-account-sub {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-email-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 179, 0, 0.12);
  border: 1px solid rgba(255, 179, 0, 0.3);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.settings-email-banner .icon-mask {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}
.settings-email-banner > div {
  flex: 1;
  min-width: 0;
}

/* -------------------------------------------------------------------------
   Sheet description text
   ------------------------------------------------------------------------- */
.sheet-description {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* -------------------------------------------------------------------------
   Success messages (matching auth-error style)
   ------------------------------------------------------------------------- */
.auth-success {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.auth-success.show { display: block; }

/* -------------------------------------------------------------------------
   Reduced motion: no movement, instant state changes
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------
   Legal footer + consent
   ------------------------------------------------------------------------- */
.legal-footer { max-width: 380px; width: 100%; margin: 28px auto auto; }
.legal-footer nav, .legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.legal-footer a, .legal-links a, .link-btn, .auth-hint a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.auth-hint a { color: var(--text); }
.link-btn { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }
.legal-footer a:hover, .legal-links a:hover, .link-btn:hover { color: var(--accent); }
.search-pill { font: inherit; font-size: 14px; text-align: left; }

#consent {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  max-width: 560px;
  margin-inline: auto;
  z-index: 10000;
  background: var(--grain), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
#consent.show { opacity: 1; transform: none; }
#consent h2 { margin: 0 0 6px; font-size: 18px; font-family: var(--font-display); }
#consent p { margin: 0 0 12px; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
#consent p a { color: var(--text); }
.consent-opt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; font-weight: 600; padding: 6px 0; }
.consent-opt input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; align-self: center; }
.consent-opt span { color: var(--text-dim); font-weight: 400; font-size: 12.5px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.consent-actions .btn { flex: 1 1 140px; width: auto; padding: 12px 14px; font-size: 14px; }

/* -------------------------------------------------------------------------
   Editorial layout: asymmetric auth, ruled sheet headers
   ------------------------------------------------------------------------- */
.sheet-header { border-left: 3px solid var(--accent); padding-left: 17px; }
.sheet-header h2 { text-transform: lowercase; letter-spacing: -0.02em; }

@media (min-width: 900px) {
  #auth-screen {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: "brand card" "foot card";
    column-gap: clamp(32px, 6vw, 96px);
    padding: clamp(32px, 6vw, 80px);
    background:
      repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--accent) 7%, transparent) 22px 23px),
      var(--grain), var(--bg);
  }
  .auth-brand { grid-area: brand; align-self: end; max-width: none; margin: 0; padding-bottom: 24px; }
  .auth-brand h1 { font-size: clamp(72px, 11vw, 168px); line-height: 0.88; margin-bottom: 16px; }
  .auth-brand p { font-size: clamp(16px, 1.6vw, 22px); max-width: 28ch; }
  .auth-card { grid-area: card; align-self: center; margin: 0; max-width: none; }
  .legal-footer { grid-area: foot; margin: 0; max-width: none; align-self: end; }
}
