/* Timerist lanes — DOM contract aligned with Playlists lanes-implementation-model.md */

.lanes-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}

section.lane {
  min-width: 0;
}

.lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.25rem 0.5rem;
}

.lane-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lane-scroll-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.0625rem;
}

h2.lane-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgb(var(--foreground));
}

a.lane-see-all {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--muted-foreground));
  text-decoration: none;
  white-space: nowrap;
}

a.lane-see-all:hover {
  color: rgb(var(--foreground));
}

@media (max-width: 767px) {
  a.lane-see-all {
    display: none;
  }
}

.lane-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.25rem 0.25rem 0.5rem;
  margin: 0 -0.25rem;
  outline: none;
}

.lane-row::-webkit-scrollbar {
  display: none;
}

a.lane-card {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 160px;
  min-height: 5.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius, 0.5rem);
  border: 1px solid rgb(var(--border));
  background: rgb(var(--card));
  color: rgb(var(--foreground));
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.dark a.lane-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

a.lane-card:hover,
a.lane-card:active {
  border-color: rgb(var(--primary));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

a.lane-card:active {
  transform: scale(0.98);
}

.lane-card-title {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lane-card-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgb(var(--muted-foreground));
}

a.lane-card--preset {
  min-height: 4.75rem;
}

@media (min-width: 768px) {
  a.lane-card {
    width: 180px;
    min-height: 6rem;
  }
}

/* --- Wide FTL-style cards + header inline scroll (index_lanes) --- */

.lane-scroll-btn {
  box-sizing: border-box;
  flex-shrink: 0;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.2rem;
  margin: 0;
  border: none;
  border-radius: var(--radius, 0.5rem);
  background: transparent;
  color: rgb(var(--muted-foreground));
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lane-scroll-btn:hover:not(:disabled) {
  color: rgb(var(--foreground));
  background: rgb(var(--accent));
}

.lane-scroll-btn:disabled,
.lane-scroll-btn[aria-disabled='true'] {
  opacity: 0.28;
  cursor: default;
}

.lane-scroll-btn:focus-visible {
  outline: 2px solid rgb(var(--ring));
  outline-offset: 2px;
}

.lane-row--ftl {
  min-width: 0;
}

/* ~2 cards visible in the scrollport (e.g. iPhone 13 mini portrait ~375px) */
.lanes-container .lane-row--ftl .timer-link-card {
  width: min(calc((100% - 0.75rem) / 2), 20rem);
  flex: 0 0 auto;
  scroll-snap-align: start;
  box-sizing: border-box;
  padding-top: 0.45rem;
}

@media (min-width: 480px) {
  .lanes-container .lane-row--ftl .timer-link-card {
    padding-top: 0.65rem;
  }
}

.lanes-container .timer-link-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  background: rgb(var(--card));
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius, 0.5rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .lanes-container .timer-link-card {
    padding: 1rem 1.25rem;
  }
}

.dark .lanes-container .timer-link-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.lanes-container .timer-link-card:hover {
  border-color: rgb(var(--primary));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lanes-container .timer-link-card .card-text {
  flex: 1;
  min-width: 0;
}

.lanes-container .timer-link-card .card-title {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: rgb(var(--foreground));
}

.lanes-container .timer-link-card .card-description {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: rgb(var(--muted-foreground));
}

/* Lane 1 (Timers): name, description, then actions on a bottom row */
.lanes-container > section.lane:first-of-type .timer-link-card {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.25rem;
}

.lanes-container > section.lane:first-of-type .timer-link-card .card-text {
  flex: 0 0 auto;
  width: 100%;
}

.lanes-container > section.lane:first-of-type .timer-link-card .badge-group {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding-top: 0.35rem;
  margin-top: 0.2rem;
}

.lanes-container > section.lane:first-of-type .timer-link-card .badge-icon-help {
  padding: 0.28rem;
  min-width: 30px;
  min-height: 30px;
}

.lanes-container > section.lane:first-of-type .timer-link-card .badge-icon-help svg {
  display: block;
}

/* Lane 4 (About Timerist): title + description, then Open below (no overlap on narrow cards) */
.lanes-container > section.lane:nth-child(4) .timer-link-card {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.25rem;
}

.lanes-container > section.lane:nth-child(4) .timer-link-card .card-text {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.lanes-container > section.lane:nth-child(4) .timer-link-card .badge-group {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding-top: 0.35rem;
  margin-top: auto;
  align-self: stretch;
}

.lanes-container .timer-link-card .badge-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
  padding-top: 0.05rem;
}

.lanes-container .timer-link-card .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  min-height: 32px;
  box-sizing: border-box;
}

.lanes-container .timer-link-card .badge:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.lanes-container .timer-link-card .badge-default {
  background: rgb(var(--primary));
  color: rgb(var(--primary-foreground));
}

.lanes-container .timer-link-card .badge-secondary {
  background: rgb(var(--secondary));
  color: rgb(var(--secondary-foreground));
}

.lanes-container .timer-link-card .badge-outline {
  border: 1px solid rgb(var(--border));
  background: transparent;
  color: rgb(var(--foreground));
}

.lane-row--chips {
  flex: 1;
  min-width: 0;
}

a.lane-preset-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius, 0.5rem);
  border: 1px solid rgb(59, 130, 246);
  background: rgb(59, 130, 246);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: filter 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

a.lane-preset-chip:hover {
  filter: brightness(1.06);
}

a.lane-preset-chip:active {
  transform: scale(0.98);
}

.dark a.lane-preset-chip {
  border-color: rgb(96, 165, 250);
  background: rgb(37, 99, 235);
  color: #fff;
}

/* index.html: lanes when bottom tab bar is visible (<769px); grid at 769px+ (matches .app-tab-bar-mobile-only) */
.home-layout-lanes {
  display: block;
}

.home-main-grid {
  display: none;
}

@media (min-width: 769px) {
  .home-layout-lanes {
    display: none;
  }

  .home-main-grid {
    display: block;
  }
}
