/* ---------- Базові стилі: скидання, аркуш, типографіка, утиліти ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* Атрибут hidden ЗАВЖДИ перемагає display з компонентів нижче. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 560px at 50% -12%, var(--accent-wash), transparent 62%),
    var(--paper-grain);
  background-repeat: no-repeat, repeat;
  /* без background-attachment: fixed — він змушує перемальовувати весь фон
     на кожному кроці прокрутки довгої шкали дня */
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
svg { flex-shrink: 0; }

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

::selection { background: var(--accent-soft); }

/* Ручне тремтіння лінії — лише декоративні рамки й іконки, ніколи текст. */
.sketchy { filter: url(#pencil-rough-sm); }
.sketch-frame { position: relative; }
.sketch-frame::before {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1.5px solid var(--hairline);
  border-radius: inherit;
  filter: url(#pencil-rough);
  pointer-events: none;
}

.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hand { font-family: var(--font-hand); }
.muted { color: var(--text-lo); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.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;
}

/* Кольорова мітка задачі — короткий «штрих», а не кружечок. */
.stroke-dot {
  width: 4px; height: 14px; border-radius: 2px;
  background: var(--c, var(--hairline));
  flex-shrink: 0;
  transform: rotate(12deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
