/* ClockIn: assets/settings/settings.css. Part of what was style.css (split in 1.42.2, rules moved as is). The load order in index.html matters: see CLAUDE.md */
/* ============================================================
   ONBOARDING WALKTHROUGH (first-run setup, see openOnboarding in app.js)
   ============================================================ */
/* A fixed height (not just max-width) so the card doesn't grow and shrink
   between steps — the shortest step (2) centers inside .onboarding-steps
   below instead of leaving the card looking collapsed. */
.onboarding-card { max-width: 420px; height: 560px; max-height: 90vh; overflow-y: auto; text-align: center; }
.onboarding-card h3 { text-align: center; }
.onboarding-card .section-note, .onboarding-card label { text-align: left; }

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--space-2);
}
.onboarding-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
}
.onboarding-dot.active { background: var(--ink); }

/* The one visible step centers vertically in the space between the logo
   row and the action buttons, so a short step (backup) doesn't just sit
   pinned to the top of a tall, mostly-empty card. */
.onboarding-steps {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.onboarding-step.hidden { display: none; }

.onboarding-lead { font-weight: 600; margin: var(--space-2) 0 4px; }

/* Skip stays on the left; Back and Next/Start Tracking group together on
   the right, unlike the flush-right default every other modal uses. */
.onboarding-actions { justify-content: space-between; }
.onboarding-actions-right { display: flex; gap: 8px; }

/* Three real choices (cancel / forward-only / retroactive) read
   better stacked full-width than squeezed into a right-aligned row
   like the simpler two-button modals. */
#rate-change-modal .modal-card { max-width: 420px; }

.rate-change-actions {
  flex-direction: column;
  align-items: stretch;
}

.rate-change-actions button { width: 100%; text-align: center; }

/* Switch intent modal (1.21.1): same stacked full-width choices. */
#switch-intent-modal .modal-card { max-width: 440px; }
.switch-intent-actions { flex-direction: column; align-items: stretch; }
.switch-intent-actions button { width: 100%; text-align: center; }
.switch-intent-actions button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Wider than the default 380px modal — needs room for a scrollable
   list of flagged duplicate rows, not just a couple of form fields. */
.import-preview-card { max-width: 560px; max-height: 80vh; overflow-y: auto; }

.import-preview-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  margin: 8px 0;
}

.import-preview-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: var(--font-size-base);
}

.import-preview-row:last-child { border-bottom: none; }
.import-preview-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

.import-preview-row-detail { color: var(--text-muted); font-size: var(--font-size-sm); margin-top: 2px; }

.import-error-list {
  max-height: 140px;
  overflow-y: auto;
  color: var(--danger);
  font-size: var(--font-size-sm);
}

.report-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px 0;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.report-pagination-controls { display: flex; align-items: center; gap: 4px; }

.page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--paper);
  color: var(--ink-light);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-ellipsis { padding: 0 2px; color: var(--text-muted); }

/* ============================================================
   DEV LOCK (1.39.5)
   Settings > Dev (was Advanced) behind a password. See DEV LOCK in
   app.js. No global .hidden rule, so each hideable piece has its own.
   ============================================================ */
.dev-lock.hidden,
.dev-content.hidden,
.dev-lock-error.hidden { display: none; }
.dev-lock-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
#tab-settings .dev-lock-form input[type="password"] {
  box-sizing: border-box;
  height: var(--btn-h-md);
  padding: 0 12px;
  width: 240px;
  max-width: 100%;
  font: inherit;
  font-size: var(--font-size-base);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface, transparent);
  color: inherit;
}
.dev-lock-error {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--danger, #d64545);
}
.dev-lock-actions { margin-bottom: var(--space-4); }
/* Achievement Testing sits on Dev now: no extra space under it there. */
#ach-test-root .ach-test-bar { margin-bottom: 0; }
.ach-test-note { margin-bottom: var(--space-4); }

/* ============================================================
   PHONE LAYOUT (1.45.0), 700px and below: every Settings page
   A setting's label gets a line of its own and its controls go under it
   (on a wide screen the label is a column on the left, which left the
   controls too little room on a phone). Choice buttons (.segmented) with
   many choices wrap onto more lines instead of running off the screen.
   #tab-settings so these beat the per-page rules in zen-pomodoro.css,
   reminders.css and the rest, whatever their load order.
   ============================================================ */
