/* Checklist Application Styles */

/* Theme variables - Material-UI v5 palette */
:root,
:root[data-theme="light"] {
  /* Light is the default even when no data-theme attribute is set (e.g. JS off),
     so the variables below always resolve to *something* readable. */
  color-scheme: light;

  /* Background & Surface */
  --bg-color: #fafafa;
  --card-bg: #ffffff;

  /* Text */
  --text-color: rgba(0, 0, 0, 0.87);
  --text-muted: rgba(0, 0, 0, 0.60);
  --text-disabled: rgba(0, 0, 0, 0.38);

  /* Borders & Dividers */
  --border-color: rgba(0, 0, 0, 0.12);
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.23);

  /* Shadows */
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);

  /* Semantic Colors */
  --primary: #1976d2;
  --primary-light: #42a5f5;
  --primary-dark: #1565c0;
  --error: #d32f2f;
  --error-light: #ef5350;
  --success: #2e7d32;
  --success-light: #66bb6a;
  --warning: #ed6c02;
  --warning-light: #ff9800;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* Background & Surface */
  --bg-color: #121212;
  --card-bg: #1e1e1e;

  /* Text */
  --text-color: rgba(255, 255, 255, 0.87);
  --text-muted: rgba(255, 255, 255, 0.60);
  --text-disabled: rgba(255, 255, 255, 0.38);

  /* Borders & Dividers */
  --border-color: rgba(255, 255, 255, 0.12);
  --input-bg: #1e1e1e;
  --input-border: rgba(255, 255, 255, 0.23);

  /* Shadows */
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-hover: rgba(0, 0, 0, 0.7);

  /* Semantic Colors */
  --primary: #90caf9; /* light blue — for accent TEXT on dark surfaces */
  --primary-light: #e3f2fd;
  /* Button/header FILL (white text sits on it) — must stay dark enough for AA.
     #42a5f5 only gave ~2.65:1 with white; #1565c0 gives 5.75:1. */
  --primary-dark: #1565c0;
  --error: #f44336;
  --error-light: #e57373;
  --success: #66bb6a;
  --success-light: #81c784;
  --warning: #ffa726;
  --warning-light: #ffb74d;
}

/* Base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

button {
  color: inherit;
}

button, [role="button"] {
  cursor: pointer;
}

code {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 1em;
}

img,
svg {
  display: block;
}

img,
video {
  max-width: 100%;
  height: auto;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji";
}

body {
  background: var(--bg-color);
  min-height: 100vh;
  color: var(--text-color, #333);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App layout */
.app {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 600px;
  min-height: 500px;
  background: var(--card-bg, white);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow, rgba(0, 0, 0, 0.1));
  /* `visible` (not `hidden`) so the kebab dropdown can extend past a short
     container instead of being clipped. The only thing that relied on clipping
     was a header sitting flush at the top corners (the portal) — handled by
     rounding that header's top corners below. */
  overflow: visible;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Header */
.header {
  background: var(--primary-dark);
  color: white;
  padding: 1.25rem 1.5rem;
  text-align: center;
  position: relative;
}

/* When the header is flush at the container's top (no on-card back link above
   it, e.g. the portal), round its top corners to match the card. */
.container > .header:first-child {
  border-radius: 12px 12px 0 0;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* Checklist selector dropdown */
.checklist-selector {
  position: relative;
}

.checklist-dropdown-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.checklist-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.checklist-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--card-bg, white);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-hover, rgba(0, 0, 0, 0.15));
  min-width: 250px;
  max-width: 300px;
  z-index: 1000;
  overflow: hidden;
}

.checklist-list {
  max-height: 300px;
  overflow-y: auto;
}

/* Grouped-list card holding the checklist rows (iOS "inset grouped" style):
   one rounded, filled card with rows separated by hairlines, instead of a box
   per checklist. */
.checklist-list {
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--shadow, rgba(0, 0, 0, 0.08));
  /* No overflow:hidden — it would clip the per-row ⋮ actions dropdown. */
}

.checklist-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.35rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

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

/* The name fills the row (tap to open); a single ⋮ button holds the rest of the
   actions, so the row stays one line on phones. */
.row-actions {
  position: relative;
  flex-shrink: 0;
}

.row-menu-btn {
  padding: 0.5rem 0.7rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-color, #333);
  cursor: pointer;
  transition: background 0.2s ease;
}

