@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url(/fonts/fredoka-600.woff2) format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 400 800; font-display: swap; src: url(/fonts/nunito-sans.woff2) format('woff2'); }

:root {
  --rosa: #F10991; --rosa-claro: #FDE6F2; --grafite: #1D2127; --grafite-2: #3A4049; --cinza: #5A6270;
  --borda: #E2E5EA; --nevoa: #F4F6F8; --azul: #1F5FBF; --azul-claro: #EAF1FB; --verde: #17733F;
  --verde-claro: #E6F4EC; --amarelo: #FFD23F; --vermelho: #C4271B; --vermelho-claro: #FDECEA;
  --h0: #F1F2F5; --h1: #FCD3E8; --h2: #F98AC2; --h3: #F4479F; --h4: #F10991;
  --r: 16px; --sombra: 0 10px 30px rgba(29, 33, 39, .12);
  --titulo: 'Fredoka', 'Nunito Sans', system-ui, sans-serif;
  --texto: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--grafite); font: 400 16px/1.45 var(--texto); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 600; margin: 0; letter-spacing: -.01em; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 14px; height: 14px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100vh; display: grid; place-items: center; }

/* ---------- login ---------- */
.login { min-height: 100svh; display: flex; flex-direction: column; background: var(--rosa); }
.login-top { flex: 1; display: grid; place-items: center; padding: 48px 24px 24px; }
.login-top miau-logo { width: min(320px, 80vw); }
.login-card { background: #fff; border-radius: 28px 28px 0 0; padding: 28px 24px calc(28px + var(--safe-b)); max-width: 480px; width: 100%; margin: 0 auto; }
.login-card h1 { font-size: 26px; }
.login-card p.lead { color: var(--cinza); margin: 6px 0 20px; }
@media (min-width: 720px) {
  .login { justify-content: center; align-items: center; }
  .login-top { flex: none; padding-bottom: 32px; }
  .login-card { border-radius: 28px; box-shadow: var(--sombra); margin-bottom: 48px; }
}

/* ---------- campos ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #C9CED6; border-radius: 14px; background: #fff; font-size: 16px; }
.input:focus { outline: 2px solid var(--azul); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 72px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.err { color: var(--vermelho); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }
.hint { color: var(--cinza); font-size: 13px; margin: 4px 0 0; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 16px; transition: background .15s, transform .12s ease-out; }
.btn:active { transform: scale(.97); }
.btn-p { background: var(--grafite); color: #fff; }
.btn-p:hover { background: var(--grafite-2); }
.btn-s { border: 2px solid var(--grafite); color: var(--grafite); }
.btn-s:hover { background: var(--nevoa); }
.btn-g { color: var(--grafite); background: var(--nevoa); }
.btn-d { color: var(--vermelho); background: var(--vermelho-claro); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; }
.iconbtn:hover { background: var(--nevoa); }

/* ---------- topo rosa ---------- */
.wrap { max-width: 760px; margin: 0 auto; }
.banner { background: var(--rosa); color: #fff; border-radius: 0 0 28px 28px; padding: 10px 16px 16px; position: relative; }
@media (min-width: 760px) { .banner { border-radius: 28px; margin-top: 16px; padding: 14px 24px 20px; } }
.banner-top { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.hello { font-weight: 700; font-size: 15px; opacity: .95; }
.banner .iconbtn:hover { background: rgba(255, 255, 255, .16); }
.banner-logo { display: block; width: min(240px, 62vw); margin: 0 auto; min-height: 60px; }
.banner-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.team { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 12px 4px 4px; border-radius: 999px; color: #fff; font-weight: 700; }
.team:hover, .team[aria-pressed="true"] { background: rgba(255, 255, 255, .18); }
.stack { display: flex; }
.stack .av { margin-left: -8px; box-shadow: 0 0 0 2px #fff; }
.stack .av:first-child { margin-left: 0; }
.mine { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 2px solid #fff; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.mine[aria-pressed="true"] { background: #fff; color: var(--rosa); }
.viewing { text-align: center; font-size: 13px; font-weight: 700; margin-top: 8px; opacity: .95; }

/* bolinhas de pessoa */
.av { --c: var(--rosa); width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--c); color: #fff; font: 600 13px/1 var(--titulo); flex: none; position: relative; }
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }
.av.white { background: #fff; color: var(--c); }

/* ---------- números ---------- */
main { padding: 0 16px calc(112px + var(--safe-b)); }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin-top: 20px; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--h0); }
.ring .fg { stroke: var(--rosa); stroke-linecap: round; transition: stroke-dashoffset .6s ease-out; }
.ring .goal { stroke: var(--grafite); stroke-width: 3; }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font: 600 28px/1 var(--titulo); }
.ring-txt small { font-size: 12px; color: var(--cinza); font-weight: 700; margin-top: 2px; }
.heatbox { min-width: 0; }
.heathead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.heathead h2 { font-size: 16px; }
.chipbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border: 1px solid var(--borda); border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--grafite); background: #fff; white-space: nowrap; }
.chipbtn:hover { background: var(--nevoa); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding: 3px; scrollbar-width: none; }
.heat::-webkit-scrollbar { display: none; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--h0); }
.heat i[data-l="1"] { background: var(--h1); } .heat i[data-l="2"] { background: var(--h2); }
.heat i[data-l="3"] { background: var(--h3); } .heat i[data-l="4"] { background: var(--h4); }
.heat i.today { outline: 2px solid var(--grafite); outline-offset: 1px; }
.heat i.pad { background: transparent; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 11px; color: var(--cinza); margin-top: 4px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.scores { display: flex; gap: 8px; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px; scrollbar-width: none; }
.scores::-webkit-scrollbar { display: none; }
.score { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--borda); border-radius: var(--r); font-size: 13px; color: var(--cinza); }
.score b { font: 600 17px/1 var(--titulo); color: var(--grafite); }

/* ---------- listas ---------- */
.day { margin-top: 26px; }
.dayhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dayhead h2 { font-size: 22px; }
.dayhead span { color: var(--cinza); font-size: 14px; font-weight: 700; }
.sep { border: 0; border-top: 2px solid var(--borda); margin: 26px 0 0; }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--borda); animation: in .2s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.check { width: 28px; height: 28px; border-radius: 999px; border: 2px solid #9AA1AC; display: grid; place-items: center; color: transparent; flex: none; margin-top: 1px; transition: background .15s, border-color .15s, transform .12s; }
.check:hover { border-color: var(--grafite); }
.check:active { transform: scale(.88); }
.check .ico { width: 16px; height: 16px; stroke-width: 3; }
.task.done .check { background: var(--verde); border-color: var(--verde); color: #fff; animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.18); } }
.task.done .t-title { color: var(--cinza); text-decoration: line-through; text-decoration-color: #9AA1AC; }
.task.off .check { border-style: dashed; }
.task.off .t-title { color: var(--cinza); }
.t-body { flex: 1; min-width: 0; text-align: left; cursor: pointer; }
.t-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.t-sub { color: var(--cinza); font-size: 14px; margin-top: 1px; overflow-wrap: anywhere; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--nevoa); color: var(--grafite); }
.pill.tag { --c: var(--azul); background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); }
.pill.late { background: var(--vermelho-claro); color: var(--vermelho); }
.pill.alarm { background: #FFF6D6; color: #6B5200; }
.pill.alarm.past { background: var(--vermelho-claro); color: var(--vermelho); }
.pill.open { background: var(--azul-claro); color: var(--azul); }
.pill.ok { background: var(--verde-claro); color: var(--verde); }
.empty { color: var(--cinza); padding: 18px 0; display: flex; gap: 10px; align-items: center; }
.empty img { width: 44px; opacity: .9; }

/* ---------- barra de baixo ---------- */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0)); z-index: 5; }
.bottombar .btn { width: 100%; max-width: 728px; margin: 0 auto; display: flex; min-height: 54px; box-shadow: var(--sombra); font-size: 17px; }

