/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f0e8;
  color: #2c2416;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2c2416;
  color: #f5f0e8;
  padding: 0 20px;
  height: 52px;
  flex-shrink: 0;
  gap: 16px;
}
.navbar-left { display: flex; align-items: center; gap: 10px; }
.navbar-crest { font-size: 20px; }
.navbar-title { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.navbar-right { display: flex; align-items: center; gap: 10px; position: relative; }

#searchInput {
  padding: 6px 12px;
  border: 1px solid #5c4636;
  border-radius: 20px;
  background: #3d2e1e;
  color: #f5f0e8;
  font-size: 13px;
  width: 200px;
  outline: none;
}
#searchInput::placeholder { color: #a08060; }
#searchInput:focus { border-color: #a08060; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid #d0c8b8;
  border-radius: 6px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #1a1008;
  border-bottom: 1px solid #f0ece4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f5f0e8; }
.search-result-item .sex-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sex-dot.male   { background: #4a90d9; }
.sex-dot.female { background: #d96b9a; }
.sex-dot.unknown { background: #aaa; }

/* Buttons */
.btn-primary {
  padding: 7px 16px;
  background: #4a3728;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary:hover { background: #5c4636; }

.btn-outline {
  padding: 6px 14px;
  background: transparent;
  color: #f5f0e8;
  border: 1px solid #5c4636;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-outline:hover { background: #3d2e1e; }
.btn-outline.dark {
  color: #4a3728;
  border-color: #c0b090;
}
.btn-outline.dark:hover { background: #f0ece4; }

.btn-ghost {
  background: transparent;
  border: none;
  color: #f5f0e8;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: inherit;
}
.btn-ghost:hover { background: #3d2e1e; }

.btn-danger {
  padding: 7px 16px;
  background: transparent;
  color: #c0392b;
  border: 1px solid #f0c0c0;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger:hover { background: #fce8e8; }

/* User menu */
.user-menu { position: relative; }
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #d0c8b8;
  border-radius: 6px;
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown button,
.user-dropdown a.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #f0ece4;
  font-size: 13px;
  cursor: pointer;
  color: #2c2416;
  font-family: inherit;
  text-decoration: none;
  box-sizing: border-box;
}
.user-dropdown > *:last-child { border-bottom: none; }
.user-dropdown button:hover,
.user-dropdown a.dropdown-item:hover { background: #f5f0e8; }

/* ── View Tabs ─────────────────────────────────────────────────────────────── */
.view-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: #e8e0d0;
  padding: 6px 16px 0;
  flex-shrink: 0;
  border-bottom: 2px solid #d0c8b8;
}
.tab-spacer { flex: 1; }
.level-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  font-size: 12px;
  color: #8c7b5e;
}
.level-selector select {
  padding: 3px 6px;
  border: 1px solid #c0b090;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: #faf8f4;
  color: #2c2416;
  cursor: pointer;
  outline: none;
}
.tab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  cursor: pointer;
  color: #8c7b5e;
  font-family: inherit;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.tab:hover { color: #4a3728; background: #f0ece4; }
.tab.active { color: #2c2416; background: #f5f0e8; border-bottom-color: #f5f0e8; font-weight: 600; }

/* ── Main Layout ───────────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Tree Container ─────────────────────────────────────────────────────────── */
.tree-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #faf7f2;
  background-image:
    radial-gradient(circle, #d0c8b820 1px, transparent 1px);
  background-size: 28px 28px;
}
.tree-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a08060;
  font-size: 15px;
}

#treeSvg {
  width: 100%;
  height: 100%;
}

/* ── Zoom Controls ─────────────────────────────────────────────────────────── */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zoom-controls button {
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #d0c8b8;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  color: #4a3728;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.1s;
}
.zoom-controls button:hover { background: #f0ece4; }

/* ── Tree Node Styles (SVG) ─────────────────────────────────────────────────── */
.tree-node { cursor: pointer; }
.tree-node rect {
  rx: 6; ry: 6;
  stroke-width: 2;
  transition: filter 0.15s;
}
.tree-node:hover rect { filter: brightness(0.95); }
.tree-node.selected rect { stroke-width: 3; }

.tree-node.male rect   { fill: #eaf3fc; stroke: #4a90d9; }
.tree-node.female rect { fill: #fceef5; stroke: #d96b9a; }
.tree-node.unknown rect { fill: #f5f5f5; stroke: #aaa; }

.tree-node.male.selected rect   { stroke: #1a6ab0; fill: #d0e8fa; }
.tree-node.female.selected rect { stroke: #b04070; fill: #f8d8ea; }
.tree-node.unknown.selected rect { stroke: #666; fill: #e8e8e8; }

.node-name {
  font-size: 12px;
  font-weight: 600;
  fill: #1a1008;
}
.node-years {
  font-size: 10px;
  fill: #8c7b5e;
}
.node-add-btn {
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.tree-node:hover .node-add-btn { opacity: 1; }

.tree-link {
  fill: none;
  stroke: #c0b090;
  stroke-width: 1.5;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #d0c8b8;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #a08060;
  font-size: 13px;
  line-height: 1.6;
}
.sidebar-detail { padding: 20px; }

.person-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e0d0;
}
.person-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
  background: #8c7b5e;
}
.person-avatar.male   { background: #4a90d9; }
.person-avatar.female { background: #d96b9a; }
.person-avatar.has-photo { background: transparent; padding: 0; overflow: hidden; }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
/* Clickable avatar: camera overlay on hover */
.person-avatar[onclick] {
  cursor: pointer;
  position: relative;
}
.person-avatar[onclick]::after {
  content: '📷';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  font-size: 18px;
  line-height: 52px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.person-avatar[onclick]:hover::after { opacity: 1; }

.person-fullname {
  font-size: 16px;
  font-weight: 700;
  color: #1a1008;
  line-height: 1.3;
}
.person-years {
  font-size: 12px;
  color: #8c7b5e;
  margin-top: 2px;
}

.detail-fields { margin-bottom: 16px; }
.detail-field {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.detail-field-label {
  color: #8c7b5e;
  min-width: 80px;
  flex-shrink: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 1px;
}
.detail-field-value { color: #2c2416; }

.detail-family {
  border-top: 1px solid #e8e0d0;
  padding-top: 14px;
  margin-bottom: 16px;
}
.detail-family-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c7b5e;
  margin-bottom: 8px;
}
.family-member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.family-member:hover { color: #4a3728; text-decoration: underline; }
.family-member .sex-dot { flex-shrink: 0; }
.family-role {
  font-size: 10px;
  color: #a08060;
  display: block;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-actions button { flex: 1; min-width: 80px; }

/* Relationship add buttons inside sidebar */
.add-relation-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: none;
  border: 1px dashed #c0b090;
  border-radius: 4px;
  font-size: 12px;
  color: #8c7b5e;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  margin-top: 4px;
  transition: all 0.15s;
}
.add-relation-btn:hover { border-color: #4a3728; color: #4a3728; background: #f5f0e8; }

/* ── All People Panel ───────────────────────────────────────────────────────── */
.all-people-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.all-people-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.people-table th {
  background: #f0ece4;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c7b5e;
  border-bottom: 1px solid #d0c8b8;
}
.people-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0ece4;
  color: #2c2416;
}
.people-table tr:last-child td { border-bottom: none; }
.people-table tr:hover td { background: #faf7f2; }
.people-table .name-cell { font-weight: 600; cursor: pointer; }
.people-table .name-cell:hover { color: #4a3728; text-decoration: underline; }
.people-table .action-cell { text-align: right; }
.people-table .action-cell button {
  padding: 4px 10px;
  font-size: 12px;
  background: none;
  border: 1px solid #d0c8b8;
  border-radius: 3px;
  cursor: pointer;
  color: #4a3728;
  font-family: inherit;
  margin-left: 4px;
}
.people-table .action-cell button:hover { background: #f0ece4; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 560px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.modal.modal-sm { width: 420px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #e8e0d0;
}
.modal-header h2 { font-size: 17px; font-weight: 700; color: #1a1008; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #8c7b5e;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #2c2416; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e8e0d0;
  margin-top: 16px;
}

/* Form */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8c7b5e;
  margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d0c8b8;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  color: #2c2416;
  background: #faf8f4;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #8c7b5e; }
.form-group textarea { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-group-sm { } /* future use */

.error-msg {
  color: #c0392b;
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
}

.relation-dropdown {
  position: relative;
  top: 0;
  left: 0;
}

/* ── Generation labels (SVG) ────────────────────────────────────────────────── */
.gen-label {
  font-size: 11px;
  font-weight: 700;
  fill: #8c7b5e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.gen-label-line {
  stroke: #d0c8b8;
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

/* ── Map Panel ──────────────────────────────────────────────────────────────── */
.map-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #d0c8b8;
  flex-shrink: 0;
  font-size: 13px;
}
.map-legend { display: flex; align-items: center; gap: 6px; color: #4a3728; }
.map-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.map-legend-dot.birth { background: #4a90d9; }
.map-legend-dot.death { background: #c0392b; }
.map-toggle { display: flex; align-items: center; gap: 6px; color: #4a3728; cursor: pointer; }
#geocodeStatus { font-size: 12px; color: #8c7b5e; }

.map-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#leafletMap {
  position: absolute;
  inset: 0;
}

/* ── Map Person Panel (slide-in) ────────────────────────────────────────────── */
.map-person-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: #fff;
  border-left: 1px solid #d0c8b8;
  z-index: 1000;
  overflow-y: auto;
  padding: 16px 20px 20px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.12);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.map-person-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #8c7b5e;
  line-height: 1;
}
.map-person-close:hover { color: #2c2416; }

/* ── Profile photo upload (modal) ───────────────────────────────────────────── */
.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.photo-preview-sm {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #d0c8b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #8c7b5e;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-preview-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-upload-controls { display: flex; gap: 8px; align-items: center; }
.photo-file-name { font-size: 12px; color: #8c7b5e; }
.btn-danger-sm {
  background: none;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.btn-danger-sm:hover { background: #fef0ef; }

/* ── Documents section ───────────────────────────────────────────────────────── */
.detail-docs {
  border-top: 1px solid #e8e0d4;
  padding-top: 14px;
  margin-top: 14px;
}
.detail-docs-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8c7b5e;
  margin-bottom: 10px;
}
.doc-upload-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.doc-type-select {
  flex: 1;
  min-width: 140px;
  padding: 5px 8px;
  border: 1px solid #d0c8b8;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  color: #2c2416;
}
.doc-file-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid #d0c8b8;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: #4a3728;
  white-space: nowrap;
}
.doc-file-label:hover { background: #f5f0e8; }
.doc-upload-btn {
  padding: 5px 12px;
  background: #5a8a5a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.doc-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.doc-upload-btn:hover:not(:disabled) { background: #4a7a4a; }
.doc-list { display: flex; flex-direction: column; gap: 5px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f5f0e8;
  border-radius: 4px;
  font-size: 12px;
}
.doc-item-icon { font-size: 15px; flex-shrink: 0; }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-type { font-weight: 600; color: #4a3728; display: block; }
.doc-item-name { color: #8c7b5e; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item-link { text-decoration: none; }
.doc-item-link:hover .doc-item-name { text-decoration: underline; color: #4a90d9; }
.doc-item-del {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 4px;
  flex-shrink: 0;
  opacity: 0.6;
}
.doc-item-del:hover { opacity: 1; }

/* ── Mobile Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Viewport fix for mobile browser chrome */
  body { height: 100dvh; }

  /* ── Navbar ── */
  .navbar { padding: 0 12px; gap: 8px; height: 48px; }
  .navbar-title { display: none; }
  #searchInput { width: 130px; font-size: 13px; }

  /* ── View tabs ── */
  .view-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding: 4px 10px 0;
    -webkit-overflow-scrolling: touch;
  }
  .view-tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 7px 14px; font-size: 12px; white-space: nowrap; }
  .level-selector { flex-shrink: 0; gap: 4px; }
  .level-selector label { display: none; }

  /* ── Main layout: stack tree on top, sidebar below ── */
  .main-layout { flex-direction: column; }
  .tree-container { flex: 1; min-height: 0; }
  .sidebar {
    width: 100%;
    height: 260px;
    max-height: 260px;
    flex-shrink: 0;
    border-left: none;
    border-top: 2px solid #d0c8b8;
    overflow-y: auto;
  }
  .sidebar-detail { padding: 14px; }
  .person-header { gap: 10px; margin-bottom: 12px; padding-bottom: 12px; }
  .person-avatar { width: 44px; height: 44px; font-size: 18px; }
  .person-fullname { font-size: 14px; }
  .detail-actions { gap: 6px; }
  .detail-actions button { padding: 7px 10px; font-size: 12px; }

  /* ── Zoom controls: bigger touch targets ── */
  .zoom-controls { bottom: 14px; right: 14px; }
  .zoom-controls button { width: 42px; height: 42px; font-size: 20px; }

  /* ── Map toolbar ── */
  .map-toolbar { flex-wrap: wrap; gap: 8px; font-size: 12px; padding: 6px 12px; }

  /* ── Map person panel: full-width bottom sheet ── */
  .map-person-panel {
    width: 100%;
    height: 56%;
    top: auto;
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: 2px solid #d0c8b8;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.14);
  }

  /* ── User dropdown ── */
  .user-dropdown { min-width: 190px; }
}

@media (max-width: 480px) {
  .navbar { height: 46px; }
  #searchInput { width: 100px; }
  .navbar-crest { font-size: 18px; }
  .sidebar { height: 280px; max-height: 280px; }
  .person-header { flex-wrap: nowrap; }
  /* Horizontal scroll hint on tree node SVG */
  .tree-hint { font-size: 13px; }
}

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #2c2416;
  color: #f5f0e8;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 1000;
  transition: transform 0.25s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #c0392b; }
