/* Layout: a study notebook — tabs for study and metrics; course trail, pace + week/month calendar, then units beside the open unit (lessons + notes). */
:root {
  /* Tema do UI kit: Urbanist; rosa #CC498F e #F4D4E6 nos detalhes, grafite #202020 no texto */
  --bg: #F8F5F7; --surface: #FFFFFF; --sunken: #F4EFF2; --ink: #202020; --muted: #776B72; --line: #EEDFE7;
  --accent: #CC498F; --accent-ink: #FFFFFF; --accent-soft: #F4D4E6;
  --lock: #A99CA3;
  /* cores de status: rosa fica só nos detalhes */
  --ok: #1E8A55; --ok-ink: #FFFFFF;                          /* concluído */
  --prog: #2B50D8; --prog-ink: #FFFFFF; --prog-soft: #E2E7FB; /* em andamento / progresso */
  --sun: #E2A200; --sun-ink: #2A2000; --sun-soft: #FBEFC8;   /* dia estudado */
  --miss: #C9432D; --miss-soft: #F5DDD7;                     /* não estudou */
  --mark: rgba(204, 73, 143, .28);
  --f-display: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --f-body: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --f-data: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --r: 24px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #151113; --surface: #1F1A1D; --sunken: #19151A; --ink: #F5EEF2; --muted: #A9989F; --line: #3A2E35;
  --accent: #E26AAB; --accent-ink: #202020; --accent-soft: #4A2338;
  --lock: #6E6168;
  --ok: #4CC287; --ok-ink: #0F131A; --prog: #7E98FF; --prog-ink: #0F131A; --prog-soft: #212947;
  --sun: #F2B705; --sun-ink: #2A2000; --sun-soft: #3A3112; --miss: #F07B67; --miss-soft: #3B201C;
  --mark: rgba(226, 106, 171, .32);
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #151113; --surface: #1F1A1D; --sunken: #19151A; --ink: #F5EEF2; --muted: #A9989F; --line: #3A2E35;
  --accent: #E26AAB; --accent-ink: #202020; --accent-soft: #4A2338;
  --lock: #6E6168;
  --ok: #4CC287; --ok-ink: #0F131A; --prog: #7E98FF; --prog-ink: #0F131A; --prog-soft: #212947;
  --sun: #F2B705; --sun-ink: #2A2000; --sun-soft: #3A3112; --miss: #F07B67; --miss-soft: #3B201C;
  --mark: rgba(226, 106, 171, .32);
  color-scheme: dark }

* { box-sizing: border-box }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5 }
.wrap { padding-block: 28px 64px;
  padding-left: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-right, 0px));
  display: grid; gap: 22px }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.015em }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 600 }
h2 { font-size: 20px; font-weight: 600 }
h3 { font-size: 17px; font-weight: 600 }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted) }
.num { font-family: var(--f-data); font-variant-numeric: tabular-nums }
.muted { color: var(--muted) }
button { font: inherit; color: inherit; cursor: pointer }
button:focus-visible, input:focus-visible, [contenteditable]:focus-visible, .wd:focus-visible, .md:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0 }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted) }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--lock) }
.status[data-s="saved"] i { background: var(--ok) }
.status[data-s="saving"] i { background: var(--sun) }
.status[data-s="error"] i { background: var(--miss) }

/* course trail */
.trail { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px }
.mod { position: relative; border-radius: var(--r); padding: 18px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 10px; align-content: start; min-width: 0 }
.mod.active { border-color: var(--prog); box-shadow: 0 0 0 1px var(--prog) inset }
.mod.locked { background: var(--sunken); color: var(--muted) }
.mod .row { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.mod h3 { font-size: 22px; font-weight: 600 }
.mod.locked h3 { color: var(--muted) }
.mod p { margin: 0; font-size: 13.5px }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap }
.chip.on { background: var(--prog); color: var(--prog-ink); border-color: var(--prog) }
.chip.done { background: var(--ok); color: var(--ok-ink); border-color: var(--ok) }
.tags { display: flex; flex-wrap: wrap; gap: 6px }
.bar { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden }
.mod.active .bar, .unit .bar, .detail .bar { background: var(--prog-soft) }
.bar > span { display: block; height: 100%; background: var(--prog); border-radius: inherit; transition: width .4s ease }
.lockline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600 }
.lockline svg { flex: none }

