/* Layout: coluna única de app de bolso; marca e contagem no topo, abas fixas embaixo. Tokens do sistema de design Engrama. */
:root{
  --grafite:#17181A; --laranja:#F76B1C; --cal:#FAFAF9;
  --bg:#F3F4F2; --surface:#FFFFFF; --surface-2:#ECEDEA; --border:#D9DBD7;
  --ink:#17181A; --ink-muted:#4D5258;
  --action:#17181A; --on-action:#FAFAF9;
  --laranja-texto:#B8470A; --laranja-soft:#FDE9DC; --on-laranja:#17181A;
  --success:#276B43; --success-soft:#E3F2E8;
  --warn:#9A5A00; --warn-soft:#FBEFD9;
  --danger:#B3261E; --danger-soft:#FBE6E4;
  --esp-1:#2F5DA8; --esp-2:#B23A6F; --esp-3:#1F6F75; --esp-4:#6B57B8; --esp-5:#8A6A12; --esp-6:#4A5A78;
  --ref:#8B9097;
  --shadow-float:0 6px 24px rgba(23,24,26,0.14);
  --radius-sm:6px; --radius-md:10px; --radius-lg:14px; --radius:14px;
  --font-sans:Onest,system-ui,-apple-system,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,'SFMono-Regular',monospace;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#121314; --surface:#1C1D20; --surface-2:#26272B; --border:#34363B;
    --ink:#F2F2F0; --ink-muted:#A4A8AD;
    --action:#F2F2F0; --on-action:#17181A;
    --laranja-texto:#FF8A4C; --laranja-soft:#3A2213;
    --success:#5CC08A; --success-soft:#15301F;
    --warn:#E7A33E; --warn-soft:#33260F;
    --danger:#F2786F; --danger-soft:#3A1A18;
    --esp-1:#7BA4EC; --esp-2:#E683AE; --esp-3:#5CC3C8; --esp-4:#A99AE8; --esp-5:#D9B558; --esp-6:#9DAECB;
    --ref:#6B7076;
    --shadow-float:0 6px 24px rgba(0,0,0,0.5);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#121314; --surface:#1C1D20; --surface-2:#26272B; --border:#34363B;
  --ink:#F2F2F0; --ink-muted:#A4A8AD;
  --action:#F2F2F0; --on-action:#17181A;
  --laranja-texto:#FF8A4C; --laranja-soft:#3A2213;
  --success:#5CC08A; --success-soft:#15301F;
  --warn:#E7A33E; --warn-soft:#33260F;
  --danger:#F2786F; --danger-soft:#3A1A18;
  --esp-1:#7BA4EC; --esp-2:#E683AE; --esp-3:#5CC3C8; --esp-4:#A99AE8; --esp-5:#D9B558; --esp-6:#9DAECB;
  --ref:#6B7076;
  --shadow-float:0 6px 24px rgba(0,0,0,0.5);
  color-scheme:dark;
}
*{box-sizing:border-box;}
body{background:var(--bg); color:var(--ink); font-family:var(--font-sans); font-size:15px; line-height:1.45;}
body::before{content:""; position:fixed; inset:0 0 auto; height:env(safe-area-inset-top,0px); z-index:10; background:var(--bg);}
#app{max-width:480px; margin:0 auto; padding:0 16px; padding-bottom:116px; min-height:100%;}
h1,h2,h3{font-weight:700; margin:0; text-wrap:balance;}
button{font-family:inherit; font-size:inherit; cursor:pointer;}
input,select{font-family:inherit; font-size:inherit;}
button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--laranja); outline-offset:2px;}
.mono{font-family:var(--font-mono); font-variant-numeric:tabular-nums;}
a{color:var(--ink);}

/* topo */
header.top{position:sticky; top:env(safe-area-inset-top,0px); z-index:5; background:var(--bg); padding:16px 0 14px; border-bottom:1px solid var(--border); margin-bottom:18px;}
.brand{display:flex; align-items:center; gap:8px; margin-bottom:14px;}
.brand svg{width:34px; height:20px; display:block;}
.brand .stroke{stroke:var(--ink);}
.brand-name{font-weight:800; font-size:21px; letter-spacing:-0.05em; line-height:1;}
.countdown-row{display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;}
.countdown-num{font-family:var(--font-mono); font-size:44px; font-weight:700; color:var(--ink); line-height:1; letter-spacing:-0.02em;}
.countdown-label{font-size:13.5px; color:var(--ink-muted);}
.countdown-date{font-family:var(--font-mono); font-size:11.5px; color:var(--ink-muted); margin-top:4px; text-transform:uppercase; letter-spacing:0.04em;}
.set-date-cta{display:inline-block; margin-top:8px; font-size:13px; font-weight:600; color:var(--laranja-texto); text-decoration:none; border-bottom:1px dashed var(--laranja-texto);}

.view{display:none;}
.view.active{display:block;}
.section-title{font-family:var(--font-mono); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-muted); margin:22px 0 10px;}
.section-title:first-child{margin-top:0;}
#hojeDataExtenso{text-transform:none; letter-spacing:0; font-family:var(--font-sans); font-weight:500;}

