body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.titlebar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 12px;
  -webkit-app-region: drag;
  user-select: none;
}

.platform-darwin .titlebar {
  padding-left: 78px;
  justify-content: flex-end;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  -webkit-app-region: no-drag;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

main {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 24px;
}

.view > * + * {
  margin-top: 12px;
}

.quick {
  flex: 1;
  font-size: 15px;
  padding: 9px 12px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 22px !important;
}

.section-head h2 {
  margin: 0 2px;
}

.total {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 6px;
}

/* ---------- Chrono en cours ---------- */

.current {
  padding: 16px;
}

.current.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.current.paused {
  border-style: dashed;
}

.cur-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cur-info {
  flex: 1;
  min-width: 0;
}

.cur-task {
  display: block;
  max-width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: text;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cur-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.cur-clock {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.cur-clock.over {
  color: var(--warn);
}

.current .progress {
  margin: 14px 0 10px;
}

.cur-status {
  color: var(--muted);
  font-size: 13px;
}

.cur-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.cur-activity {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cur-edit {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.empty {
  color: var(--muted);
}

.empty b {
  color: var(--text);
}

kbd {
  font: inherit;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}

/* ---------- Entrées ---------- */

.entries,
.rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.entry:hover {
  background: var(--surface);
}

.entry .bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  flex: none;
}

.entry .e-main {
  flex: 1;
  min-width: 0;
}

.entry .e-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry .e-meta {
  color: var(--faint);
  font-size: 12.5px;
}

.entry .e-dur {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.entry.live {
  cursor: default;
}

.entry.live .e-dur {
  color: var(--accent-text);
  font-weight: 500;
}

.editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  margin: 4px 0 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.editor .full {
  grid-column: 1 / -1;
}

.editor label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.editor .row {
  grid-column: 1 / -1;
}

.empty-list {
  color: var(--faint);
  padding: 10px;
  font-size: 13px;
}

/* ---------- Semaine ---------- */

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  height: 150px;
  padding: 12px;
}

.wd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  font-size: 11.5px;
  color: var(--muted);
}

.wd .col-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.wd .col {
  width: 100%;
  max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  background: var(--accent);
  min-height: 2px;
}

.wd.today .col {
  background: var(--accent-hover);
}

.wd.empty .col {
  background: var(--surface-2);
}

.groups .group {
  margin-bottom: 12px;
}

.g-head,
.g-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 70px;
  align-items: center;
  gap: 10px;
}

.g-head {
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.g-row {
  padding: 5px 0;
  font-size: 13px;
}

.g-row .name {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.g-row .progress {
  height: 5px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.actions {
  margin-top: 18px !important;
}

/* ---------- Projets ---------- */

.projects {
  margin-top: 12px;
}

.p-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1.3fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.p-row .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
}

.p-row input {
  padding: 5px 8px;
  border-color: transparent;
  background: transparent;
}

.p-row input:hover {
  border-color: var(--border-strong);
}

.p-row input:focus {
  background: var(--surface);
}

.rules li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.rules .pattern {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
}

.archived {
  margin-top: 22px;
  color: var(--muted);
}

.archived summary {
  cursor: pointer;
  font-size: 13px;
}

/* ---------- Réglages ---------- */

.settings h2 {
  margin-bottom: 10px;
}

/* Une phrase avec le champ au milieu : « Absent après [5] min sans clavier ni souris ». */
.setting {
  display: block;
  margin: 8px 0;
  font-size: 13.5px;
  line-height: 2.1;
}

.setting input[type='number'],
.setting input[type='text'] {
  display: inline-block;
  margin: 0 4px;
  padding: 3px 8px;
  line-height: 1.4;
}

.setting input[type='number'] {
  width: 58px;
}

.setting.column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.45;
}

.setting.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.setting.check input {
  margin-top: 2px;
}

.claude-hook {
  display: flex;
  align-items: center;
  gap: 10px;
}

.claude-hook .hint {
  flex: 1;
}

.ax {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--warn-soft);
}

.path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
}

.version {
  text-align: center;
  margin-top: 18px !important;
}

/* ---------- Plan du jour ---------- */

.sub-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px !important;
}

.sub-head h3 {
  margin: 0;
}

.plan {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
}

.plan-item:hover {
  background: var(--surface);
}

.plan-item .bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
  flex: none;
}

.plan-item .e-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.plan-item .e-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-item .e-meta {
  color: var(--faint);
  font-size: 12.5px;
}

.plan-item.done .e-task {
  text-decoration: line-through;
  color: var(--faint);
}

