/* FocoOS — estilos
   Paleta: fundo cinza-azulado, tinta quase preta, tomate (Pomodoro) como destaque único
   e as quatro cores da Matriz de Eisenhower (validadas para daltonismo, claro e escuro). */

:root {
  color-scheme: light;
  --ground: #EDF0F4;
  --surface: #FFFFFF;
  --surface-2: #F5F7FA;
  --lane: #E2E6ED;
  --line: #D3D9E3;
  --line-soft: #E4E8EE;
  --ink: #131A2A;
  --ink-2: #3D475E;
  --muted: #5F6982;
  --btn: #131A2A;
  --btn-ink: #FFFFFF;
  --ring: #2F6FD6;
  --tomato: #E0533D;
  --leaf: #2F8A57;
  --q1: #D63B3B; --q2: #2F6FD6; --q3: #BF7A0A; --q4: #8E6FCF; --q0: #8D96A8;
  --q1-soft: #FBEAEA; --q2-soft: #E7EFFB; --q3-soft: #FAF0DE; --q4-soft: #F1ECFA;
  --q1-ink: #A52424; --q2-ink: #1D55B2; --q3-ink: #845204; --q4-ink: #6547AC;
  --good: #1E8656; --good-soft: #E2F3EA;
  --warn: #9A6005; --warn-soft: #FCF0D9;
  --crit: #C3353A; --crit-soft: #FCE7E7;
  --c-focus: #E0533D;
  --c-done: #34405A;
  --c-mood: #16877C;
  --grid: #E6EAF0;
  --t-aula: #8E6FCF; --t-trabalho: #5D6B85; --t-reuniao: #2F6FD6; --t-comunicacao: #BF7A0A;
  --t-foco: #E0533D; --t-pessoal: #C24E86; --t-descanso: #1E8656;
  --shadow-1: 0 1px 0 rgba(19, 26, 42, .06), 0 1px 3px rgba(19, 26, 42, .08);
  --shadow-2: 0 18px 48px rgba(19, 26, 42, .22), 0 2px 8px rgba(19, 26, 42, .08);
  --gutter: clamp(16px, 2.4vw, 32px);
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E1117; --surface: #181D26; --surface-2: #141922; --lane: #1C222C;
    --line: #2B3340; --line-soft: #232A35;
    --ink: #E7EBF3; --ink-2: #B5BDCC; --muted: #8E97AA;
    --btn: #E7EBF3; --btn-ink: #10141B; --ring: #7AA7F2;
    --tomato: #EE654F; --leaf: #4CB77C;
    --q1: #D9463F; --q2: #3F7FE0; --q3: #B8801C; --q4: #8A6FD6; --q0: #6F788B;
    --q1-soft: #33201F; --q2-soft: #1B2638; --q3-soft: #312716; --q4-soft: #251F38;
    --q1-ink: #FF9C94; --q2-ink: #9CC0FA; --q3-ink: #EDC173; --q4-ink: #C8B7F6;
    --good: #52C58D; --good-soft: #16301F; --warn: #E6AA45; --warn-soft: #33280F; --crit: #FF7C76; --crit-soft: #3A1E20;
    --c-focus: #EE654F; --c-done: #9AA8C2; --c-mood: #33B3A5;
    --grid: #252C37;
    --t-aula: #9C80E0; --t-trabalho: #8391AB; --t-reuniao: #4F8CE8; --t-comunicacao: #C68E2A;
    --t-foco: #EE654F; --t-pessoal: #D86AA0; --t-descanso: #3DB27A;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .35);
    --shadow-2: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E1117; --surface: #181D26; --surface-2: #141922; --lane: #1C222C;
  --line: #2B3340; --line-soft: #232A35;
  --ink: #E7EBF3; --ink-2: #B5BDCC; --muted: #8E97AA;
  --btn: #E7EBF3; --btn-ink: #10141B; --ring: #7AA7F2;
  --tomato: #EE654F; --leaf: #4CB77C;
  --q1: #D9463F; --q2: #3F7FE0; --q3: #B8801C; --q4: #8A6FD6; --q0: #6F788B;
  --q1-soft: #33201F; --q2-soft: #1B2638; --q3-soft: #312716; --q4-soft: #251F38;
  --q1-ink: #FF9C94; --q2-ink: #9CC0FA; --q3-ink: #EDC173; --q4-ink: #C8B7F6;
  --good: #52C58D; --good-soft: #16301F; --warn: #E6AA45; --warn-soft: #33280F; --crit: #FF7C76; --crit-soft: #3A1E20;
  --c-focus: #EE654F; --c-done: #9AA8C2; --c-mood: #33B3A5;
  --grid: #252C37;
  --t-aula: #9C80E0; --t-trabalho: #8391AB; --t-reuniao: #4F8CE8; --t-comunicacao: #C68E2A;
  --t-foco: #EE654F; --t-pessoal: #D86AA0; --t-descanso: #3DB27A;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-2: 0 18px 48px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 18px; height: 18px; flex: none; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
code, kbd { font-family: var(--f-mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.app { max-width: 1680px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 0 48px; }

/* ---------- Cabeçalho ---------- */
.masthead { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ground); margin-inline: calc(-1 * var(--gutter)); padding: 12px var(--gutter) 0; border-bottom: 1px solid var(--line-soft); }
.topbar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 30px; height: 30px; flex: none; }
.logo .l-track { fill: none; stroke: var(--line); stroke-width: 4; }
.logo .l-bar { fill: none; stroke: var(--tomato); stroke-width: 4; stroke-linecap: round; }
.logo .l-leaf { fill: none; stroke: var(--leaf); stroke-width: 2.4; stroke-linecap: round; }
.brand-name { font-family: var(--f-display); font-weight: 800; font-stretch: 125%; font-size: 21px; letter-spacing: -0.01em; line-height: 1; }
.brand-tag { font-size: 11.5px; line-height: 1.2; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; max-width: 20ch; }
.capture { flex: 1 1 340px; display: flex; gap: 8px; max-width: 660px; }
.capture input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.capture input::placeholder { color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 11px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a .i { width: 17px; height: 17px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tomato); }

.timer-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; }
.tc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tomato); animation: pulse 1.6s ease-in-out infinite; }
.timer-chip[data-mode="short"] .tc-dot, .timer-chip[data-mode="long"] .tc-dot { background: var(--good); }
.timer-chip.paused .tc-dot { animation: none; background: var(--muted); }
.tc-time { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { opacity: .35; } }

