:root {
  /* brand */
  --primary: #0e4a59;
  --primary-hover: #0b3b47;
  --primary-soft: rgba(14, 74, 89, 0.08);
  --primary-soft-hover: rgba(14, 74, 89, 0.14);

  /* neutrals */
  --neutral-50:  #f7f8fa;
  --neutral-100: #eef0f3;
  --neutral-200: #e2e6eb;
  --neutral-300: #cdd3da;
  --neutral-500: #6b7785;
  --neutral-700: #374151;
  --neutral-900: #0f172a;

  /* surfaces — photo backdrop stays via .bg div; surfaces sit on top */
  --bg-card:        #ffffff;
  --bg-card-alpha:  rgba(255,255,255,0.96);
  --border:         var(--neutral-200);
  --text:           var(--neutral-900);
  --muted:          var(--neutral-500);
  --photo-overlay:  rgba(8, 12, 18, 0.45);

  /* legacy aliases — many existing rules reference these */
  --card-bg:     var(--bg-card);
  --card-border: var(--border);

  /* status */
  --success:  #16a34a;
  --warning:  #d97706;
  --danger:   #dc2626;
  --info:     #2563eb;

  /* radius scale */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* shadow scale */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow:    0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);

  /* spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background — wildlife photo with deeper overlay so foreground content reads cleanly */
.bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  transform: scale(1.02);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--photo-overlay);
}

/* Topbar — solid white, dark text, subtle shadow */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  height: 32px;
  width: auto;
  display: block;
}

.actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 74, 89, 0.25);
}

/* Secondary button — was previously referenced everywhere but never defined */
.btn-lite {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn-lite:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
  color: var(--text);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

/* Page card — solid white, sits over the wildlife photo */
.page-card {
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 10px;
}
.page-inner {
  padding: 22px;
}

/* Flash messages */
.flash {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

/* Header row */
.header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.header-row h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
  color: var(--text);
}
.header-row p {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--neutral-300);
}

.card-cover {
  height: 140px;
  overflow: hidden;
  background: var(--neutral-100);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body { padding: 14px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 6px 0; color: var(--text); letter-spacing: -0.01em; }
.card-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.card-desc { font-size: 13px; color: var(--neutral-700); line-height: 1.5; }
.card-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--neutral-50);
  color: var(--neutral-700);
}

/* Form styles */
.form { margin-top: 10px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  font: inherit;
  font-size: 14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 74, 89, 0.15);
}

input[type="file"] { padding: 10px 12px; }
input[type="file"]::file-selector-button {
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  margin-right: 10px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(255,255,255,1);
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
}

.help {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.form-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* About menu — pill-shaped, secondary-button language */
.about-menu { position: relative; display: flex; align-items: center; }

.about-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, border-color .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.about-btn:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
}

/* User menu / avatar dropdown */
.user-menu { position: relative; }

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  user-select: none;
  transition: background .15s ease, box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
}
.avatar-btn:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow);
}

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 50;
}
.dropdown.open { display: block; }

.dropdown .head {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.dropdown .head .name {
  font-weight: 800;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}
.dropdown .head .email {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown a {
  display: flex;
  padding: 11px 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.dropdown a:hover {
  background: rgba(14, 74, 89, 0.10);
}
.dropdown a.danger {
  color: #8b1e1e;
}
.dropdown a.danger:hover {
  background: rgba(220, 38, 38, 0.10);
}

/* Notifications */
.notif-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--neutral-700);
  cursor: pointer;
  padding: 0;
  border-radius: 999px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.notif-btn:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
  color: var(--text);
}

.notif-icon {
  font-size: 19px;
  line-height: 1;
  /* SVG icons render in currentColor; emoji fallback no longer needs grayscale */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px !important;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.28);
  border: 2px solid rgba(10,14,20,0.55);
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 320px;
  max-height: 360px;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.notif-title {
  padding: 10px 12px;
  font-weight: 900;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.notif-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.notif-item.unread {
  background: rgba(14,74,89,0.06);
}
.notif-item:hover {
  background: rgba(14,74,89,0.08);
}

.notif-item-msg {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}
.notif-item-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Shared section card components (used on multiple pages) */
.section-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 14px;
}
.section-head p {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}
.divider {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.10);
  margin: 18px 0;
}
.muted-mini {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* =========================================================
   Dashboard search + filter pills (also reused on AI Models)
   ========================================================= */
.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 14px;
  flex-wrap: wrap;
}