.plan-item.running {
  background: var(--accent-soft);
}

.plan-item.essential .e-task {
  font-weight: 600;
}

.star {
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 15px;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
}

.plan-item.essential .star {
  color: #e8a400;
}

.pi-live {
  font-size: 12px;
  color: var(--accent-text);
  font-weight: 500;
}

.leftover {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--warn-soft);
}

.leftover .hint {
  flex: 1;
}

#plan-hint:empty {
  display: none;
}

.goals-empty,
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-text);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.goals-empty {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
}

/* ---------- Bandeau P90 et lignes de mesures ---------- */

.p90-strip {
  padding: 12px 14px;
  font-size: 13px;
}

.gs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.gs-head.link {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.gs-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 12px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gl {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  font-size: 13px;
}

.gl-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-mark {
  color: var(--faint);
  width: 12px;
  text-align: center;
}

.gl.met .gl-title {
  color: var(--faint);
  text-decoration: line-through;
}

.gl.focus {
  cursor: pointer;
}

.gl.warn .gl-title {
  color: var(--warn);
}

.gl-pace {
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
}

.gl-pace.ok {
  color: var(--ok);
}

.gl-pace.late {
  color: var(--warn);
}

.score {
  font-variant-numeric: tabular-nums;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
}

.score.good,
.ws-score.good {
  color: var(--ok);
}

.score.mid,
.ws-score.mid {
  color: #b7791f;
}

.score.low,
.ws-score.low {
  color: var(--warn);
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.counter .btn.small {
  padding: 1px 8px;
}

.count-input {
  width: 60px;
  padding: 2px 6px;
}

/* ---------- Onglet P90 ---------- */

.p90-head {
  display: grid;
  gap: 8px;
}

.p90-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  border-color: transparent;
  background: transparent;
  padding: 3px 6px;
  margin-left: -6px;
}

.p90-title:hover {
  border-color: var(--border-strong);
}

.cycle-select {
  max-width: 160px;
}

.p90-dates,
.p90-meta {
  font-size: 13px;
  color: var(--muted);
}

.p90-dates .row {
  flex-wrap: wrap;
}

.p90-bar {
  position: relative;
  overflow: visible;
}

.p90-bar > div {
  border-radius: 3px;
}

.p90-bar .pace {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  background: var(--text);
  opacity: 0.45;
}

.vision {
  display: grid;
  gap: 4px;
}

.measures {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.measure {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.measure .progress {
  margin: 6px 0 4px;
}

.measure.met .progress > div {
  background: var(--ok);
}

.m-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.measure .e-meta {
  color: var(--faint);
  font-size: 12.5px;
}

.warn-text {
  color: var(--warn);
}

.m-form {
  margin-top: 8px !important;
}

.m-form summary {
  cursor: pointer;
  color: var(--accent-text);
  font-size: 13px;
}

.m-fields {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.m-fields .target {
  width: 80px;
}

.m-fields .btn {
  justify-self: start;
}

.m-link {
  display: grid;
  gap: 3px;
}

.p90-new {
  display: grid;
  gap: 10px;
}

.p90-new .row {
  flex-wrap: wrap;
}

.score-history .sh-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 90px;
  padding-top: 6px;
}

.sh-week {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 100%;
  font-size: 10.5px;
  color: var(--faint);
}

.sh-col {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--surface-2);
  border-radius: 4px;
}

.sh-col > div {
  width: 100%;
  border-radius: 4px;
  background: var(--warn);
}

.sh-week.mid .sh-col > div {
  background: #e0a030;
}

.sh-week.good .sh-col > div {
  background: var(--ok);
}

/* Trait de l'objectif à 85 %, à la hauteur des colonnes (sous elles : 17 px de libellé). */
.sh-goal {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(17px + (100% - 23px) * 0.85);
  border-top: 1px dashed var(--muted);
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Points du soir et de la semaine ---------- */

.review-teaser {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.review-teaser .hint {
  flex: 1;
}

.review {
  display: grid;
  gap: 8px;
}

.review-sum {
  font-size: 13px;
  color: var(--muted);
}

.rated {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.rate-row .bar {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
}

.rate-row .e-main {
  flex: 1;
  min-width: 0;
}

.rate-row .e-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.rate-row .e-meta {
  color: var(--faint);
  font-size: 12px;
}

.rate {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 7px;
  width: 30px;
  height: 26px;
  color: var(--faint);
  cursor: pointer;
}

.rate.up.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.rate.down.on {
  background: var(--surface-2);
  color: var(--text);
}

.review-field {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.week-score {
  display: grid;
  gap: 4px;
}

.ws-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ws-label {
  font-weight: 600;
  font-size: 15px;
}

.ws-score {
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.share {
  margin: 6px 0;
  font-size: 13px;
}

.share .progress {
  margin-top: 4px;
}

#week-review > * + * {
  margin-top: 12px;
}

#plan-add input {
  width: 100%;
}

.review .row input {
  flex: 1;
}

.setting select,
.setting input[type='time'] {
  display: inline-block;
  margin: 0 4px;
  padding: 3px 8px;
  line-height: 1.4;
}

.setting > input[type='checkbox'] {
  vertical-align: -3px;
  margin-right: 6px;
}

/* ---------- Déroulés guidés ---------- */

.guide {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 28px;
}

.g-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.g-kind {
  font-weight: 600;
  color: var(--accent-text);
}

.g-count {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.g-progress {
  display: flex;
  gap: 4px;
  margin: 10px 0 22px;
}

.g-progress span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
}

.g-progress span.done {
  background: var(--accent-soft);
}

.g-progress span.now {
  background: var(--accent);
}

.g-question {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
}

.g-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.g-body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.g-answer {
  font-size: 14.5px;
  line-height: 1.5;
  padding: 10px 12px;
}

.g-card {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}

.g-card p {
  font-size: 13.5px;
  line-height: 1.45;
}

.g-preview {
  display: grid;
  gap: 5px;
}

.g-parsed {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.g-reuse {
  display: grid;
  gap: 6px;
}

.g-list {
  display: grid;
  gap: 6px;
}

.g-numbered {
  display: flex;
  align-items: center;
  gap: 10px;
}

.g-numbered span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.g-numbered input,
.g-body > .row input {
  flex: 1;
}

.g-slot,
.g-count-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.g-slot select {
  width: 150px;
}

.g-dur,
.g-count-row input {
  width: 70px;
}

.g-count-row .hint {
  font-size: 12px;
  white-space: nowrap;
}

.g-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font-size: 13.5px;
}

.g-pick.on {
  border-color: #e8a400;
  background: rgba(232, 164, 0, 0.08);
}

.g-pick.on .star {
  color: #e8a400;
}

.g-recap {
  margin-top: 8px;
}

.g-result {
  font-weight: 600;
  font-size: 13.5px;
}

.g-action {
  color: var(--muted);
  padding-left: 12px;
  font-size: 13px;
}

.g-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.row.wrap {
  flex-wrap: wrap;
}

.g-count-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 130px;
}

.g-count-row .hint {
  text-align: right;
}

.g-slot .gl-title {
  flex: 1;
}

.g-slot select {
  width: 120px;
}

/* ---------- Version 0.6 : P90 → semaine → jour ---------- */

.rank {
  display: inline-block;
  min-width: 22px;
  padding: 0 4px;
  margin-right: 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  vertical-align: 1px;
  flex: none;
}

.north,
.north-big {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  margin-bottom: 8px;
}

.north.link {
  cursor: pointer;
}

.north-label {
  font-size: 11.5px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.north-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.north-big {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
}

.north-big .north-text {
  font-size: 17px;
}

.north-line {
  font-size: 13.5px;
  font-weight: 500;
}

.pre {
  white-space: pre-wrap;
}

.p90-name {
  font-size: 16px;
}

.task-input {
  margin-top: 6px;
}

.task-input input {
  width: 100%;
}

.picker {
  margin-top: 6px;
}

.picker summary {
  cursor: pointer;
  color: var(--accent-text);
  font-size: 13px;
  padding: 2px 0;
}

.picker .chips {
  margin-top: 6px;
}

.day-pick {
  width: 92px;
  padding: 3px 6px;
  font-size: 12.5px;
}

.week-block {
  display: grid;
  gap: 4px;
}

.week-block .gs-head .row {
  gap: 6px;
}

.p-actions-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.p-row.open {
  background: var(--surface);
  border-radius: 10px;
}

.project-tasks {
  padding: 4px 8px 12px 30px;
}

.vision-card summary {
  cursor: pointer;
  font-weight: 600;
}

.reflection summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
}

.share-card {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.plan-item .star:empty {
  width: 17px;
  display: inline-block;
}

.project-tasks .e-task,
.week-block .e-task {
  white-space: normal;
}

.week-block .gs-head {
  width: auto;
}

.plan-item .star {
  width: 20px;
  flex: none;
  text-align: center;
}