.banner { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); font-size: 14px; }
.banner p { max-width: 80ch; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, opacity .15s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 17px; height: 17px; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { opacity: .9; }
.btn.tomato { background: var(--tomato); border-color: var(--tomato); color: #FFFFFF; }
.btn.tomato:hover { opacity: .92; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--crit); }
.btn.armed, .btn.danger.armed { background: var(--crit); border-color: var(--crit); color: #FFFFFF; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 30px; font-size: 16px; min-width: 160px; border-radius: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.sm .i { width: 16px; height: 16px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 6px; }
.icon-btn.xs .i { width: 14px; height: 14px; }
.icon-btn.armed { width: auto; padding: 0 8px; background: var(--crit); color: #FFFFFF; font-size: 12px; font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { display: inline-grid; place-items: center; height: 30px; min-width: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-weight: 600; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button:hover { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

/* ---------- Cabeçalho das telas ---------- */
.view { padding-top: 20px; }
.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.view-head h1 { font-family: var(--f-display); font-stretch: 112%; font-weight: 750; font-size: clamp(23px, 2.2vw, 29px); letter-spacing: -0.015em; line-height: 1.1; text-wrap: balance; }
.view-head p { color: var(--muted); margin-top: 5px; max-width: 72ch; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.count { display: inline-grid; place-items: center; min-width: 24px; padding: 3px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); font: 600 12px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.count.warn { background: var(--crit-soft); color: var(--crit); }
.empty { font-size: 13px; color: var(--muted); padding: 14px 8px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.drop-over { outline: 2px dashed var(--ring); outline-offset: -3px; }
.drop-over .empty { display: none; }
.card-ph { flex: none; border-radius: 9px; border: 1px dashed var(--muted); background: var(--surface-2); opacity: .8; }

/* ---------- Quadro ---------- */
.agenda-strip { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 0 0 14px; scrollbar-width: thin; }
.as-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; margin-right: 4px; }
.as-label .i { width: 16px; height: 16px; color: var(--muted); }
.as-ev { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--tc) 14%, var(--surface)); }
.as-ev::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--tc); }
.as-ev .mono { font-size: 12px; color: var(--ink-2); }
.as-ev.is-past { opacity: .6; }
.as-more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.as-more .i { width: 16px; height: 16px; }
.as-more:hover { color: var(--ink); }

