:root {
  --accent: #ff4d5a;
  --accent-dark: #e63946;
  --bg: #ffffff;
  --bg-soft: #fff7f4;
  --ink: #2b2d33;
  --ink-soft: #6b7280;
  --line: #f0e4e0;
  --shadow: 0 8px 28px rgba(43, 45, 51, 0.14);
  --radius: 14px;
  --sidebar-w: 360px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  /* Noto Color Emoji supplies flag glyphs, which Windows system fonts lack */
  font-family: "Nunito", system-ui, -apple-system, "Noto Color Emoji", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

#app {
  display: flex;
  height: 100%;
}

/* ---------- Sidebar ---------- */

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  z-index: 1000;
}

.brand {
  padding: 22px 20px 14px;
  background: linear-gradient(135deg, #fff1ee 0%, #ffe3e6 100%);
  border-bottom: 1px solid var(--line);
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand h1 span { color: var(--accent); }
.brand h1 em { font-style: normal; font-size: 22px; }

.brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

/* Hidden until renderTagline() sets the final text, so the HTML default never
   flashes before the random pick. Space stays reserved (no layout jump). */
#brandTagline { visibility: hidden; }

#accountBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 0;
}

#accountBar[hidden] { display: none; }

#accountBar .acct-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

#accountBar .wide { width: 100%; }

#accountBar { flex-wrap: wrap; }

.map-switcher {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-soft);
  cursor: pointer;
  outline: none;
}

.map-switcher:focus { border-color: var(--accent); }

.searchbox {
  position: relative;
  padding: 14px 16px 8px;
}

.searchbox-icon {
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(calc(-50% + 3px));
  font-size: 14px;
  pointer-events: none;
  opacity: 0.6;
}

.searchbox input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: var(--bg-soft);
  transition: border-color 0.15s;
}

.searchbox input:focus { border-color: var(--accent); background: #fff; }

/* One always-single-row chip strip: scrolls horizontally instead of wrapping,
   so filters never eat more than ~45px of sidebar height. */
#chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;             /* Firefox */
}

#chips::-webkit-scrollbar { display: none; }

/* Edge fades hint that there are more chips off-screen */
#chips.fade-right {
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

#chips.fade-left {
  mask-image: linear-gradient(to right, transparent, #000 28px);
}

#chips.fade-left.fade-right {
  mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

.chip {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Place list ---------- */

#placeList {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

#placeList .empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

#placeList .empty strong { color: var(--ink); }

.place-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}

.place-item:hover { background: var(--bg-soft); }

.place-item .dot {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, 0.55);
}

.place-item .meta { min-width: 0; }

.place-item .meta strong {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-item .meta strong .fav { color: var(--accent); margin-left: 4px; }

.place-item .sub {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-item .sub .rating { color: #f5a623; letter-spacing: 1px; }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 700;
}

.io { display: flex; gap: 6px; }

.build-info {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-soft);
  opacity: 0.7;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

button { font-family: inherit; }

.ghost {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.ghost:hover { border-color: var(--accent); color: var(--accent); }

.primary {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.primary:hover { background: var(--accent-dark); }

.danger {
  border: 1.5px solid #fecaca;
  background: #fff;
  color: #dc2626;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.danger:hover { background: #fef2f2; }

/* ---------- Map area ---------- */

#mapwrap { position: relative; flex: 1; min-width: 0; }

#map { position: absolute; inset: 0; }

.fab-row {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  gap: 10px;
}

.fab {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 14px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.15s;
  white-space: nowrap;
}

.fab:hover { background: var(--accent-dark); transform: translateY(-2px); }

.fab-secondary { background: #fff; color: var(--ink); }
.fab-secondary:hover { background: var(--bg-soft); }

.locate {
  position: absolute;
  right: 14px;
  bottom: 26px;
  z-index: 800;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #fff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.locate:hover { background: var(--bg-soft); }

#pickBanner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

#pickBanner button {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#pickBanner button:hover { background: rgba(255, 255, 255, 0.32); }

#pickBanner[hidden] { display: none; }

#sharedBanner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: #1e3a8a;
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sharedBanner[hidden] { display: none; }

/* Read-only shared view: hide everything that mutates the map */
body.readonly #addBtn,
body.readonly #importBtn,
body.readonly #accountBar { display: none; }

/* Viewing a friend's map (read-only, but still signed in so the account bar
   and map switcher stay): hide the place-adding controls. */
body.viewing-friend #addBtn,
body.viewing-friend #importBtn { display: none; }

/* A friend request awaiting my answer puts a dot on the 👥 button. */
#friendsBtn.has-pending { position: relative; }
#friendsBtn.has-pending::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #fff;
}

#mapwrap.picking #map { cursor: crosshair; }

/* While picking, pins must not swallow map clicks */
#mapwrap.picking .leaflet-marker-icon { pointer-events: none !important; }

/* ---------- Map pins ---------- */

.pin-icon { background: none; border: none; }

.pin {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

.pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top: 9px solid var(--c, var(--accent));
  border-bottom: none;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.2));
}

/* ---------- Leaflet popup ---------- */

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.leaflet-popup-content { margin: 14px 16px; font-family: inherit; }

.popup { min-width: 200px; max-width: 240px; }

.popup h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 900;
}

.popup .cat-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.popup .cat-line {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--c, var(--accent));
  border-radius: 999px;
  padding: 2px 9px;
}

/* Light colors (e.g. white): dark text + visible outline instead of white-on-white */
.popup .cat-line.light {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.pin.light { border-color: #94a3b8; }

.dot.light,
.cat-swatch.light {
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.2);
}

.cat-option.light.active {
  color: var(--ink);
  border-color: #94a3b8;
}

.popup .rating { color: #f5a623; font-size: 14px; letter-spacing: 2px; margin-bottom: 4px; }

.popup .tags { margin: 4px 0; display: flex; flex-wrap: wrap; gap: 4px; }

.popup .tag {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 1.5px 8px;
}

.popup .note {
  font-size: 13px;
  color: var(--ink);
  margin: 6px 0;
  line-height: 1.45;
}

.popup .addr { font-size: 11.5px; color: var(--ink-soft); margin: 4px 0 8px; line-height: 1.4; }

.popup .actions { display: flex; gap: 6px; margin-top: 8px; }

.popup .actions button {
  flex: 1;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-soft);
}

.popup .actions button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Modal ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 45, 51, 0.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay[hidden] { display: none; }

.modal {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal h2 { margin: 0 0 16px; font-size: 21px; font-weight: 900; }

.field { display: block; margin-bottom: 14px; }
.field[hidden] { display: none; }

.field > span {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  margin-bottom: 5px;
  color: var(--ink);
}

.field small { font-weight: 600; color: var(--ink-soft); }

.field input,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s;
  resize: vertical;
}

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

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 42px; }
.pass-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.pass-toggle:hover { opacity: 1; }
.pass-toggle[aria-pressed="true"] { opacity: 1; }

.addr-field { position: relative; }

#addrResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 180px;
  overflow-y: auto;
}

#addrResults .addr-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

#addrResults .addr-option:last-child { border-bottom: none; }
#addrResults .addr-option:hover { background: var(--bg-soft); }

.loc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
}