/* pace + calendar */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 22px }
.pace { display: grid; gap: 18px; align-content: start }
.big { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center }
.ring { width: 104px; height: 104px }
.ring circle { fill: none; stroke-width: 10 }
.ring .trk { stroke: var(--prog-soft) }
.ring .val { stroke: var(--prog); stroke-linecap: round; transition: stroke-dashoffset .5s ease }
.ring text { fill: var(--ink); font-family: var(--f-data); font-weight: 600; font-size: 20px }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px }
.stat b { display: block; font-family: var(--f-data); font-size: 18px; font-weight: 600 }
.stat span { font-size: 12.5px; color: var(--muted) }
.forecast { border-top: 1px dashed var(--line); padding-top: 14px; display: grid; gap: 12px }
.fc { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap }
.fc .when { font-family: var(--f-display); font-weight: 600; font-size: 22px }
.fc small { color: var(--muted); font-size: 12.5px }

.cal-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px }
.calbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line) }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted) }
.seg button { border: 1px solid transparent }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent) }
.calnav { display: flex; align-items: center; gap: 6px }
.calnav .arrow { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; font-size: 16px; line-height: 1 }
.calnav .arrow:hover { border-color: var(--accent); color: var(--accent) }
#calTitle { font-weight: 600; font-size: 14px; min-width: 150px; text-align: center }

/* semana */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px }
.wd { display: grid; justify-items: center; gap: 6px; padding: 12px 2px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); min-width: 0 }
.wd .wn { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.wd .wdt { font-family: var(--f-display); font-weight: 600; font-size: 22px; line-height: 1 }
.wd .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken) }
.wd .wc { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 2px }
.wd.st { background: var(--sun-soft); border-color: var(--sun) }
.wd.st .dot { background: var(--sun); color: var(--sun-ink) }
.wd.st .wc { color: var(--ink); font-weight: 600 }
.wd.miss .dot { background: var(--miss-soft); box-shadow: inset 0 0 0 1.5px var(--miss) }
.wd.miss .wc { color: var(--miss) }
.wd.pre, .wd.fut { background: transparent }
.wd.fut { opacity: .5; cursor: default }
.wd.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent) }

/* mês */
.mo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px }
.mo .mh { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px }
.md { position: relative; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; font-family: var(--f-data); font-size: 13px; min-width: 0 }
.md small { position: absolute; right: 5px; bottom: 3px; font-size: 10px; font-weight: 600 }
.md.st { background: var(--sun); border-color: var(--sun); color: var(--sun-ink); font-weight: 600 }
.md.miss { background: var(--miss-soft); border-color: transparent; color: var(--miss) }
.md.pre, .md.fut { background: transparent; color: var(--muted) }
.md.fut { cursor: default }
.md.out { opacity: .35 }
.md.today { box-shadow: inset 0 0 0 2px var(--accent) }

.calsum { margin: 14px 0 0; font-size: 13.5px }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 12px; align-items: center }
.legend span { display: inline-flex; align-items: center; gap: 6px }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block }
.legend .hint { margin-left: auto }

/* abas e métricas */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line) }
.tabs button { border: 0; background: none; padding: 10px 0; font-weight: 600; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent) }
.tabpanel { display: grid; gap: 22px }
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 18px; margin-top: 16px }
.mgrid .stat b { font-size: 26px }
.todaybtn { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 13px }
.todaybtn.on { background: var(--accent); color: var(--accent-ink) }