.row-menu-btn:hover {
  background: var(--card-bg, #f7fafc);
}

/* Full-screen catcher so a tap/click outside closes the menu. */
.row-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.row-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  background: var(--bg-color, white);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.row-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  color: var(--text-color, #333);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.row-menu__item:hover:not(:disabled) {
  background: var(--card-bg, #f7fafc);
}

.row-menu__item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.row-menu__item.danger {
  color: var(--error);
}

.checklist-option {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--card-bg, white);
  border: none;
  color: var(--text-color, #2d3748);
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.checklist-option:hover {
  background: color-mix(in srgb, var(--text-color) 5%, transparent);
}

.checklist-option.active {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
}

.new-checklist-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--card-bg, #f7fafc);
  border-top: 2px solid var(--border-color, #e2e8f0);
}

.new-checklist-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border-color, #cbd5e0);
  border-radius: 4px;
  font-size: 0.9rem;
  background: var(--input-bg, white);
  color: var(--text-color, #333);
}

.new-checklist-input:focus {
  outline: none;
  border-color: var(--primary);
}

.new-checklist-btn {
  padding: 0.5rem 1rem;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: filter 0.2s ease;
}

.new-checklist-btn:hover {
  filter: brightness(0.9);
}

/* Mode switch */
.mode-switch {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0;
}

.mode-button {
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: white;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.mode-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.8);
}

.mode-button.active {
  background: white;
  color: var(--primary-dark);
  border-color: white;
}

.mode-button.reset-button {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.6);
}

.mode-button.reset-button:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.3);
  border-color: rgba(255, 107, 107, 0.9);
}

.mode-button.reset-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Main content */
.main {
  min-height: 300px;
  padding: 2rem;
}

/* Checklist pages: tint the content area with the page background so the white
   grouped cards "float" above it (iOS inset-grouped style). Round the bottom to
   match the container's corners since .main is its last child. */
.main--grouped {
  background: var(--bg-color, #fafafa);
  border-radius: 0 0 12px 12px;
}

.loading, .error {
  text-align: center;
  padding: 3rem 2rem;
  font-size: 1.2rem;
}

.error {
  color: var(--error);
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted, #666);
}

.empty-state h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-color, #4a5568);
}

/* Check-off mode */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section {
  margin-bottom: 1.5rem;
}

.section:last-child {
  margin-bottom: 0;
}