/* ---------- folhas (modais) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(29, 33, 39, .45); animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92svh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 8px 20px calc(20px + var(--safe-b)); animation: up .32s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 720px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; padding-bottom: 24px; } .sheet.wide { max-width: 760px; } }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--borda); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 21px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borda); font-size: 14px; font-weight: 700; background: #fff; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--grafite); border-color: var(--grafite); color: #fff; }
.chip.tagchip[aria-pressed="true"] { --c: var(--azul); background: var(--c); border-color: var(--c); }
.chip .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--c, var(--azul)); }
.picker { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid #C9CED6; border-radius: 14px; text-align: left; font-weight: 700; }
.picker .ico { color: var(--cinza); }
.picker span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colors { display: flex; gap: 8px; }
.colors button { width: 30px; height: 30px; border-radius: 99px; background: var(--c); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--grafite); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.actions .full { grid-column: 1 / -1; }
.info { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 15px; }
.info dt { color: var(--cinza); }
.info dd { margin: 0; font-weight: 700; }
.history { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; color: var(--cinza); }
.history li { padding: 6px 0; border-top: 1px solid var(--nevoa); }
.history b { color: var(--grafite); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--borda); }
.list li .grow { flex: 1; min-width: 0; }
.list small { color: var(--cinza); display: block; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 4px; border-bottom: 1px solid var(--borda); font-weight: 700; text-align: left; }
.menu-item .ico { color: var(--cinza); }
.code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--nevoa); border-radius: 12px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.note { background: var(--azul-claro); color: #173F7A; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 10px 0; }

/* seletor de datas (inspirado no Meta) */
.dp { display: grid; grid-template-columns: 1fr; gap: 14px; }
.dp-presets { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px; scrollbar-width: none; }
.dp-presets label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--borda); border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer; }
.dp-presets input { accent-color: var(--azul); width: 18px; height: 18px; margin: 0; }
.dp-presets label:has(input:checked) { border-color: var(--azul); background: var(--azul-claro); color: var(--azul); }
@media (min-width: 720px) {
  .dp { grid-template-columns: 200px 1fr; }
  .dp-presets { flex-direction: column; margin: 0; padding: 0; overflow: visible; border-right: 1px solid var(--borda); padding-right: 14px; }
  .dp-presets label { border: 0; border-radius: 10px; min-height: 40px; }
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font: 600 17px var(--titulo); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal .wd { font-size: 12px; color: var(--cinza); font-weight: 700; padding: 4px 0; }
.cal button { height: 42px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.cal button:hover { background: var(--nevoa); }
.cal button.today { color: var(--azul); }
.cal button.sel { background: var(--azul); color: #fff; }
.cal button.inrange { background: var(--azul-claro); border-radius: 0; }
.cal button[disabled] { color: #B8BDC6; pointer-events: none; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dp-foot small { color: var(--cinza); }

#toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--grafite); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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