/* ==========================================================
   vazio. — app (player, timer, painel e estatísticas)
   ========================================================== */

body { min-height: 100vh; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.today-pill {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
}

.app-grid {
  display: grid; grid-template-columns: 1fr 360px; gap: clamp(24px, 4vw, 56px);
  padding-top: clamp(24px, 4vw, 56px); padding-bottom: 56px; align-items: start;
}

/* ---------- Player ---------- */
.player { --phase: var(--mode-foco); display: flex; flex-direction: column; align-items: center; }
.player[data-mode="aquecer"] { --phase: var(--mode-aquecer); }
.player[data-mode="foco"] { --phase: var(--mode-foco); }
.player[data-mode="pausa"] { --phase: var(--mode-pausa); }

.ring-wrap { position: relative; width: min(440px, 100%); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-progress {
  fill: none; stroke: var(--phase); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 929.9; stroke-dashoffset: 929.9;
  transition: stroke-dashoffset .4s linear, stroke .6s ease;
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 15%;
}
.phase-label {
  margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--phase);
  transition: color .6s ease;
}
.clock {
  margin: 4px 0; font-family: var(--font-display);
  font-size: clamp(64px, 14vw, 112px); line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.phase-next { margin: 0; font-size: 14px; color: var(--muted); }
.phase-subject { margin: 0 0 6px; font-size: 16px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Respiração sutil do anel enquanto toca */
.player.is-playing .ring-progress { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { stroke-width: 9; } }

.controls { display: flex; align-items: center; gap: 20px; margin: 24px 0 32px; }
.ctrl {
  width: 52px; height: 52px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; transition: border-color .2s ease, transform .15s ease;
}
.ctrl:hover { border-color: var(--ink); }
.ctrl:active { transform: scale(.96); }
.ctrl svg { width: 22px; height: 22px; }
.ctrl-main { width: 76px; height: 76px; background: var(--phase); border-color: transparent; color: var(--accent-ink); }
.ctrl-main svg { width: 30px; height: 30px; }
.ctrl-main:hover { border-color: transparent; filter: brightness(1.08); }
.ctrl-main .i-pause { display: none; }
.player.is-playing .ctrl-main .i-play { display: none; }
.player.is-playing .ctrl-main .i-pause { display: block; }

/* Faixa com as etapas */
.strip { list-style: none; padding: 0; margin: 0; display: flex; gap: 4px; width: min(560px, 100%); }
.strip li {
  flex: var(--w, 1); min-width: 6px; height: 8px; border-radius: 999px;
  background: var(--line); position: relative; overflow: hidden;
}
.strip li::after {
  content: ""; position: absolute; inset: 0; width: var(--fill, 0%);
  background: var(--c); border-radius: inherit; transition: width .4s linear;
}
.strip li.done::after { width: 100%; }
.strip li.current { outline: 2px solid color-mix(in srgb, var(--c) 35%, transparent); outline-offset: 2px; }
.hint { font-size: 12px; color: var(--muted); margin: 20px 0 0; text-align: center; }

/* ---------- Painel lateral ---------- */
.side { display: grid; gap: 16px; }
.panel { padding: 22px; }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 18px; }

.field { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field legend, .field-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; padding: 0; display: block; }
.field-row { display: flex; align-items: center; justify-content: space-between; }
.field-row .field-label { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; transition: all .2s ease;
}
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip small { font-family: var(--font-mono); font-size: 11px; opacity: .7; margin-left: 4px; }

.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; font-size: 18px; border-radius: 999px; }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 24px; text-align: center; }

input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-n { font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.stat-l { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.3; }
.week { display: flex; align-items: flex-end; gap: 6px; height: 96px; margin-top: 22px; }
.week .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week .bar i {
  width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; background: var(--accent);
  min-height: 2px; display: block; opacity: .85;
}
.week .bar.today i { opacity: 1; }
.week .bar span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.stats-note { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .app-grid { grid-template-columns: 1fr; }
  .ring-wrap { width: min(340px, 100%); }
}

/* ==========================================================
   Navegação entre seções do app + elementos compartilhados
   (usados por app.html, plano.html e evolucao.html)
   ========================================================== */
.topbar-inner { gap: 12px; }
.tabs {
  display: flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.tabs a {
  text-decoration: none; font-size: 14px; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; transition: background .2s ease, color .2s ease;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.page { padding-top: clamp(24px, 4vw, 48px); padding-bottom: 64px; }
.input-rect { border-radius: 10px; width: 100%; }
select.input-rect { appearance: auto; cursor: pointer; }
.hint-txt { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.kpi { padding: 18px 20px; }
.kpi-l { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.kpi-n { margin: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1.1; }
.kpi-s { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.block { padding: 22px; }
.block .eyebrow { margin-bottom: 10px; }
.block-sub { margin: -4px 0 16px; font-size: 14px; color: var(--muted); }
.mat-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; display: inline-block; }

/* Matéria atual no player */
.subject {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  font-size: 15px; font-weight: 500;
}
.subject-pick { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.plan-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.plan-link:hover { color: var(--ink); }
.panel-foot { margin: 14px 0 0; font-size: 14px; }
.panel-foot a { color: var(--accent); text-decoration: none; }
.chip-plan { border-color: var(--accent); }

@media (max-width: 640px) {
  .topbar .logo { font-size: 24px; }
  .tabs a { padding: 7px 10px; font-size: 13px; }
  .today-pill { display: none; }
  .kpis, .kpis-4 { grid-template-columns: 1fr 1fr; }
}

/* Meta semanal no painel */
.meta { margin-top: 20px; }
.meta-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.meta-top .mono { color: var(--ink); }
.meter { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
@media (max-width: 640px) {
  .kpis:not(.kpis-4) .kpi:last-child { grid-column: 1 / -1; }
}