/* units */
/* conteúdo do módulo: unidades | aulas | anotações */
.content { display: grid; gap: 16px; scroll-margin-top: 16px }
.content-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap }
.chead { display: grid; gap: 6px; min-width: 0; flex: 1 }
.content-head h2 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 600 }
.back { font-size: 13.5px; font-weight: 600; color: var(--accent); text-decoration: none; margin-bottom: 6px }
.back:hover { text-decoration: underline; text-underline-offset: 3px }
.seg.sm { flex-wrap: wrap; justify-self: start; max-width: 100% }
.seg.sm button { padding: 4px 12px; font-size: 12.5px }
.fcrow { display: flex; justify-content: space-between; align-items: center; gap: 12px }
.fcrow > div { display: grid; gap: 2px; min-width: 0 }
.fcrow span { font-size: 14px }
.fcrow small { color: var(--muted); font-size: 12.5px }
.fcrow .when, .big-date { font-family: var(--f-display); font-weight: 600; font-size: 22px; white-space: nowrap }
.lockedview { display: flex; gap: 16px; align-items: center; padding: 6px 0 }
.lockedview .emptyicon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); flex: none }
.lockedview small { display: block; margin-top: 4px }
.tl { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 14px }
.tlrow { display: grid; grid-template-columns: 12px 110px 1fr; gap: 10px; align-items: center; font-size: 13.5px }
.tldot { width: 10px; height: 10px; border-radius: 50%; background: var(--line) }
.tlrow.cur .tldot { background: var(--prog) }
.settings { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 16px }
.settings label { display: grid; gap: 6px; font-size: 13px; font-weight: 600 }
.settings input { font: inherit; font-family: var(--f-data); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 180px }
.settings { align-items: start }
.pagetitle { font-size: clamp(30px, 3.4vw, 42px); font-weight: 600 }
.timepick { display: flex; gap: 6px }
.settings select { font: inherit; font-family: var(--f-data); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink) }
.field { display: grid; gap: 6px }
.flabel { font-size: 13px; font-weight: 600 }
.days { display: flex; gap: 6px; flex-wrap: wrap }
.days button { width: 48px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); text-transform: capitalize }
.days button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.planout { display: grid; gap: 4px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line) }
.planout b { font-family: var(--f-display); font-weight: 600; font-size: 28px }
.planout span { font-size: 13px; color: var(--muted) }
.mgrid .stat.hl b { color: var(--accent) }
.wd.off { background: transparent; border-style: dashed }
.wd.off .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line) }
.md.off { background: transparent; border-style: dashed; color: var(--muted) }
.pace-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap }
.pace-head .back { margin: 0 }
#panelMetrics > .back { justify-self: start; margin: 0 }
#mScope { margin-top: -6px }
#mForecast:not(:empty) { margin-top: 18px }
#mForecast .tl { margin-top: 14px }
#mLocked { display: grid; gap: 16px; margin-top: 14px }
.cprog { display: flex; align-items: center; gap: 14px; font-size: 13px; white-space: nowrap }
.cprog .bar { flex: 1; min-width: 80px; background: var(--prog-soft) }
.seg button svg { vertical-align: -2px; margin-right: 4px }
.units { display: grid; grid-template-columns: 280px minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start }
.modopen { justify-self: start; margin-top: 4px; padding: 7px 16px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13.5px; text-decoration: none }
.modopen:hover { filter: brightness(1.08) }
.modopen.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line) }
.modopen:focus-visible, .back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.modempty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 20px }
.modempty p { margin: 0; max-width: 52ch }
.modempty .emptyicon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); font-size: 24px }
.ulist { display: grid; gap: 6px; padding: 10px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px) }
.unit { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 10px; align-items: center; text-align: left; padding: 10px; border-radius: 16px; border: 1px solid transparent; background: transparent }
.unit:hover { background: var(--sunken) }
.unit[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent) }
.unit .n { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-data); font-weight: 600; background: var(--sunken); font-size: 14px }
.unit.full .n { background: var(--ok); color: var(--ok-ink) }
.unit .t { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.unit .c { font-family: var(--f-data); font-size: 12px; color: var(--muted) }
.unit .bar { grid-column: 2 / 4; height: 5px }

.detail { display: grid; gap: 22px }
.dhead { display: grid; gap: 10px }
.dhead .row { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap }
.lessons { display: grid; gap: 0; border-top: 1px solid var(--line) }
.lesson { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); align-items: start }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; padding: 0; margin-top: 1px }
.check svg { opacity: 0 }
.lesson.done .check { background: var(--ok); border-color: var(--ok); color: var(--ok-ink) }
.lesson.done .check svg { opacity: 1 }
.lesson .lt { font-weight: 600; font-size: 15px }
.lesson.done .lt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line) }
.lesson .ld { font-size: 13.5px; color: var(--muted); margin: 2px 0 0 }
.lesson .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); align-items: center; margin-top: 6px }
.lesson .type { font-weight: 600; color: var(--accent); letter-spacing: .02em }

