/* One Step – styles. Themes, text size and spacing are driven by data-* attributes on <html>. */

:root {
  --scale: 1;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1b1f2a;
  --muted: #4a5163;
  --primary: #3b4cca;
  --primary-text: #ffffff;
  --border: #b9bfd0;
  --focus: #ff8a00;
  --radius: 14px;
  --line: 1.6;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --letter: normal;
  --word: normal;
}

html[data-theme="dark"] {
  --bg: #12141c;
  --surface: #1c2030;
  --text: #f1f3fa;
  --muted: #b7bdd0;
  --primary: #8fa0ff;
  --primary-text: #10121a;
  --border: #4a5170;
}

html[data-theme="contrast"] {
  --bg: #000000;
  --surface: #000000;
  --text: #ffffff;
  --muted: #ffffff;
  --primary: #ffe600;
  --primary-text: #000000;
  --border: #ffffff;
  --focus: #00e5ff;
}

html[data-font="easy"] {
  --font: Verdana, "Trebuchet MS", "Atkinson Hyperlegible", Tahoma, sans-serif;
  --letter: 0.04em;
  --word: 0.12em;
}

html[data-spacing="on"] { --line: 2.0; }

html[lang="ur"] {
  --font: "Noto Naskh Arabic", "Segoe UI", Tahoma, "Geeza Pro", sans-serif;
  --line: 1.9;
}
html[lang="ur"][data-spacing="on"] { --line: 2.3; }

html { font-size: calc(100% * var(--scale)); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: var(--letter);
  word-spacing: var(--word);
  line-height: var(--line);
  font-size: 1.1rem;
}

/* Visible focus for keyboard users */
:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}
main:focus, h2[tabindex="-1"]:focus { outline: none; }

.skip {
  position: absolute;
  inset-inline-start: 0.5rem;
  top: -4rem;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 0.5rem; }

.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;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
}
.brand { margin: 0; font-size: 1.5rem; }

main, .panel, .foot {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem;
}

h2 { font-size: 1.6rem; line-height: 1.3; margin: 0.5rem 0; }

.hint { color: var(--muted); margin: 0.4rem 0; }
.label { display: block; font-weight: 700; margin-bottom: 0.4rem; }

.row { display: flex; gap: 0.6rem; align-items: stretch; }
.row.wrap { flex-wrap: wrap; }

input[type="text"], select {
  flex: 1;
  min-height: 3rem;
  padding: 0.5rem 0.8rem;
  font: inherit;
  letter-spacing: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  width: 100%;
}

.btn {
  min-height: 3rem;
  min-width: 3rem;
  padding: 0.5rem 1.1rem;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover { border-color: var(--primary); }
.btn.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn.ghost { background: transparent; }
.btn.big { width: 100%; font-size: 1.2rem; min-height: 3.5rem; margin-top: 0.8rem; }
.btn.icon { flex: 0 0 auto; font-size: 1.3rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  margin-block: 0.5rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.checks { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.check { display: flex; align-items: center; gap: 0.7rem; min-height: 2.75rem; }
.check input { width: 1.6rem; height: 1.6rem; flex: 0 0 auto; accent-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--primary); }

.task-name { margin: 0.2rem 0; color: var(--muted); }
.progress-text { margin: 0.2rem 0; font-weight: 700; }
progress {
  width: 100%;
  height: 1rem;
  accent-color: var(--primary);
}

.card {
  background: var(--surface);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  margin: 1rem 0;
}
.card h2 { font-size: 1.9rem; margin: 0 0 0.4rem; }

.timer {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.time {
  margin: 0 0 0.6rem;
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.timer .row { justify-content: center; }

.actions .row { margin-top: 0.8rem; }

.all-steps { margin: 1.2rem 0; }
.all-steps summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }
#stepList { padding-inline-start: 1.5rem; }
#stepList li { margin: 0.5rem 0; }
#stepList li.is-done .step-text { text-decoration: line-through; color: var(--muted); }
#stepList li.is-current .step-text { font-weight: 700; }
.step-line { display: flex; gap: 0.6rem; align-items: center; justify-content: space-between; }
.step-line .btn { min-height: 2.5rem; padding: 0.2rem 0.8rem; }

.foot { color: var(--muted); font-size: 0.95rem; text-align: center; }

#newTaskBtn { margin-top: 0.5rem; }

/* Gentle motion only, and none if the user asks for less */
.btn, .chip { transition: border-color 0.15s ease; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 30rem) {
  .time { font-size: 2.4rem; }
  .card h2 { font-size: 1.6rem; }
}