.empty{border:1px dashed var(--border); border-radius:var(--radius-lg); padding:28px 18px; text-align:center; color:var(--ink-muted); font-size:13.5px; background:var(--surface);}
.empty strong{display:block; color:var(--ink); font-size:15px; margin-bottom:6px; font-weight:700;}

.card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; margin-bottom:12px;}
.card-head{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:6px;}
.card-head > div{display:flex; flex-direction:column; gap:6px; min-width:0;}
.tema-nome{font-weight:700; font-size:16px; line-height:22px;}
.esp{align-self:flex-start; font-family:var(--font-mono); font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:4px 7px; border-radius:var(--radius-sm); color:var(--surface); line-height:1;}
.chip{display:inline-block; font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:999px; background:var(--surface-2); color:var(--ink-muted); white-space:nowrap;}
.chip.warn{background:var(--warn-soft); color:var(--warn);}
.chip.danger{background:var(--danger-soft); color:var(--danger);}
.chip.success{background:var(--success-soft); color:var(--success);}
.chip.muted{background:var(--laranja-soft); color:var(--laranja-texto);}
.tema-meta{font-size:12.5px; color:var(--ink-muted);}

.task{border-top:1px solid var(--border);}
.card .task:first-of-type{border-top:none;}
.task-row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:11px 0;}
.task-info{display:flex; flex-direction:column; gap:2px; min-width:0;}
.task-tipo{font-size:14px; font-weight:600;}
.task-sub{font-size:12px; color:var(--ink-muted);}
.task-actions{display:flex; align-items:center; gap:8px; flex-shrink:0;}
.btn-check{border:0; background:var(--action); color:var(--on-action); border-radius:var(--radius-md); min-height:40px; padding:0 14px; font-size:13.5px; font-weight:600; white-space:nowrap;}
.btn-check:active{opacity:.85;}
.btn-ghost{border:1px solid var(--border); background:var(--surface-2); color:var(--ink); border-radius:var(--radius-md); min-height:40px; padding:0 14px; font-size:13.5px; font-weight:600; white-space:nowrap;}

.score-form{background:var(--surface-2); border-radius:var(--radius-md); padding:12px; margin-bottom:12px;}
.score-line{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.score-line label{font-size:13px; font-weight:600;}
.score-line input{width:62px; padding:9px 8px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--ink); font-family:var(--font-mono); font-weight:700; text-align:center;}
.score-line .de{font-size:13px; color:var(--ink-muted);}
.score-hint{font-size:12px; color:var(--ink-muted); margin-top:8px;}
.score-err{font-size:12px; color:var(--danger); margin-top:6px; font-weight:600;}
.score-btns{display:flex; gap:8px; margin-top:10px;}

.forecast{display:grid; grid-template-columns:repeat(7,1fr); gap:6px; align-items:end; height:100px; margin-top:4px;}
.fc-col{display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:4px; min-width:0;}
.fc-num{font-family:var(--font-mono); font-size:11.5px; font-weight:700; color:var(--ink);}
.fc-bar{width:100%; max-width:28px; border-radius:6px 6px 2px 2px; background:var(--surface-2); border:1px solid var(--border); min-height:3px;}
.fc-col.today .fc-bar{background:var(--laranja); border-color:var(--laranja);}
.fc-day{font-size:11px; color:var(--ink-muted); text-transform:lowercase;}
.fc-col.today .fc-day{color:var(--laranja-texto); font-weight:700;}
.fc-total{font-size:12.5px; color:var(--ink-muted); margin-top:12px;}
.fc-total b{color:var(--ink); font-family:var(--font-mono);}

.banner{background:var(--warn-soft); color:var(--ink); border-radius:var(--radius-lg); padding:14px; font-size:13px; margin-bottom:12px;}
.banner b{font-weight:700; color:var(--warn);}
.banner-actions{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; align-items:center;}
.banner .pill{border:1px solid var(--warn); background:transparent; color:var(--warn); border-radius:999px; min-height:34px; padding:0 14px; font-size:12.5px; font-weight:600;}
.banner .pill.solid{background:var(--action); border-color:var(--action); color:var(--on-action);}

.tema-row{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; margin-bottom:12px;}
.track-line{display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:13px; padding:6px 0; color:var(--ink-muted); border-top:1px solid var(--border);}
.track-line b{color:var(--ink); font-weight:700; font-family:var(--font-mono); font-size:12.5px;}
.track-right{display:flex; gap:6px; align-items:center;}
.tema-row .toggle-detail{margin-top:10px; font-size:12.5px; font-weight:600; color:var(--ink); background:none; border:none; padding:0; text-decoration:underline; text-decoration-color:var(--laranja); text-underline-offset:4px;}
.detail{margin-top:10px; padding-top:10px; border-top:1px solid var(--border); display:none;}
.detail.open{display:block;}
.hist-item{display:flex; justify-content:space-between; gap:8px; font-size:12.5px; color:var(--ink-muted); padding:3px 0;}
.hist-item .late{color:var(--danger);}
.row-actions{display:flex; gap:14px; margin-top:10px; flex-wrap:wrap; align-items:center;}
.link-btn{background:none; border:none; padding:0; font-size:12.5px; font-weight:600; color:var(--ink-muted);}
.link-btn.danger{color:var(--danger);}

