:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --sheet: #fffef9;
  --ink: #172451;
  --muted: #5f6781;
  --rule: #cfd5e6;
  --rule-strong: #8f9aba;
  --marker: #e4ad32;
  --marker-dark: #77520a;
  --focus: #2457d6;
  --danger: #a2342f;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

button, select, textarea { font: inherit; }

a { color: inherit; }

.masthead,
footer {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.masthead {
  min-height: 82px;
  border-bottom: 2px solid var(--ink);
}

.masthead p,
footer p { margin: 0; color: var(--muted); font-size: 0.83rem; }

.wordmark {
  text-decoration: none;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 92px) 0;
}

.planner {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(400px, 1.14fr);
  gap: clamp(36px, 7vw, 96px);
  align-items: start;
}

.brief { padding-top: 10px; }

.kicker {
  margin: 0 0 12px;
  color: var(--marker-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  max-width: 650px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.intro {
  max-width: 590px;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

form { max-width: 620px; }

form > label,
legend {
  display: block;
  margin: 0 0 9px;
  font-size: 0.86rem;
  font-weight: 750;
}

textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 14px 15px;
  background: var(--sheet);
  color: var(--ink);
  line-height: 1.55;
}

fieldset { margin: 20px 0; border: 0; padding: 0; }

.day-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; }

.day-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.day-toggle label {
  min-width: 104px;
  border: 1px solid var(--rule-strong);
  padding: 10px 18px;
  text-align: center;
  cursor: pointer;
}

.day-toggle label + input + label { border-left: 0; }

.day-toggle input:checked + label {
  background: var(--ink);
  color: white;
}

.form-actions { display: flex; align-items: end; gap: 18px; }

.example-picker { display: grid; gap: 6px; }

.example-picker label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.example-picker select {
  min-height: 44px;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 9px 34px 9px 12px;
  background: var(--sheet);
  color: var(--ink);
}

button {
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 12px 18px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.text-button {
  border: 0;
  padding: 6px 0;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

button:hover { background: #253775; }
.text-button:hover { background: transparent; color: var(--focus); }

button:focus-visible,
textarea:focus-visible,
input:focus-visible + label,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.form-note,
.save-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.form-note { margin: 12px 0 0; }

.day-sheet {
  min-height: 620px;
  border: 1px solid var(--rule-strong);
  background:
    linear-gradient(90deg, transparent 0 76px, rgba(190, 78, 64, 0.28) 76px 77px, transparent 77px),
    repeating-linear-gradient(var(--sheet) 0 43px, var(--rule) 44px);
  box-shadow: 12px 14px 0 rgba(23, 36, 81, 0.1);
}

.sheet-heading {
  display: flex;
  min-height: 108px;
  padding: 25px 28px 20px 94px;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 254, 249, 0.94);
}

h2 { margin: 0; font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; }

.schedule { margin: 0; padding: 14px 28px 24px 0; list-style: none; }

.schedule-item,
.empty-state {
  display: grid;
  grid-template-columns: 76px 1fr;
  min-height: 72px;
  align-items: start;
}

.schedule-time,
.empty-time {
  padding: 5px 10px 0 0;
  color: var(--marker-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.schedule-copy { padding: 0 0 14px 18px; }
.schedule-copy strong { display: block; font-size: 1rem; line-height: 1.35; }
.schedule-copy span { color: var(--muted); font-size: 0.78rem; }

.empty-state p {
  max-width: 360px;
  margin: 0;
  padding: 2px 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.schedule-item.break .schedule-copy strong { color: var(--muted); font-weight: 600; }

.save-status {
  margin: 0;
  padding: 0 28px 24px 94px;
  background: rgba(255, 254, 249, 0.9);
}

footer { min-height: 86px; border-top: 1px solid var(--rule-strong); }
footer a { font-size: 0.85rem; font-weight: 750; }

@media (max-width: 820px) {
  .planner { grid-template-columns: 1fr; }
  .day-sheet { min-height: 520px; }
}

@media (max-width: 520px) {
  .masthead, main, footer { width: min(100% - 24px, 1180px); }
  .masthead { align-items: flex-start; flex-direction: column; justify-content: center; }
  h1 { font-size: clamp(2.6rem, 14vw, 4.2rem); }
  .form-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .sheet-heading { padding-left: 82px; }
  .schedule { padding-right: 14px; }
  .save-status { padding-left: 82px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
