/* Ryth planner pages (week, day, study plan). Builds on style.css: same tokens, cards, fields and the timeline. */

.planner { padding-top: 24px; }
.planner h1 {
  margin-top: 20px;
  text-wrap: balance;
  font-size: clamp(30px, 7.5vw, 40px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Switch between the three planners: the segmented control of the language switch */
.tool-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-elevated);
}
.tool-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.tool-switch a:hover { color: var(--text-primary); }
.tool-switch a[aria-current] {
  background: var(--bg-selected);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-segment);
}

/* Form: task rows, then the settings */
.planner-form { max-width: 720px; margin-top: 20px; padding: 16px; }
@media (min-width: 640px) { .planner-form { padding: 20px; } }
.form-title { font-size: 16px; font-weight: 600; }
.task-rows { display: grid; gap: 12px; margin-top: 12px; }
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr) 44px;
  gap: 8px;
  align-items: end;
}
.task-row .field-title { grid-column: 1 / -1; }
/* The date of an exam needs more room than the hours on a phone */
[data-mode="study"] .task-row { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr) 44px; }
@media (min-width: 640px) {
  [data-mode="study"] .task-row,
  .task-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .task-row .field-title { grid-column: auto; }
}
.task-rows .task-row + .task-row { padding-top: 12px; border-top: 1px solid var(--border-subtle); }
@media (min-width: 640px) {
  .task-rows .task-row + .task-row { padding-top: 0; border-top: 0; }
  /* The labels of the first row name the columns; the rows below keep theirs for screen readers only */
  .task-rows .task-row + .task-row .field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
.field .input { width: 100%; }
select.input { padding-right: 8px; }
.row-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.row-remove:hover { background: var(--bg-elevated); color: var(--text-primary); }
.row-remove svg { width: 18px; height: 18px; stroke: currentColor; }
.add-row { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; margin-left: -12px; }
.add-row svg { width: 16px; height: 16px; stroke: currentColor; }

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
@media (min-width: 640px) { .settings { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.settings .days { grid-column: 1 / -1; }
.settings legend { padding: 0; }
.days .choices { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 420px; }
.days .choice span { justify-content: center; width: 100%; padding: 0; }

/* The plan */
.plan-out { margin-top: 32px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-head h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.plan-head .btn-secondary { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.plan { margin-top: 16px; color: var(--text-secondary); }

.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; align-items: start; }
.plan-day { min-width: 0; padding: 12px; }
.plan-day h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.plan-day h3 span { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.day-items { display: grid; gap: 6px; margin-top: 10px; padding: 0; list-style: none; }
.item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 10px 10px 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.item .shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.item .shape path { fill: var(--bg-canvas); stroke: var(--border-subtle); stroke-width: 1; }
.item .check {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--border-focus);
  border-radius: 50%;
}
.item-text { position: relative; display: grid; min-width: 0; line-height: 20px; overflow-wrap: break-word; hyphens: auto; }
.item-time { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.item-exam { align-items: center; padding-left: 20px; font-weight: 600; }
.item-exam .check { display: none; }

.plan-timeline { max-width: 480px; }
.plan-timeline .row { opacity: 1; transform: none; }

.plan-notes {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px dashed var(--border-focus);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}
.plan-notes-title { font-weight: 600; color: var(--text-primary); }
.plan-notes ul { margin-top: 4px; padding-left: 18px; }

/* Way into Ryth below the plan */
.ryth-cta { margin-top: 32px; padding: 20px; }
.ryth-cta h2 { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.ryth-cta p { max-width: 34rem; margin-top: 8px; color: var(--text-secondary); }
.ryth-cta .btn-primary { display: inline-flex; align-items: center; margin-top: 16px; text-decoration: none; }
.ryth-cta .fine { margin-top: 8px; }

.planner .section p { max-width: 40rem; margin-top: 8px; color: var(--text-secondary); }

/* Print: only the plan, in the light colors */
@media print {
  :root {
    --bg-canvas: #ffffff;
    --bg-surface: #ffffff;
    --border-subtle: #d4d4da;
    --border-focus: #a8a8b2;
    --text-primary: #1a1a1f;
    --text-secondary: #55555f;
    --text-muted: #6d6d78;
  }
  body { background: #ffffff; }
  .top, .tool-switch, .planner h1, .lead, .planner-form, .plan-head .btn-secondary, .ryth-cta, .planner .section, .foot { display: none !important; }
  .plan-day, .plan-timeline .row { break-inside: avoid; }
}
