/* 90 Jours — thème « carnet de bord » : bleu marine et or */
:root {
  --bg: #0a1128;
  --bg-deep: #060b1c;
  --card: #111d42;
  --card-2: #16244e;
  --line: rgba(201, 162, 39, 0.2);
  --text: #ece7d8;
  --muted: #9aa3c4;
  --gold: #c9a227;
  --gold-2: #e0bd4f;
  --red: #c4504b;
  --orange: #d98a3a;
  --green: #3fae7d;
  --special: #5b6a96;
  --radius: 14px;
  --f-display: "Fraunces", Georgia, serif;
  --f-body: "Source Serif 4", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Coquille ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 16px) 16px 12px; border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--f-display); font-weight: 600; font-size: 28px; margin: 0; }
.kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: .05em; color: var(--muted); }
main { padding: 0 16px 24px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: rgba(6, 11, 28, .96); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.nav a {
  flex: 1 1 0; min-width: 0; max-width: 96px; text-align: center; padding: 14px 1px 12px;
  font-family: var(--f-body); font-size: 12.5px; color: var(--muted); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav a.on { color: var(--gold-2); box-shadow: inset 0 2px 0 var(--gold); }

@media (min-width: 900px) {
  .app { max-width: 900px; padding-bottom: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .nav { position: sticky; top: 0; bottom: auto; justify-content: flex-start; padding: 0 8px; border-top: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
  .nav a { flex: 0 0 auto; max-width: none; padding: 14px 16px; font-size: 12px; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--gold); }
  .app { display: flex; flex-direction: column; }
  .topbar { order: 0; } .nav { order: 1; } .update-banner { order: 2; } main { order: 3; padding: 0 32px 40px; }
  .page-objectifs .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .page-jour .tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
}

.update-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--gold); font-size: 14px;
}

/* ---------- Éléments communs ---------- */
.page-head { padding: 20px 0 12px; }
.page-head h2 { font-family: var(--f-display); font-weight: 600; font-size: 24px; margin: 0; }
.page-sub { margin: 2px 0 0; color: var(--muted); font-family: var(--f-mono); font-size: 12px; }
.empty, .hint { color: var(--muted); font-size: 13px; }
.hint { margin: 6px 0; }
.locked { font-size: 13px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.warn { color: var(--red); font-size: 13px; margin: 4px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--cat); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--gold);
  background: var(--gold); color: #1a1405; font-family: var(--f-mono); font-size: 13px; font-weight: 500;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--gold-2); }
.btn-danger { background: transparent; border-color: rgba(196, 80, 75, .6); color: #e58a85; }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.btn.wide { width: 100%; margin-top: 12px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:disabled { opacity: .3; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.x:hover { color: var(--red); }

input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-deep); font-size: 16px; /* 16px : évite le zoom auto sur iPhone */
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 1px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; cursor: pointer;
}
.chip.on { border-color: var(--gold); color: var(--text); background: var(--card-2); }
.chip .dot { background: currentColor; }
.chip .dot[style] { background: inherit; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 16px; }
.panel h3 { margin: 0 0 10px; font-family: var(--f-display); font-weight: 500; font-size: 17px; }

