/* ============================================
   Hourcraft - Time Tracker PWA Styles
   ============================================ */

/* --- CSS Custom Properties (Theming) --- */
/* Force the `hidden` attribute to win over any explicit display rule. Without
   this, a class like `.auth-form { display: flex }` beats `hidden`'s default. */
[hidden] { display: none !important; }

:root {
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-text: #1a1d1c;
  --color-text-secondary: #6b716e;
  --color-primary: #0f5a52;
  --color-primary-hover: #0c473f;
  --color-on-primary: #f7f7f5;
  --color-accent: #14b8a6;
  --color-accent-hover: #0d9488;
  --color-start: #16a34a;
  --color-start-hover: #15803d;
  --color-running: #0f8a6e;
  --color-paused: #c79100;
  --color-idle: #a3a8a5;
  --color-border: #e4e6e3;
  --color-danger: #c0392b;
  --color-danger-hover: #a93226;
  --color-warning: #a16207;
  --color-toast-bg: #1a1d1c;
  --color-toast-text: #f7f7f5;
  --color-pause-btn-bg: #c79100;
  --color-pause-btn-icon: #1a1d1c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --nav-height: 64px;
  --header-height: 56px;
}

[data-theme="dark"] {
  --color-bg: #0b0e0d;
  --color-surface: #171b1a;
  --color-text: #f2f4f3;
  --color-text-secondary: #9aa19e;
  --color-primary: #2dd4bf;
  --color-primary-hover: #5eead4;
  --color-on-primary: #06201c;
  --color-accent: #2dd4bf;
  --color-accent-hover: #5eead4;
  --color-start: #16a34a;
  --color-start-hover: #22c55e;
  --color-running: #34d399;
  --color-paused: #e0b341;
  --color-idle: #5b615e;
  --color-border: #262b29;
  --color-danger: #dc2626;
  --color-danger-hover: #ef4444;
  --color-warning: #e0b341;
  --color-toast-bg: #f2f4f3;
  --color-toast-text: #171b1a;
  --color-pause-btn-bg: #e0b341;
  --color-pause-btn-icon: #1a1d1c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* --- Screen Reader Only --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Global focus-visible outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0));
  padding: env(safe-area-inset-top, 0) 20px 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Main Content --- */
.main {
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0) + 32px);
  max-width: 600px;
  margin: 0 auto;
}

.view {
  min-height: calc(100dvh - var(--header-height) - var(--nav-height) - env(safe-area-inset-bottom, 0) - 32px);
  display: flex;
  flex-direction: column;
}

.view[hidden] {
  display: none;
}

/* --- Buttons --- */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

@media (hover: hover) {
  .btn-icon:hover {
    background: var(--color-border);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--color-primary-hover);
  }
}

/* Focus ring on primary buttons: contrast against the primary fill in both themes */
.btn--primary:focus-visible {
  outline-color: var(--color-on-primary);
  box-shadow: 0 0 0 4px var(--color-primary);
}

.btn--secondary {
  background: var(--color-border);
  color: var(--color-text);
}

@media (hover: hover) {
  .btn--secondary:hover {
    opacity: 0.8;
  }
}

.btn--small {
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

@media (hover: hover) {
  .btn--small:hover {
    background: var(--color-border);
    color: var(--color-text);
  }
}

.btn--small.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

/* Focus ring on active small buttons: contrast against the primary fill in both themes */
.btn--small.active:focus-visible {
  outline-color: var(--color-on-primary);
  box-shadow: 0 0 0 4px var(--color-primary);
}

/* --- Theme Toggle (icon = mode you'll switch TO) --- */
[data-theme="dark"] .icon-sun  { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun  { display: none; }
.icon-moon { display: block; }

/* --- Add Task --- */
.btn-add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px dashed var(--color-text-secondary);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  opacity: 0.7;
}

@media (hover: hover) {
  .btn-add:hover {
    border-color: var(--color-primary);
    opacity: 1;
  }
}

.btn-add[hidden] {
  display: none;
}

.add-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 300px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
}

.add-form.add-form--collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

.input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  transition: border-color 0.15s;
}