.form-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; margin-bottom:16px; display:none;}
.form-card.open{display:block;}
.field{margin-bottom:12px;}
.field label{display:block; font-size:12.5px; font-weight:600; color:var(--ink-muted); margin-bottom:6px;}
.field input{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-2); color:var(--ink);}
.btn-primary{width:100%; background:var(--action); color:var(--on-action); border:none; border-radius:var(--radius-md); min-height:46px; font-weight:600; font-size:14px;}
.btn-add{width:100%; border:1px dashed var(--ink-muted); background:var(--surface); color:var(--ink); border-radius:var(--radius-lg); min-height:48px; font-weight:600; font-size:14px; margin-bottom:14px;}
.q-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.q-grid .field{margin-bottom:0;}
.q-grid input{font-family:var(--font-mono); font-weight:700; text-align:center;}
.note{font-size:12.5px; color:var(--ink-muted); margin:12px 0;}
.note.warn{color:var(--warn); font-weight:600;}

.stat-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px;}
.stat-grid.three{grid-template-columns:repeat(3,1fr);}
.stat-tile{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px 12px; min-width:0;}
.stat-num{font-family:var(--font-mono); font-size:22px; font-weight:700; color:var(--ink);}
.stat-label{font-size:12px; color:var(--ink-muted); margin-top:2px;}
.chips{display:flex; gap:6px; overflow-x:auto; padding-bottom:4px; margin-bottom:10px; scrollbar-width:none;}
.chips button{flex-shrink:0; border:1px solid var(--border); background:var(--surface); color:var(--ink-muted); border-radius:999px; min-height:34px; padding:0 13px; font-size:12.5px; font-weight:600;}
.chips button[aria-pressed="true"]{background:var(--action); border-color:var(--action); color:var(--on-action);}
.chart-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:12px 10px 8px;}
.chart-card svg{display:block; width:100%; height:auto;}
.chart-card .grid{stroke:var(--border); stroke-width:1;}
.chart-card .ref60{stroke:var(--danger); stroke-width:1; stroke-dasharray:3 4; opacity:.75;}
.chart-card .ref85{stroke:var(--success); stroke-width:1; stroke-dasharray:3 4; opacity:.75;}
.chart-card .axis{fill:var(--ink-muted); font-family:var(--font-mono); font-size:9.5px;}
.chart-card .line-main{fill:none; stroke:var(--serie,var(--ink)); stroke-width:2.4; stroke-linejoin:round; stroke-linecap:round;}
.chart-card .area-main{fill:var(--serie,var(--ink)); opacity:.08;}
.chart-card .line-ref{fill:none; stroke:var(--ref); stroke-width:1.5; stroke-dasharray:4 3;}
.chart-card .dot-main{fill:var(--laranja);}
.chart-card .dot-end{fill:var(--surface); stroke:var(--laranja); stroke-width:2.6;}
.chart-card .end-label{fill:var(--ink); font-family:var(--font-mono); font-size:11px; font-weight:700;}
.legend{display:flex; gap:14px; flex-wrap:wrap; font-size:11.5px; color:var(--ink-muted); padding:6px 6px 2px;}
.legend span{display:inline-flex; align-items:center; gap:6px;}
.legend i{display:inline-block; width:14px; height:0; border-top:2px solid var(--serie,var(--ink));}
.legend i.ref{border-top:2px dashed var(--ref);}
.legend i.r60{border-top:1px dashed var(--danger);}
.legend i.r85{border-top:1px dashed var(--success);}
.legend i.dot{width:8px; height:8px; border:0; border-radius:50%; background:var(--laranja);}
.rank-row{padding:11px 0; border-top:1px solid var(--border);}
.rank-row:first-child{border-top:none; padding-top:2px;}
.rank-head{display:flex; justify-content:space-between; gap:8px; align-items:baseline; font-size:14px;}
.rank-name{font-weight:600; min-width:0; overflow-wrap:anywhere; display:inline-flex; align-items:center; gap:8px;}
.rank-name i{width:8px; height:8px; border-radius:2px; flex-shrink:0;}
.rank-pct{font-family:var(--font-mono); font-weight:700; font-variant-numeric:tabular-nums;}
.rank-pct.danger{color:var(--danger);} .rank-pct.warn{color:var(--warn);} .rank-pct.success{color:var(--success);}
.rank-bar{height:6px; border-radius:999px; background:var(--surface-2); margin-top:7px; overflow:hidden;}
.rank-bar span{display:block; height:100%; border-radius:999px;}
.rank-bar span.danger{background:var(--danger);} .rank-bar span.warn{background:var(--warn);} .rank-bar span.success{background:var(--success);}
.rank-sub{font-size:11.5px; color:var(--ink-muted); margin-top:4px;}

details{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px 16px; margin-top:6px;}
details summary{font-weight:600; font-size:14px; cursor:pointer;}
details p{font-size:13.5px; color:var(--ink-muted); margin:10px 0 0;}
details ul{margin:8px 0 0; padding-left:18px; font-size:13.5px; color:var(--ink-muted);}
details li{margin-bottom:4px;}