.notes { display: grid; gap: 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px) }
.nhead { display: grid; gap: 4px }
.nhead-row { display: flex; justify-content: space-between; align-items: center; gap: 12px }
.btn.sm { padding: 6px 16px; font-size: 13.5px }
.noteview { max-height: calc(100vh - 260px); overflow-y: auto; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; padding-right: 4px }
.noteempty { display: grid; gap: 4px; width: 100%; padding: 36px 16px; border: 1.5px dashed var(--line); border-radius: 18px; background: transparent; color: var(--muted); text-align: center }
.noteempty span { color: var(--accent); font-weight: 600; font-size: 13.5px }
.noteempty:hover { border-color: var(--accent) }

/* modal de edição: janela inteira em telas pequenas ou divididas */
body.modal-open { overflow: hidden }
.notemodal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(12, 8, 10, .55); backdrop-filter: blur(3px);
  padding: calc(env(safe-area-inset-top, 0px) + 24px) max(24px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(24px, env(safe-area-inset-left, 0px)) }
.nm-panel { width: min(920px, 100%); height: 100%; min-height: 0; display: grid; grid-template-rows: auto auto 1fr auto; gap: 12px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) }
.nm-head { display: flex; justify-content: space-between; align-items: start; gap: 12px }
.nm-head h2 { font-size: clamp(22px, 2.6vw, 28px) }
.nm-panel .editor { min-height: 0; max-height: none; height: 100%; font-size: 16px }
@media (max-width: 1100px) {
  .notemodal { padding: 0; background: var(--surface); backdrop-filter: none }
  .nm-panel { width: 100%; border: 0; border-radius: 0;
    padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(16px, env(safe-area-inset-left, 0px)) }
}
.tool { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--sunken) }
.tool button { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; min-width: 32px }
.tool button:hover { background: var(--surface) }
.tool .sep { width: 1px; background: var(--line); margin: 4px 4px }
.editor { min-height: 420px; max-height: calc(100vh - 220px); overflow-y: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 0 0 18px 18px; background: var(--surface); outline: none; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65 }
.editor:focus { border-color: var(--accent) }
.editor:empty::before { content: attr(data-ph); color: var(--muted); pointer-events: none }
.prose h3 { font-size: 18px; margin: 14px 0 4px }
.prose p { margin: 0 0 8px }
.prose ul, .prose ol { margin: 4px 0 8px; padding-left: 22px }
.prose blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0 }
.prose code { font-family: var(--f-data); font-size: 13px; background: var(--sunken); padding: 1px 5px; border-radius: 4px }
.nmeta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted) }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s ease; max-width: calc(100% - 32px) }
.toast.show { opacity: 1; transform: translateX(-50%) }