@media (max-width: 700px) {
  #tab-settings .settings-row.field-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
  }
  #tab-settings .field-row > .field-label { flex: 1 0 100%; width: auto; min-width: 0; color: var(--ink); }
  #tab-settings .field-row .field-unit { max-width: none; min-width: 0; }
  #tab-settings .field-controls { flex: 1 1 100%; min-width: 0; }
  #tab-settings .field-controls select { min-width: 0; flex: 1 1 160px; }
  #tab-settings .settings-row select { max-width: 100%; min-width: 0; }

  /* Fields under a switch line up with the switch, not with its text: the
     58px they are moved in by on a wide screen is too much room here. */
  #tab-settings .rule-fields { margin-left: 0; }
  /* Break length (Reminders) is indented like those fields but not under a
     switch; the same here (2.6.1). Its long unit stays beside the box and
     wraps there instead of dropping under it. */
  #tab-settings .rule-indent { margin-left: 0; }
  #tab-settings .field-row .field-unit { flex: 1 1 0; }

  #tab-settings .theme-appearance { gap: var(--space-3) var(--space-4); }
  #tab-settings .theme-appearance-label { flex: 1 0 100%; min-width: 0; }
  /* Choice buttons (2.6.1): each line of buttons fills the width, so a
     wrapped choice (Nothing, Just Delete; 60 Minutes) gets a full line
     instead of a short button bunched at the left, and the lines sit 12px
     apart. */
  #tab-settings .segmented { display: flex; width: 100%; gap: var(--space-3) var(--space-2); }
  #tab-settings .segmented-opt { flex: 1 1 auto; }

  /* Appearance: one theme or font card per line (the cards are at least
     420px wide on a wider screen). */
  #tab-settings .theme-cards.is-grid { grid-template-columns: minmax(0, 1fr); }
  /* List view: the name on its line, the Light and Dark strips under it,
     one per line. */
  #tab-settings .is-list .theme-card-inner { flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3); }
  #tab-settings .is-list .theme-card-head { width: auto; flex: 1 1 100%; }
  #tab-settings .is-list .theme-card-modes { margin-left: 0; flex: 1 1 100%; flex-direction: column; gap: var(--space-2); }
  #tab-settings .is-list .theme-card-actions { width: auto; flex-wrap: wrap; }

  /* Theme builder (2.0.4): fields full width, buttons wrap under the
     dropdowns, the Light / Dark choice wraps under "Editing" (its label
     takes a full line above), color rows are label | swatch | hex, and
     the contrast table scrolls inside its box if it is still too wide. */
  #tab-settings .theme-builder { padding: var(--space-3); }
  #tab-settings .tb-top { gap: var(--space-3); }
  #tab-settings .tb-labeled { flex: 1 1 100%; min-width: 0; }
  #tab-settings .tb-labeled input[type="text"] { width: 100%; }
  #tab-settings .tb-inline { flex-wrap: wrap; }
  #tab-settings .tb-inline select { flex: 1 1 100%; min-width: 0; max-width: none; }
  #tab-settings .tb-mode-row { flex-wrap: wrap; gap: var(--space-2); }
  #tab-settings .tb-field { grid-template-columns: minmax(0, 1fr) 40px 124px; }
  #tab-settings .tb-field label { min-width: 0; overflow-wrap: anywhere; }
  #tab-settings .tb-checks { overflow-x: auto; }
  #tab-settings .tb-fields-col > .btn-secondary { display: flex; width: fit-content; }

  /* Font builder (2.0.4): each label on its own line with its dropdown or
     size field under it (the label was a 240px column, which pushed the
     dropdowns off the screen). */
  #tab-settings .font-custom { padding: var(--space-3); }
  #tab-settings .font-custom-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-1) 0; }
  #tab-settings .font-custom-grid > label { margin-top: var(--space-2); }
  #tab-settings .font-custom-grid select { width: 100%; min-width: 0; }
  #tab-settings .font-sample-row { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); }
  #tab-settings .font-add-row input { width: 100%; }
}

/* ============================================================
   SETTINGS SPACING (1.55.0)
   One spacing for every Settings page (it was only Zen Clock and the
   Pomodoro Timer, the rest had gaps from 0 to 14px):
     48px above a divider line, 32px below it,
     16px under a heading (8px to a note right under it),
     24px between one row and the next,
     16px from a row to the note that explains it, 24px after the note.
   #tab-settings .settings-page so these win over the older per-file rules
   (.settings-row in manage.css, .field-row in reminders.css) whatever
   the load order. Layouts inside a row (grids, the two column Do Not
   Allow pairs) are left alone.
   ============================================================ */
#tab-settings .settings-page h2 { margin: var(--space-6) 0 var(--space-4); }
#tab-settings .settings-page .settings-divider { margin: var(--space-7) 0 var(--space-6); }
#tab-settings .settings-page .settings-divider + h2 { margin-top: 0; }
#tab-settings .settings-page h3.backup-sub { margin: var(--space-6) 0 var(--space-4); }
#tab-settings .settings-page .settings-row { margin: 0 0 var(--space-5); }
#tab-settings .settings-page .section-note { margin: calc(-1 * var(--space-2)) 0 var(--space-5); max-width: 620px; }
#tab-settings .settings-page > h1 + .section-note { margin-top: 0; }
/* In the Theme and Font builders a note follows a button or a table, not a
   heading, so it doesn't move up under it (2.0.4: the note covered the
   Copy Light Colors To Dark button). */
#tab-settings .settings-page .tb-fields-col .section-note,
#tab-settings .settings-page .tb-checks .section-note { margin-top: 20px; }
#tab-settings .settings-page .font-custom [data-fs-action="reset-sizes"] { margin-bottom: var(--space-5); }
#tab-settings .settings-page .backup-actions { margin: 0 0 var(--space-5); }
#tab-settings .settings-page .br-picker { margin: 0 0 var(--space-5); }
/* The Do Not Allow pairs are a grid: its rows' margins don't merge with
   the divider under it, so the pair carries the 24px instead. */
#tab-settings .settings-page .require-pair { margin: 0 0 var(--space-5); }
#tab-settings .settings-page .require-pair .settings-row { margin-bottom: 0; }
/* Selects look like the number and text fields beside them (they had the
   browser's own dark square border). */
#tab-settings select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