.input:focus-visible {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.input {
  -webkit-user-select: text;
  user-select: text;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--color-text-secondary);
}

.add-form__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* --- Task List --- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* --- Task Row --- */
.task-row {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (hover: hover) {
  .task-row:hover {
    box-shadow: var(--shadow-lg);
  }
}

.task-row__swipe-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-danger);
}

.task-row__swipe-delete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  padding: 8px;
}

.task-row__swipe-content {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px 14px;
  background: var(--color-surface);
  will-change: transform;
  touch-action: pan-y;
}

.task-row--running {
  border-color: var(--color-running);
}

.task-row--paused {
  border-color: var(--color-paused);
}

/* Status dot */
.task-row__dot {
  grid-row: 1 / 3;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-idle);
  flex-shrink: 0;
}

.task-row--running .task-row__dot {
  background: var(--color-running);
  animation: pulse 1.5s ease-in-out infinite;
}

.task-row--paused .task-row__dot {
  background: var(--color-paused);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Task info */
.task-row__info {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.task-row__name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.task-row__category {
  flex-shrink: 1;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stopwatch */
.task-row__time {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text);
  line-height: 1.2;
}

.task-row--running .task-row__time {
  color: var(--color-running);
}

.task-row--paused .task-row__time {
  color: #a16207;
}

[data-theme="dark"] .task-row--paused .task-row__time {
  color: var(--color-paused);
}

/* Controls */
.task-row__controls {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.btn-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  color: #fff;
}

.btn-control:active {
  transform: scale(0.92);
}

.btn-control:focus-visible {
  outline-offset: 3px;
}

.btn-play {
  background: var(--color-start);
}

@media (hover: hover) {
  .btn-play:hover {
    background: var(--color-start-hover);
  }
}

.btn-pause {
  background: var(--color-pause-btn-bg);
  color: var(--color-pause-btn-icon);
}

@media (hover: hover) {
  .btn-pause:hover {
    background: var(--color-pause-btn-bg);
    filter: brightness(0.92);
    color: var(--color-pause-btn-icon);
  }
}

.btn-stop {
  background: var(--color-danger);
}

@media (hover: hover) {
  .btn-stop:hover {
    background: var(--color-danger-hover);
  }
}

.btn-delete {
  background: none;
  color: var(--color-text-secondary);
  width: 44px;
  height: 44px;
}

@media (hover: hover) {
  .btn-delete:hover {
    color: var(--color-danger);
  }
}

/* Idle tasks: dim the stopwatch display */
.task-row:not(.task-row--running):not(.task-row--paused) .task-row__time {
  color: var(--color-text-secondary);
  opacity: 0.5;
  font-size: 22px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 16px;
  color: var(--color-text-secondary);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state p {
  font-size: 16px;
  font-weight: 600;
}

.empty-state__sub {
  font-size: 14px !important;
  font-weight: 400 !important;
  margin-top: 4px;
}

/* Center add-task + empty state when no tasks */
.view--empty {
  justify-content: center;
  align-items: stretch;
  flex: 1;
}

.view--empty #add-task-area {
  display: flex;
  flex-direction: column;
}

.view--empty .empty-state {
  flex: 0;
  padding-top: 16px;
}

/* --- Date Navigation --- */
.date-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.date-nav__date {
  font-size: 16px;
  font-weight: 600;
  min-width: 180px;
  text-align: center;
  cursor: pointer;
}

@media (hover: hover) {
  .date-nav__date:hover {
    color: var(--color-primary);
  }
}

.date-nav__picker {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.date-nav__shortcuts {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 16px;
  padding-right: 12px; /* keep "Select" off the right edge in narrow viewports */
}

.date-nav__shortcuts .btn--small {
  border-radius: 0;
  border-right-width: 0;
}

.date-nav__shortcuts .btn--small:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.date-nav__shortcuts .btn--small[data-mode="all"] {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-right-width: 1px;
}

/* Today jump button */
.btn-today {
  margin-left: 12px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  background: none;
  border: 1px solid var(--color-primary);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-today:active {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

@media (hover: hover) {
  .btn-today:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
  }
}

/* --- Summary Content --- */
.summary-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-total {
  text-align: center;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.summary-total__label {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-total__value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  margin-top: 4px;
}

/* Category group */
.category-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.category-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--color-border);
}

.category-group__time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--color-primary);
}

/* Expandable category headers */
.category-group__header--tappable {
  cursor: pointer;
  transition: background 0.15s;
}

@media (hover: hover) {
  .category-group__header--tappable:hover {
    background: var(--color-border);
  }
}

.category-group__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-group__chevron {
  transition: transform 0.25s ease;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.category-group--expanded .category-group__chevron {
  transform: rotate(180deg);
}

.category-group__sessions {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.category-group:not(.category-group--expandable) .category-group__header {
  border-bottom: none;
}

.category-group--expandable:not(.category-group--expanded) .category-group__header {
  border-bottom: none;
}

/* Session item (swipeable) */
.session-row {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

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

.session-row__swipe-action {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-danger);
}

.session-row__swipe-delete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  padding: 8px;
}

.session-row__swipe-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-surface);
  will-change: transform;
  touch-action: pan-y;
  transition: background 0.15s;
}