.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.lane { flex: 1 0 250px; max-width: 360px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-height: 220px; padding: 10px 8px 8px; border-radius: 14px; background: var(--lane); scroll-snap-align: start; }
.lane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 0; }
.lane-head h2 { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; }
.lane-head .i { width: 16px; height: 16px; color: var(--muted); }
.lane-hint { font-size: 12.5px; color: var(--muted); padding: 2px 6px 8px; }
.lane.is-over .lane-hint { color: var(--crit); font-weight: 600; }
.lane-cards { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-height: 72px; overflow-y: auto; padding: 2px 2px 6px; border-radius: 10px; }
.lane-add { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; text-align: left; cursor: pointer; }
.lane-add .i { width: 16px; height: 16px; }
.lane-add:hover { background: var(--surface); color: var(--ink); }
.lane-add.armed { background: var(--crit); color: #FFFFFF; }
.add-form { display: grid; gap: 8px; margin-top: 4px; }
.add-form textarea { width: 100%; min-height: 64px; resize: vertical; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }

/* ---------- Cartão ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 9px 10px 10px; border-radius: 10px; border: 1px solid transparent; background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; -webkit-user-select: none; user-select: none; }
.card:hover { border-color: var(--line); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .35; }
.card-row { display: flex; gap: 9px; align-items: flex-start; }
.card-title { font-size: 14px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.check { flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; padding: 0; border-radius: 50%; border: 1.6px solid var(--muted); background: transparent; color: var(--good); cursor: pointer; }
.check .i { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.check:hover { border-color: var(--good); }
.check:hover .i { opacity: .7; }
.is-done .check { background: var(--good); border-color: var(--good); color: #FFFFFF; }
.is-done .check .i { opacity: 1; }
.is-done .card-title { color: var(--muted); text-decoration: line-through; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); font: 500 11.5px/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.badge .i { width: 13px; height: 13px; }
.badge.late { background: var(--crit-soft); color: var(--crit); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }
.badge.ai { font-family: var(--f-body); font-weight: 700; letter-spacing: .05em; background: transparent; border: 1px solid var(--line); }
.area { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.qchip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px 3px 6px; border-radius: 5px; font-size: 11.5px; font-weight: 650; line-height: 1.2; }
.qchip::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--qc); }
.qchip.q1 { --qc: var(--q1); background: var(--q1-soft); color: var(--q1-ink); }
.qchip.q2 { --qc: var(--q2); background: var(--q2-soft); color: var(--q2-ink); }
.qchip.q3 { --qc: var(--q3); background: var(--q3-soft); color: var(--q3-ink); }
.qchip.q4 { --qc: var(--q4); background: var(--q4-soft); color: var(--q4-ink); }
.qchip.q0 { --qc: transparent; padding-block: 2px; border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.qchip.q0::before { width: 7px; height: 7px; border: 1.5px solid var(--q0); }
.card.compact { gap: 5px; padding: 7px 9px 8px; }
.card.compact .card-title { font-size: 13.5px; }

/* ---------- Bandejas e Matriz ---------- */
.tray { margin-bottom: 14px; padding: 12px; border-radius: 14px; background: var(--lane); }
.tray > header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.tray h2 { font-size: 15px; font-weight: 700; }
.tray-hint { font-size: 13px; color: var(--muted); }
.tray-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tray.strip .tray-cards { display: flex; overflow-x: auto; padding-bottom: 4px; }
.tray.strip .card { flex: 0 0 230px; }
.tray.strip .empty { flex: 1; }
.matrix { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.axis-x { grid-column: 2 / 4; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.axis-x span, .axis-y span { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.axis-y { grid-column: 1; grid-row: 2 / 4; display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.axis-y span { display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg); }
.quad { display: flex; flex-direction: column; gap: 8px; min-height: 230px; padding: 12px; border-radius: 14px; }
.quad.q1 { grid-column: 2; grid-row: 2; background: var(--q1-soft); }
.quad.q2 { grid-column: 3; grid-row: 2; background: var(--q2-soft); }
.quad.q3 { grid-column: 2; grid-row: 3; background: var(--q3-soft); }
.quad.q4 { grid-column: 3; grid-row: 3; background: var(--q4-soft); }
.quad > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quad .qchip { font-size: 13px; background: var(--surface); }
.quad-desc { font-size: 13px; color: var(--ink-2); }
.quad-cards { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; align-content: start; }
.quad .empty { border-color: color-mix(in srgb, var(--ink) 20%, transparent); }

/* ---------- Semana ---------- */
.goals { margin-bottom: 14px; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.goals h2 { margin-bottom: 10px; font-size: 15px; font-weight: 700; }
.goal-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.goal { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--surface-2); }
.goal:focus-within { border-color: var(--ring); }
.goal-n { width: 14px; font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: 18px; color: var(--tomato); }
.goal input { flex: 1; min-width: 0; height: 32px; padding: 0 4px; border: 0; background: transparent; }
.goal input:focus-visible { outline: none; }
.week-scroll { overflow-x: auto; margin-bottom: 12px; padding-bottom: 6px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; }
.day { display: flex; flex-direction: column; gap: 8px; min-height: 320px; padding: 10px 8px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); }
.day.is-past { background: var(--surface-2); box-shadow: none; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.day-head { display: flex; align-items: center; gap: 6px; }
.dow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dnum { font-family: var(--f-display); font-stretch: 118%; font-weight: 750; font-size: 22px; line-height: 1; }
.pill { padding: 3px 7px; border-radius: 999px; background: var(--tomato); color: #FFFFFF; font-size: 11px; font-weight: 700; }
.day-head .icon-btn { margin-left: auto; }
.day-load { font: 500 11.5px/1.3 var(--f-mono); color: var(--muted); }
.events { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.ev { display: grid; gap: 1px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: color-mix(in srgb, var(--tc) 13%, var(--surface)); color: var(--ink); text-align: left; cursor: pointer; }
.ev:hover { background: color-mix(in srgb, var(--tc) 22%, var(--surface)); }
.ev-time { display: flex; align-items: center; gap: 6px; font: 600 11px/1.2 var(--f-mono); color: var(--ink-2); }
.ev-time::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--tc); }
.ev-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.day-tasks { display: grid; gap: 6px; }
.t-aula { --tc: var(--t-aula); } .t-trabalho { --tc: var(--t-trabalho); } .t-reuniao { --tc: var(--t-reuniao); }
.t-comunicacao { --tc: var(--t-comunicacao); } .t-foco { --tc: var(--t-foco); } .t-pessoal { --tc: var(--t-pessoal); } .t-descanso { --tc: var(--t-descanso); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--tc); }

/* ---------- Foco ---------- */
.panel { padding: 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.panel h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 700; }
.panel h2 .i { width: 17px; height: 17px; color: var(--muted); }
.focus { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.focus-main { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 16px; }
.ring-wrap { position: relative; width: min(300px, 76vw); max-width: 100%; aspect-ratio: 1; }
.ring { display: block; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--line-soft); stroke-width: 12; }
.ring-bar { fill: none; stroke: var(--tomato); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.mode-short .ring-bar, .mode-long .ring-bar { stroke: var(--good); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; }
.clock { font-family: var(--f-mono); font-weight: 600; font-size: clamp(44px, 9vw, 66px); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring-sub { font-size: 13.5px; color: var(--muted); }
.cycle-dots { display: flex; gap: 8px; }
.cycle-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--tomato); }
.cycle-dots i.on { background: var(--tomato); }
.timer-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.focus-main .field { max-width: 440px; }
.focus-side { display: grid; gap: 12px; }
.prep { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.prep li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.prep input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--good); }
.sessions { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 22px; font-size: 13.5px; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 6px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field > legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .inline-form input {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px;
}
.field textarea { resize: vertical; line-height: 1.45; }
.inline-form { display: flex; gap: 8px; margin: 10px 0 8px; }
.inline-form input { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.field-note, .note { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; }

/* ---------- Painel ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { display: grid; gap: 4px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.kpi h3 { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-v { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.delta { font-size: 12.5px; color: var(--muted); }
.delta.up { color: var(--good); }
.delta.down { color: var(--crit); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.status .i { width: 15px; height: 15px; }
.kpi.is-crit .status { color: var(--crit); }
.kpi.is-good .status { color: var(--good); }
.meter { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--good); }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-family: var(--f-body); font-size: 11px; }
.chart .tick { font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--ink); font-weight: 700; font-size: 11.5px; }
.chart .xl.today { fill: var(--ink); font-weight: 700; }
.chart .bar-focus { fill: var(--c-focus); }
.chart .bar-done { fill: var(--c-done); }
.chart .hit { fill: transparent; outline: none; }
.chart .col:hover .bar, .chart .col:focus-within .bar { opacity: .75; }
.chart .col:focus-within .hit { stroke: var(--ring); stroke-width: 1.5; }
.hbars { display: grid; gap: 10px; margin-top: 12px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 44%) minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 13px; border-radius: 6px; }
.hbar:hover .fill, .hbar:focus-visible .fill { opacity: .75; }
.hl { color: var(--ink-2); line-height: 1.25; }
.track { height: 14px; border-left: 1px solid var(--line); }
.fill { display: block; height: 100%; min-width: 2px; border-radius: 0 4px 4px 0; }
.fill.q1 { background: var(--q1); } .fill.q2 { background: var(--q2); } .fill.q3 { background: var(--q3); } .fill.q4 { background: var(--q4); } .fill.q0 { background: var(--q0); }
.hv { font-family: var(--f-mono); font-weight: 600; text-align: right; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.habits th, .habits td { padding: 5px 4px; text-align: center; }
.habits thead th { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.habits thead th span { display: block; line-height: 1.25; }
.habits thead th.is-today { color: var(--ink); }
.habits tbody th { min-width: 150px; text-align: left; font-size: 13.5px; font-weight: 500; }
.habits tbody th > span { margin-right: 4px; }
.habits tbody th .icon-btn { vertical-align: middle; opacity: 0; }
.habits tr:hover th .icon-btn, .habits th .icon-btn:focus-visible, .habits th .icon-btn.armed { opacity: 1; }
.habits td.mono { color: var(--ink-2); font-size: 12px; }
.dot-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface); color: transparent; cursor: pointer; }
.dot-btn .i { width: 14px; height: 14px; stroke-width: 3; }
.dot-btn:hover { border-color: var(--good); color: var(--good); }
.dot-btn.on { background: var(--good); border-color: var(--good); color: #FFFFFF; }
.mood-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.mood { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 11.5px; cursor: pointer; }
.mood:hover { border-color: var(--muted); }
.mood-n { font-family: var(--f-display); font-stretch: 118%; font-weight: 800; font-size: 20px; color: var(--ink); }
.mood[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.mood[aria-pressed="true"] .mood-n { color: var(--btn-ink); }
.mood-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 88px; margin-bottom: 6px; }
.ms { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 4px; height: 100%; }
.ms-bar { display: flex; align-items: flex-end; width: 16px; height: 100%; border-bottom: 1px solid var(--line); }
.ms-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--c-mood); }
.ms-l { font-size: 11px; color: var(--muted); }
.ms-l.today { color: var(--ink); font-weight: 700; }
.insights { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.insights li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.45; }
.mini-log { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.mini-log .mono { margin-right: 8px; font-size: 12px; color: var(--muted); }
.retro-text { max-width: 80ch; margin-top: 8px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.data-table { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.data-table summary { font-size: 14px; font-weight: 600; cursor: pointer; }
.data-table table { margin-top: 10px; }
.data-table th, .data-table td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.data-table th:first-child { text-align: left; }
.data-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- Assistente IA ---------- */
.ai-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: passo; }
.ai-steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-1); font-size: 14px; counter-increment: passo; }
.ai-steps li::before { content: counter(passo); display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--btn); color: var(--btn-ink); font-size: 13px; font-weight: 700; }
.ai-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-tools { display: grid; gap: 6px; }
.ai-tools button { display: grid; gap: 2px; padding: 10px 12px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.ai-tools button span { font-size: 12.5px; color: var(--muted); }
.ai-tools button:hover { background: var(--surface); border-color: var(--line); }
.ai-tools button[aria-pressed="true"] { background: var(--surface); border-color: var(--ink); box-shadow: var(--shadow-1); }
.ai-work { display: grid; gap: 14px; }
.ai-work > .btn { justify-self: start; }
.ai-work h2 { font-family: var(--f-display); font-stretch: 110%; font-size: 19px; }
.ai-work > div > p { max-width: 72ch; margin-top: 4px; }
.prompt-box, .response-box { display: grid; gap: 8px; }
.prompt-box > label, .response-box > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.prompt-box textarea, .response-box textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: 12.5px/1.5 var(--f-mono); resize: vertical; }
.response-box textarea { background: var(--surface); }
.response-box .btn { justify-self: start; }
.ai-result { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.ai-result.ok { background: var(--good-soft); }
.ai-result.err { background: var(--crit-soft); color: var(--crit); }
.ai-result h3 { margin-top: 4px; font-size: 13.5px; }
.ai-result ul { margin: 0; padding-left: 18px; }
.ai-result .links { display: flex; flex-wrap: wrap; gap: 14px; }
.ai-result a { font-weight: 700; }
.ai-log { margin-top: 14px; }
.ai-log ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.ai-log .mono { margin-right: 8px; font-size: 12px; color: var(--muted); }

/* ---------- Janelas ---------- */
.modal { width: min(840px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.modal.narrow { width: min(580px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(10, 14, 22, .5); }
.modal-card { display: grid; gap: 14px; padding: 18px 20px 20px; }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.m-head h2 { font-family: var(--f-display); font-stretch: 112%; font-weight: 750; font-size: 20px; }
.m-title { flex: 1; min-width: 0; margin-left: -8px; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; font-family: var(--f-display); font-stretch: 108%; font-weight: 700; font-size: 20px; line-height: 1.25; resize: none; }
.m-title:hover { border-color: var(--line); }
.m-title:focus { outline: none; border-color: var(--line); background: var(--surface-2); }
.m-sub { margin-top: -8px; font-size: 13px; color: var(--muted); }
.m-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
.m-main, .m-side { display: grid; gap: 14px; align-content: start; }
.checklist header { display: flex; align-items: center; justify-content: space-between; }
.checklist h3 { font-size: 14px; }
.checklist ul { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; font-size: 14px; }
.checklist li:hover { background: var(--surface-2); }
.checklist li label { flex: 1; cursor: pointer; }
.checklist input[type="checkbox"] { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--good); }
.checklist input:checked + label { color: var(--muted); text-decoration: line-through; }
.checklist li .icon-btn { opacity: 0; }
.checklist li:hover .icon-btn, .checklist li .icon-btn:focus-visible { opacity: 1; }
.qpick { gap: 4px; }
.qopt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; }
.qopt:hover { background: var(--surface-2); }
.qopt input { margin: 0; accent-color: var(--ink); }
.qopt span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 2px; background: var(--qc); }
.qopt.q1 { --qc: var(--q1); } .qopt.q2 { --qc: var(--q2); } .qopt.q3 { --qc: var(--q3); } .qopt.q4 { --qc: var(--q4); }
.qopt.q0 { --qc: transparent; }
.qopt.q0 span::before { border: 1.5px solid var(--q0); }
.qopt:has(input:checked) { border-color: var(--line); background: var(--surface-2); }
.m-actions { display: grid; gap: 8px; }
.m-actions .btn { justify-content: flex-start; }
.m-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.m-section { margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick { position: relative; }
.day-pick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.day-pick span { display: grid; place-items: center; min-width: 46px; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.day-pick input:checked + span { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.day-pick input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }
.form-error { font-size: 13.5px; font-weight: 600; color: var(--crit); }
.steps { display: grid; gap: 6px; margin: 0; padding-left: 20px; font-size: 14px; }
#export-text { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: 12px/1.45 var(--f-mono); resize: vertical; }

/* ---------- Avisos e dicas ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 10px; background: var(--btn); color: var(--btn-ink); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2); animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.toast.good::before { background: var(--good); }
.toast.warn::before { background: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.chart-tip { position: fixed; z-index: 70; display: grid; gap: 1px; max-width: 260px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12.5px; box-shadow: var(--shadow-2); pointer-events: none; }
.chart-tip strong { font-size: 13.5px; white-space: pre-line; }
.chart-tip span { color: var(--muted); }
.chart-tip span:empty { display: none; }

/* ---------- Telas menores ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .focus, .ai-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-tools { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .ai-steps, .goal-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .brand-tag { display: none; }
  .capture { order: 3; flex-basis: 100%; max-width: none; }
  .lane { flex: 0 0 min(84vw, 320px); max-height: none; }
  .matrix { grid-template-columns: minmax(0, 1fr); }
  .axis-x, .axis-y { display: none; }
  .quad.q1, .quad.q2, .quad.q3, .quad.q4 { grid-column: 1; grid-row: auto; min-height: 0; }
  .week-grid { grid-template-columns: minmax(0, 1fr); }
  .day { min-height: 0; }
  .m-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-v { font-size: 28px; }
}
@media (max-width: 680px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .capture .btn { padding: 0 12px; }
  .tabs a { padding-inline: 10px; }
}