@media (max-width: 1180px) {
  .units { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
  .ulist { grid-column: 1 / -1; position: static; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) }
}
@media (max-width: 920px) {
  .trail { grid-template-columns: 1fr }
  .duo { grid-template-columns: 1fr }
  .units { grid-template-columns: 1fr }
  .notes { position: static }
  .editor { min-height: 280px; max-height: none }
}
@media (max-width: 520px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .wk { gap: 4px }
  .wd { padding: 10px 0 }
  .wd .wdt { font-size: 18px }
  .wd .wc { font-size: 10px; padding-inline: 0 }
  .wd .wc.s { display: none }
  .legend .hint { margin-left: 0 }
  #calTitle { min-width: 0 }
  .ring { width: 88px; height: 88px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }

/* campos: borda rosa ao passar o mouse, rosa claro com foco (UI kit) */
.settings input:hover, .settings select:hover, .auth input:hover { border-color: var(--accent) }
.settings input:focus, .settings select:focus, .auth input:focus { outline: none; border-color: var(--accent); background: var(--accent-soft) }
.days button { border-radius: 999px }

/* ===== editor de anotações ===== */
.nm-panel { width: min(1180px, 100%) }
.nm-panel .tool { align-items: center; border-bottom: 1px solid var(--line); border-radius: 18px; padding: 6px 8px; gap: 4px }
.nm-panel .tool .tb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 9px; border-radius: 10px; font-size: 13px; font-weight: 600; min-width: 32px; justify-content: center; color: var(--ink) }
.nm-panel .tool .tb:hover { background: var(--surface) }
.nm-panel .tool .tb[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent) }
.nm-panel .tool select { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 160px }
.nm-panel .tool select:hover { border-color: var(--accent) }
.sizebox { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface) }
.sizebox button { width: 28px; height: 30px; border: 0; background: transparent; font-size: 16px; color: var(--ink); border-radius: 999px }
.sizebox button:hover { color: var(--accent) }
.sizebox input { width: 36px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 13px; color: var(--ink); -moz-appearance: textfield }
.sizebox input::-webkit-outer-spin-button, .sizebox input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0 }
.tb .glyph { font-weight: 700; font-size: 14px; line-height: 1 }
.tb .bar { position: absolute; left: 50%; bottom: 3px; width: 16px; height: 3px; margin-left: -8px; border-radius: 2px; background: var(--ink) }
.tb .bar#hiliteBar { background: rgba(242, 183, 5, .7) }
.pal-wrap { position: relative; display: inline-flex }
.pal-wrap .tb { position: relative; padding-bottom: 9px }
.palette { position: absolute; top: calc(100% + 6px); left: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 26px); gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 24px rgba(0, 0, 0, .18) }
.palette[hidden] { display: none }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); padding: 0; background: var(--surface) }
.sw:hover { transform: scale(1.12) }
.sw.none { background: linear-gradient(135deg, transparent 44%, var(--miss) 44% 56%, transparent 56%), var(--surface) }
.pinbtn { color: var(--accent) !important }

.nm-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; min-height: 0 }
.nm-body.noguide { grid-template-columns: minmax(0, 1fr) }
.nm-body.noguide .guide { display: none }
.guide { min-height: 0; overflow-y: auto; padding: 12px 6px 12px 4px; border-right: 1px solid var(--line) }
.guide ol, .vguide ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px }
.guide button, .vguide button { width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 10px; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.guide button:hover, .vguide button:hover { background: var(--sunken); color: var(--accent) }
.guide .lv1 button, .vguide .lv1 button { color: var(--ink); font-weight: 600 }
.guide .lv2, .vguide .lv2 { padding-left: 12px }
.guide .lv3, .vguide .lv3 { padding-left: 24px }
.guide .empty { font-size: 12.5px; color: var(--muted); padding: 6px 10px; line-height: 1.4 }
.nm-panel .editor { border-radius: 18px; padding: 18px 22px }
.vguide { border: 1px solid var(--line); border-radius: 16px; padding: 8px 10px; background: var(--sunken) }
.vguide summary { cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) }
.vguide ol { max-height: 180px; overflow-y: auto }
@media (max-width: 760px) {
  .nm-body:not(.noguide) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) }
  .guide { max-height: 26vh; border-right: 0; border-bottom: 1px solid var(--line) }
  .nm-panel .tool { overflow-x: auto; flex-wrap: nowrap }
  .palette { position: fixed; top: auto; left: 16px }
}