dialog.sheet {
  width: min(480px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--text); padding: 20px;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { font-family: var(--f-display); margin: 0 0 8px; }
dialog h3 { font-size: 15px; margin: 16px 0 4px; }

/* ---------- Objectifs ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--cat, var(--gold)); border-radius: var(--radius); overflow: hidden; }
.card-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; border: 0; background: none; text-align: left; cursor: pointer;
}
.card-title { flex: 1; font-family: var(--f-display); font-size: 17px; font-weight: 500; }
.status { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid var(--muted); }
.status.green { background: var(--green); border-color: var(--green); }
.status.orange { background: var(--orange); border-color: var(--orange); }
.status.red { background: var(--red); border-color: var(--red); }
.chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin: 0 4px 4px; }
.card.open .chev { transform: rotate(-135deg); margin-bottom: 0; }
.card-body { padding: 0 14px 14px; }
.card-body > form.edit, .card > form.edit { padding: 14px; }
.card-body h4 { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin: 14px 0 6px; font-weight: 500; }
.status-line { font-size: 13px; margin: 0; color: var(--muted); }
.status-line.green { color: var(--green); } .status-line.orange { color: var(--orange); } .status-line.red { color: #e58a85; }
.list { margin: 0; padding-left: 18px; }
.list li { margin: 3px 0; }
.engagement { margin: 0; }

.metric { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.metric-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: 14px; }
.metric-label { font-weight: 600; }
.metric-vals { font-size: 12px; color: var(--muted); }
.metric-vals strong { color: var(--text); }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin: 8px 0 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--cat, var(--gold)); }
.spark { width: 100%; height: 80px; display: block; margin: 6px 0; }
.spark-line { fill: none; stroke: var(--cat, var(--gold)); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--cat, var(--gold)); }
.spark-target { stroke: var(--gold-2); stroke-dasharray: 4 4; stroke-width: 1; opacity: .7; }
.spark-today { stroke: var(--muted); stroke-width: 1; opacity: .35; }
.measure-form { display: grid; grid-template-columns: minmax(0, 1fr) 138px auto; gap: 6px; margin-top: 6px; }
.measure-form input, .metric-row input, .prog-row input { min-width: 0; }
.measure-form input[type=date] { font-size: 14px; padding: 8px 6px; }
.measures summary { font-size: 12px; color: var(--muted); cursor: pointer; margin-top: 8px; }
.measures ul { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }
.measures li { display: flex; align-items: center; gap: 8px; }
.measures li .x { margin-left: auto; }

.programs { list-style: none; padding: 0; margin: 8px 0; }
.programs li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.programs select { width: auto; min-width: 120px; flex: none; font-size: 14px; }
.programs .st-accepted { border-color: var(--green); color: var(--green); }
.programs .st-rejected { border-color: var(--red); color: #e58a85; }
.programs .st-sent, .programs .st-interview { border-color: var(--gold); }

form.edit label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
form.edit label > input, form.edit label > select, form.edit label > textarea { margin-top: 4px; color: var(--text); }
form.edit fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 8px 10px; }
form.edit legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.metric-row, .prog-row { display: grid; gap: 6px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.metric-row { grid-template-columns: 1fr 1fr 1fr auto; }
.metric-row [name=m_label] { grid-column: 1 / -1; }
.metric-row [name=m_deadline] { grid-column: 1 / 4; }
.prog-row { grid-template-columns: 1fr auto; }
.prog-row [name=p_school], .prog-row [name=p_name] { grid-column: 1 / -1; }

/* ---------- Suivi du jour ---------- */
.day-head { display: flex; align-items: center; gap: 12px; }
.day-title { flex: 1; text-align: center; }
.score-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.score-card.is-special { border-style: dashed; }
.score-main { display: flex; align-items: baseline; gap: 6px; }
.score-num { font-family: var(--f-display); font-size: 48px; font-weight: 600; line-height: 1; }
.score-num.red { color: #e58a85; } .score-num.gold { color: var(--gold-2); } .score-num.green { color: var(--green); }
.score-den { font-family: var(--f-mono); color: var(--muted); }
.badge-bonus { margin-left: auto; font-family: var(--f-mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #1a1405; }
.gauge { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .08); margin: 12px 0; overflow: hidden; }
.gauge span { display: block; height: 100%; transition: width .25s; }
.gauge .red, .bar-fill.red, .hcell.red, .legend .red { background: var(--red); }
.gauge .gold, .bar-fill.gold, .hcell.gold, .legend .gold { background: var(--gold); }
.gauge .green, .bar-fill.green, .hcell.green, .legend .green { background: var(--green); }
.gauge .tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .5; }
.score-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 10px; }
.pill-special { font-family: var(--f-mono); font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--special); }
.score-card .hint { display: inline-block; margin-left: 8px; }