nav.bottom{position:fixed; left:0; right:0; bottom:0; z-index:5; background:var(--surface); border-top:1px solid var(--border); padding:6px 12px calc(10px + env(safe-area-inset-bottom,0px)); display:flex; justify-content:center;}
.nav-inner{display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); width:100%; max-width:480px;}
nav.bottom a{position:relative; display:flex; flex-direction:column; align-items:center; gap:3px; text-decoration:none; color:var(--ink-muted); font-size:11px; font-weight:600; padding:10px 4px 4px; min-height:48px;}
nav.bottom a svg{width:21px; height:21px; stroke:currentColor; fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
nav.bottom a.active{color:var(--ink);}
nav.bottom a.active::before{content:""; position:absolute; top:2px; width:5px; height:5px; border-radius:50%; background:var(--laranja);}

.toast{position:fixed; left:50%; transform:translateX(-50%); z-index:20; bottom:calc(80px + env(safe-area-inset-bottom,0px)); width:calc(100% - 32px); max-width:448px; background:var(--action); color:var(--on-action); border-radius:12px; padding:12px 14px; font-size:13.5px; font-weight:500; box-shadow:var(--shadow-float);}
.toast.danger{background:var(--danger); color:#FFFFFF;}
@media (prefers-reduced-motion: no-preference){
  .toast{animation:toastIn .18s ease-out;}
  @keyframes toastIn{from{opacity:0; transform:translate(-50%,6px);} to{opacity:1; transform:translate(-50%,0);}}
}




















/* provas em abas */
.prova-tabs{display:flex; gap:6px; overflow-x:auto; margin-top:12px; scrollbar-width:none;}
.prova-tabs button{flex-shrink:0; border:1px solid var(--border); background:var(--surface); color:var(--ink-muted); border-radius:999px; min-height:34px; padding:0 14px; font-size:12.5px; font-weight:600;}
.prova-tabs button[aria-pressed="true"]{background:var(--action); border-color:var(--action); color:var(--on-action);}

/* boas-vindas */
.onboard{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px 16px; margin-bottom:16px; display:flex; flex-direction:column; gap:14px;}
.onboard h2{font-size:22px; line-height:28px; letter-spacing:-0.01em;}
.onboard p{margin:0; font-size:14px; color:var(--ink-muted);}
.area-pick{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.area-pick button{border:1px solid var(--border); background:var(--surface-2); color:var(--ink); border-radius:var(--radius-md); min-height:64px; padding:10px; font-size:14px; font-weight:600; text-align:left; display:flex; flex-direction:column; gap:2px;}
.area-pick button span{font-size:12px; font-weight:400; color:var(--ink-muted);}
.area-pick button[aria-pressed="true"]{border:2px solid var(--ink); background:var(--surface);}
.steps{margin:0; padding-left:18px; font-size:13.5px; color:var(--ink-muted); display:flex; flex-direction:column; gap:4px;}

/* provas em ajustes */
.prova-item{display:grid; grid-template-columns:minmax(0,1fr) 150px; gap:8px; align-items:end; padding:10px 0; border-top:1px solid var(--border);}
.prova-item:first-child{border-top:none; padding-top:0;}
.prova-item .field{margin-bottom:0;}
.prova-item .row-actions{grid-column:1 / -1; margin-top:0;}
.check-list{display:flex; flex-wrap:wrap; gap:8px;}
.check-list label{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); background:var(--surface-2); border-radius:999px; min-height:36px; padding:0 12px; font-size:13px; font-weight:600; color:var(--ink);}
.check-list input{accent-color:var(--grafite); width:16px; height:16px;}
.toggle-list{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px;}
.toggle-list button{border:1px solid var(--border); background:var(--surface); color:var(--ink-muted); border-radius:999px; min-height:32px; padding:0 12px; font-size:12px; font-weight:600;}
.toggle-list button[aria-pressed="true"]{background:var(--surface-2); color:var(--ink); border-color:var(--ink-muted);}
.seg{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.seg button{border:1px solid var(--border); background:var(--surface-2); color:var(--ink-muted); border-radius:var(--radius-md); min-height:44px; font-size:13.5px; font-weight:600;}
.seg button[aria-pressed="true"]{background:var(--action); border-color:var(--action); color:var(--on-action);}

/* foco */
.btn-icon{border:1px solid var(--border); background:var(--surface-2); color:var(--ink); border-radius:var(--radius-md); width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center; padding:0;}
.btn-icon svg{width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
.timer-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px 16px; display:flex; flex-direction:column; align-items:center; gap:14px; margin-bottom:12px;}
.timer-ring{position:relative; width:232px; height:232px;}
.timer-ring svg{width:100%; height:100%; transform:rotate(-90deg);}
.timer-ring .track{fill:none; stroke:var(--surface-2); stroke-width:10;}
.timer-ring .prog{fill:none; stroke:var(--ring,var(--ink)); stroke-width:10; stroke-linecap:round; transition:stroke-dashoffset .25s linear;}
.timer-center{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;}
.timer-time{font-family:var(--font-mono); font-size:54px; font-weight:700; letter-spacing:-0.03em; line-height:1; font-variant-numeric:tabular-nums;}
.timer-phase{font-family:var(--font-mono); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-muted);}
.timer-blocks{display:flex; gap:6px;}
.timer-blocks i{width:10px; height:10px; border-radius:50%; background:var(--surface-2); border:1px solid var(--border);}
.timer-blocks i.on{background:var(--laranja); border-color:var(--laranja);}
.timer-ctrl{display:flex; gap:8px; width:100%;}
.timer-ctrl .btn-primary{flex:1;}
.timer-ctrl .btn-ghost{min-height:46px;}
.timer-task{width:100%; background:var(--surface-2); border-radius:var(--radius-md); padding:10px 12px; font-size:13px; display:flex; justify-content:space-between; gap:8px; align-items:center;}
.timer-task b{font-weight:600;}
.timer-done{width:100%; background:var(--laranja-soft); border-radius:var(--radius-md); padding:12px; font-size:13.5px; display:flex; flex-direction:column; gap:10px;}
.timer-done b{color:var(--laranja-texto);}
.today-line{font-size:13px; color:var(--ink-muted); text-align:center;}
.today-line b{font-family:var(--font-mono); color:var(--ink);}
select{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-2); color:var(--ink);}
.refs{font-size:12.5px; color:var(--ink-muted); padding-left:18px; margin:10px 0 0;}
.refs li{margin-bottom:6px;}

/* marca completa */
.brand svg{width:40px; height:24px;}
.brand-text{display:flex; flex-direction:column; gap:2px;}
.brand-text .brand-name{font-size:22px;}
.brand-desc{font-size:9.5px; font-weight:500; letter-spacing:.32em; color:var(--ink-muted); line-height:1;}

/* origem do pomodoro */
.pomo-origin{display:flex; gap:14px; align-items:center;}
.pomo-origin svg{width:96px; height:90px; flex-shrink:0;}
.pomo-origin p{margin:6px 0 0; font-size:13.5px; color:var(--ink-muted);}
.pomo-origin .tomato{fill:var(--laranja); stroke:var(--ink); stroke-width:3;}
.pomo-origin .band{fill:none; stroke:var(--ink); stroke-width:2.5; stroke-linecap:round;}
.pomo-origin .tick{fill:none; stroke:var(--ink); stroke-width:2; stroke-linecap:round;}
.pomo-origin .pointer{fill:var(--ink);}
.pomo-origin .num{font-family:var(--font-mono); font-size:11px; font-weight:700; fill:var(--on-laranja);}
.pomo-origin .leaf{fill:var(--success); stroke:var(--ink); stroke-width:2.5; stroke-linejoin:round; stroke-linecap:round;}

/* curva do esquecimento */
.curve-fig{margin:12px 0 0; background:var(--surface-2); border-radius:var(--radius-md); padding:10px 8px 10px;}
.curve-chart{display:block; width:100%; height:auto;}
.curve-chart .g{stroke:var(--border); stroke-width:1;}
.curve-chart .ax{fill:var(--ink-muted); font-family:var(--font-mono); font-size:9px;}
.curve-chart .area{fill:var(--ink); opacity:.07;}
.curve-chart .line{fill:none; stroke:var(--ink); stroke-width:2.4; stroke-linejoin:round; stroke-linecap:round;}
.curve-chart .pt{fill:var(--laranja);}
.curve-chart .val{fill:var(--ink); font-family:var(--font-mono); font-size:9.5px; font-weight:700;}
.curve-fig figcaption{font-size:11.5px; line-height:1.45; color:var(--ink-muted); padding:6px 6px 0;}

/* editar aula */
.edit-form{background:var(--surface-2); border-radius:var(--radius-md); padding:12px; margin-top:12px;}
.edit-form .field input{background:var(--surface);}
.edit-form .score-btns{margin-top:4px;}
.curve-chart .axt{fill:var(--ink-muted); font-family:var(--font-sans); font-size:10px; font-weight:600;}
.curve-chart .line-sem{fill:none; stroke:var(--ink-muted); stroke-width:1.8; stroke-dasharray:4 4; stroke-linecap:round;}
.curve-chart .pt-rev{fill:var(--laranja);}
.curve-chart .val-muted{fill:var(--ink-muted); font-family:var(--font-mono); font-size:9.5px; font-weight:700;}
.curve-fig + p{margin-top:12px;}
.curve-chart .axs{fill:var(--ink-muted); font-family:var(--font-mono); font-size:8.5px;}

/* tema escolhido pela pessoa: vence o tema do celular e o do visualizador */
:root[data-engrama-theme="claro"]{
  --bg:#F3F4F2; --surface:#FFFFFF; --surface-2:#ECEDEA; --border:#D9DBD7;
  --ink:#17181A; --ink-muted:#4D5258; --action:#17181A; --on-action:#FAFAF9;
  --laranja-texto:#B8470A; --laranja-soft:#FDE9DC;
  --success:#276B43; --success-soft:#E3F2E8; --warn:#9A5A00; --warn-soft:#FBEFD9; --danger:#B3261E; --danger-soft:#FBE6E4;
  --esp-1:#2F5DA8; --esp-2:#B23A6F; --esp-3:#1F6F75; --esp-4:#6B57B8; --esp-5:#8A6A12; --esp-6:#4A5A78;
  --ref:#8B9097; --shadow-float:0 6px 24px rgba(23,24,26,0.14);
  color-scheme:light;
}
:root[data-engrama-theme="escuro"]{
  --bg:#121314; --surface:#1C1D20; --surface-2:#26272B; --border:#34363B;
  --ink:#F2F2F0; --ink-muted:#A4A8AD; --action:#F2F2F0; --on-action:#17181A;
  --laranja-texto:#FF8A4C; --laranja-soft:#3A2213;
  --success:#5CC08A; --success-soft:#15301F; --warn:#E7A33E; --warn-soft:#33260F; --danger:#F2786F; --danger-soft:#3A1A18;
  --esp-1:#7BA4EC; --esp-2:#E683AE; --esp-3:#5CC3C8; --esp-4:#A99AE8; --esp-5:#D9B558; --esp-6:#9DAECB;
  --ref:#6B7076; --shadow-float:0 6px 24px rgba(0,0,0,0.5);
  color-scheme:dark;
}
:root[data-engrama-theme="papel"]{
  --bg:#F2ECE0; --surface:#FBF7EF; --surface-2:#ECE4D4; --border:#DCD2BF;
  --ink:#2B2620; --ink-muted:#5C5245; --action:#2B2620; --on-action:#FBF7EF;
  --laranja-texto:#A3400A; --laranja-soft:#F7E1CE;
  --success:#276B43; --success-soft:#E2EEDD; --warn:#8A5000; --warn-soft:#F6E7CB; --danger:#A8241C; --danger-soft:#F7DFDA;
  --esp-1:#2F5DA8; --esp-2:#B23A6F; --esp-3:#1F6F75; --esp-4:#6B57B8; --esp-5:#8A6A12; --esp-6:#4A5A78;
  --ref:#9A9080; --shadow-float:0 6px 24px rgba(43,38,32,0.16);
  color-scheme:light;
}
.seg.four{grid-template-columns:repeat(2,minmax(0,1fr));}
.seg button .sw{display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:6px; vertical-align:-1px; border:1px solid var(--border);}

/* agenda */
.fc-head{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px;}
.fc-range{font-family:var(--font-mono); font-size:12px; font-weight:700; color:var(--ink);}
.fc-nav{border:1px solid var(--border); background:var(--surface-2); color:var(--ink); border-radius:var(--radius-md); width:36px; height:36px; font-size:18px; line-height:1; padding:0;}
.fc-nav:disabled{opacity:.35; cursor:default;}
button.fc-col{background:none; border:0; padding:4px 0 2px; font:inherit; color:inherit; border-radius:8px; cursor:pointer;}
button.fc-col.sel{background:var(--surface-2);}
button.fc-col.sel .fc-day{color:var(--ink); font-weight:700; text-decoration:underline; text-decoration-color:var(--laranja); text-decoration-thickness:2px; text-underline-offset:3px;}
.fc-hint{font-size:12px; color:var(--ink-muted); margin-top:4px;}
.list-head{display:flex; align-items:baseline; justify-content:space-between; gap:8px;}
.list-head .section-title{margin-bottom:10px;}
.mover-dia{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:12px 14px; margin-bottom:12px; font-size:13px;}
.inline-date{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:8px;}
.inline-date input{padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2); color:var(--ink); min-height:40px;}
.task-acts{background:var(--surface-2); border-radius:var(--radius-md); padding:10px 12px; margin-bottom:12px; font-size:13px; display:flex; flex-direction:column; gap:8px;}
.task-acts .row{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
.task-acts .inline-date{margin-top:0;}
.task-acts .inline-date input{background:var(--surface);}
.task-sub .chip{margin-left:6px; vertical-align:1px;}
/* material */
.mat{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:4px;}
.mat-link{display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:var(--ink); text-decoration:underline; text-decoration-color:var(--laranja); text-underline-offset:3px;}
.mat-note{font-size:12.5px; color:var(--ink-muted); font-style:italic; overflow-wrap:anywhere;}
.opt{font-weight:400;}
.file-pick{display:inline-flex !important; align-items:center; gap:6px; margin-top:8px; border:1px dashed var(--ink-muted); border-radius:var(--radius-md); padding:8px 12px; font-size:13px; font-weight:600; color:var(--ink) !important; cursor:pointer;}
.file-pick input{position:absolute; width:1px; height:1px; opacity:0;}
.file-pick:focus-within{outline:2px solid var(--laranja); outline-offset:2px;}
.file-name{font-size:12.5px; color:var(--ink); margin-top:6px; overflow-wrap:anywhere;}
/* filtros */
.filters{display:flex; flex-direction:column; gap:8px; margin-bottom:12px;}
.filters input[type=search]{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); color:var(--ink);}
.filter-row{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
.filter-row select{background:var(--surface);}
.filters .chips{margin-bottom:0;}

[hidden]{display:none !important;}
.fc-day{display:flex; flex-direction:column; align-items:center; line-height:1.2;}
.forecast{height:112px;}
.filter-row{grid-template-columns:1fr;}
.filters .chips{flex-wrap:wrap; overflow:visible;}

/* agenda: um só destaque por estado */
button.fc-col.sel .fc-day{text-decoration:none; color:var(--ink); font-weight:700;}
.fc-col.today .fc-day, button.fc-col.today.sel .fc-day{color:var(--laranja-texto); font-weight:700;}
.fc-col.zero .fc-bar{background:var(--surface-2) !important; border-color:var(--border) !important;}
button.fc-col.sel{background:var(--surface-2); box-shadow:inset 0 0 0 1.5px var(--ink-muted);}
button.fc-col.sel:not(.today):not(.zero) .fc-bar{background:var(--ink); border-color:var(--ink);}
button.fc-col.sel{background:transparent;}

/* anexos, resumo e cartões */
button.mat-link{background:none; border:0; padding:0; font-family:inherit; cursor:pointer;}
.aula-extras{display:flex; gap:8px; margin-top:12px;}
.aula-extras .btn-ghost{flex:1; min-height:38px; font-size:13px;}
body.modal-aberto{overflow:hidden;}
.modal{position:fixed; inset:0; z-index:30; background:rgba(10,10,12,.55); display:flex; align-items:flex-end; justify-content:center;}
.modal[hidden]{display:none !important;}
.modal-box{background:var(--bg); width:100%; max-width:560px; max-height:calc(100% - 24px); border-radius:18px 18px 0 0; display:flex; flex-direction:column; box-shadow:var(--shadow-float);}
@media (min-width:600px){ .modal{align-items:center; padding:24px;} .modal-box{border-radius:18px; max-height:calc(100% - 48px);} }
.modal-head{display:flex; align-items:center; gap:12px; padding:14px 16px 10px; border-bottom:1px solid var(--border);}
.modal-head h2{flex:1; min-width:0; margin:0; font-size:15px; font-weight:700; line-height:1.3; overflow-wrap:anywhere;}
.modal-body{padding:14px 16px calc(20px + env(safe-area-inset-bottom,0px)); overflow-y:auto; -webkit-overflow-scrolling:touch;}
.modal-acoes{display:flex; gap:8px; flex-wrap:wrap; margin-top:14px;}
.anexo-img{display:block; max-width:100%; height:auto; margin:0 auto; border-radius:var(--radius-md); background:#fff;}

.rich{font-size:15px; line-height:1.55; color:var(--ink); overflow-wrap:anywhere;}
.rich h1,.rich h2,.rich h3,.rich h4{font-size:16px; margin:14px 0 6px; line-height:1.3;}
.rich p{margin:0 0 8px;}
.rich ul,.rich ol{margin:0 0 8px; padding-left:22px;}
.rich img{max-width:100%; height:auto; border-radius:6px; background:#fff;}
.rich table{border-collapse:collapse; margin:8px 0; font-size:13.5px; display:block; overflow-x:auto;}
.rich td,.rich th{border:1px solid var(--border); padding:4px 8px; vertical-align:top;}
.rich mark{background:var(--laranja-soft); color:inherit;}
.rich blockquote{margin:0 0 8px; padding-left:10px; border-left:3px solid var(--border); color:var(--ink-muted);}
.rich .cloze{font-weight:700; color:var(--laranja-texto);}
.rich hr{border:0; border-top:1px solid var(--border); margin:10px 0;}
.leitura{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:14px 16px;}
.texto-puro{white-space:pre-wrap; font-size:14px;}

.rt{border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); overflow:hidden;}
.rt-bar{display:flex; flex-wrap:wrap; gap:4px; padding:6px; border-bottom:1px solid var(--border); background:var(--surface-2);}
.rt-bar button,.rt-img{border:1px solid var(--border); background:var(--surface); color:var(--ink); border-radius:8px; min-height:34px; min-width:34px; padding:0 9px; font-size:13px; font-weight:600; display:inline-flex; align-items:center; cursor:pointer;}
.rt-img input{position:absolute; width:1px; height:1px; opacity:0;}
.rt-img:focus-within{outline:2px solid var(--laranja); outline-offset:1px;}
.rt-edit{min-height:120px; padding:10px 12px; outline:none;}
.cg-form .rt-edit{min-height:72px;}
.rt-edit:empty::before{content:attr(data-ph); color:var(--ink-muted);}
.rt:focus-within{border-color:var(--ink-muted);}
#rsTexto{min-height:45vh;}

.cg-acoes{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px;}
.file-btn{display:inline-flex; align-items:center; cursor:pointer; position:relative;}
.file-btn input{position:absolute; width:1px; height:1px; opacity:0;}
.file-btn:focus-within{outline:2px solid var(--laranja); outline-offset:2px;}
.cg-busca{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); color:var(--ink); margin-bottom:10px; font-size:14px;}
.cg-lista{display:flex; flex-direction:column; gap:8px;}
.cg-item{display:flex; gap:10px; align-items:flex-start; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:10px 12px;}
.cg-txt{flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; font-size:13px; overflow-wrap:anywhere;}
.cg-txt b{font-weight:600;}
.cg-txt span{color:var(--ink-muted);}
.cg-txt .cg-st{font-size:11.5px; font-family:var(--font-mono);}
.cg-btns{display:flex; flex-direction:column; gap:8px; align-items:flex-end; flex-shrink:0;}
.cg-pag{display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:12px; font-size:13px; color:var(--ink-muted);}
.cg-pag button:disabled{opacity:.45;}

.imp-resumo{font-size:14px; margin:6px 0;}
.imp-avisos{margin:6px 0 10px; padding-left:18px; font-size:12.5px; color:var(--ink-muted);}
.imp-avisos li{margin-bottom:3px;}
.imp-decks{flex-direction:column; align-items:stretch;}
.imp-decks label{border-radius:var(--radius-md); min-height:40px;}
.imp-ex{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; display:flex; flex-direction:column; gap:6px;}
.imp-ex .rich{font-size:13.5px;}
.imp-ex-v{color:var(--ink-muted); border-top:1px dashed var(--border); padding-top:6px;}

.score-cards{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; font-size:13px; padding-bottom:10px; margin-bottom:10px; border-bottom:1px solid var(--border);}
.score-cards .btn-ghost{background:var(--surface);}

.flash-prog{display:flex; align-items:center; gap:10px; font-size:12px; color:var(--ink-muted); font-family:var(--font-mono); margin-bottom:12px;}
.flash-bar{flex:1; height:4px; border-radius:2px; background:var(--surface-2); overflow:hidden;}
.flash-bar i{display:block; height:100%; background:var(--laranja);}
.flash{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; min-height:160px;}
.flash-rot{font-family:var(--font-mono); font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-muted); margin-bottom:8px;}
.flash-rot.resp{margin-top:14px; padding-top:12px; border-top:1px dashed var(--border); color:var(--laranja-texto);}
.flash-face{font-size:16px;}
.flash-btn{margin-top:14px; min-height:50px;}
.flash-res{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.flash-res .btn-check,.flash-res .btn-ghost{min-height:50px; font-size:15px;}
.flash-res .errei{color:var(--danger);}
.flash-dica{text-align:center; margin-bottom:0;}
.flash-fim{text-align:center; padding:12px 0;}
.flash-fim .stat-num{font-size:40px;}
.flash-fim .stat-num.danger{color:var(--danger);} .flash-fim .stat-num.warn{color:var(--warn);} .flash-fim .stat-num.success{color:var(--success);}
.flash-fim p{font-size:14px; color:var(--ink-muted); margin:8px 0 16px;}

/* entrar / criar conta */
[hidden]{display:none !important;}
.entrar{min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:32px 16px; background:var(--bg);}
.entrar .brand{margin-bottom:22px;}
.entrar-card{width:100%; max-width:400px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:22px 18px;}
.entrar-card h1{font-size:20px; margin:0 0 6px; letter-spacing:-0.01em;}
.entrar-txt{font-size:13.5px; color:var(--ink-muted); margin:0 0 14px; line-height:1.5;}
.entrar-card form{margin-top:12px;}
.entrar-card .field input{font-size:16px;}
.entrar-card .btn-primary{margin-top:6px;}
.entrar-card .score-err{margin:4px 0 8px;}
.entrar-links{display:flex; justify-content:space-between; gap:12px; margin-top:16px; flex-wrap:wrap;}
.entrar-links .link-btn{font-size:13.5px; padding:6px 0;}
.link-btn.forte{color:var(--ink); text-decoration:underline; text-decoration-color:var(--laranja); text-underline-offset:3px;}
.entrar-full{width:100%;}
.entrar-rodape{font-size:12px; color:var(--ink-muted); margin-top:18px; text-align:center; max-width:400px;}
.conta-linha{display:flex; flex-direction:column; gap:2px; font-size:14px; overflow-wrap:anywhere;}
.excluir-conta{margin-top:14px; padding:12px; border-radius:var(--radius-md); background:var(--danger-soft); font-size:13px;}
.excluir-conta p{margin:0 0 10px;}
.excluir-conta .field input{background:var(--surface);}
.danger-bg{background:var(--danger) !important; color:#fff !important;}
.excluir-rodape{margin:28px 0 8px; text-align:center;}
.excluir-rodape .link-btn{font-size:12px; font-weight:500; color:var(--ink-muted); text-decoration:underline; text-underline-offset:3px; opacity:.8;}
.excluir-rodape .excluir-conta{text-align:left; margin-top:0;}
.q-grid .field{display:flex; flex-direction:column; justify-content:flex-end;}
.aviso-instalar{display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--border); border-left:4px solid var(--laranja); border-radius:var(--radius-md); padding:10px 8px 10px 12px; margin-bottom:12px; font-size:13px;}
.aviso-instalar span{flex:1; min-width:0;}
.aviso-instalar .btn-check{min-height:36px;}
.aviso-x{border:0; background:none; color:var(--ink-muted); font-size:22px; line-height:1; width:32px; height:32px; padding:0; flex-shrink:0;}
.nt-linha{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.nt-chave{display:inline-flex; align-items:center; gap:8px; font-size:14px; font-weight:600;}
.nt-chave input{width:20px; height:20px; accent-color:var(--grafite);}
.nt-linha select{width:auto; min-width:96px; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-2); color:var(--ink); font-family:var(--font-mono); font-weight:700;}