/* títulos e texto das anotações */
.prose h1 { font-size: 26px; margin: 18px 0 6px }
.prose h2 { font-size: 21px; margin: 16px 0 4px }
.prose > :first-child { margin-top: 0 }

/* post-its: o trecho fica marcado; o bilhete aparece ao clicar */
.pin { --pin: #D9A400; --pin-bg: rgba(255, 214, 0, .22); background: var(--pin-bg); border-bottom: 2px solid var(--pin); border-radius: 3px; padding: 0 1px; cursor: pointer }
.pin::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 4px; border-radius: 50%; background: var(--pin); vertical-align: .35em; box-shadow: 0 0 0 2px var(--surface) }
.pin[data-color="pink"] { --pin: #D9539A; --pin-bg: rgba(217, 83, 154, .2) }
.pin[data-color="green"] { --pin: #36A35F; --pin-bg: rgba(54, 163, 95, .2) }
.pin[data-color="blue"] { --pin: #4A7FE0; --pin-bg: rgba(74, 127, 224, .2) }
.pin[data-color="purple"] { --pin: #9466D8; --pin-bg: rgba(148, 102, 216, .22) }
.pinpop { position: fixed; z-index: 70; width: 250px; min-height: 220px; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; padding: 12px 14px 14px;
  background: var(--pp-bg, #FFE58A); color: #2A2420; border-radius: 3px 3px 3px 3px; transform: rotate(-1.2deg);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .2); font-family: "Patrick Hand", var(--f-body) }
.pinpop[hidden] { display: none }
.pinpop::after { content: ""; position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; background: linear-gradient(315deg, var(--bg) 50%, rgba(0, 0, 0, .14) 50%) }
.pp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 20px }
.pp-colors { display: flex; gap: 6px }
.pp-colors[hidden] { display: none }
.pp-colors button { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, .3); padding: 0 }
.pp-colors button[aria-pressed="true"] { outline: 2px solid #2A2420; outline-offset: 1px }
.pp-x { border: 0; background: none; color: inherit; font-size: 22px; line-height: 1; padding: 0 2px; margin-left: auto }
.pinpop textarea { resize: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: 19px; line-height: 1.3; outline: none; min-height: 140px }
.pinpop textarea::placeholder { color: rgba(42, 36, 32, .5) }
.pp-read { font-size: 19px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere }
.pp-del { justify-self: start; border: 0; background: none; padding: 0; font: 600 13px var(--f-body); color: #8A2E2E; text-decoration: underline; text-underline-offset: 3px }
@media (prefers-reduced-motion: reduce) { .pinpop { transform: none } }

/* alternância claro/escuro */
.top-right { display: grid; justify-items: end; gap: 10px }
.theme-switch { position: relative; display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunken) }
.theme-switch .ti { position: relative; z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); transition: color .2s }
.theme-switch .knob { position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s ease }
.theme-switch[aria-checked="true"] .knob { transform: translateX(30px) }
.theme-switch[aria-checked="false"] .sun, .theme-switch[aria-checked="true"] .moon { color: var(--accent) }
.theme-switch:hover { border-color: var(--accent) }

/* login e conta */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.auth .card { width: 100%; max-width: 400px; display: grid; gap: 16px; padding: 28px }
.auth label { display: grid; gap: 6px; font-size: 13px; font-weight: 600 }
.auth input { font: inherit; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink) }
.auth .btns { display: flex; gap: 8px; flex-wrap: wrap }
.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 9px 18px; font-weight: 600 }
.btn.ghost { background: transparent; color: var(--accent) }
.btn:disabled { opacity: .6; cursor: progress }
.auth .msg { font-size: 13px; color: var(--muted); min-height: 1.2em; margin: 0 }
.auth .msg.err { color: var(--miss) }
.account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end }
.account .who { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: underline; text-underline-offset: 3px }