.dash-search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.dash-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  pointer-events: none;
}

/* `input.dash-search` (not just `.dash-search`) — the global
   `input[type="search"]` rule above has specificity 0,0,1,1 (tag +
   attribute) and tied the plain `.dash-search` class selector at
   0,0,1,0 every time, which let the global padding (10px 12px) win
   and ate our left-pad for the magnifier icon. Adding `input` brings
   us to 0,0,1,1 too, and source-order tie-break leans on us. */
input.dash-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color .12s ease, box-shadow .12s ease;
}

input.dash-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 74, 89, 0.15);
}

.dash-type-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dash-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}

.dash-pill:hover {
  border-color: var(--neutral-300);
  background: var(--neutral-100);
}

.dash-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* =========================================================
   About / User Guide page
   ========================================================= */

.about-hero {
  padding: 8px 0 4px 0;
}
.about-hero h1 {
  margin: 0 0 6px 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.about-hero p.lead {
  margin: 0 0 14px 0;
  color: var(--muted);
  font-size: 15px;
}
.toc-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(14, 74, 89, 0.08);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(14, 74, 89, 0.18);
  transition: background .15s ease, transform .12s ease;
}
.toc-chip:hover {
  background: rgba(14, 74, 89, 0.14);
  transform: translateY(-1px);
}
.toc-chip svg { width: 14px; height: 14px; }

.about-section {
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 90px;
}

.about-h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.about-h2 .icon-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(14,74,89,0.16), rgba(14,74,89,0.06));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.about-h2 .icon-tile svg { width: 20px; height: 20px; }

.about-prose p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 12px 0;
}
.about-prose p:last-child { margin-bottom: 0; }

/* Zig-zag feature panels */
.feature-zigzag {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 6px;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

.feature-row .feature-img {
  grid-column: 1;
  grid-row: 1;
}
.feature-row .feature-text {
  grid-column: 2;
  grid-row: 1;
}
.feature-row.reverse .feature-img {
  grid-column: 2;
  grid-row: 1;
}
.feature-row.reverse .feature-text {
  grid-column: 1;
  grid-row: 1;
}

.feature-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 18px 38px rgba(0,0,0,0.14), 0 4px 10px rgba(0,0,0,0.06);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14,74,89,0.16), rgba(14,74,89,0.06));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.feature-heading .feature-icon { margin-bottom: 0; }
.feature-heading h3 { margin: 0 !important; }