.coords { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.coords.set { color: #16a34a; }

.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; }

.cat-option {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.cat-option.active {
  border-color: var(--c, var(--accent));
  background: var(--c, var(--accent));
  color: #fff;
}

.field-row { display: flex; gap: 20px; }
.field-row .field { flex: 1; min-width: 0; }

.price-picker { display: flex; gap: 6px; }

.price-option {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 7px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}

.price-option:hover { border-color: #16a34a; color: #16a34a; }

.price-option.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.price { color: #16a34a; font-weight: 800; }

.stars { display: flex; gap: 2px; }

.stars button {
  border: none;
  background: none;
  font-size: 26px;
  cursor: pointer;
  color: #d6d3d1;
  padding: 0 2px;
  transition: transform 0.1s;
}

.stars button:hover { transform: scale(1.15); }
.stars button.lit { color: #f5a623; }

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .spacer { flex: 1; }

/* ---------- Category manager ---------- */

.chip-manage { border-style: dashed; }

#catList {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  max-height: 290px;
  overflow-y: auto;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.cat-row:last-child { border-bottom: none; }

.cat-swatch {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.cat-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.cat-icon-btn,
.cat-del {
  border: none;
  background: none;
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
}

.cat-del:hover { background: #fef2f2; color: #dc2626; }
.cat-edit:hover { background: var(--bg-soft); color: var(--accent); }
.cat-save { color: #16a34a; font-weight: 800; }
.cat-save:hover { background: #f0fdf4; }
.cat-cancel:hover { background: var(--bg-soft); color: var(--ink); }

.cat-row-editing .cat-edit-name {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
}

.cat-row-editing .cat-edit-name:focus { border-color: var(--accent); }

.cat-row-editing input[type="color"] {
  width: 36px;
  min-width: 36px;
  height: 34px;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.cat-add-row { display: flex; align-items: center; gap: 8px; }

.cat-add-row input {
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.cat-add-row input:focus { border-color: var(--accent); }
.cat-add-row #cLabel { flex: 1; min-width: 0; }

.emoji-wrap { position: relative; }

#cEmojiBtn {
  width: 44px;
  height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: border-color 0.15s;
}

#cEmojiBtn:hover { border-color: var(--accent); }

#emojiPop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 272px;
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}

#emojiPop[hidden] { display: none; }

.emoji-sec {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 8px 0 4px;
}

.emoji-sec:first-child { margin-top: 0; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-grid button {
  border: none;
  background: none;
  font-size: 18px;
  padding: 4px 0;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.emoji-grid button:hover { background: var(--bg-soft); }

.cat-add-row input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

/* ---------- Account & sharing ---------- */

.modal-sm { max-width: 400px; }

.modal-hint,
.share-hint {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0 0 14px;
}

.auth-error {
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  margin: -4px 0 10px;
}

.auth-toggle {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}

.auth-toggle a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.auth-toggle a:hover { text-decoration: underline; }

.settings-section { margin: 0; }
.settings-section .field { margin-bottom: 10px; }

.settings-actions {
  display: flex;
  justify-content: flex-end;
}

.settings-actions .primary {
  padding: 8px 16px;
  font-size: 13px;
}

.share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.share-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  outline: none;
}

.share-row input:focus { border-color: var(--accent); }

.share-sub {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 900;
}

.share-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0 14px;
}

.collab-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.collab-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--line);
}

.collab-list li:last-child { border-bottom: none; }

.collab-email {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collab-email small { font-weight: 600; color: var(--ink-soft); }

/* Friend-row action cluster (accept / make editor / remove). */
.friend-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.friend-actions small { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.mini-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 9px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Toast ---------- */

#toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  max-width: 90vw;
  text-align: center;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- Sidebar toggle (mobile) ---------- */

#sidebarToggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1500;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: #fff;
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  #sidebarToggle { display: block; }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease-out;
    box-shadow: var(--shadow);
    width: min(var(--sidebar-w), 86vw);
    min-width: 0;
  }

  #sidebar.open { transform: translateX(0); }

  .brand { padding-left: 68px; }

  .fab { padding: 12px 16px; font-size: 13.5px; }
}
