:root {
  color-scheme: light dark;
  --canvas: #f4f6f3;
  --page: #fff;
  --ink: #223a30;
  --soft: #52655a;
  --line: #dce6df;
  --brand: #1f5742;
  --head: #edf5ed;
  --color-a: #cdebd9;
  --color-b: #cfe4fb;
  --color-c: #ecdcf6;
  --color-d: #ffe1c5;
  --open: #fbeec5;
  --error: #8a3229;
  font: 16px/1.4 system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #182019;
    --page: #202823;
    --ink: #eaf4ed;
    --soft: #b7c8bd;
    --line: #3c4b40;
    --brand: #b8eac8;
    --head: #28392c;
    --color-a: #304c3e;
    --color-b: #2e455a;
    --color-c: #49394d;
    --color-d: #554634;
    --open: #534827;
    --error: #ffb4a7;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 24px 10px; }
main {
  width: min(100%, 470px);
  margin-inline: auto;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
header { padding: 16px 15px 14px; background: var(--head); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.25rem, 5.5vw, 1.55rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.08rem; }
button, input, textarea, select { font: inherit; color: inherit; }
button { min-height: 44px; cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.plan-head, .guidance { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#account { color: var(--soft); font-size: .82rem; margin-bottom: 3px; }
.quiet, .weeks button { background: transparent; color: var(--brand); border: 0; }
.quiet { padding-inline: 4px; font-size: .85rem; }
.weeks { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; text-align: center; border-bottom: 1px solid var(--line); }
.weeks button { font-size: 1.65rem; line-height: 1; }
.weeks strong { font-size: .95rem; }
table { border-collapse: collapse; table-layout: fixed; width: 100%; }
.day-column { width: clamp(2.5rem, 10.75vw, 3rem); }
th, td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); }
thead th { padding: 8px 0; font-size: .8rem; font-weight: 550; color: var(--soft); }
tbody th { font-size: .92rem; }
.day-date { display: block; color: var(--soft); font-size: .75rem; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.015em; white-space: nowrap; }
.today-label { display: none; }
.is-today > th, .is-today > td {
  background: var(--head);
  box-shadow: inset 0 2px var(--brand), inset 0 -2px var(--brand);
}
.is-today > th { padding-block: 4px; color: var(--brand); }
.is-today .today-label { display: block; font-size: .75rem; font-weight: 700; line-height: 1.2; }
.slot { width: 100%; padding: 0 1px; background: transparent; border: 0; font-size: clamp(1.125rem, 5.55vw, 1.5rem); font-weight: 650; line-height: 1.2; }
.name { display: inline-block; position: relative; border-radius: 6px; max-width: 100%; padding: 5px 3px; background: var(--open); }
/* The longest name needs more room than the others in the four-column phone layout. */
.slot[data-color="1"] .name { padding-inline: 1px; font-size: clamp(.9rem, 4.6vw, 1.3rem); letter-spacing: -.04em; }
[data-color="0"] .name { background: var(--color-a); }
[data-color="1"] .name { background: var(--color-b); }
[data-color="2"] .name { background: var(--color-c); }
[data-color="3"] .name { background: var(--color-d); }
.slot[aria-expanded="true"] .name { outline: 2px solid var(--brand); }
.slot.has-task .name::after { content: ""; position: absolute; right: 2px; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.guidance { padding: 9px 12px; flex-wrap: wrap; }
.guidance p, #feedback, #start-status { color: var(--soft); font-size: .85rem; }
#feedback:not(:empty), #start-status:not(:empty) { padding: 10px 14px; }
#start-retry { margin: 0 14px 14px; }
form { display: grid; gap: 6px; padding: 16px 14px; }
#editor { border-top: 1px solid var(--line); background: var(--head); }
label { font-size: .88rem; color: var(--soft); }
label:not(:first-child), form h2 { margin-top: 3px; }
input, textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); padding: 8px; font-size: 16px; }
textarea { resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.primary, .secondary { border: 1px solid var(--line); padding: 8px 14px; border-radius: 7px; background: var(--page); }
.primary { color: var(--page); background: var(--brand); border-color: var(--brand); }
form .primary, form .actions { margin-top: 4px; }
.actions .primary { margin-top: 0; }
.notice { padding: 11px 14px; border-top: 1px solid var(--line); }
.notice button { margin-top: 6px; }
#conflict { margin-block: 4px; background: var(--open); border: 0; border-radius: 7px; }
.notice p, .error { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.error, #plan-error { color: var(--error); }
.error:empty, #start-status:empty, #feedback:empty { display: none; }
@media (max-width: 480px) {
  body { padding: 0; background: var(--page); }
  main { width: 100%; border: 0; border-radius: 0; }
}