.feature-text h3 {
  margin: 0 0 8px 0;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.feature-text p {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.feature-text p:last-child { margin-bottom: 0; }

/* "More features" grid */
.more-features-h3 {
  margin: 28px 0 12px 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.feature-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--neutral-300);
}
.feature-card .feature-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
}
.feature-card .feature-icon svg { width: 19px; height: 19px; }
.feature-card h4 {
  margin: 0 0 6px 0;
  font-size: 14.5px;
  font-weight: 800;
}
.feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* User guide subsection headings */
.guide-h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 8px 0;
  font-size: 16px;
  letter-spacing: -0.005em;
}
.guide-h3 svg {
  color: var(--primary);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.guide-h3:first-of-type { margin-top: 4px; }

.about-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.55);
  margin-top: 8px;
}
.about-section table thead tr {
  background: rgba(14, 74, 89, 0.06);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.about-section table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-section table td {
  padding: 11px 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
  vertical-align: top;
}
.about-section table td:first-child {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.about-section p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 10px 0;
}

/* Mobile: stack zig-zag panels with image always on top */
@media (max-width: 820px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .feature-row .feature-img,
  .feature-row.reverse .feature-img {
    grid-column: 1;
    grid-row: 1;
  }
  .feature-row .feature-text,
  .feature-row.reverse .feature-text {
    grid-column: 1;
    grid-row: 2;
  }
  .about-hero h1 { font-size: 24px; }
  .about-h2 { font-size: 19px; }
  .feature-text h3 { font-size: 17px; }
}

/* =========================================================
   Section-title utility — heading + leading icon pattern
   used by templates that import {{ icon('...') }} from _icons.html
   ========================================================= */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.section-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* =========================================================
   Sidebar navigation (Commit 3)
   ========================================================= */
.app-shell {
  margin-left: 240px;
}

/* Pages without auth get no sidebar — drop the offset and let content centre */
body.no-nav .app-shell { margin-left: 0; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sidebar-brand img {
  max-height: 36px;
  max-width: 100%;
  width: auto;
  display: block;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--neutral-700);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { color: var(--neutral-500); flex-shrink: 0; }
.nav-item:hover {
  background: var(--neutral-100);
  color: var(--text);
}
.nav-item:hover svg { color: var(--neutral-700); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-item.active svg { color: var(--primary); }
.nav-item.danger { color: var(--danger); }
.nav-item.danger:hover { background: rgba(220, 38, 38, 0.08); color: var(--danger); }
.nav-item.danger svg { color: var(--danger); }

.nav-section {
  padding: 14px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--neutral-700);
  cursor: pointer;
}
.sidebar-toggle:hover { background: var(--neutral-100); }

.topbar-spacer { flex: 1; }

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .app-shell { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
}

/* -------------------------------------------------------------------
   Public header — thin white banner rendered on the login page and on
   the About / AI Models / Tutorials pages when the visitor isn't
   signed in. Kept purely presentational + high z-index so it floats
   above the background video/image on the login page.
   ------------------------------------------------------------------- */
.public-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.public-header-brand {
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}
.public-header-brand img {
  height: 36px;
  width: auto;
  display: block;
}
.public-header-nav {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-left: auto;
}
.public-header-nav a {
  color: var(--text, #0b1b22);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}
.public-header-nav a:hover {
  border-bottom-color: rgba(0, 0, 0, 0.24);
}
.public-header-nav a.active {
  border-bottom-color: var(--accent, #0b1b22);
}
@media (max-width: 640px) {
  .public-header { padding: 0 14px; gap: 8px; }
  .public-header-brand img { height: 28px; }
  .public-header-nav { gap: 14px; }
  .public-header-nav a { font-size: 13px; }
}

/* -------------------------------------------------------------------
   Delete confirmation modal — shared partial rendered by
   _delete_confirm_modal.html. Any page that includes that partial
   picks up these styles.
   ------------------------------------------------------------------- */
.btn.danger {
  background: var(--danger, #dc2626);
  color: #fff;
  border-color: var(--danger, #dc2626);
}
.btn.danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}
.btn.danger:disabled {
  background: #f5c2c0;
  border-color: #f5c2c0;
  color: #fff;
  cursor: not-allowed;
}

.danger-zone { border-radius: 14px; padding: 16px; }
.danger-zone h2 { margin-top: 0; }

/* Native <dialog>. Firefox/Chrome/Safari all support this in the versions
   we target; the fallback to display:block is handled inline in the JS
   for very old browsers. */
.delete-modal {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 20px 22px;
  max-width: 520px;
  width: 92vw;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
  color: var(--text, #0b1b22);
}
.delete-modal::backdrop {
  background: rgba(0, 0, 0, 0.42);
}
.delete-modal-title {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 800;
  color: #a31f0e;
}
.delete-modal-warning {
  margin: 0 0 10px 0;
  color: #a31f0e;
}
.delete-modal-body {
  margin: 0 0 14px 0;
  color: var(--text, #0b1b22);
  line-height: 1.45;
}
.delete-modal-label {
  display: block;
  margin: 4px 0 6px 0;
  font-size: 14px;
  font-weight: 600;
}
.delete-modal-label code {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  font-family: monospace;
  font-weight: 800;
}
.delete-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  font-size: 16px;
  font-family: monospace;
  letter-spacing: 0.05em;
  box-sizing: border-box;
}
.delete-modal-input:focus {
  outline: 2px solid rgba(220, 38, 38, 0.35);
  outline-offset: 1px;
  border-color: var(--danger, #dc2626);
}
.delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.delete-modal-form { margin: 0; }
