/* The schedules view: the list, the week grid, the editor, and the week strip of the
   dashboard panel. Tokens only, so both themes follow. */

/* --- The bar above the list and the grid. */
.sched-bar { margin-bottom: 14px; }
.sched-count { margin: 0; }

/* --- The list. */
.sched-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 12px; margin-bottom: 10px; }
.sched-item.sched-paused { background: none; border-style: dashed; }
.sched-item.sched-paused .sched-h b { color: var(--muted); }
.sched-h { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.sched-h b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; margin-right: 2px; }
.sched-when { font-family: var(--f-mono); }
/* Passive: a quiet chip, no colour of its own. */
.sched-quiet { border-style: dashed; }
.sched-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 6px 0 8px; font-size: .8rem; color: var(--muted); }
.sched-last.sched-bad { color: var(--bad); }
.sched-last.sched-muted { color: var(--muted); }
.sched-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-runs { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 20px; }
/* Made by a Claude session: a chip of its own colour, so it stands out from the user's own. */
.sched-made { border-color: var(--accent); color: var(--accent); }
.pl-tag.done { border-color: var(--ok); color: var(--ok); }
.sched-ask { font-size: .82rem; font-weight: 600; color: var(--bad); }

/* --- The editor. */
.sched-form { display: grid; gap: 12px; max-width: 640px; }
.sched-field { display: grid; gap: 4px; min-width: 0; border: 0; padding: 0; margin: 0; font-size: .8rem; color: var(--muted); }
.sched-field > span:first-child, .sched-field > legend { font-weight: 600; padding: 0; }
.sched-field input[type="text"], .sched-field input[type="time"], .sched-field input[type="date"], .sched-field select, .sched-field textarea {
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink);
  padding: 7px 9px; font: inherit; font-size: .9rem; min-width: 0; max-width: 100%;
}
.sched-field textarea { resize: vertical; min-height: 84px; font-family: var(--f-text); }
.sched-field input:focus-visible, .sched-field select:focus-visible, .sched-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sched-time input[type="time"] { width: 9em; font-family: var(--f-mono); }
.sched-days { justify-self: start; max-width: 100%; }
.sched-kind { justify-self: start; }
.sched-access select { justify-self: start; }
.sched-once-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-once-row input { font-family: var(--f-mono); }
.sched-report { gap: 6px; }
.sched-radio { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--ink); cursor: pointer; }
.sched-radio input { accent-color: var(--accent); margin: 0; }
.sched-explain { font-size: .8rem; color: var(--muted); max-width: 64ch; padding: 6px 9px; border-left: 2px solid var(--line); }
.sched-err { font-size: .8rem; font-weight: 500; color: var(--bad); }
.sched-err-form { padding: 0; }

/* --- The week grid: the name of the schedule, then one cell per day. */
.wk-grid { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.wk-row { display: grid; grid-template-columns: minmax(130px, 1.6fr) repeat(7, minmax(0, 1fr)); align-items: stretch; }
.wk-row + .wk-row { border-top: 1px solid var(--line); }
.wk-name { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; padding: 8px 10px; }
.wk-name b { font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.wk-name small { font-size: .72rem; color: var(--muted); font-family: var(--f-mono); }
.wk-cell { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; align-content: center; min-width: 0; min-height: 38px; padding: 6px 2px; border-left: 1px solid var(--line); }
.wk-head { background: var(--sunk); }
.wk-head .wk-name { font-size: .72rem; font-weight: 600; color: var(--muted); }
.wk-head .wk-cell { flex-direction: column; flex-wrap: nowrap; gap: 0; font-size: .76rem; color: var(--muted); }
.wk-head .wk-cell b { font-weight: 600; color: var(--ink); }
.wk-head .wk-cell small { font-family: var(--f-mono); font-size: .66rem; }
/* Today: the column is tinted and its head says so in words too. */
.wk-today { background: var(--accent-soft); }
.wk-head .wk-today b { color: var(--accent); }
.wk-now { font-size: .58rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.wk-paused .wk-name b { color: var(--muted); }

/* --- A mark: one run. The shape and the sign tell the result, the colour only repeats it. */
.wk-mark {
  appearance: none; box-sizing: border-box; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin: 0; padding: 0; border: 1.5px solid transparent; border-radius: 50%;
  background: none; color: var(--muted); font-family: var(--f-mono); font-size: .68rem; font-weight: 700; line-height: 1;
}
button.wk-mark { cursor: pointer; }
button.wk-mark:hover { box-shadow: 0 0 0 2px var(--hairline); }
button.wk-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wk-ok { background: var(--ok); border-color: var(--ok); }
.wk-failed { border-radius: 4px; border-color: var(--bad); color: var(--bad); }
.wk-skipped { border-color: var(--line); color: var(--muted); }
.wk-missed { border-color: var(--warn); border-style: dotted; color: var(--warn); }
/* Nothing to report: a small grey dot, the least of all marks. */
.wk-quiet::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .7; }
/* A finding: the accent, with a ring, because it is the one mark that asks for the user. */
.wk-find { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* A run to come: an outline. */
.wk-future { border: 1.5px dashed var(--muted); opacity: .75; }

.wk-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.wk-leg { display: inline-flex; align-items: center; gap: 6px; }

/* --- The week in one line, in the dashboard panel. */
.wk-strip {
  appearance: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; width: 100%;
  margin: 6px 0 0; padding: 0; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: center; cursor: pointer;
}
.wk-strip:hover { background: var(--sunk); }
.wk-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wk-scell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 6px 1px 8px; }
.wk-scell + .wk-scell { border-left: 1px solid var(--line); }
.wk-scell small { font-size: .64rem; font-weight: 600; color: var(--muted); }
.wk-scell.wk-today small { color: var(--accent); }
.wk-smarks { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; min-height: 10px; }
.wk-strip .wk-mark { width: 10px; height: 10px; border-width: 1px; font-size: 0; }
.wk-strip .wk-failed { background: var(--bad); border-radius: 2px; }
.wk-strip .wk-quiet::before { width: 4px; height: 4px; }
.wk-strip .wk-find { box-shadow: 0 0 0 1px var(--accent-soft); }
.wk-strip .wk-future { border-width: 1px; }

@media (max-width: 559px) {
  .sched-item { padding: 9px 10px; }
  .sched-meta { flex-direction: column; gap: 1px; }
  .sched-days button { padding: 6px 7px; }
  .sched-time input[type="time"] { width: 100%; }
  /* The name of a schedule takes a line of its own, the seven days sit under it. */
  .wk-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .wk-name { grid-column: 1 / -1; padding: 6px 8px 2px; }
  .wk-head .wk-name { display: none; }
  .wk-cell { min-height: 40px; }
  .wk-row .wk-cell:nth-child(2) { border-left: 0; }
  /* A finger needs more than 18 px. */
  button.wk-mark { width: 24px; height: 24px; }
  .wk-legend { gap: 6px 10px; }
}