.task-group { margin-top: 18px; }
.task-group h3 { display: flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 6px 0; border-radius: 10px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--cat); flex: none; display: grid; place-items: center; }
.check.on .box { background: var(--cat); }
.check.on .box::after { content: ""; width: 6px; height: 11px; border: solid var(--bg-deep); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.on .lbl { color: var(--muted); }
.check:has(input:disabled) { cursor: default; opacity: .75; }
.check:has(input:focus-visible) { outline: 2px solid var(--gold-2); }
.edit-row { display: flex; gap: 6px; margin: 6px 0; }
.add-task { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 16px; }
@media (min-width: 420px) { .add-task { grid-template-columns: 1fr 140px auto; } }

.bars { display: flex; gap: 6px; align-items: flex-end; height: 120px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; }
.bar-fill { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; }
.bar-fill.special, .hcell.special, .legend .special { background: var(--special); }
.bar-val { font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.bar-day { font-family: var(--f-mono); font-size: 10px; color: var(--muted); }

.hgrid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.hcell { aspect-ratio: 1; border-radius: 3px; border: 0; padding: 0; cursor: pointer; background: rgba(255, 255, 255, .06); }
.hcell.future { background: rgba(255, 255, 255, .03); cursor: default; }
.hcell.empty { background: rgba(255, 255, 255, .12); }
.hcell.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* ---------- Semaine ---------- */
.check.counter { cursor: default; flex-wrap: wrap; }
.check.counter .lbl { flex: 1 1 140px; }
.mini-bar { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); margin-top: 6px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--cat); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: var(--card-2); font-size: 18px; cursor: pointer; }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper input { width: 52px; min-height: 36px; border: 0; border-radius: 0; text-align: center; padding: 0; font-family: var(--f-mono); }
.target { color: var(--muted); font-size: 12px; }
.edit-row .narrow { width: 80px; flex: none; }
.add-goal { display: grid; gap: 6px; margin-top: 16px; }
@media (min-width: 520px) { .add-goal { grid-template-columns: 1fr 1fr; } .add-goal [name=label] { grid-column: 1 / -1; } }
.mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow-label { flex: 1 1 180px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.mrow-label .small { flex-basis: 100%; padding-left: 17px; }
.mform { display: flex; gap: 6px; }
.mform input { width: 96px; min-width: 0; }
.gauge .orange { background: var(--orange); }

/* ---------- Bilan ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat.wide { grid-column: 1 / -1; }
.stat-num { font-family: var(--f-display); font-size: 28px; font-weight: 600; }
.stat-num.green { color: var(--green); } .stat-num.orange { color: var(--orange); } .stat-num.red { color: #e58a85; }
.stat-lbl { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.small-list { font-size: 14px; margin-top: 4px; }
form.bilan { margin-top: 16px; }
form.bilan label { display: block; font-family: var(--f-display); font-size: 16px; margin-bottom: 14px; }
form.bilan textarea { margin-top: 6px; font-family: var(--f-body); }
.final-hint { margin-top: 16px; }
.hist { border-top: 1px solid var(--line); padding: 10px 0; }
.hist summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.hist summary .mono { margin-left: auto; color: var(--muted); }
.hist h4 { font-family: var(--f-mono); font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 2px; font-weight: 500; }
.hist p { margin: 0; font-size: 14px; }
.wdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.wdot.green { background: var(--green); } .wdot.orange { background: var(--orange); } .wdot.red { background: var(--red); }
.final-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.final-table th { text-align: left; font-family: var(--f-mono); font-size: 11px; color: var(--muted); font-weight: 500; padding: 6px 4px; }
.final-table td { border-top: 1px solid var(--line); padding: 8px 4px; vertical-align: top; }
.ok { color: var(--green); } .ko { color: #e58a85; }

/* ---------- Progression ---------- */
.timebar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); margin-bottom: 12px; overflow: hidden; }
.timebar span { display: block; height: 100%; background: var(--gold); }
.chart-panel { padding: 10px 6px; margin-top: 4px; }
.chart { width: 100%; height: auto; display: block; }
.g-line { stroke: rgba(255, 255, 255, .07); }
.g-target { stroke: var(--gold); stroke-opacity: .4; }
.g-txt { fill: var(--muted); font-family: var(--f-mono); font-size: 11px; }
.today-txt { fill: var(--text); }
.g-today { stroke: var(--text); stroke-opacity: .35; stroke-dasharray: 2 3; }
.g-ideal { stroke: var(--gold-2); stroke-width: 1.5; stroke-dasharray: 6 5; opacity: .8; }
.g-empty { fill: var(--muted); font-size: 13px; }
.serie { cursor: pointer; transition: opacity .15s; }
.serie.dim { opacity: .12; }
.s-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.serie.hi .s-line { stroke-width: 4; }
.s-proj { stroke-width: 1.8; stroke-dasharray: 3 4; opacity: .8; }
.s-hit { fill: none; stroke: transparent; stroke-width: 16; }
.legend .ideal, .legend .proj { width: 18px; height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--gold-2); }
.legend .proj { border-top: 2px dotted var(--text); }
.prog-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.prog-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
}
.prog-row.on { border-color: var(--gold); }
.prog-row.dim { opacity: .5; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-title { font-family: var(--f-display); font-size: 15px; }
.pr-sub { font-size: 12px; color: var(--muted); }
.pr-nums { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; line-height: 1.35; }
.pr-nums strong { font-size: 15px; color: var(--text); }
@media (min-width: 900px) { .prog-list { display: grid; grid-template-columns: 1fr 1fr; } .page-semaine .tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } }

