/* Fontes hospedadas no próprio app (sem Google Fonts: privacidade e funciona sem depender de terceiros) */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/fraunces-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/fraunces-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/fraunces-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 500; font-display: swap; src: url('fonts/fraunces-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 600; font-display: swap; src: url('fonts/fraunces-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 700; font-display: swap; src: url('fonts/fraunces-latin-700-italic.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/playfair-display-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/playfair-display-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 500; font-display: swap; src: url('fonts/playfair-display-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 700; font-display: swap; src: url('fonts/playfair-display-latin-700-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }

/* Temas: cada pessoa escolhe o seu em "Ambiente". Cores só via variáveis. Padrão: Toada. */
:root, [data-theme="toada"] {
  --bg: #F6F1EA; --surface: #FFFFFF; --line: #E4DDD3; --line-soft: #EEE8DF;
  --text: #22323A; --heading: #1E3A44; --muted: #5E6A6E;
  --side: #1E3A44; --side-text: #F6F1EA; --side-muted: #B9D3D0; --side-on: #F6DCD2; --side-on-text: #1E3A44;
  --accent: #1E3A44; --accent-text: #F6F1EA;
  --note: #F6DCD2; --note-tag: #A8432E; --note-text: #5C3B32;
  --cool: #DCEAE7; --cool-text: #1E3A44;
  --warm: #F2E8D8; --warm-text: #5C4A23;
  --danger: #A8432E;
  --bar-done: #1E3A44; --bar-doing: #D9694F; --bar-todo: #9FC3BF; --bar-other: #C9C2BD;
  --serif: 'Fraunces', Georgia, serif;
}
[data-theme="marcela"] {
  --bg: #FBF7F4; --surface: #FFFFFF; --line: #E6DCD8; --line-soft: #F0E8E5;
  --text: #2B2B33; --heading: #2C4058; --muted: #6B6573;
  --side: #3F5A7A; --side-text: #FBF7F4; --side-muted: #E9C6CE; --side-on: #F6DDE2; --side-on-text: #2C4058;
  --accent: #3F5A7A; --accent-text: #FBF7F4;
  --note: #F6DDE2; --note-tag: #8E2F48; --note-text: #5A4A55;
  --cool: #E4EAF1; --cool-text: #2C4058;
  --warm: #F3EBDD; --warm-text: #5C4A23;
  --danger: #8E2F48;
  --bar-done: #3F5A7A; --bar-doing: #E9B8C3; --bar-todo: #A7B7CA; --bar-other: #C9C2BD;
  --serif: 'Playfair Display', Georgia, serif;
}
[data-theme="sereno"] {
  --bg: #F6F3EC; --surface: #FFFFFF; --line: #E2DED3; --line-soft: #ECE8DF;
  --text: #2B2E2A; --heading: #2D4438; --muted: #646A60;
  --side: #3E5B4C; --side-text: #F6F3EC; --side-muted: #CFDCCB; --side-on: #DDE6DA; --side-on-text: #2D4438;
  --accent: #3E5B4C; --accent-text: #F6F3EC;
  --note: #DDE6DA; --note-tag: #2D4438; --note-text: #40503F;
  --cool: #E6ECEE; --cool-text: #2E4448;
  --warm: #EDE5D3; --warm-text: #4E4126;
  --danger: #8A3A2E;
  --bar-done: #3E5B4C; --bar-doing: #B9CDB4; --bar-todo: #C9C1A9; --bar-other: #D3D0C6;
  --serif: 'Fraunces', Georgia, serif;
}
[data-theme="noite"] {
  --bg: #1F2430; --surface: #2A303D; --line: #39404F; --line-soft: #333A48;
  --text: #EDE6E3; --heading: #F3ECEA; --muted: #B3ADB8;
  --side: #161A23; --side-text: #EDE6E3; --side-muted: #C9A9B3; --side-on: #3A3346; --side-on-text: #F6DDE2;
  --accent: #F2B8C6; --accent-text: #1F2430;
  --note: #3A3346; --note-tag: #F2B8C6; --note-text: #D9D0D6;
  --cool: #323A4A; --cool-text: #D7E0EC;
  --warm: #3D3628; --warm-text: #EBDDBC;
  --danger: #F2A3B5;
  --bar-done: #8EA6C4; --bar-doing: #F2B8C6; --bar-todo: #56627A; --bar-other: #4A4F5C;
  --serif: 'Playfair Display', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif; }
a { color: var(--accent); }
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }

/* ---------- Barra lateral ---------- */
.side { flex: 1 1 250px; max-width: 100%; background: var(--side); color: var(--side-text); padding: 28px 20px; display: flex; flex-direction: column; gap: 26px; }
.brand-eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--side-muted); }
.brand { font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 34px; line-height: 1.1; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { background: var(--side-on); color: var(--side-on-text); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--side-muted); margin-bottom: 6px; }
.plist { display: flex; flex-direction: column; gap: 2px; }
.plist a { display: flex; justify-content: space-between; gap: 8px; color: var(--side-text); text-decoration: none; font-size: 14px; padding: 7px 12px; border-radius: 6px; }
.plist a:hover { background: rgba(255,255,255,.08); }
.plist a[aria-current="page"] { background: var(--side-on); color: var(--side-on-text); }
.plist .count { color: var(--side-muted); font-variant-numeric: tabular-nums; }
.plist a[aria-current="page"] .count { color: inherit; }
.side details summary { cursor: pointer; font-size: 13px; color: var(--side-muted); padding: 6px 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.btn-side { background: var(--side-text); color: var(--side); border: 0; border-radius: 8px; min-height: 44px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }

/* ---------- Área principal ---------- */
.main { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; display: flex; flex-direction: column; gap: 32px; outline: none; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 4px 0; font-family: var(--serif); font-weight: 700; font-size: 44px; line-height: 1.08; color: var(--heading); }
h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 26px; color: var(--heading); }
h3 { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
em, .it { font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
section { display: flex; flex-direction: column; gap: 12px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.btn { font: inherit; font-size: 14px; min-height: 44px; padding: 0 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--heading); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 8px; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; }
.icon-btn:hover { border-color: var(--line); color: var(--heading); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Bilhetes (alertas) ---------- */
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note { text-decoration: none; border-radius: 4px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; cursor: pointer; border: 1px solid transparent; color: var(--text); }
.note:nth-child(3n+1) { transform: rotate(-.6deg); }
.note:nth-child(3n+2) { transform: rotate(.4deg); }
.note:nth-child(3n) { transform: rotate(-.3deg); }
.note:hover { transform: none; }
.note .tag { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.note .title { font-family: var(--serif); font-size: 20px; line-height: 1.25; color: var(--heading); }
.note .sub { font-size: 13px; }
.note.parada, .note.atrasada { background: var(--note); }
.note.parada .tag, .note.atrasada .tag { color: var(--note-tag); }
.note.parada .sub, .note.atrasada .sub { color: var(--note-text); }
.note.esperando { background: var(--surface); border-color: var(--line); }
.note.esperando .tag { color: var(--accent); }
.note.esperando .sub { color: var(--muted); }
.note.semana { background: var(--cool); }
.note.semana .tag, .note.semana .sub { color: var(--cool-text); }
.note.calm { background: var(--surface); border-color: var(--line); cursor: default; }

/* ---------- Listas de tarefas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tlist { overflow: hidden; }
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); min-height: 52px; }
.trow:last-child { border-bottom: 0; }
.trow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.trow .ttl { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.trow .ttl:hover { text-decoration: underline; }
.trow.done .ttl { color: var(--muted); text-decoration: line-through; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--cool); color: var(--cool-text); white-space: nowrap; text-decoration: none; }
.pill.warm { background: var(--warm); color: var(--warm-text); }
.pill.rose { background: var(--note); color: var(--note-tag); }
.due { font-size: 13px; color: var(--muted); min-width: 90px; text-align: right; white-space: nowrap; }
.due.late { color: var(--danger); font-weight: 600; }
.empty { padding: 22px 18px; color: var(--muted); }

/* ---------- Projeto ---------- */
.pname { font-family: var(--serif); font-weight: 700; font-size: 40px; color: var(--heading); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; margin-left: -9px; width: 100%; }
.pname:hover, .pname:focus { border-color: var(--line); background: var(--surface); }
.meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea, .inp { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-height: 40px; }
.field textarea { min-height: 90px; resize: vertical; }
.summary { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 14px; }
.summary b { color: var(--heading); font-weight: 600; }
.late-txt { color: var(--danger); }

.ttable-wrap { overflow-x: auto; }
.ttable { width: 100%; border-collapse: collapse; min-width: 900px; }
.ttable th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.ttable td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.ttable tr:last-child td { border-bottom: 0; }
.ttable tr.done td .inp-title { color: var(--muted); text-decoration: line-through; }
.ttable .inp { width: 100%; min-height: 36px; padding: 6px 8px; border-color: transparent; background: transparent; }
.ttable .inp:hover, .ttable .inp:focus { border-color: var(--line); background: var(--surface); }
.ttable .num { width: 72px; }
.ttable td:nth-child(2) { min-width: 240px; }
.ttable td:nth-child(3) { min-width: 120px; }
.ttable td:nth-child(7) { min-width: 130px; }
.ttable .dates { font-size: 13px; color: var(--muted); white-space: nowrap; }
.ttable .other { color: var(--muted); font-style: italic; }
.ttable .par { text-align: center; vertical-align: middle; }
.ttable .par input { width: 18px; height: 18px; margin: 0; vertical-align: middle; accent-color: var(--accent); cursor: pointer; }
.ttable th.par-h { text-align: center; cursor: help; }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.addrow .inp { flex: 1 1 200px; }
.addrow .inp.short { flex: 0 1 140px; }

/* ---------- Linha do tempo ---------- */
.tl { overflow-x: auto; padding: 16px 18px; }
.tl-grid { min-width: 820px; display: grid; grid-template-columns: 240px 1fr; row-gap: 6px; font-size: 13px; }
.tl-label { padding-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }
.tl-label.proj { font-weight: 600; color: var(--heading); padding-top: 10px; }
.tl-label.sub { padding-left: 14px; color: var(--muted); }
.tl-label.sub.mine { color: var(--text); }
.tl-track { position: relative; height: 26px; }
.tl-track.proj { height: 14px; margin-top: 10px; }
.tl-head { position: relative; height: 22px; border-bottom: 1px solid var(--line); }
.tl-week { position: absolute; top: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-week.now { color: var(--heading); font-weight: 600; }
.tl-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.tl-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--danger); opacity: .7; }
.bar { position: absolute; top: 4px; height: 18px; border-radius: 4px; border: 0; padding: 0; cursor: pointer; min-width: 4px; }
.bar.done { background: var(--bar-done); }
.bar.doing { background: var(--bar-doing); }
.bar.todo, .bar.waiting { background: var(--bar-todo); }
.bar.other { background: repeating-linear-gradient(135deg, var(--bar-other) 0 6px, transparent 6px 10px); border: 1px solid var(--bar-other); }
.bar.late { outline: 2px solid var(--danger); outline-offset: 1px; }
.bar.proj { top: 3px; height: 8px; background: var(--heading); opacity: .35; cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--muted); padding: 0 18px 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- Ambiente ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.theme { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: left; min-height: 64px; }
.theme[aria-pressed="true"] { border: 2px solid var(--accent); }
.sw { display: flex; gap: 4px; }
.sw i { width: 22px; height: 22px; border-radius: 50%; display: block; border: 1px solid rgba(0,0,0,.08); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ---------- Diálogo e avisos ---------- */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--bg); color: var(--text); }
dialog::backdrop { background: rgba(20, 22, 30, .45); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dlg h2 { font-size: 24px; }
.dlg .field textarea { min-height: 120px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dlg-actions .spacer { flex: 1; }
.links { display: flex; flex-direction: column; gap: 4px; font-size: 14px; word-break: break-all; }
.err { color: var(--danger); font-size: 13px; min-height: 1em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--heading); color: var(--bg); padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Painel de projetos ---------- */
.chip { font: inherit; font-size: 13px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--heading); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: 13px; min-height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--cool); color: var(--cool-text); font-weight: 600; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcard-name { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.2; }
.pcard-name a { color: var(--heading); text-decoration: none; }
.pcard-name a:hover { text-decoration: underline; }
.ppill { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.ppill.alta { background: var(--note); color: var(--note-tag); }
.ppill.media { background: var(--cool); color: var(--cool-text); }
.ppill.baixa { background: var(--warm); color: var(--warm-text); }
.alert-chip { font-size: 12px; font-weight: 600; color: var(--note-tag); background: var(--note); padding: 3px 10px; border-radius: 4px; }
.prog { display: flex; flex-direction: column; gap: 6px; }
.prog-bar { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.prog-bar i { display: block; height: 6px; background: var(--accent); border-radius: 999px; }
.prog-txt { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; position: relative; padding-bottom: 12px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; box-sizing: border-box; position: relative; z-index: 1; }
.step.done .dot { background: var(--accent); }
.step.done.empty .dot { background: var(--surface); border: 2px solid var(--line); }
.step.now .dot { background: var(--note); border: 2px solid var(--note-tag); }
.step.next .dot { background: var(--surface); border: 2px dashed var(--bar-todo); }
.step > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.step .now-box { background: var(--note); border-radius: 8px; padding: 6px 10px; margin-top: -4px; }
.step .lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.step.now .lbl { color: var(--note-tag); font-weight: 600; }
.step .ttl, .ptable .ttl { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.step.now .ttl { font-size: 15px; font-weight: 500; }
.step .ttl:hover, .ptable .ttl:hover { text-decoration: underline; }
.meta { font-size: 12px; color: var(--muted); display: block; }
.struck { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.none { font-size: 14px; color: var(--muted); font-style: italic; }
.pcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: auto; }
.btn.sm { min-height: 36px; font-size: 13px; font-weight: 600; padding: 0 12px; }
.btn.sm svg { width: 16px; height: 16px; }
.ptable { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 14px; }
.ptable th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable .now-col { background: var(--note); }
.ptable th.now-col { color: var(--note-tag); }
.ptable td:nth-child(5) { width: 220px; }
.pname-sm { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--heading); text-decoration: none; }

/* ---------- Menu recolhível ---------- */
.side-brand { display: flex; align-items: center; gap: 12px; }
.side-logo { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-toggle { width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--side-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.side-toggle:hover { background: rgba(255,255,255,.08); color: var(--side-text); }
.side-toggle svg { width: 20px; height: 20px; }
.btn-side svg { width: 20px; height: 20px; }
.app.collapsed .side { flex: 0 0 76px; padding: 20px 12px; align-items: center; position: sticky; top: 0; height: 100vh; }
.app.collapsed .side-head { flex-direction: column; align-items: center; }
.app.collapsed .side-brand-txt, .app.collapsed .lbl-txt, .app.collapsed .side-projects { display: none; }
.app.collapsed .nav a { justify-content: center; padding: 10px; width: 48px; }
.app.collapsed .btn-side { width: 48px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Toada: login, avisos, compartilhamento, instalação ---------- */
.app.auth-mode .side { display: none; }
.auth-wrap { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: min(440px, 100%); padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { border-radius: 14px; }
.brand-auth { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 34px; line-height: 1; color: var(--heading); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-size: 28px; margin: 0; }
.auth-form .btn.primary { justify-content: center; }
.auth-form p { margin: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; min-height: 0; }
[data-theme="noite"] .linkish { color: var(--accent); }
.banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: -8px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--cool); color: var(--cool-text); }
.banner > div:first-child { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; }
.banner svg { width: 20px; height: 20px; flex-shrink: 0; }
.banner.invite { background: var(--note); color: var(--note-text); }
.banner.ok { background: var(--cool); }
.banner a { color: inherit; }
.people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.people svg { width: 18px; height: 18px; }
.person { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--cool); color: var(--cool-text); }
.person.me { background: var(--note); color: var(--note-tag); }
.shared-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.shared-line svg { width: 15px; height: 15px; }
.shared-dot { font-size: 11px; color: var(--side-muted); }
.share-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.share-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.share-row:last-child { border-bottom: 0; }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--side-muted); overflow: hidden; }
.side-user .lbl-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app.collapsed .side-user { justify-content: center; }
.side-logo { border-radius: 12px; object-fit: cover; }
.install-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.install-card.mine { border: 2px solid var(--accent); }
.steps-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.steps-list li { padding-left: 4px; line-height: 1.55; }
.steps-list li::marker { color: var(--note-tag); font-weight: 600; }
.ios-share { display: inline-flex; vertical-align: middle; width: 22px; height: 22px; border-radius: 6px; background: var(--cool); color: var(--cool-text); align-items: center; justify-content: center; }
.ios-share svg { width: 16px; height: 16px; }
#push-box .pill { display: inline-flex; align-items: center; gap: 6px; }
#push-box .pill svg, .btn svg { width: 16px; height: 16px; }
.icon-editor { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.icon-preview { display: flex; gap: 14px; align-items: flex-end; }
.icon-preview canvas, .icon-preview img { border-radius: 22%; box-shadow: 0 0 0 1px var(--line); background: var(--surface); }
.icon-controls { display: flex; flex-direction: column; gap: 12px; flex: 1 1 260px; }
.icon-controls input[type=color] { width: 56px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* ---------- Celular: topo compacto + barra de abas fixa embaixo ---------- */
.tabbar { display: none; }
@media (max-width: 700px) {
  .side { flex: 1 1 100%; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); gap: 10px; position: sticky; top: 0; z-index: 20; }
  .side .side-toggle[data-action=toggle-side] { display: none; }
  .side .brand { font-size: 26px; }
  .side .side-logo { width: 34px; height: 34px; }
  .app:not(.menu-open) .side .nav, .app:not(.menu-open) .side .side-projects, .app:not(.menu-open) .side .side-foot { display: none; }
  .app.menu-open .side { min-height: calc(100vh - 64px); padding-bottom: 90px; }
  .app.menu-open .main { display: none; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; font: inherit; font-size: 11px; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar [aria-current="page"] { color: var(--heading); font-weight: 600; }
  .tabbar [aria-current="page"] svg { color: var(--note-tag); }
  .app.auth-mode ~ .tabbar { display: none; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 700px) {
  .app.collapsed .side { flex: 1 1 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .app.collapsed .side-head { flex-direction: row; }
  .app.collapsed .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 34px; }
  .side { padding: 20px 16px; }
  .trow { flex-wrap: wrap; }
  .trow .ttl { flex: 1 1 70%; }
  .due { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } .note { transform: none !important; } }

/* Link do convite na janela Compartilhar */
.invite-link { display: flex; gap: 8px; margin: -2px 0 8px; }
.invite-link .inp { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); }

/* Entrar com o Google */
.google-btn { width: 100%; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 500; }
.google-btn:hover { background: #f7f8f8; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 2px 0; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
