:root {
  --paper: light-dark(#f7f7f1, #172322);
  --panel: light-dark(#fffef8, #1f2e2b);
  --surface: light-dark(#e8efe9, #253833);
  --ink: light-dark(#243432, #eef4ec);
  --muted: light-dark(#4c645d, #b9cec5);
  --line: light-dark(#bbc9bf, #4d655d);
  --accent: light-dark(#145454, #a4ddcb);
  --accent-text: light-dark(#fff, #182e28);
  --warning: light-dark(#8a3825, #ffc4af);
  --serif: Georgia, "Times New Roman", serif;
  --wide: 72rem;
}

::selection { background: var(--accent); color: var(--accent-text); }
input { caret-color: var(--accent); }

/* Override shared underline rules, including hover and keyboard focus. */
a[href] { text-decoration-line: none !important; }
:where(.prose, .document-rail, .week-review-tip, .tool-data-note) a:not(.button) {
  font-weight: 600;
}
@media (hover: hover) {
  a[href]:not(.button, .wordmark, .skip):hover {
    background-color: color-mix(in srgb, currentColor 8%, transparent);
  }
}

.guide-edition .edition--week-guide {
  grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr);
  padding-block: clamp(2rem, 5.2vw, 4.6rem);
  gap: clamp(1.15rem, 5vw, 4.1rem);
}
.guide-edition .edition--week-guide h1 {
  max-width: 13ch;
  font-size: clamp(2.45rem, 5.8vw, 5.25rem);
  line-height: 1.02;
}
.edition--week-guide .edition-copy > p { max-width: 42ch; }
.guide-edition .edition--week-guide .edition-cover {
  border-radius: .85rem;
  aspect-ratio: 4 / 3;
  object-position: center 56%;
}

.week-guide-steps { padding-block: clamp(1.4rem, 4vw, 2.55rem); border-block-start: 1px solid var(--line); }
.week-guide-steps h2 { margin-bottom: .9rem; }
.week-guide-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem clamp(1rem, 3.5vw, 2.7rem);
  padding: 0;
  margin: 0;
  list-style: none;
}
.week-guide-steps li { padding-block: .8rem; border-block-start: 1px solid var(--line); }
.week-guide-steps h3 { margin: 0 0 .42rem; font-size: 1.07rem; }
.week-guide-steps p { margin: 0; color: var(--muted); font-size: .98rem; }

.week-worked {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 1rem clamp(1rem, 6vw, 4.25rem);
  padding: clamp(1rem, 4vw, 2.6rem);
  background: var(--surface);
  border-radius: .85rem;
}
.week-worked h2 { margin-bottom: .55rem; }
.week-worked-copy p { margin-bottom: .5rem; max-width: 43ch; }
.week-worked-copy a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }
.week-worked-lines { margin: 0; }
.week-worked-lines > div {
  display: grid;
  grid-template-columns: 7.1rem minmax(0, 1fr);
  align-items: center;
  gap: .5rem 1rem;
  padding: .7rem 0;
  border-block-start: 1px solid var(--line);
}
.week-worked-lines > div:last-child { border-block-end: 1px solid var(--line); }
.week-worked-lines dt { font-weight: 700; font-variant-numeric: tabular-nums; }
.week-worked-lines dd { margin: 0; color: var(--muted); }
.guide-edition .reading { padding-top: clamp(1.5rem, 4vw, 3rem); }

#site-tool { padding-block-start: clamp(1.55rem, 4vw, 3.3rem); }
#site-tool h1 { max-width: 17ch; font-size: clamp(2.35rem, 5.2vw, 4.65rem); }
#site-tool > p:not(.tool-data-note) { max-width: 58ch; }
.week-planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(16.5rem, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
}
.week-days, .week-entries { list-style: none; margin: 0; padding: 0; }
.week-days { min-width: 0; border-block-start: 1px solid var(--line); }
.week-plan-day { border-block-end: 1px solid var(--line); }
.week-plan-day-head {
  display: flex;
  align-items: center;
  gap: .35rem 1rem;
  flex-wrap: wrap;
  padding: .5rem .08rem;
  min-height: 3.85rem;
}
.week-plan-day-head h2 { margin: 0; font: 700 1.15rem/1.25 var(--body); }
.week-day-duration { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.week-add, .week-edit, .week-clear {
  border-color: transparent;
  background: transparent;
  font-size: .91rem;
}
.week-add { margin-inline-start: auto; padding-inline: .55rem; }
.week-add:hover, .week-edit:hover, .week-clear:hover {
  color: var(--accent);
  background: var(--surface);
  box-shadow: none;
}
.week-entry {
  display: grid;
  grid-template-columns: minmax(6.35rem, .76fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: .12rem .65rem;
  padding: .18rem 0;
  border-block-start: 1px solid var(--line);
}
.week-entry-time { font-size: .94rem; font-variant-numeric: tabular-nums; }
.week-entry-kind { min-width: 0; color: var(--muted); }
.week-entry[data-type="lesson"] .week-entry-kind { color: var(--ink); font-weight: 690; }
.week-edit { padding-inline: .45rem; }
.week-entry-form {
  margin: .45rem 0 .8rem;
  padding: clamp(.75rem, 2.6vw, 1rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .72rem;
}
.week-entry-form h3 { font-size: 1.09rem; margin-bottom: .7rem; }
.week-entry-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(6.8rem, .8fr) minmax(5rem, .55fr);
  gap: .55rem .7rem;
  margin-bottom: .75rem;
}
.week-entry-fields label { display: grid; align-content: start; gap: .26rem; min-width: 0; font-size: .9rem; font-weight: 650; }
.week-entry-fields :is(input, select) { font-size: 1rem; max-width: 100%; }
.week-entry-fields input[type="time"] { min-inline-size: 0; }
.week-entry-fields input[aria-invalid] { border-color: var(--warning); }
.week-form-error { margin: 0 0 .7rem; color: var(--warning); font-weight: 600; }

.week-review {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.55rem);
  border-radius: .85rem;
  background: var(--surface);
}
.week-review h2 { font-size: clamp(1.55rem, 2.5vw, 1.85rem); margin-bottom: .8rem; }
.week-review-totals { margin: 0 0 .75rem; }
.week-review-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem;
  padding: .52rem 0;
  border-block-start: 1px solid var(--line);
}
.week-review-totals > div:last-child { border-block-end: 1px solid var(--line); font-weight: 720; }
.week-review-totals dd { margin: 0; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-review-tip { margin: 0 0 .9rem; color: var(--muted); font-size: .95rem; }
.week-review-actions { display: grid; justify-items: start; }
.week-review-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.week-clear { padding-inline: 0; }
.week-review-actions #week-storage { margin: .3rem 0 0; }
.week-example-note {
  margin: 0 0 .9rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--panel);
}
.week-example-note a { font-weight: 650; margin-inline-start: .35rem; }
.week-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.guide-article figure img { object-fit: contain; }
.guide-article .week-action { margin-top: 1.4rem; }
.guide-article table { table-layout: fixed; }
.guide-edition .cookie-note { box-shadow: none; }

@media (max-width: 810px) {
  .week-planner-layout, .week-worked { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .guide-edition .edition--week-guide, .week-guide-steps ol { grid-template-columns: minmax(0, 1fr); }
  .guide-edition .edition--week-guide .edition-cover { aspect-ratio: 2 / 1; }
  .week-guide-steps ol { gap: .15rem; }
  .week-guide-steps li { padding-block: .7rem; }
}
@media (max-width: 500px) {
  .week-entry-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-entry-fields label:first-child { grid-column: 1 / -1; }
  .week-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 0 .4rem; padding-block: .4rem; }
  .week-entry-time { grid-column: 1; }
  .week-entry-kind { grid-column: 1; }
  .week-edit { grid-column: 2; grid-row: 1 / span 2; }
  .week-plan-day-head { gap: .2rem .5rem; }
  .week-plan-day-head h2 { font-size: 1.05rem; }
  .week-day-duration { font-size: .81rem; }
}
@media print {
  @page { size: A4; margin: 13mm; }
  #site-tool.tool-page > h1 { display: block !important; color: #000; font: 700 23pt/1.1 Georgia, serif; margin-bottom: 5mm; }
  #site-tool .week-print-note { margin: 0 0 5mm; color: #000; font-size: 10pt; }
  #site-tool .week-planner-layout { --body: Arial, sans-serif; display: block; color: #000; font-family: var(--body); }
  #site-tool .week-review { background: transparent; padding: 0; margin-top: 4mm; }
  #site-tool .week-review h2 { font-size: 13pt; }
  #site-tool .week-review-tip, #site-tool .week-example-note { display: none; }
  .week-day-duration, .week-entry-kind, .week-entry[data-type="lesson"] .week-entry-kind { color: #000; }
  .week-plan-day { break-inside: avoid; }
  .week-plan-day-head { padding: 2mm 0; min-height: 0; }
  .week-plan-day-head h2 { font-size: 11pt; }
  .week-entry { grid-template-columns: 34mm minmax(0, 1fr); padding: 1mm 0; font-size: 10pt; }
  .week-entry-time, .week-entry-kind { grid-column: auto; }
  .week-review-totals > div { padding: 1.4mm 0; }
}