/* ---------- Réglages ---------- */
#newCycleForm { align-items: flex-end; }
#newCycleForm label { flex: 1 1 180px; }
.archive-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.archive-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.stepper input:disabled { color: var(--muted); -webkit-text-fill-color: var(--muted); opacity: 1; }
.check .stepper input { position: static; opacity: 1; width: 52px; height: 36px; }

/* ---------- Planif ---------- */
.plan-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.nav-group { display: flex; align-items: center; gap: 6px; }
.plan-toolbar > .btn { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); color: var(--muted); padding: 8px 12px; min-height: 36px; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--card-2); color: var(--gold-2); }
.seg.wide { display: flex; margin: 8px 0 12px; } .seg.wide button { flex: 1; }
.flash { background: rgba(63, 174, 125, .15); border: 1px solid var(--green); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.proposal, .conflicts { border: 1px dashed var(--gold); background: var(--card-2); border-radius: 12px; padding: 12px; margin-bottom: 10px; font-size: 14px; }
.conflicts { border-color: var(--red); }
.proposal ul, .conflicts ul { margin: 6px 0 0; padding-left: 18px; }
.conflicts li { margin: 4px 0; }

.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tl { display: grid; grid-template-columns: 34px repeat(var(--cols), minmax(0, 1fr)); }
.tl-gutter .tl-body { position: relative; }
.tl-hour { position: absolute; right: 4px; transform: translateY(-50%); font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.tl-col { border-left: 1px solid var(--line); min-width: 0; }
.tl-col.today .tl-colhead { color: var(--gold-2); }
.tl-colhead { display: flex; flex-direction: column; align-items: center; width: 100%; height: 44px; justify-content: center; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 0; }
.tl-colhead strong { font-family: var(--f-display); font-size: 17px; color: var(--text); }
.tl-col.today .tl-colhead strong { color: var(--gold-2); }
.tl-allday { min-height: 6px; display: flex; flex-direction: column; gap: 2px; padding: 0 2px 4px; border-bottom: 1px solid var(--line); }
.allday { font-size: 10px; line-height: 1.2; padding: 2px 4px; border-radius: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: rgba(111, 134, 201, .3); }
.allday.deadline { background: rgba(201, 162, 39, .25); color: var(--gold-2); }
.tl-body { position: relative; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 100% calc(60px * var(--ppm, 1)); }
.cal-day .tl-body { --ppm: 1.1; } .cal-week .tl-body { --ppm: .85; }
.ev {
  position: absolute; overflow: hidden; text-align: left; cursor: pointer; padding: 2px 4px; border-radius: 5px;
  border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 28%, var(--bg)); color: var(--text);
  display: flex; flex-direction: column; font-size: 11px; line-height: 1.2;
}
.cal-day .ev { font-size: 13px; padding: 4px 8px; }
.ev-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-meta { font-family: var(--f-mono); font-size: 10px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ev-ext { background: rgba(111, 134, 201, .25); }
.ev-fixed { background: repeating-linear-gradient(45deg, rgba(154,163,196,.18) 0 6px, rgba(154,163,196,.08) 6px 12px); border-left-color: var(--muted); }
.ev-task { border-left-style: solid; }
.ev-task.done { opacity: .45; } .ev-task.done .ev-title { text-decoration: line-through; }
.ev-proposal { --c: var(--gold-2); background: rgba(224, 189, 79, .14); border: 1px dashed var(--gold-2); border-left: 3px solid var(--gold-2); cursor: default; }
.tl-travel { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(-45deg, rgba(201,162,39,.16) 0 4px, transparent 4px 8px); border-radius: 3px; pointer-events: none; }
.tl-travel span { font-family: var(--f-mono); font-size: 10px; color: var(--gold); padding-left: 6px; }
.tl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

.m-head, .m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.m-head span { text-align: center; font-family: var(--f-mono); font-size: 10px; color: var(--muted); padding: 6px 0; }
.m-cell { min-height: 74px; border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: none; padding: 3px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; color: var(--text); }
.m-cell:nth-child(7n + 1) { border-left: 0; }
.m-cell.other { opacity: .4; }
.m-cell.today .m-num { background: var(--gold); color: #1a1405; border-radius: 50%; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.m-cell.sel { background: var(--card-2); }
.m-num { font-family: var(--f-mono); font-size: 12px; }
.m-pill { font-size: 9.5px; line-height: 1.25; padding: 1px 3px; border-radius: 3px; background: color-mix(in srgb, var(--c, #6f86c9) 35%, transparent); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-pill.deadline { background: rgba(201, 162, 39, .3); color: var(--gold-2); }
.m-more { font-size: 10px; color: var(--muted); }
@media (min-width: 900px) { .m-cell { min-height: 100px; } .m-pill { font-size: 11px; } }

.task-list { list-style: none; padding: 0; margin: 0; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task-row.done .t-title { text-decoration: line-through; color: var(--muted); }
.tcheck { position: relative; cursor: pointer; }
.tcheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tcheck .box { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--c); }
.tcheck input:checked + .box { background: var(--c); }
.tcheck input:checked + .box::after { content: ""; width: 6px; height: 11px; border: solid var(--bg-deep); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.tcheck input:focus-visible + .box { outline: 2px solid var(--gold-2); }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-title { font-size: 15px; }
.t-meta { font-size: 12px; color: var(--muted); }
.badge { font-family: var(--f-mono); font-size: 10px; padding: 1px 6px; border-radius: 999px; }
.badge.high { background: rgba(196, 80, 75, .25); color: #f0a09b; }
.badge.montue { background: rgba(201, 162, 39, .25); color: var(--gold-2); }
.quick-task { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 12px; }
.quick-task input { grid-column: 1 / -1; }
@media (min-width: 600px) { .quick-task { grid-template-columns: 1fr 110px auto; } .quick-task input { grid-column: auto; } }
.dl-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.dl-list li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.dl-list .mono { color: var(--gold-2); min-width: 56px; }

details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h3 { margin: 0; }
details.panel > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 6px; }
details.panel[open] > summary::after { transform: rotate(-135deg); }
details.panel[open] > summary { margin-bottom: 8px; }
.panel h4 { font-family: var(--f-mono); font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 6px; font-weight: 500; }
.src-list { list-style: none; padding: 0; margin: 0; }
.src-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.src-list li > div { flex: 1 1 100%; }
.src-list select { width: auto; flex: 1; }
.src-form { display: grid; gap: 6px; }
@media (min-width: 600px) { .src-form { grid-template-columns: 1fr 1fr auto; } .src-form[data-act=addsrc] { grid-template-columns: 1fr 2fr 1fr auto; } }
.plan-settings .rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.srow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.srow input, .srow select { flex: 1 1 90px; min-width: 0; width: auto; }
.srow input[type=time] { flex: 0 1 100px; }
.trow input[name=tmin] { flex: 0 0 64px; }
.frow { padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.grid2 label, .sheet-form > label { display: block; font-size: 13px; color: var(--muted); }
.grid2 input, .grid2 select, .sheet-form > label input { margin-top: 4px; color: var(--text); }
.sheet-form > label { margin-bottom: 10px; }
.sheet-form label.inline { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--text); font-size: 14px; }
.sheet-form label.inline input { width: 20px; min-height: 20px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 0; padding: 8px; }
.days legend { font-size: 13px; color: var(--muted); }
.days label { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.days input { width: 18px; min-height: 18px; }
.blocks { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.blocks li { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
dialog.plan-sheet { max-height: calc(100dvh - 32px); overflow: auto; }

/* ---------- Synchro ---------- */
#openSettings { position: relative; }
.sync-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--bg); background: var(--muted); }
.sync-dot.synced { background: var(--green); }
.sync-dot.syncing { background: var(--gold); }
.sync-dot.offline, .sync-dot.signedout { background: var(--orange); }
.sync-dot.error { background: var(--red); }
.sync-status { font-size: 14px; margin: 4px 0 8px; }
.sync-status.synced { color: var(--green); } .sync-status.error { color: #e58a85; } .sync-status.offline { color: var(--orange); }
.auth-form { display: grid; gap: 8px; }
.auth-form .row-btns { margin-top: 4px; }
