/* Fast for Free: calm teal on light or dark (follows the system). Accent #0f766e with white text (5.5:1);
   in dark mode #2dd4bf with dark text (10:1). */
:root {
  --bg: #f6faf9; --surface: #ffffff; --surface2: #e6f0ee; --line: #c5d6d2; --text: #11201d; --muted: #4a5c58;
  --accent: #0f766e; --accent-text: #ffffff; --link: #0b6058; --track: #d9e7e4; --done: #b45309;
  --ok-bg: #dcf3ea; --ok-text: #0b5c3f; --miss-bg: #fbeee2; --miss-text: #8a3b00; --danger: #b42318;
  --shadow: 0 1px 2px rgba(16, 40, 36, .06), 0 4px 16px rgba(16, 40, 36, .06); --radius: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1715; --surface: #14211f; --surface2: #1c2c29; --line: #2f4541; --text: #e7f1ef; --muted: #a8bcb7;
    --accent: #2dd4bf; --accent-text: #04201c; --link: #5eead4; --track: #24403b; --done: #fbbf24;
    --ok-bg: #123a2e; --ok-text: #86efc0; --miss-bg: #3b2814; --miss-text: #fdc78d; --danger: #ff9b8f;
    --shadow: none;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus, h2:focus { outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); margin-top: .6em; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .92rem; color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { font-size: 1.12rem; color: var(--muted); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-text); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }

/* header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 10px 10px; color: var(--text); text-decoration: none; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface2); }
.nav a.pro { border: 1px solid var(--accent); color: var(--link); padding: 8px 12px; margin-left: 4px; }
.nav a.lang { font-size: .95rem; }
@media (max-width: 680px) { .nav .sec { display: none; } }
@media (max-width: 360px) { .brand img { display: none; } .nav a { padding: 10px 8px; } }

.foot { margin-top: 64px; border-top: 1px solid var(--line); padding: 32px 0 40px; background: var(--surface); }
.foot .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .6em; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0 0 .25em; }
.foot li a { display: inline-block; padding: 6px 0; color: var(--text); overflow-wrap: anywhere; }
.foot .fine { margin-top: 28px; font-size: .85rem; color: var(--muted); }
@media (max-width: 720px) { .foot .cols { grid-template-columns: 1fr; gap: 16px; } }
.crumbs { margin-top: 20px; }
.crumbs a { color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--accent); border-radius: 12px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
}
.btn:hover { filter: brightness(1.07); }
.btn.big { min-height: 54px; padding: 14px 24px; font-size: 1.1rem; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--surface2); filter: none; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.end { background: var(--surface2); border-color: var(--accent); color: var(--text); }
.btn:disabled { cursor: not-allowed; filter: none; background: var(--surface2); border-color: var(--line); color: var(--muted); }
.btn:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.linkbtn {
  background: none; border: 0; padding: 10px 8px; min-height: 44px; font: inherit; font-weight: 600; color: var(--link);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.linkbtn.danger { color: var(--danger); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge { display: inline-block; vertical-align: middle; font-size: .75rem; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); }

/* home */
.hero { padding: 8px 0 4px; max-width: 820px; }
.hero h1 { margin-bottom: .3em; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.badges li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; color: var(--muted); background: var(--surface); }

.ff { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 4px 0 40px; }
.ff > .warn { grid-column: 1 / -1; margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--miss-bg); color: var(--miss-text); font-weight: 600; }
.ff .side { display: grid; gap: 20px; }
@media (max-width: 860px) { .ff { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 .7em; font-size: 1.2rem; }
.card > :last-child { margin-bottom: 0; }

.timer { text-align: center; }
.plans { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.plans legend { font-weight: 700; margin: 0 auto 10px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); line-height: 1.15; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip .c-main { font-weight: 700; }
.chip .c-sub { font-size: .8rem; color: var(--muted); }
.chip:hover { background: var(--surface2); }
.chip:has(input:checked) { border: 2px solid var(--accent); padding: 5px 11px; background: var(--surface2); }
.chip:has(input:checked) .c-main::before { content: "✓ "; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.custom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; }
.custom label { font-weight: 600; }
input[type="number"], input[type="datetime-local"] {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 8px 10px;
}
input[type="number"] { width: 6em; }
input[aria-invalid="true"] { border: 2px solid var(--danger); }

.ring { position: relative; width: min(100%, 280px); margin: 16px auto 8px; aspect-ratio: 1; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 16; }
.ring .track { stroke: var(--track); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.timer:not(.running) .ring .bar { stroke-linecap: butt; }
.timer.done .ring .bar { stroke: var(--done); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 36px; }
.ring-in p { margin: 0; }
.ring-label { font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.timer.done .ring-label { color: var(--done); }
.ring-time { font-size: clamp(2rem, 1.4rem + 3vw, 2.8rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.15; margin: 4px 0 !important; }
.ring-sub { color: var(--muted); font-size: .95rem; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 16px; }
.times div { background: var(--bg); border-radius: 12px; padding: 8px; }
.times dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.times dd { margin: 0; font-weight: 600; }
.acts { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.acts .btn.big { width: min(100%, 320px); }
.since { margin: 12px 0 0; }

.ad-slot { margin-top: 20px; text-align: center; min-height: 120px; }
.ad-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.adsbygoogle { display: block; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.stats div { background: var(--bg); border-radius: 12px; padding: 10px; }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.week { margin: 0; }
.week figcaption { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; margin: 0; }
.bars li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.b-val { font-size: .78rem; color: var(--muted); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.b-track { position: relative; width: 100%; max-width: 34px; height: 96px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.b-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); }
.b-day { font-size: .8rem; color: var(--muted); }
.bars li.today .b-day { color: var(--text); font-weight: 700; }

.hist { list-style: none; padding: 0; margin: 0; }
.h-item { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.h-item:first-child { border-top: 0; padding-top: 0; }
.h-item p { margin: 0; }
.h-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.h-top strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tag { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag.met { background: var(--ok-bg); color: var(--ok-text); }
.tag.missed { background: var(--miss-bg); color: var(--miss-text); }
.h-acts { margin-left: -8px !important; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.filebtn { position: relative; display: inline-flex; }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.filebtn input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .wrap-row > * { flex: 1 1 100%; } .wrap-row .btn { width: 100%; } }
.pro-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; transform: translate(-50%, 160%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); width: max-content; padding: 6px 8px 6px 16px;
  border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); transition: transform .25s ease; visibility: hidden;
}
.toast.on { transform: translate(-50%, 0); visibility: visible; }
.toast .linkbtn { color: var(--bg); }
.toast span { padding: 8px 0; }
@media (prefers-reduced-motion: reduce) { .toast, .ring .bar { transition: none; } }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 20px; width: min(420px, calc(100% - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog h2 { margin: 0 0 .8em; font-size: 1.2rem; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; }
.field input { width: 100%; }
.err { color: var(--danger); font-weight: 600; min-height: 1.5em; margin: 0 0 8px; }
.noscript { grid-column: 1 / -1; padding: 12px 16px; border-radius: 12px; background: var(--miss-bg); color: var(--miss-text); }

/* content pages */
.content h2 { margin-top: 1.8em; }
.content li { margin-bottom: .4em; }
.note { border-left: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 12px 12px 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.table-wrap:focus-visible { outline: 3px solid var(--accent); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface2); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.faq { margin-top: 40px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 0 0 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 16px; min-height: 44px; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }
