/* Planning packs: the AI Labs look (big white cards, numbered sections, green and gold). */
.plan-access { background: #FFFBEA; border: 2px solid var(--chalk); border-radius: 18px; padding: 14px 18px; margin: 0 0 22px; font-size: 1.05rem; }
.plan-access a { color: var(--deep); font-weight: 700; }
.plan-subject { max-width: 420px; margin-bottom: 18px; }
.plan-lead { margin: 0 0 18px; max-width: 80ch; }
.plan-h3 { font-family: var(--font-display); font-size: 1.3rem; margin: 26px 0 12px; }
.plan-h3 small { font-family: var(--font-body); font-weight: 400; color: var(--muted); }

.plan-topics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.plan-topic {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 64px; text-align: left; font: inherit; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer;
}
.plan-topic:hover { border-color: var(--accent); }
.plan-topic.on { border-color: var(--chalk); background: #FFFBEA; box-shadow: 0 0 0 3px rgb(244 200 66 / .35); }
.plan-topic-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 1.3rem; }
.plan-topic > span:nth-child(2) { flex: 1 1 140px; }
.free-tag, .lock-tag { font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.free-tag { background: var(--chalk); color: var(--chalk-ink); }
.lock-tag { background: var(--soft); color: var(--deep); }

.plan-ican { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .plan-ican { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan-ican-col { border-radius: 18px; padding: 16px 18px; border: 1px solid var(--line); }
.plan-ican-col h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.1rem; }
.plan-ican-col ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.plan-ican-col.emerging { background: #F3FAF6; }
.plan-ican-col.building { background: #E1F4EB; }
.plan-ican-col.achieving { background: #D2EEDF; border-color: #2DBE8F; }
.plan-ican-col.excelling { background: #FFF6D6; border-color: var(--chalk); }

.plan-docs { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-doc { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; box-shadow: 0 6px 18px rgb(14 77 62 / .06); display: flex; flex-direction: column; }
.plan-doc h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.15rem; }
.plan-doc p { margin: 0 0 12px; color: var(--muted); flex: 1; }
.plan-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-doc-actions button, .plan-actions button { min-height: 44px; }

.plan-spec { overflow-x: auto; }
.plan-spec-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; }
.plan-spec-table th, .plan-spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plan-spec-table th { background: var(--soft); font-weight: 700; }

.plan-preview { margin-top: 22px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); }
.plan-preview summary { cursor: pointer; padding: 14px 18px; font-weight: 700; min-height: 44px; }
.plan-preview-body { padding: 4px 18px 18px; overflow-x: auto; }
.plan-preview-body table { border-collapse: collapse; margin: 0 0 12px; }
.plan-preview-body th, .plan-preview-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }

.plan-hw-setup, .plan-hw-dates { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.plan-hw-topics { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-hw-topics fieldset { border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; background: var(--bg); margin: 0; min-width: 0; }
.plan-hw-topics legend { font-weight: 700; padding: 0 6px; }
.plan-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.plan-check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

.plan-weeks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.plan-week { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 10px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.plan-week-dates { display: grid; gap: 8px; align-content: start; }
.plan-week-dates b { font-family: var(--font-display); font-size: 1.15rem; color: var(--deep); }
.plan-week-dates label { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 6px; }
.plan-week-dates input { min-height: 44px; }
.plan-week-tasks p { margin: 0 0 10px; }
.plan-tag { display: inline-block; font-size: .85rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin-right: 8px; }
.plan-tag.now { background: var(--accent); color: var(--accent-ink); }
.plan-tag.back { background: var(--chalk); color: var(--chalk-ink); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media (max-width: 980px) {
  .plan-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-hw-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .plan-ican, .plan-docs, .plan-hw-setup, .plan-hw-dates, .plan-hw-topics, .plan-week { grid-template-columns: minmax(0, 1fr); }
}

/* Home learning: settings, term dates, and the sheet itself (edited in place). */
.plan-hw-setup { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-dates-box { margin: 6px 0 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.plan-dates-box summary { cursor: pointer; padding: 12px 16px; font-weight: 700; min-height: 44px; }
.plan-dates-box > div { padding: 0 16px 8px; }
.plan-term-name { grid-column: 1 / -1; color: var(--deep); }
.plan-update { background: #FFFBEA; border: 2px solid var(--chalk); border-radius: 14px; padding: 10px 14px; }

.hw-sheet { max-width: 860px; margin: 8px auto 0; background: #FFFFFF; color: #10211C; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgb(14 77 62 / .08); padding: clamp(16px, 4vw, 40px); font-family: Arial, var(--font-body); }
.hw-logo { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.hw-logo img { max-width: 170px; max-height: 80px; object-fit: contain; }
.hw-title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 0; }
.hw-sub { font-size: clamp(1.3rem, 3.4vw, 1.9rem); font-weight: 800; color: #137A5E; margin: 2px 0 16px; }
.hw-section + .hw-section { margin-top: 28px; }
.hw-break { text-align: center; color: var(--muted); font-size: .85rem; border-top: 2px dashed var(--line); padding-top: 10px; margin: 0 0 16px; }
.hw-exp { background: #F3FAF6; border: 2px solid #2DBE8F; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.hw-exp p { margin: 0 0 6px; }
.hw-exp-title { font-weight: 800; color: #0E4D3E; }
.hw-intro { margin: 0 0 14px; }
.hw-table-wrap { overflow-x: auto; }
.hw-table { width: 100%; min-width: 540px; border-collapse: collapse; table-layout: fixed; font-size: .95rem; }
.hw-table th, .hw-table td { border: 1px solid #D4E4DD; padding: 8px 10px; text-align: left; vertical-align: top; }
.hw-table th { background: #E1F4EB; color: #0E4D3E; }
.hw-table th:first-child { width: 22%; }
.hw-table td:first-child { position: relative; }
.hw-half td { background: #FFF6D6; font-weight: 700; }
.hw-task b { color: #0E4D3E; }
.hw-link { display: inline-block; margin-top: 6px; font-size: .85rem; color: #137A5E; font-weight: 600; }
.hw-ext { margin-top: 10px; padding: 8px 10px; border-left: 4px solid #F4C842; background: #FFF9E6; border-radius: 8px; }
.hw-ext-text b { color: #0E4D3E; }
.hw-x { display: block; margin-top: 8px; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; cursor: pointer; color: var(--muted); }
.hw-x:hover { color: var(--danger); border-color: var(--danger); }
.hw-sheet [contenteditable="true"] { border-radius: 4px; outline-offset: 2px; }
.hw-sheet [contenteditable="true"]:hover { background: #FFFBEA; }
.hw-sheet [contenteditable="true"]:focus { outline: 3px solid var(--chalk); background: #FFFBEA; }
@media (max-width: 980px) { .plan-hw-setup { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .plan-hw-setup { grid-template-columns: minmax(0, 1fr); } }
/* Phones: each week stacks as a card instead of a wide table. */
@media (max-width: 600px) {
  .hw-table { min-width: 0; }
  .hw-table thead { display: none; }
  .hw-table, .hw-table tbody, .hw-table tr, .hw-table td { display: block; width: auto; }
  .hw-table tr { border: 1px solid #D4E4DD; border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
  .hw-table td { border: 0; border-top: 1px solid #D4E4DD; }
  .hw-table td:first-child { border-top: 0; background: #E1F4EB; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
  .hw-table td:first-child .hw-x { margin: 0; }
  .hw-table tr[data-row] td:nth-child(2)::before { content: "This week's topic"; display: block; font-size: .8rem; font-weight: 700; color: #137A5E; }
  .hw-table tr[data-row] td:nth-child(3)::before { content: "Look back"; display: block; font-size: .8rem; font-weight: 700; color: #137A5E; }
  .hw-sheet { padding: 14px; }
}
/* Scheme of work */
.plan-sow-topics { border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; margin: 14px 0; }
.plan-sow-topics legend { font-weight: 700; padding: 0 6px; }
#sowTopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.plan-sow-topic { min-height: 44px; border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; background: var(--surface); }
.plan-sow-topic:has(input:checked) { border-color: var(--accent); background: #E1F4EB; }
.plan-sow-doc { border: 1px solid var(--line); border-radius: 20px; padding: clamp(16px, 3vw, 32px); background: var(--surface); margin-top: 14px; overflow-x: auto; }
.plan-sow-doc table { min-width: 640px; }
.labs-section-title .lock-tag { font-size: .8rem; margin-left: 8px; }
/* Whole-year curriculum plan: the plan at a glance */
.yr-timeline { margin: 14px 0; }
.yr-head { font-size: 1.05rem; color: var(--deep); }
.yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.yr-card { border-radius: 20px; padding: 14px 16px; background: #F3FAF6; border: 2px solid #B8E6CF; border-top: 6px solid var(--accent); transition: transform .18s ease, box-shadow .18s ease; }
.yr-card.y2 { background: #E1F4EB; border-top-color: var(--mint); }
.yr-card.rev { background: #FFF6D6; border-color: var(--chalk); border-top-color: #C99A0E; }
.yr-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgb(14 77 62 / .12); }
.yr-when { margin: 0 0 6px; display: grid; }
.yr-when b { font-family: var(--font-display); color: var(--deep); font-size: 1.05rem; }
.yr-when span { font-size: .85rem; color: var(--muted); }
.yr-card ul { margin: 0 0 8px; padding-left: 1.1em; font-weight: 600; }
.yr-assess { margin: 0; font-size: .9rem; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .yr-card { transition: none; } .yr-card:hover { transform: none; } }

/* Previews of plans and schemes of work: a full-width Lessonsmith sheet, not a narrow column. */
.plan-sow-doc { max-width: 1040px; margin: 14px auto 0; background: #FFFFFF; color: #10211C; border-radius: 22px; box-shadow: 0 12px 30px rgb(14 77 62 / .08); padding: clamp(18px, 4vw, 44px); font-size: 1rem; line-height: 1.55; }
.plan-sow-doc p, .plan-sow-doc ul, .plan-sow-doc ol, .plan-sow-doc blockquote { max-width: none; }
.plan-sow-doc h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); color: #10211C; padding-bottom: 10px; border-bottom: 4px solid var(--chalk); }
.plan-sow-doc h2 { color: #0E4D3E; font-size: 1.35rem; border-bottom: 2px solid var(--mint); padding-bottom: 6px; margin-top: 30px; }
.plan-sow-doc h3 { color: #137A5E; font-size: 1.12rem; }
.plan-sow-doc table { border: 1px solid #D4E4DD; border-radius: 12px; overflow: hidden; margin: 8px 0 16px; }
.plan-sow-doc th { background: #E1F4EB; color: #0E4D3E; font-family: var(--font-body); font-size: .9rem; text-transform: none; letter-spacing: 0; font-weight: 700; }
.plan-sow-doc th, .plan-sow-doc td { border: 1px solid #D4E4DD; }
.plan-sow-doc blockquote { border-left: 5px solid var(--mint); background: #F3FAF6; border-radius: 0 12px 12px 0; padding: 10px 16px; }
.plan-sow-doc hr { border-top: 2px dashed var(--line); margin: 28px 0; }
@media (max-width: 700px) { .plan-sow-doc { padding: 16px; border-radius: 16px; } }
.cm-promo { background: #FFFBEA; border: 2px solid var(--chalk); border-radius: 16px; padding: 10px 14px; }
/* Adapting the whole-year plan with AI. */
.yr-ai { margin: 16px 0; padding: 16px 18px; border-radius: 22px; border: 2px solid var(--mint); background: linear-gradient(160deg, var(--soft), var(--surface) 70%); }
.yr-ai h3 { margin: 0 0 6px; font-family: var(--font-display); color: var(--deep); font-size: 1.25rem; }
.yr-ai textarea { width: 100%; min-height: 110px; }
.yr-ai-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.yr-ai-changes { margin: 6px 0 0; padding-left: 20px; }
.yr-ai-file label:focus-within { outline: 3px solid var(--chalk); outline-offset: 2px; }
