/* Wigwam Tools — planners (TL-08 moving planner, TL-13 student planner): forms, dated lists, print view.
 * Same isolation contract as wt-tools.css: every selector begins with .wt-, no Bootstrap names, no !important.
 * Loaded only on pages that hold one of the two planners (tools/_planners/shared.php). */

/* --- shared form pieces ------------------------------------------------------------------------------------ */
.wt-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15.5px; cursor: pointer; }
.wt-check input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--wg-teal); }
.wt-errsum { margin: 0 0 16px; padding: 14px 16px; border: 3px solid var(--wg-coral-text); border-radius: var(--wg-radius-s); background: #fff; }
.wt-errsum-h { margin: 0 0 6px; color: var(--wg-coral-text); font-size: 18px; font-weight: 600; }
.wt-errsum-list { margin: 0; padding-left: 1.1em; }
.wt-errsum-list a { color: var(--wg-coral-text); font-weight: 600; }
.wt-tool .wt-error:empty { display: none; }
.wt-tool [aria-invalid="true"] { border-color: var(--wg-coral-text); box-shadow: inset 0 0 0 1px var(--wg-coral-text); }
.wt-tool .wt-print-only { display: none; }

/* --- TL-08 form: one column on phones, two columns of fields from 760px ---------------------------------- */
.wt-mp-form { max-width: 960px; }
.wt-mp-fields { display: grid; gap: 18px 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .wt-mp-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .wt-mp-fields > [data-f="tenure"], .wt-mp-fields > [data-f="gap"] { grid-column: 1 / -1; } }
.wt-mp-date { max-width: 260px; }
.wt-mp-radios { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .wt-mp-radios { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .wt-mp-radios { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wt-mp-card { flex-direction: row; align-items: center; gap: 10px; min-height: 52px; }
.wt-mp-radio { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--wg-teal); }
/* returning visitor / shared link prompt: above the form, shown by tool.php's inline script before first paint (rule 13) */
.wt-mp-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 0 0 16px; max-width: 960px; }
.wt-mp-welcome-t { margin: 0; flex: 1 1 260px; }
.wt-mp-welcome-b { display: flex; flex-wrap: wrap; gap: 8px; }
.wt-mp-welcome-b .wg-b { min-height: 44px; }
.wt-tool .wt-mp-welcome.wt-off { display: none; }

/* --- TL-08 result: dated groups and task rows ----------------------------------------------------------- */
.wt-mp-result { margin-top: var(--wg-gap); max-width: 960px; }
.wt-mp-h { font-size: clamp(22px, 2.4vw, 30px); scroll-margin-top: 122px; }
@media (min-width: 1000px) { .wt-mp-h { scroll-margin-top: 152px; } }
.wt-mp-summary { margin: 0 0 12px; font-size: 16.5px; font-weight: 500; }
.wt-mp-group { margin: 22px 0 0; }
.wt-mp-group--now .wt-group-h { color: var(--wg-coral-text); }
.wt-mp-tasks { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--wg-line); }
.wt-mp-task { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 12px 0; border-bottom: 1px solid var(--wg-line); }
.wt-mp-cb { flex: 0 0 auto; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--wg-teal); scroll-margin-bottom: 120px; cursor: pointer; }
.wt-mp-tb { flex: 1 1 auto; min-width: 0; }
.wt-mp-title { display: block; margin: 0 0 4px; color: var(--wg-ink); font-size: 16px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.wt-mp-task--done .wt-mp-title { color: var(--wg-mute); text-decoration: line-through; }
.wt-mp-due { margin: 0 0 4px; color: var(--wg-blue); font-size: 14.5px; font-weight: 600; }
.wt-mp-now { display: inline-flex; align-items: center; gap: 5px; color: var(--wg-coral-text); }
.wt-mp-now-i { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--wg-coral-text); color: #fff; font-size: 12px; font-weight: 700; }
.wt-mp-note { margin: 4px 0; padding: 8px 10px; border-radius: var(--wg-radius-s); background: var(--wg-amber); font-size: 14.5px; }
.wt-mp-body { margin: 0 0 4px; font-size: 15px; }
.wt-mp-src { margin: 4px 0 0; color: var(--wg-mute); font-size: 13.5px; }
.wt-mp-src a, .wt-mp-more a { min-height: 24px; }
.wt-mp-sugg { font-style: italic; }
.wt-mp-info-i { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 2px 0 0; border-radius: 50%; background: var(--wg-blue); color: #fff; font-size: 14px; font-weight: 700; font-style: italic; }
.wt-mp-task--info .wt-mp-title { cursor: default; }
.wt-tool .wt-mp-pn, .wt-tool .wt-mp-psrc { display: none; }
.wt-mp-more { margin: 4px 0 0; font-size: 15px; }
.wt-mp-more a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.wt-mp-acts { margin-top: 10px; align-items: center; }
.wt-mp-near { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
/* UX round: on phones a task shows job + date; "Why, and where this comes from" opens the body and source (screen only,
   so desktop and print always show them). "Do these now" rows start open (.wt-mp-open). */
.wt-tool .wt-mp-whyt { display: none; }
@media screen and (max-width: 768px) {
  .wt-tool .wt-mp-whyt { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0; background: none; color: var(--wg-blue); font: inherit; font-size: 14.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .wt-tool .wt-mp-task:not(.wt-mp-open) .wt-mp-why { display: none; }
}
/* "Cleared. Undo" beside "Make my plan": its space is always reserved (visibility only), so it never moves the page. */
.wt-mp-undo { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.wt-tool .wt-mp-undo.wt-mp-hide { visibility: hidden; }
.wt-mp-undo .wg-b { min-height: 44px; }
/* tl08-r2 #6: Chrome focuses a date field's calendar button on Shift+Tab, so :focus-visible misses the input. */
.wt-tool--moving-planner input[type="date"]:focus { outline: 2px solid var(--wg-teal); outline-offset: 2px; }
/* tl08-r2 #8 (E-05): JavaScript on but the module failed: say so, instead of "needs JavaScript". */
.wt-tool .wt-mp-e05 { display: none; }
.wt-tool.wt-is-static .wt-mp-e05 { display: block; }
.wt-tool.wt-is-static .wt-nojs.wt-mp-nojs { display: none; }
.wt-mp-wide { width: 100%; margin: 0; }
.wt-mp-inline { min-height: 44px; }
/* toolbar: sticky to the bottom of the screen while the plan is in view (phones), never over a focused row */
.wt-mp-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px -20px 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--wg-line); border-bottom: 1px solid var(--wg-line); background: #fff; }
@media (max-width: 520px) { .wt-mp-bar { flex-wrap: nowrap; gap: 6px; margin: 18px -14px 0; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); } .wt-mp-bar .wg-b { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 6px 6px; font-size: 13.5px; line-height: 1.2; text-align: center; white-space: normal; } }
@media (max-width: 520px) { .wt-mp-bar .wg-b[data-ics] { flex-grow: 1.7; } .wt-mp-bar .wg-b[data-reset] { flex-grow: .8; } }
.wt-mp-after { margin: 10px 0 0; }
@media (min-width: 1000px) { .wt-mp-bar { position: static; } }

/* --- TL-08 twin ------------------------------------------------------------------------------------------- */
.wt-mp-twin .wt-group-h { margin-top: 20px; }
.wt-mp-twinlist { margin: 0 0 8px; padding-left: 1.3em; }
.wt-mp-twinlist li { margin: 0 0 10px; }
.wt-mp-twinlist a, .wt-mp-tell a { overflow-wrap: anywhere; }
.wt-mp-tell { margin: 0 0 12px; padding-left: 1.1em; columns: 1; }
@media (min-width: 760px) { .wt-mp-tell { columns: 2; column-gap: 32px; } }
.wt-mp-tell li { margin: 0 0 10px; break-inside: avoid; }
.wt-mp-ctable td, .wt-mp-ctable th { min-width: 140px; }
@media (prefers-reduced-motion: no-preference) { .wt-mp-result { animation: wt-mp-fade .15s ease-out; } }
@keyframes wt-mp-fade { from { opacity: 0; } to { opacity: 1; } }

/* --- TL-13 student planner -------------------------------------------------------------------------------- */
.wt-sp .wt-field + .wt-field, .wt-sp .wt-field + .wt-fieldset, .wt-sp .wt-fieldset + .wt-field, .wt-sp .wt-fieldset + .wt-fieldset, .wt-sp .wt-sp-dates, .wt-sp .wt-sp-dates + .wt-field { margin-top: 16px; }
.wt-sp .wt-sp-2 > .wt-field { margin-top: 0; }
.wt-sp-empty { margin: -4px 0 12px; }
.wt-sp-row { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wt-sp-row--3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .wt-sp-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) and (max-width: 1279.98px) { .wt-sp-row--3 { grid-template-columns: minmax(0, 1fr); } }
.wt-sp-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
@media (max-width: 359.98px) { .wt-sp-2 { grid-template-columns: minmax(0, 1fr); } }
.wt-sp-source { margin: 6px 0 0; }
.wt-sp-source:empty { display: none; }
.wt-sp-step { margin-top: 2px; }
.wt-sp-each { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wt-tool .wt-sp-each.wt-off, .wt-tool .wt-sp-row.wt-off, .wt-tool .wt-check.wt-off { display: none; }
.wt-sp-cost { margin: 10px 0 4px; }
.wt-sp-p { margin: 0 0 8px; font-size: 15.5px; }
.wt-sp-details { margin: 8px 0; font-size: 15px; }
.wt-sp-small { margin: 0 0 6px; }
.wt-sp-bills { margin: 10px 0 12px; }
.wt-sp-bills .wt-table { font-size: 14.5px; }
.wt-sp-bills th, .wt-sp-bills td { padding: 6px 12px; }
.wt-sp-share { margin: 14px 0 0; }
.wt-sp-share .wt-group-h { margin-bottom: 4px; }
.wt-sp-share p { margin: 0; }
.wt-sp-kit { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--wg-line); border-radius: var(--wg-radius-s); background: var(--wg-grey); }
.wt-sp-kit p { margin: 0 0 6px; font-size: 15px; }
.wt-sp-pre { white-space: pre-wrap; font-size: 14px; }
.wt-sp-twin th, .wt-sp-twin td { white-space: nowrap; }
.wt-sp-twin td:last-child { white-space: normal; min-width: 180px; }
.wt-sp-twin .wt-sp-15 { display: block; white-space: nowrap; }
.wt-sp-sources { margin: 0 0 10px; padding-left: 1.1em; }
.wt-sp-sources li { margin: 0 0 8px; }
.wt-sp-sources a { overflow-wrap: anywhere; }
.wt-sp-actions .wg-b { min-height: 44px; }

/* --- print: only the plan (planner-ui.js printScope hides everything else) ----------------------------- */
@media print {
  .wt-print-hide { display: none; }
  .wt-tool .wt-print-only { display: block; }
  .wt-tool .wt-mp-result, .wt-tool .wt-sp-result { margin: 0; padding: 0; border: 0; max-width: none; animation: none; }
  .wt-tool .wt-mp-bar, .wt-tool .wt-mp-after, .wt-tool .wt-mp-variant, .wt-tool .wt-mp-acts, .wt-tool .wt-mp-whyt, .wt-tool .wt-sp-actions, .wt-tool .wt-sp-copy { display: none; }
  .wt-tool .wt-mp-why { display: inline; }
  /* TL-08: the worked example fits 1-2 A4 pages (FR-11, r1 #6); nothing under 10 pt; each source URL once, at the end */
  .wt-tool .wt-mp-h { margin: 0 0 2pt; font-size: 13pt; line-height: 1.2; }
  .wt-tool .wt-mp-printhead, .wt-tool .wt-mp-summary, .wt-tool .wt-mp-result .wt-line { margin: 0 0 3pt; padding: 0; font-size: 10pt; line-height: 1.18; background: none; }
  .wt-tool .wt-mp-result .wt-group-h { margin: 4pt 0 1pt; font-size: 11pt; break-after: avoid; page-break-after: avoid; }
  .wt-tool .wt-mp-task { gap: 6pt; min-height: 0; padding: 1.5pt 0; break-inside: avoid; font-size: 10pt; line-height: 1.18; }
  .wt-tool .wt-mp-title { margin: 0; font-size: 10.5pt; line-height: 1.18; }
  .wt-tool .wt-mp-body, .wt-tool .wt-mp-src, .wt-tool .wt-mp-due, .wt-tool .wt-mp-note { margin: 0; padding: 0; font-size: 10pt; line-height: 1.18; background: none; }
  .wt-tool .wt-mp-src { color: #333; }
  .wt-tool .wt-mp-src a { min-height: 0; color: inherit; text-decoration: none; }
  .wt-tool .wt-mp-pdrop, .wt-tool .wt-mp-more, .wt-tool .wt-mp-welcome, .wt-tool .wt-mp-result [data-link-msg] { display: none; }
  .wt-tool .wt-mp-pn { display: inline; }
  .wt-tool .wt-mp-psrc { display: block; font-size: 10pt; line-height: 1.18; }
  .wt-tool .wt-mp-psrc ol { margin: 0; padding: 0; list-style: none; }
  .wt-tool .wt-mp-psrc li { display: inline; margin: 0 0.9em 0 0; overflow-wrap: anywhere; }
  .wt-tool .wt-mp-cb { -webkit-appearance: none; appearance: none; width: 11pt; height: 11pt; margin: 1pt 0 0; border: 1.5pt solid #000; border-radius: 0; background: #fff; }
  .wt-tool .wt-mp-info-i, .wt-tool .wt-mp-now-i { width: 11pt; height: 11pt; font-size: 10pt; }
  .wt-tool .wt-mp-tb > .wt-mp-title, .wt-tool .wt-mp-tb > .wt-mp-due { display: inline; }
  .wt-tool .wt-mp-tb > .wt-mp-due::before { content: " \00b7  "; color: #000; }
  /* the source line runs on after the body text instead of starting a line of its own */
  .wt-tool .wt-mp-why > .wt-mp-body:not(.wt-mp-pdrop) { display: inline; }
  .wt-tool .wt-mp-tb > .wt-mp-due + .wt-mp-whyt + .wt-mp-why > .wt-mp-body:first-child:not(.wt-mp-pdrop)::before, .wt-tool .wt-mp-why > .wt-mp-body + .wt-mp-body::before { content: "\A"; white-space: pre; }
  .wt-tool .wt-mp-why > .wt-mp-body:not(.wt-mp-pdrop) + .wt-mp-src { display: inline; }
  .wt-tool .wt-mp-why > .wt-mp-body:not(.wt-mp-pdrop) + .wt-mp-src::before { content: " "; }
  .wt-tool .wt-mp-group { margin-top: 0; break-inside: auto; }
  .wt-print-path { margin: 0; padding: 0; }
}
