/* ═══════════════════════════════════════════════════════════════════════
   Pomodoro: foco com pausas, tarefas e música. Visual escuro e quente, com um anel grande e uma cor por fase.
   A cor do projeto vem de --accent / --accent-2 (o <body> as recebe do catálogo, src/data/projects.js).
   As cores com função fixa são as das fases (--c-focus, --c-short, --c-long) e o tom que se lê em cima delas (--ink-*): o JS as
   repete em public/js/pomodoro-engine.js (PHASES) e test/pomodoro.test.js confere que são as mesmas e que passam no contraste.
   --phase é a cor da fase de agora: o <body> a troca (data-kind) e ela desliza de uma cor para outra (@property).
   Movimento: juice.js põe data-motion="reduced" no <html> (opção Animações ou sistema pedindo menos movimento).
   Não depende de tokens.css nem de Bootstrap.
   ═══════════════════════════════════════════════════════════════════════ */

@property --phase { syntax: '<color>'; inherits: true; initial-value: #ff6b57; }
@property --phase-ink { syntax: '<color>'; inherits: true; initial-value: #120704; }

:root {
	color-scheme: dark;
	--accent: #ff6b57;
	--accent-2: #ffb199;
	--bg: #0c0807;
	--panel: rgb(255 255 255 / .05);
	--panel-2: rgb(255 255 255 / .09);
	--ink: #f8eeea;
	--ink-2: #d9c8c2;
	--ink-3: #ab9890;
	--line: rgb(255 255 255 / .12);
	--c-focus: #ff6b57;
	--c-short: #4ade80;
	--c-long: #60a5fa;
	--ink-focus: #120704;
	--ink-short: #06130a;
	--ink-long: #071426;
	--danger: #f87171;
	--ease: cubic-bezier(.2, .8, .2, 1);
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
	--radius: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	--phase: var(--c-focus);
	--phase-ink: var(--ink-focus);
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	background: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.5 var(--font);
	-webkit-tap-highlight-color: transparent;
	transition: --phase .7s ease, --phase-ink .7s ease;
}
body[data-kind="short"] { --phase: var(--c-short); --phase-ink: var(--ink-short); }
body[data-kind="long"] { --phase: var(--c-long); --phase-ink: var(--ink-long); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flip { transform: scaleX(-1); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--phase) 70%, #fff); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: rgb(255 255 255 / .06); font: 700 .78em/1.5 var(--mono); text-align: center; }
code { font: 500 .9em/1.4 var(--mono); }

/* ───────── Fundo: a cor da fase ilumina a página ───────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--phase) 14%, #150e0c) 0%, var(--bg) 62%); }
.bg i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(120px); opacity: .14; }
.bg i:nth-child(1) { left: -22vmax; top: -28vmax; background: var(--phase); animation: drift 30s ease-in-out infinite alternate; }
.bg i:nth-child(2) { right: -28vmax; bottom: -32vmax; background: var(--accent-2); opacity: .08; animation: drift 36s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(7vmax, 5vmax) scale(1.12); } }
.grid { position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(color-mix(in srgb, var(--phase) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--phase) 6%, transparent) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 55% at 50% 0%, #000, transparent); }

/* ───────── Esqueleto de carregamento ───────── */
.sk { display: block; border-radius: 8px; background: linear-gradient(100deg, rgb(255 255 255 / .06) 30%, rgb(255 255 255 / .14) 50%, rgb(255 255 255 / .06) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }
.sk--player { position: absolute; inset: 0; border-radius: 0; }
@keyframes shimmer { to { background-position: -220% 0; } }
body[data-phase="boot"] .clock { color: transparent; border-radius: 16px; background: linear-gradient(100deg, rgb(255 255 255 / .06) 30%, rgb(255 255 255 / .14) 50%, rgb(255 255 255 / .06) 70%) 0 0 / 220% 100%; animation: shimmer 1.4s linear infinite; }

/* ───────── Topo ───────── */
.top { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: max(.8rem, env(safe-area-inset-top)) clamp(.9rem, 3vw, 1.6rem) .8rem; }
.pill { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .35rem .95rem .35rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-size: .88rem; font-weight: 600; text-decoration: none; transition: border-color .2s, color .2s; }
.pill:hover { border-color: color-mix(in srgb, var(--phase) 55%, transparent); color: var(--ink); }
.brand { display: flex; align-items: center; gap: .55rem; font: 800 1.3rem/1 var(--font); letter-spacing: -.02em; }
.brand__logo { width: 1.9rem; height: 1.9rem; stroke: none; }
.top__tools { display: flex; gap: .4rem; }
.tool { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink-2); transition: border-color .2s, color .2s, background .2s; }
.tool:hover { border-color: color-mix(in srgb, var(--phase) 55%, transparent); color: var(--ink); }
.tool[aria-pressed="false"] { color: var(--ink-3); background: transparent; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.tool[aria-pressed="false"] .i { opacity: .55; }

/* ───────── Corpo ───────── */
.app { width: min(1180px, 100%); margin: 0 auto; padding: .4rem clamp(.9rem, 3vw, 1.6rem) 2rem; display: grid; gap: 1.1rem; }
.nojs { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.lead__title { font: 800 clamp(1.5rem, 3.4vw, 2.2rem)/1.15 var(--font); letter-spacing: -.025em; }
.lead__text { max-width: 62ch; margin-top: .4rem; color: var(--ink-2); }
.lead__text b { color: var(--ink); }

.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.side { display: grid; gap: 1.1rem; min-width: 0; align-content: start; }
@media (min-width: 980px) {
	.board { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
	.timer { position: sticky; top: 1rem; }
}

.card { position: relative; min-width: 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgb(255 255 255 / .065), rgb(255 255 255 / .025)); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 18px 50px -26px rgb(0 0 0 / .85); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; }
.card__title { display: flex; align-items: center; gap: .55rem; font: 700 1.05rem/1.2 var(--font); }
.card__title .i { color: var(--phase); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .9rem; }
/* sem nada à vista (histórico vazio), o rodapé do cartão não deixa um vão */
.card__foot:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.sub { margin: 1.1rem 0 .55rem; color: var(--ink-3); font: 700 .78rem/1.2 var(--font); letter-spacing: .07em; text-transform: uppercase; }
.card__head + .sub { margin-top: 0; }
.fine { margin-top: .8rem; color: var(--ink-3); font-size: .82rem; line-height: 1.45; }
.fine--note { margin-top: .5rem; color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-weight: 600; font-size: .92rem; transition: transform .15s var(--ease), border-color .2s, background .2s, filter .2s; }
.btn:hover { border-color: color-mix(in srgb, var(--phase) 55%, transparent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--primary { border-color: transparent; background: var(--phase); color: var(--phase-ink); font-weight: 700; }
.btn--primary:hover { border-color: transparent; filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn--danger { border-color: transparent; background: var(--danger); color: #1f0707; font-weight: 700; }
.btn--danger:hover { border-color: transparent; filter: brightness(1.08); }
.btn--sm { min-height: 38px; padding: .25rem .8rem; font-size: .85rem; }
.btn[aria-pressed="true"] { border-color: color-mix(in srgb, var(--phase) 60%, transparent); color: var(--ink); }

/* ───────── Cronômetro ───────── */
.timer { display: grid; justify-items: center; padding: 1.3rem 1.2rem 1.4rem; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.kind { display: grid; gap: .05rem; justify-items: center; min-height: 56px; padding: .35rem .4rem; border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); transition: background .25s, color .25s, box-shadow .25s; }
.kind__name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.kind__min { color: var(--ink-3); font-size: .78rem; font-weight: 600; }
.kind:hover { background: var(--panel-2); color: var(--ink); }
.kind[aria-pressed="true"] { background: var(--phase); color: var(--phase-ink); box-shadow: 0 8px 24px -10px var(--phase); }
.kind[aria-pressed="true"] .kind__min { color: var(--phase-ink); font-weight: 700; }

.ringbox { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 1.3rem auto .9rem; container-type: inline-size; }
.ring { width: 100%; height: 100%; display: block; overflow: visible; }
.ring__ticks { fill: none; stroke: rgb(255 255 255 / .17); stroke-width: 6; stroke-dasharray: 1.6 12.223; }
.ring__track { fill: none; stroke: rgb(255 255 255 / .08); stroke-width: 14; }
.ring__bar { fill: none; stroke: url(#ringG); stroke-width: 14; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 140px 140px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--phase) 55%, transparent)); transition: stroke-dashoffset .3s linear, opacity .2s; }
.ring__s1 { stop-color: var(--phase); }
.ring__s2 { stop-color: color-mix(in srgb, var(--phase) 55%, #fff); }
.ring__tip { transform-origin: 140px 140px; transition: transform .3s linear; }
.ring__tip circle { fill: #fff; filter: drop-shadow(0 0 6px var(--phase)); }
.ringbox.snap .ring__bar, .ringbox.snap .ring__tip { transition: none; }
body[data-run="running"] .ring__bar { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--phase) 80%, transparent)); } }
.ring__center { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .15em; text-align: center; padding: 14%; }
.clock { font: 800 21cqw/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.ring__phase { color: var(--phase); font: 800 4.4cqw/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; }
body[data-run="paused"] .clock { opacity: .7; }
body[data-run="paused"] .ring__phase::after { content: ' · pausado'; color: var(--ink-2); }
.ring__task { max-width: 100%; margin-top: .4em; color: var(--ink-2); font: 500 4.2cqw/1.3 var(--font); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.dots { display: flex; justify-content: center; gap: .5rem; min-height: 12px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: rgb(255 255 255 / .16); transition: background .3s, box-shadow .3s, transform .3s var(--ease); }
.dot.is-on { background: var(--c-focus); box-shadow: 0 0 12px color-mix(in srgb, var(--c-focus) 70%, transparent); transform: scale(1.1); }

.controls { display: flex; align-items: center; justify-content: center; gap: 1.1rem; margin-top: 1.3rem; }
.round { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--ink-2); transition: transform .15s var(--ease), border-color .2s, color .2s, background .2s; }
.round .i { width: 1.4em; height: 1.4em; }
.round:hover { border-color: color-mix(in srgb, var(--phase) 55%, transparent); color: var(--ink); }
.round:active { transform: scale(.94); }
.round--sm { width: 40px; height: 40px; flex: none; }
.round--sm .i { width: 1.15em; height: 1.15em; }
.main { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-width: 11rem; min-height: 64px; padding: 0 2rem; border: 0; border-radius: 999px; background: var(--phase); color: var(--phase-ink); font: 800 1.15rem/1 var(--font); box-shadow: 0 16px 36px -14px var(--phase); transition: transform .15s var(--ease), filter .2s, box-shadow .3s; }
.main .i { width: 1.35em; height: 1.35em; fill: currentColor; stroke: currentColor; }
.main:hover { filter: brightness(1.08); }
.main:active { transform: scale(.97); }
.timer__hint { margin-top: 1.1rem; color: var(--ink-3); font-size: .82rem; text-align: center; }
.exit-focus { display: none; margin-top: 1.4rem; }
/* no celular não há teclado: a dica de atalhos some */
@media (hover: none) and (pointer: coarse) { .timer__hint, .foot__keys { display: none; } }

/* ───────── Campos e linhas de adicionar ───────── */
.add { display: flex; gap: .5rem; }
.field { flex: 1; min-width: 0; min-height: 44px; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / .05); color: var(--ink); transition: border-color .2s, background .2s; }
.field::placeholder { color: var(--ink-3); }
.field:hover { border-color: rgb(255 255 255 / .22); }
.field:focus { border-color: var(--phase); background: rgb(255 255 255 / .08); }
.field--num { flex: none; width: 5.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.field__err { margin-top: .45rem; color: #fca5a5; font-size: .86rem; line-height: 1.4; }

/* ───────── Tarefas ───────── */
.tasks { display: grid; gap: .4rem; margin-top: .9rem; max-height: 23rem; overflow-y: auto; padding-right: 2px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .3rem; padding: .25rem .35rem .25rem .3rem; border: 1px solid transparent; border-radius: 14px; background: rgb(255 255 255 / .035); transition: border-color .25s, background .25s; }
.task.is-current { border-color: color-mix(in srgb, var(--c-focus) 55%, transparent); background: color-mix(in srgb, var(--c-focus) 10%, transparent); }
.task__check { position: relative; display: grid; place-items: center; width: 30px; height: 30px; margin: 0 .2rem; border: 2px solid var(--ink-3); border-radius: 50%; background: transparent; color: transparent; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease); }
.task__check::before { content: ''; position: absolute; inset: -9px; }
.task__check .i { width: 1em; height: 1em; stroke-width: 3; }
.task__check:hover { border-color: var(--c-short); }
.task__check[aria-checked="true"] { border-color: var(--c-short); background: var(--c-short); color: var(--ink-short); }
.task__text { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; min-height: 44px; padding: .3rem .4rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-weight: 500; text-align: left; }
.task__text:disabled { cursor: default; color: var(--ink-3); }
.task__name { flex: 1 1 7rem; min-width: 0; overflow-wrap: anywhere; }
.task__tag { flex: none; padding: .1rem .55rem; border-radius: 999px; background: var(--c-focus); color: var(--ink-focus); font-size: .7rem; font-weight: 800; letter-spacing: .03em; }
.task.is-done .task__name { text-decoration: line-through; color: var(--ink-3); }
.task__pomos { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem; border-radius: 999px; background: rgb(255 255 255 / .08); color: var(--ink-2); font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.task__pomos::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c-focus); }
.task__del { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); transition: color .2s, background .2s; }
.task__del:hover { color: var(--danger); background: rgb(248 113 113 / .12); }
.task__del .i { width: 1.05em; height: 1.05em; }

.empty { display: grid; justify-items: center; gap: .3rem; padding: 1.2rem .6rem .6rem; text-align: center; }
.empty__art { width: 76px; height: 76px; fill: none; stroke: var(--c-focus); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; margin-bottom: .4rem; }
.empty__title { font-weight: 700; }
.empty__text { max-width: 36ch; color: var(--ink-3); font-size: .9rem; line-height: 1.45; }
.card > .empty__text { margin-top: .9rem; text-align: center; margin-inline: auto; }

/* ───────── Música e sons de fundo ───────── */
.noises, .suggest { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggest { margin-top: .7rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .3rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink-2); font-weight: 600; font-size: .88rem; transition: border-color .2s, background .2s, color .2s, transform .15s var(--ease); }
.chip:hover { border-color: color-mix(in srgb, var(--phase) 55%, transparent); color: var(--ink); }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { border-color: var(--phase); background: color-mix(in srgb, var(--phase) 18%, transparent); color: var(--ink); }
.chip--ghost { min-height: 38px; font-size: .84rem; background: transparent; }
.chip .i { width: 1em; height: 1em; }
.vol { display: flex; align-items: center; gap: .7rem; margin-top: .8rem; color: var(--ink-2); font-size: .88rem; }
.vol input[type="range"] { flex: 1; min-width: 0; height: 32px; accent-color: var(--phase); cursor: pointer; }
.vol output { min-width: 3ch; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.vol--inline { margin: 0; width: 8rem; flex: none; }
.vol--row { margin-top: 1rem; flex-wrap: wrap; }
.player { margin-top: .9rem; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #000; }
.player__frame { position: relative; width: 100%; min-height: 200px; aspect-ratio: 16 / 9; background: #000; }
.player__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__bar { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; background: #17100e; }
.player__status { flex: 1; min-width: 0; color: var(--ink-2); font-size: .85rem; }

/* ───────── Estatísticas ───────── */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.figure { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.figure dt { order: 2; color: var(--ink-3); font-size: .78rem; line-height: 1.3; }
.figure dd { order: 1; font: 800 1.45rem/1.1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart { position: relative; margin-top: 1.1rem; padding-top: 1.2rem; }
.chart__top { position: absolute; top: 0; left: 0; color: var(--ink-3); font-size: .72rem; font-variant-numeric: tabular-nums; }
.bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 168px; }
.bars::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); pointer-events: none; }
.bar { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%; border-radius: 10px; outline-offset: -2px; transition: background .2s; }
.bar:hover, .bar:focus-visible { background: rgb(255 255 255 / .05); }
.bar__col { position: relative; display: flex; flex: 1; align-items: flex-end; justify-content: center; border-bottom: 1px solid rgb(255 255 255 / .26); }
.bar__fill { display: block; width: min(24px, 60%); height: 3px; border-radius: 2px; background: rgb(255 255 255 / .22); transition: height .55s var(--ease), filter .2s; }
.bar:not(.is-zero) .bar__fill { border-radius: 4px 4px 0 0; background: var(--c-focus); }
.bar:hover .bar__fill, .bar:focus-visible .bar__fill { filter: brightness(1.2); }
.bar__value { position: absolute; left: 50%; transform: translateX(-50%); color: var(--ink); font-size: .72rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.bar__day { height: 24px; padding-top: .35rem; color: var(--ink-3); font-size: .76rem; text-align: center; }
.bar.is-today .bar__day { color: var(--ink); font-weight: 800; }
.tip { position: absolute; z-index: 6; display: grid; gap: .1rem; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #1d1412; box-shadow: 0 14px 34px -12px #000; white-space: nowrap; pointer-events: none; transform: translateX(-50%); }
.tip__value { font-weight: 800; font-variant-numeric: tabular-nums; }
.tip__day { color: var(--ink-2); font-size: .78rem; }
.table { width: 100%; margin-top: 1rem; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .5rem .35rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 500; }
.table thead th { color: var(--ink-3); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.table td, .table thead th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.usage-wrap { margin-top: .6rem; }

/* ───────── Rodapé, avisos e janelas ───────── */
.foot { margin-top: auto; padding: 1.4rem clamp(.9rem, 3vw, 1.6rem) max(1.4rem, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-3); font-size: .85rem; text-align: center; }
.foot p + p { margin-top: .35rem; }
.foot a { color: var(--ink-2); }
.toasts { position: fixed; z-index: 60; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); display: grid; gap: .5rem; width: min(30rem, calc(100vw - 1.6rem)); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .8rem; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 14px; background: #1a1210; box-shadow: 0 14px 40px -12px rgb(0 0 0 / .8); font-size: .92rem; pointer-events: auto; animation: toastin .3s var(--ease) both; }
.toast--bad { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.toast.is-out { animation: toastout .2s ease-in both; }
.toast__text { flex: 1; }
.toast__btn { min-height: 36px; padding: .25rem .8rem; border: 1px solid color-mix(in srgb, var(--phase) 55%, transparent); border-radius: 10px; background: transparent; color: var(--ink); font-weight: 700; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.dlg { width: min(34rem, calc(100vw - 1.6rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: #160f0d; color: var(--ink); box-shadow: 0 30px 80px -20px #000; }
.dlg--wide { width: min(40rem, calc(100vw - 1.6rem)); }
.dlg::backdrop { background: rgb(0 0 0 / .65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg[open] { animation: dlgin .28s var(--ease) both; }
@keyframes dlgin { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.dlg__box { display: grid; gap: .9rem; padding: 1.2rem 1.3rem 1.1rem; }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dlg__head h2 { font: 800 1.3rem/1.2 var(--font); letter-spacing: -.02em; }
.dlg__lead { color: var(--ink-2); }
.dlg__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.dlg__sub { font: 700 1rem/1.2 var(--font); }
.dlg__fine { color: var(--ink-3); font-size: .86rem; }
.steps { display: grid; gap: .7rem; padding-left: 1.2rem; list-style: decimal; color: var(--ink-2); }
.steps b { color: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .5rem .9rem; }
.keys > div { display: flex; align-items: center; gap: .6rem; }
.keys dt { min-width: 3.4rem; }
.keys dd { color: var(--ink-2); font-size: .9rem; }

.set { display: grid; gap: .2rem; margin: 0; padding: .9rem 1rem 1rem; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.set legend { padding: 0 .5rem; color: var(--ink-3); font: 700 .78rem/1.2 var(--font); letter-spacing: .07em; text-transform: uppercase; }
.nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.num label { display: block; margin-bottom: .35rem; color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.num__box { display: flex; align-items: center; gap: .55rem; color: var(--ink-3); font-size: .88rem; }
.switch { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .9rem; padding: .7rem .1rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-of-type { border-bottom: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__box { position: relative; width: 46px; height: 28px; border-radius: 999px; background: rgb(255 255 255 / .16); transition: background .25s; }
.switch__box::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .4); transition: transform .25s var(--ease); }
.switch input:checked + .switch__box { background: var(--phase); }
.switch input:checked + .switch__box::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__box { outline: 3px solid color-mix(in srgb, var(--phase) 70%, #fff); outline-offset: 3px; }
.switch input:disabled ~ * { opacity: .5; }
.switch:has(input:disabled) { cursor: default; }
.switch__text { display: grid; gap: .1rem; }
.switch__text small { color: var(--ink-3); font-size: .84rem; line-height: 1.4; }

/* ───────── Modo foco: só o anel ───────── */
body[data-focusmode="on"] .top, body[data-focusmode="on"] .lead, body[data-focusmode="on"] .side, body[data-focusmode="on"] .usage-wrap, body[data-focusmode="on"] .foot,
body[data-focusmode="on"] .timer__hint, body[data-focusmode="on"] .kinds { display: none; }
body[data-focusmode="on"] .app { flex: 1; align-content: center; width: 100%; }
body[data-focusmode="on"] .board { grid-template-columns: minmax(0, 1fr); place-items: center; }
body[data-focusmode="on"] .timer { position: static; width: min(100%, 640px); border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body[data-focusmode="on"] .ringbox { width: min(88vw, 62vh, 560px); }
/* o botão de sair fica no canto de cima: os avisos aparecem embaixo e cobririam um botão no pé da tela */
body[data-focusmode="on"] .exit-focus { display: inline-flex; position: fixed; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); z-index: 20; margin: 0; }

/* ───────── Telas estreitas ───────── */
@media (max-width: 600px) {
	.pill span { display: none; }
	.pill { padding: .35rem .75rem; }
	.brand { font-size: 1.15rem; }
	.top__tools { gap: .3rem; }
	.tool { width: 38px; height: 38px; }
	.kind__name { font-size: .84rem; }
	.controls { gap: .8rem; }
	.main { min-width: 9.5rem; padding: 0 1.4rem; }
	.nums { grid-template-columns: minmax(0, 1fr); }
	.figures { gap: .4rem; }
	.figure { padding: .65rem .6rem; }
	.figure dd { font-size: 1.2rem; }
	.vol--inline { width: 6rem; }
}
@media (max-width: 380px) {
	/* o contador de focos desce para a segunda linha: ao lado do nome, não sobrava largura para o texto */
	.task { grid-template-columns: auto minmax(0, 1fr) auto; }
	.task__pomos { grid-column: 2; grid-row: 2; justify-self: start; margin: 0 0 .35rem .45rem; }
}
@media (max-width: 360px) {
	.top { gap: .4rem; }
	.top__tools { gap: 2px; }
	.tool { width: 36px; height: 36px; }
	.controls { gap: .6rem; }
	.round { width: 48px; height: 48px; }
	.main { min-width: 0; padding: 0 1.2rem; font-size: 1.05rem; }
}
@media (max-width: 440px) {
	.brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.add { flex-wrap: wrap; }
	.add .btn { flex: 1 1 100%; }
	.card { padding: 1rem; }
}

/* ───────── Menos movimento ───────── */
html[data-motion="reduced"] .bg i, html[data-motion="reduced"] .sk, html[data-motion="reduced"] .toast, html[data-motion="reduced"] .dlg[open], html[data-motion="reduced"] body[data-run="running"] .ring__bar,
html[data-motion="reduced"] body[data-phase="boot"] .clock { animation: none; }
html[data-motion="reduced"] .ring__bar, html[data-motion="reduced"] .ring__tip, html[data-motion="reduced"] .bar__fill, html[data-motion="reduced"] .dot, html[data-motion="reduced"] body { transition: none; }
@media (prefers-reduced-motion: reduce) {
	.bg i, .sk, .toast, .dlg[open], body[data-run="running"] .ring__bar, body[data-phase="boot"] .clock { animation: none; }
	.ring__bar, .ring__tip, .bar__fill, .dot, body { transition: none; }
}