.section-header {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

.section-header[tabindex="0"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Grouped-list card: the whole section is one filled, rounded card and the
   items are rows separated by inset hairlines (iOS "inset grouped" style),
   rather than a box around each item. */
.section-items {
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--shadow, rgba(0, 0, 0, 0.08));
  overflow: hidden;
}

.checklist-item {
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  transition: background 0.15s ease;
}

.checklist-item:last-child {
  border-bottom: none;
}

.checklist-item:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.checkbox:focus ~ .checkmark {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  height: 24px;
  width: 24px;
  background-color: var(--input-bg, #edf2f7);
  border: 2px solid var(--border-color, #cbd5e0);
  border-radius: 4px;
  margin-right: 1rem;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox:checked ~ .checkmark {
  background-color: var(--success);
  border-color: var(--success);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox:checked ~ .checkmark:after {
  display: block;
}

.item-text {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-color, #2d3748);
  transition: all 0.2s ease;
}

.checkbox:checked ~ .item-text {
  text-decoration: line-through;
  color: var(--text-muted, #a0aec0);
}

/* Edit mode */
.edit-mode {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* The section is a grouping container only; the grouped card styling lives on
   .edit-items so items render as hairline-separated rows, not nested boxes. */
.edit-section {
  display: flex;
  flex-direction: column;
}

.section-header-edit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  padding: 0.4rem 0.8rem;
  background: var(--input-bg, white);
  border: 1px solid var(--border-color, #cbd5e0);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color, #333);
  transition: all 0.2s ease;
  line-height: 1;
}

.control-btn:hover:not(:disabled) {
  background: var(--card-bg, #f7fafc);
  border-color: var(--text-color);
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.control-btn.delete-btn {
  color: var(--error);
}

.control-btn.delete-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border-color: var(--error-light);
}

.edit-items {
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--shadow, rgba(0, 0, 0, 0.08));
  overflow: hidden;
}

/* Inline rename form for an item. The input takes the row; on a phone it goes
   full-width with the save/cancel buttons wrapping to a row beneath, so there's
   room to read and edit a long task. */
.item-edit-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.item-edit-form .add-input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .item-edit-form {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .item-edit-form .add-input {
    flex-basis: 100%;
  }
}

.edit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-color, #333);
  transition: background 0.15s ease;
  outline: none;
}

.edit-item:last-child {
  border-bottom: none;
}

.edit-item:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

/* Inset offset so the focus ring isn't clipped by the card's overflow:hidden. */
.edit-item span[tabindex="0"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Hidden until the row is selected (tap), focused (keyboard), or hovered on a
   real pointer device — keeps the mobile list compact. display:none (not
   opacity) so the hidden control row reclaims its vertical space on phones. */
.item-controls {
  display: none;
  gap: 0.3rem;
  flex-shrink: 0;
  margin-left: 1rem;
  /* Wrap rather than overflow the row: on a narrow phone the buttons can't all
     fit on one line, and without wrapping the right-aligned group spills its
     first button outside the row's box. */
  flex-wrap: wrap;
}

.edit-item.is-selected .item-controls,
.edit-item:focus-within .item-controls {
  display: flex;
}

@media (hover: hover) {
  .edit-item:hover .item-controls {
    display: flex;
  }
}

/* Highlight the selected row with a fill tint + an inset accent bar (inset so
   it isn't clipped by the card's overflow:hidden, unlike an outset ring). */
.edit-item.is-selected {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--primary);
}

.edit-item:focus-within {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.add-item-form,
.add-section-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.add-input {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--input-bg, white);
  color: var(--text-color, #333);
  transition:
    border-color 0.2s ease,
    background-color 0.3s ease,
    color 0.3s ease;
}

.add-input:focus {
  outline: none;
  border-color: var(--primary);
}

.add-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary-dark);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.add-btn:hover {
  filter: brightness(0.9);
}

.add-section-form {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
}

/* Footer */
.footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 1rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .app {
    padding: 1rem;
  }

  .header {
    padding: 1.5rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .header-top {
    justify-content: center;
    margin-bottom: 1rem;
  }

  .checklist-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }

  .checklist-dropdown-btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }

  .mode-switch {
    flex-direction: column;
  }

  .mode-button {
    width: 100%;
  }

  .main {
    padding: 1.5rem;
  }

  .checkbox-label {
    padding: 1rem;
  }

  .edit-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-controls {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    margin-top: 0.5rem;
    row-gap: 0.3rem; /* spacing if the buttons wrap to a second line */
  }

  /* Tighten the action buttons on phones so the full set is more likely to fit
     one line within the row's box. */
  .item-controls .control-btn {
    padding: 0.35rem 0.55rem;
    font-size: 1.1rem;
  }

  .add-item-form,
  .add-section-form {
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
  }

  .new-checklist-form {
    flex-direction: column;
  }

  .new-checklist-btn {
    width: 100%;
  }
}

/* Checklist name as a grouped-list row (not a box). It fills the row and tints
   on hover/focus; the row's hairline (on .checklist-item-row) separates it. */
.checklist-link {
  display: block;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text-color, #2d3748);
  transition: background 0.15s ease;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 6px;
}

.checklist-link:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.checklist-link:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* Movies list rows — each links to the movie's detail page. Styled to read as
   interactive: hover/focus highlight + a chevron hinting it leads somewhere. */
.movie-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  color: var(--text-color, #333);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color, #eee);
  transition: background 0.15s ease;
}

.movie-row:hover {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.movie-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.movie-row .chevron {
  flex-shrink: 0;
  opacity: 0.4;
  font-size: 1.1rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.movie-row:hover .chevron,
.movie-row:focus-visible .chevron {
  opacity: 0.9;
  transform: translateX(3px);
}

/* Movie-row columns (in CSS, not inline styles, so the layout can restack on
   narrow screens). Wide layout = a single line. */
.movie-row__rank {
  opacity: 0.6;
  min-width: 1.75rem;
  text-align: right;
}

.movie-row__rating {
  font-weight: 700;
  min-width: 2.5rem;
}

.movie-row__cert {
  min-width: 3.5rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

.movie-row__title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.5rem;
}

.movie-row__genres {
  flex-shrink: 1;
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: right;
}

/* Phones: stack each entry into 3 lines — rank+rating+cert, then the full
   title (wrapping, never truncated), then genres. */
@media (max-width: 600px) {
  .movie-row {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    /* Anchor for the disclosure chevron; leave room so text never runs under it. */
    position: relative;
    padding-right: 1.9rem;
  }

  .movie-row__title {
    flex: 1 1 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding-right: 0;
  }

  .movie-row__genres {
    flex: 1 1 100%;
    text-align: left;
  }

  /* Touch has no hover/arrow cue, so show an iOS-style disclosure indicator:
     a faint chevron vertically centered on the row's right edge. */
  .movie-row .chevron {
    display: block;
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    opacity: 0.5;
  }
}

/* Navigation home link — default styling is for use *inside* the colored
   .header (white on --primary-dark). */
.nav-home-link {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  transition: opacity 0.2s, color 0.2s;
  font-weight: 500;
}

.nav-home-link:hover {
  opacity: 0.8;
}

/* Page-level back link sitting directly on the card surface (e.g. "← Apps").
   White would be invisible on the light card, so use the primary link color and
   give it padding since the bare link would otherwise jam into the rounded corner. */
.container > .nav-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 1.25rem 1.5rem 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--primary);
}

/* Back arrow drawn as an inline SVG (not a font glyph) so it renders identically
   across browsers. Centered with the label via flexbox `align-items: center`
   rather than vertical-align, because Firefox and Chromium disagree on an inline
   SVG's baseline — flex box-centering is consistent, and since the arrow is
   centered in its 0..24 viewBox this lands it on the text's optical middle. */
.nav-home-link .back-arrow {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}
