/* ==========================================================================
   Apple-Style Sticky Frosted Navigation Bar
   ========================================================================== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--bg-translucent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--hairline-border);
  height: 52px;
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.hole-logo {
  width: 26px;
  height: 26px;
  display: inline-flex;
  flex-shrink: 0;
}
.hole-logo svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s var(--ease-apple), transform 0.15s var(--ease-apple);
}

.nav-links.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.nav-link {
  text-decoration: none;
  background: transparent;
  border: var(--hairline-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-surface-subtle);
}

/* Top bar: the header gear is the only Settings entry */
#navSettingsLink {
  display: none;
}

/* Sub-tab accordions live only in the side rails */
.nav-item-wrap {
  display: contents;
}
.nav-sub-toggle, .nav-sub-list {
  display: none;
}

/* Side-rail layouts (desktop only; set via html[data-nav]) */
@media (min-width: 769px) {
  html[data-nav="left"] .nav-bar, html[data-nav="right"] .nav-bar {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 184px;
    height: auto;
    min-height: 0;
    padding: 14px 10px;
    border-bottom: none;
  }
  html[data-nav="left"] .nav-bar { left: 0; border-right: var(--hairline-border); }
  html[data-nav="right"] .nav-bar { right: 0; border-left: var(--hairline-border); }
  html[data-nav="left"] .nav-container, html[data-nav="right"] .nav-container {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    height: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  html[data-nav="left"] .nav-top-row, html[data-nav="right"] .nav-top-row {
    flex-direction: column;
    align-items: flex-start;
  }
  html[data-nav="left"] .nav-actions, html[data-nav="right"] .nav-actions {
    flex-wrap: wrap;
  }
  /* One settings entry per rail: the labeled row stays, the gear hides */
  html[data-nav="left"] #btnSettingsGear, html[data-nav="right"] #btnSettingsGear {
    display: none;
  }
  html[data-nav="left"] .nav-links, html[data-nav="right"] .nav-links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 2px;
  }
  /* Rails: the labeled Settings row is the only Settings entry */
  html[data-nav="left"] #navSettingsLink, html[data-nav="right"] #navSettingsLink {
    display: block;
  }
  /* Side rails are plain radio rows, not boxes */
  html[data-nav="left"] .nav-link, html[data-nav="right"] .nav-link {
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 7px 10px 7px 28px;
    font-size: 13px;
    font-weight: 500;
    position: relative;
  }
  html[data-nav="left"] .nav-link::before, html[data-nav="right"] .nav-link::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--text-tertiary);
  }
  html[data-nav="left"] .nav-link:hover, html[data-nav="right"] .nav-link:hover {
    border: none;
    background: var(--bg-surface-subtle);
  }
  html[data-nav="left"] .nav-link.active, html[data-nav="right"] .nav-link.active {
    border: none;
    background: var(--accent-blue-subtle);
    color: var(--text-primary);
  }
  html[data-nav="left"] .nav-link.active::before, html[data-nav="right"] .nav-link.active::before {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
  }
  /* Minimal sub-tab accordions */
  html[data-nav="left"] .nav-item-wrap, html[data-nav="right"] .nav-item-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  html[data-nav="left"] .nav-item-row, html[data-nav="right"] .nav-item-row {
    display: flex;
    align-items: stretch;
    gap: 2px;
  }
  html[data-nav="left"] .nav-item-row .nav-link, html[data-nav="right"] .nav-item-row .nav-link {
    flex: 1;
    min-width: 0;
  }
  html[data-nav="left"] .nav-sub-toggle, html[data-nav="right"] .nav-sub-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex: none;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-tertiary);
    font-size: 10px;
    cursor: pointer;
    transition: transform var(--transition-fast), color var(--transition-fast);
  }
  html[data-nav="left"] .nav-sub-toggle:hover, html[data-nav="right"] .nav-sub-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-surface-subtle);
  }
  html[data-nav="left"] .nav-item-wrap.open .nav-sub-toggle, html[data-nav="right"] .nav-item-wrap.open .nav-sub-toggle {
    transform: rotate(90deg);
    color: var(--accent-blue);
  }
  html[data-nav="left"] .nav-item-wrap.open .nav-sub-list, html[data-nav="right"] .nav-item-wrap.open .nav-sub-list {
    display: flex;
    flex-direction: column;
    margin: 2px 0 2px 30px;
  }
  html[data-nav="left"] .nav-sub-link, html[data-nav="right"] .nav-sub-link {
    background: transparent;
    border: none;
    text-align: left;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
  }
  html[data-nav="left"] .nav-sub-link:hover, html[data-nav="right"] .nav-sub-link:hover {
    color: var(--text-primary);
    background: var(--bg-surface-subtle);
  }
  html[data-nav="left"] main, html[data-nav="left"] .site-footer {
    margin-left: 184px;
  }
  html[data-nav="right"] main, html[data-nav="right"] .site-footer {
    margin-right: 184px;
  }
  /* Popups center on the content area, not the whole viewport */
  html[data-nav="left"] .modal-backdrop { left: 184px; }
  html[data-nav="right"] .modal-backdrop { right: 184px; }
}

:is([data-theme="light"], [data-theme="colorblind-light"]) .nav-link:hover {
  border-color: rgba(0, 0, 0, 0.25);
}

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

.pt-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.pt-text {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pt-digits {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ==========================================================================
   Pill Buttons (border-radius: 980px, flat colors, zero gradients)
   ========================================================================== */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-normal);
  white-space: nowrap;
}

.pill-btn:active {
  transform: scale(0.98);
}

.pill-btn-primary {
  background-color: var(--accent-blue);
  color: #ffffff;
}

.pill-btn-primary:hover {
  background-color: var(--accent-blue-hover);
  box-shadow: 0 2px 12px rgba(15, 98, 254, 0.25);
}

.pill-btn-secondary {
  background-color: rgba(255, 255, 255, 0.13);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.pill-btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.19);
  border-color: rgba(255, 255, 255, 0.34);
}

.pill-btn-lg {
  padding: 10px 24px;
  font-size: 14px;
}

.pill-sm {
  padding: 5px 14px;
  font-size: 12px;
}

.pill-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pill-btn-secondary.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Icons */
.icon-svg {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* Dark base: faint icon controls get a real surface so none vanish */
html:not([data-theme]) .btn-card-glyph,
html:not([data-theme]) .modal-close-btn,
html:not([data-theme]) .shuffle-btn,
html:not([data-theme]) .btn-remove-row {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.07);
  border: var(--hairline-border);
}
html:not([data-theme]) .chip-btn {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}
html:not([data-theme]) .todo-circle { border-color: rgba(255, 255, 255, 0.45); }
html:not([data-theme]) .fmt-btn { background: rgba(255, 255, 255, 0.05); }