@media (hover: hover) {
  .session-row__swipe-content:hover {
    background: var(--color-bg);
  }
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
}

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

.session-item__name {
  font-size: 14px;
  font-weight: 500;
}

/* Pomodoro tag on a consolidated session row: "🍅 ×N" completed cycles. */
.session-item__pomo {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.session-item__detail {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.session-item__duration {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Weekly bar chart */
.week-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.week-chart__row {
  display: grid;
  grid-template-columns: 36px 1fr 60px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.week-chart__day {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.week-chart__bar-bg {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.4;
}

.week-chart__row--has-data .week-chart__bar-bg {
  opacity: 1;
}

.week-chart__bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.week-chart__time {
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  color: var(--color-text-secondary);
}

/* --- Filter Chips (All view) --- */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 2px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 99px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.filter-chip--active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

/* Focus ring on active filter chips: contrast against the primary fill in both themes */
.filter-chip--active:focus-visible {
  outline-color: var(--color-on-primary);
  box-shadow: 0 0 0 4px var(--color-primary);
}

@media (hover: hover) {
  .filter-chip:not(.filter-chip--active):hover {
    background: var(--color-border);
    color: var(--color-text);
  }
}

/* --- Date Group (All view) --- */
.date-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.date-group__header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* --- Load More --- */
.btn--load-more {
  width: 100%;
  height: 44px;
  margin-top: 4px;
}

/* --- Session Category Badge --- */
.session-item__category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-right: 4px;
}

/* --- Select Mode (Bulk Delete) --- */
.session-row {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.select-mode .session-row__swipe-content {
  transform: none !important;
}

.select-checkbox {
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-text-secondary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 10px;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* 44x44 touch target via invisible pseudo-element */
.select-checkbox::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.select-checkbox--checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.select-checkbox--checked::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--color-on-primary);
  border-bottom: 2px solid var(--color-on-primary);
  transform: rotate(-45deg) translateY(-1px);
}

.select-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.select-action-bar__count {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: var(--color-toast-bg);
  color: var(--color-toast-text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  pointer-events: none;
}

.toast[hidden] {
  display: block;
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

.toast.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.toast__undo {
  background: none;
  border: 0;
  color: var(--color-toast-text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  min-height: var(--nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.bottom-nav__tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  padding: 8px 0;
  text-align: center;
}

.bottom-nav__tab--active {
  color: var(--color-primary);
}

@media (hover: hover) {
  .bottom-nav__tab:hover {
    color: var(--color-text);
  }

  .bottom-nav__tab--active:hover {
    color: var(--color-primary-hover);
  }
}

.bottom-nav__tab:focus-visible {
  outline-offset: -2px;
}

/* --- Confirm Dialog Overlay --- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 24px;
}

.confirm-dialog {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.confirm-dialog__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-dialog__message {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-dialog__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
}

@media (hover: hover) {
  .btn--danger:hover {
    background: #dc2626;
  }
}

/* Focus ring on danger buttons: white outline for contrast against red bg */
.btn--danger:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 4px var(--color-danger);
}

/* --- Running Dot Indicator --- */
.bottom-nav__tab .running-dot {
  display: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-running);
  position: absolute;
  top: 6px;
  right: calc(50% - 24px);
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 4px var(--color-running);
}

/* --- Offline Banner --- */
.offline-banner {
  background: var(--color-paused);
  color: #422006;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

.offline-banner[hidden] {
  display: none;
}

/* --- Swipe Hint --- */
.task-row__swipe-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  opacity: 0;
  animation: swipeHint 3s ease-in-out 1s 1 forwards;
  pointer-events: none;
  z-index: 1;
}

@keyframes swipeHint {
  0% { opacity: 0; transform: translateY(-50%) translateX(0); }
  15% { opacity: 0.6; transform: translateY(-50%) translateX(-8px); }
  30% { opacity: 0.6; transform: translateY(-50%) translateX(0); }
  45% { opacity: 0.6; transform: translateY(-50%) translateX(-8px); }
  60% { opacity: 0.6; transform: translateY(-50%) translateX(0); }
  80% { opacity: 0; }
  100% { opacity: 0; }
}

.swipe-hint-shown .task-row__swipe-hint {
  display: none;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    var(--color-surface) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-task-row {
  height: 80px;
  margin-bottom: 10px;
  border-radius: var(--radius);
}

.skeleton-summary {
  height: 100px;
  margin-bottom: 12px;
  border-radius: var(--radius);
}

/* --- Weekly Chart Enhancements --- */
.week-chart__daynum {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.week-chart__row--tappable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px 0;
  transition: background 0.15s;
}

@media (hover: hover) {
  .week-chart__row--tappable:hover {
    background: var(--color-border);
  }
}

/* --- Edit Task Inline --- */
.task-row__edit-input {
  max-width: 100%;
}

.task-row__name[data-editable] {
  cursor: text;
  -webkit-user-select: none;
  user-select: none;
}

@media (hover: hover) {
  .task-row__name[data-editable]:hover {
    text-decoration: underline dotted var(--color-text-secondary);
    text-underline-offset: 3px;
  }
}

/* ============================================
   Auth: login screen, user menu, paywall
   ============================================ */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.auth-card__title {
  margin: 0 0 8px;
  font-size: 22px;
}

.auth-card__sub {
  margin: 0 0 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-msg {
  margin: 0;
  font-size: 14px;
  min-height: 20px;
  color: var(--color-text-secondary);
}

.auth-msg[data-state="success"] { color: var(--color-running); }
.auth-msg[data-state="error"]   { color: var(--color-danger); }

.auth-card__tagline {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.auth-benefits {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-benefits li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  color: var(--color-text);
}

/* CSS checkmark in the brand accent — no extra markup/assets. */
.auth-benefits li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: rotate(-45deg);
}

.auth-card__footer {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.auth-card__footer a {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

/* First-run onboarding card */
.onboarding {
  position: relative;
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.onboarding__title {
  margin: 0 0 10px;
  font-size: 16px;
}

.onboarding__steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text);
}

.onboarding__pro {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.onboarding__upgrade {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 4px;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.onboarding__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0 4px;
}

/* User menu in header */
.user-menu {
  position: absolute;
  right: 12px;
  top: 56px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  padding: 8px;
  z-index: 50;
}

.user-menu__email {
  padding: 8px 12px 4px;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
  word-break: break-all;
}

.user-menu__plan {
  padding: 0 12px 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}

/* Shown only when a cancellation is scheduled. Warning-toned so it reads as a
   state worth acting on, not as ordinary plan metadata. */
.user-menu__ending {
  padding: 0 12px 8px;
  font-size: 12px;
  color: var(--color-warning);
}

.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
}

.user-menu__item:hover {
  background: var(--color-border);
}

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

.user-menu__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.user-menu__toggle input[type="checkbox"] {
  accent-color: var(--color-primary, #0f5a52);
  cursor: pointer;
}

.user-menu__item--locked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-secondary);
}

.user-menu__pro {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-menu__legal {
  padding: 8px 12px 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}

.user-menu__legal a { color: var(--color-text-secondary); text-decoration: none; }
.user-menu__legal a:hover { text-decoration: underline; }

/* --- Reports view --- */
.reports-controls {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.btn--active {
  background: var(--color-primary, #0f5a52);
  color: var(--color-on-primary);
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 16px;
}

.report-stat {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-width: 0;
}

.report-stat__label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-stat__value {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-section {
  padding: 0 16px 24px;
}

.report-section__title {
  font-size: 14px;
  margin: 0 0 12px;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.report-empty {
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 16px 0;
}

/* Trend chart (weekly bars) */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
  padding: 8px 0;
  overflow-x: auto;
}

.trend-bar {
  flex: 0 0 auto;
  width: 16px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.trend-bar__fill {
  width: 100%;
  background: var(--color-primary, #0f5a52);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

/* Category breakdown */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-row__head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.cat-row__name {
  font-weight: 500;
  color: var(--color-text);
}

.cat-row__value {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.cat-row__pct {
  color: var(--color-text-secondary);
}

.cat-row__bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.cat-row__fill {
  height: 100%;
  background: var(--color-primary, #0f5a52);
  border-radius: 3px;
}

/* Heatmap */
.hm-grid {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 4px 0;
}

.hm-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.hm-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.hm-legend__cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* --- Pomodoro indicator --- */
.pomo-indicator {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.pomo-indicator--short-break,
.pomo-indicator--long-break {
  border-left-color: var(--color-running);
}

.pomo-indicator__main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.pomo-indicator__phase {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.pomo-indicator__time {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.pomo-indicator__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.pomo-indicator__skip {
  background: none;
  border: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.pomo-indicator__skip:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* --- Pomodoro settings modal --- */
.pomo-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}

.pomo-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pomo-settings-grid input[type="number"] {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
}

.pomo-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text);
  padding: 8px 0;
  margin-bottom: 8px;
}

.pomo-settings-row input[type="checkbox"] {
  accent-color: var(--color-primary);
  cursor: pointer;
}

.pomo-settings-row__test {
  margin-left: auto;
  background: var(--color-border);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
}

.pomo-explainer {
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
}

.pomo-explainer summary {
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pomo-explainer summary::before {
  content: '›';
  display: inline-block;
  transition: transform 0.15s;
  font-size: 16px;
  line-height: 1;
}

.pomo-explainer[open] summary::before {
  transform: rotate(90deg);
}

.pomo-explainer p {
  margin: 10px 0 0;
  line-height: 1.5;
}

.paywall-actions--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.paywall-actions__right {
  display: flex;
  gap: 8px;
}

.btn--ghost {
  background: none;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.btn--ghost:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Reports paywall card (Free users) */
.report-paywall {
  text-align: center;
  padding: 48px 24px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  margin: 16px;
}

.report-paywall h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.report-paywall p {
  margin: 0 0 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* Paywall overlay */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.paywall-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.paywall-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.paywall-card p {
  margin: 0 0 16px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.paywall-prices {
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 10px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: center;
}

.paywall-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 16px;
}

.paywall-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s;
}

.paywall-plan:hover:not(:disabled) {
  border-color: var(--color-primary);
}

.paywall-plan:disabled {
  opacity: 0.5;
  cursor: wait;
}

.paywall-plan--featured {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface));
}

.paywall-plan__name {
  font-weight: 500;
}

.paywall-plan__price {
  color: var(--color-text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.paywall-plan__sub {
  font-size: 11px;
  margin-top: 2px;
}

.paywall-features {
  margin: 0 0 16px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: var(--color-text);
}

.paywall-reassure {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: center;
}

.paywall-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.user-menu__item--upgrade {
  color: var(--color-primary);
  font-weight: 500;
}

/* --- Marketing landing (signed-out only; see #landing in index.html) --- */
/* With the landing open, the auth hero must not eat a full viewport — the
   first feature row peeking above the fold is the cue to scroll. */
body.landing-open .auth-screen {
  min-height: 0;
  padding: 36px 16px 12px;
}
body.landing-open .main {
  /* The reserved bottom-nav space is dead air here — the nav is hidden on
     the login screen, and it kept the first landing section off-screen. */
  padding-bottom: 0;
}

#landing, .landing-wrap {
  max-width: 1020px;
  margin: 0 auto;
  padding: 8px 20px 0;
}

.landing-section {
  padding: 28px 0;
  border-top: 1px solid var(--color-border);
}
.landing-section:first-child { border-top: none; padding-top: 20px; }

.landing-section h1,
.landing-section h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

/* Doubled class beats the generic `.landing-section p` margin rule that
   otherwise pins the max-width text box to the left (equal specificity +
   source order — the same trap as the CTA display rule). */
.landing-section.landing-hero { text-align: center; }
.landing-section.landing-hero h1,
.landing-section.landing-hero h2 { font-size: 2rem; }
.landing-section.landing-hero p {
  max-width: 640px;
  margin: 0 auto 16px;
  font-size: 1.05rem;
}

/* Doubled class ups specificity over `.landing-feature__shot img`'s
   width:100% — equal-specificity source order is too fragile to rely on. */
.landing-feature__shot.landing-feature__shot--narrow img {
  width: auto;
  max-height: 400px;
  margin: 0 auto;
}

.landing-steps {
  padding-left: 1.3rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.landing-steps li { margin: 8px 0; }
.landing-steps a { color: var(--color-primary); }

/* Static pricing content on /upgrade (below the live checkout card) */
.pricing-static { padding: 0 0 40px; }
.pricing-static h2 { font-size: 1.3rem; margin: 28px 0 12px; }
.pricing-static p {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
}
.pricing-static a { color: var(--color-primary); }
.pricing-static__links { margin-top: 20px; font-size: 0.9rem; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.compare-table th, .compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.compare-table thead th {
  color: var(--color-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.compare-table td { text-align: center; color: var(--color-text-secondary); }
.compare-table tbody th { font-weight: 500; }
.landing-section p {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
}

.landing-feature {
  display: flex;
  align-items: center;
  gap: 32px;
}
.landing-feature:nth-of-type(even) { flex-direction: row-reverse; }
.landing-feature__text { flex: 1 1 300px; }
.landing-feature__shot {
  flex: 1.4 1 380px;
  margin: 0;
}
.landing-feature__shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.landing-pro {
  display: inline-block;
  vertical-align: 0.25em;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.landing-extension {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.landing-extension__icon { border-radius: 16px; flex: 0 0 auto; }
.landing-extension__more { margin-top: 10px; font-size: 0.9rem; }
.landing-extension__more a { color: var(--color-primary); }
/* inline-FLEX, not block: .btn centers its label with flex inside a fixed
   40px height — block display top-aligns the text on <a> CTAs. */
.landing-cta { display: inline-flex; text-decoration: none; }

.landing-pricing h2, .landing-faq h2 { margin-bottom: 20px; }
.landing-pricing__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.landing-price {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.landing-price--pro { border-color: var(--color-primary); }
.landing-price h3 { margin: 0 0 4px; font-size: 1.05rem; }
.landing-price__amount { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.landing-price__amount span { font-size: 0.9rem; font-weight: 500; color: var(--color-text-secondary); }
.landing-price ul {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  flex: 1;
}
.landing-price li {
  padding: 5px 0 5px 26px;
  position: relative;
  color: var(--color-text-secondary);
  line-height: 1.45;
}
.landing-price li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--color-accent);
  font-weight: 700;
}
.landing-pricing__note {
  margin: 16px 0 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--color-text-secondary);
}
.landing-pricing__note a { color: var(--color-text-secondary); }

.landing-faq details {
  border-bottom: 1px solid var(--color-border);
  padding: 4px 0;
}
.landing-faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
  list-style-position: outside;
}
.landing-faq details p { margin: 4px 0 14px; }
.landing-faq a { color: var(--color-primary); }

.landing-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0 40px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 12px;
}
.landing-footer a { color: var(--color-text-secondary); }
.landing-footer a:hover { color: var(--color-text); }
.landing-footer p { margin: 0; }

@media (max-width: 700px) {
  .landing-feature,
  .landing-feature:nth-of-type(even) {
    flex-direction: column;
    gap: 18px;
  }
  .landing-pricing__cards { grid-template-columns: 1fr; }
  .landing-extension { flex-direction: column; }
}
