/* Miller Farm School — styles on top of the book's tokens (../css/tokens.css) and the site's buttons,
   cards and chips (../css/site.css). Phone first: 16px side gutters, nothing wider than the screen. */

body.school { background: var(--meadow); min-height: 100vh; display: flex; flex-direction: column; }
.s-main { flex: 1 0 auto; outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.tiny { font-size: .78rem; }
.small { font-size: var(--fs-small); }
.center { text-align: center; }
.ok { color: var(--green-text); font-weight: 700; }
.warn { color: #8a5200; }
.error { color: var(--barn-red-text); background: var(--tint-barn); border: 2px solid var(--barn-red); border-radius: var(--r-sm); padding: 8px 12px; margin: 8px 0; font-weight: 600; }
.error.big { font-size: 1.15rem; text-align: center; }
.ok-box { background: var(--tint-grass); border: 2px solid var(--tractor-green); border-radius: var(--r-md); padding: 12px 16px; margin: 12px 0; }
.offline-note { background: var(--tint-hay); border: 2px dashed var(--hay-dark); border-radius: var(--r-sm); padding: 6px 12px; font-size: .9rem; margin: 0 0 12px; }
.disclaimer { margin: 24px auto 8px; max-width: 46em; text-align: center; font-size: .92rem; color: var(--text-2); font-style: italic; }

/* ---------- header ---------- */
.s-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, var(--sky-top), var(--sky-mid)); border-bottom: 3px solid var(--outline);
}
.s-brand { display: flex; border-radius: 12px; }
.s-logo { height: 44px; width: auto; filter: drop-shadow(0 2px 0 rgba(43, 26, 16, .35)); }
.s-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.snav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.snav-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px 14px; font: 600 .98rem var(--font-display);
  color: var(--text); text-decoration: none; background: var(--paper); border: 2.5px solid var(--outline); border-radius: var(--r-pill);
  box-shadow: 0 3px 0 var(--outline); cursor: pointer;
}
.snav-link.on { background: var(--tractor-yellow); }
.snav-out { background: var(--tint-barn); }
.net-badge { position: sticky; top: 64px; z-index: 39; margin: 0; padding: 6px 16px; text-align: center; font-weight: 700; background: var(--tint-sky); border-bottom: 2px solid var(--outline); }
.net-badge.off { background: var(--tractor-yellow); }

/* ---------- layout ---------- */
.wrap-s { max-width: var(--wrap); margin: 0 auto; padding: 20px 16px 32px; }
.wrap-s.narrow { max-width: 560px; }
.s-card { padding: 20px; border-radius: var(--r-lg); box-shadow: var(--shadow-sticker-sm); margin-bottom: 16px; min-width: 0; }
.s-hero { font-size: var(--fs-hero); line-height: 1.02; letter-spacing: .01em; color: var(--text); text-shadow: 0 3px 0 rgba(255, 255, 255, .8); }
.s-h1 { font-size: var(--fs-h1); margin-bottom: 6px; outline: none; overflow-wrap: anywhere; }
.s-h2 { font-size: var(--fs-h2); margin: 24px 0 12px; }
.s-h3 { font-size: 1.22rem; margin: 0 0 8px; }
.grid-s { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.grid-s > .s-card { margin-bottom: 0; }
.grid-s.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-top: 16px; }
.grid-s.three, .grid-s.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 200px; min-width: 0; }
.row.tight { gap: 8px; align-items: center; }
.row.tight > * { flex: 0 1 auto; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.btn-row.tight { gap: 6px; margin: 4px 0; }
.btn-row.center { justify-content: center; }
.btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.btn-grid .btn { padding-left: 6px; padding-right: 6px; }
.stack > * + * { margin-top: 12px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.page-head > div { min-width: 0; flex: 1 1 200px; }
.ul-plain, ul.plain { list-style: none; padding: 0; }
ul.plain > li { margin: 6px 0; }
ul.ticks { list-style: none; padding: 0; }
ul.ticks li { padding-left: 1.5em; position: relative; margin: 6px 0; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--green-text); font-weight: 800; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px 16px; font-weight: 700; color: var(--text-2); }
.spinner { width: 22px; height: 22px; border: 4px solid var(--tint-sky); border-top-color: var(--barn-red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 20px 12px; color: var(--text-2); }
.empty img { margin: 0 auto 8px; width: 72px; height: 72px; }
.empty .btn-row { justify-content: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .s-label, .field .label { font-weight: 700; font-family: var(--font-display); }
.school input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .school select, .school textarea {
  font: inherit; font-size: 1rem; color: var(--text); background: #fff; border: 2.5px solid var(--outline-soft); border-radius: 12px;
  padding: 10px 12px; min-height: 46px; width: 100%; max-width: 100%;
}
.school textarea { min-height: 80px; resize: vertical; }
.school textarea.big-text { min-height: 180px; font-family: var(--font-body); }
.school input:focus-visible, .school select:focus-visible, .school textarea:focus-visible { border-color: var(--focus); }
.school input[type=file] { max-width: 100%; }
.school input[type=color] { width: 64px; height: 44px; border: 2.5px solid var(--outline-soft); border-radius: 10px; padding: 2px; background: #fff; }
.hint { font-size: .88rem; color: var(--text-2); margin: 2px 0 0; }
.hint.bad { color: var(--barn-red-text); font-weight: 700; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--tractor-green); }
.check input[type=radio] + span input { margin-top: 6px; }
.check .check-grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.check input.check-name { width: 100%; height: auto; margin-top: 0; }
.big-check { font-size: 1.05rem; font-weight: 600; background: var(--tint-grass); border-radius: 12px; padding: 10px 12px; }
.label.inline, label.inline { display: inline-flex; align-items: center; gap: 4px; }
label.inline input { width: 5.5em !important; }
fieldset.plain, fieldset.consent { border: 2px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 14px 12px; min-width: 0; }
fieldset legend { font-weight: 700; font-family: var(--font-display); padding: 0 6px; }
fieldset.consent.need { border-color: var(--barn-red); background: var(--tint-barn); }
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-family: var(--font-display) !important; }
.btn-link { background: none; border: 0; color: var(--link); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px 4px; min-height: 36px; }
.btn-link.danger, .danger { color: var(--barn-red-text); }
.icon-btn { min-width: 36px; min-height: 36px; border: 2px solid var(--outline-soft); background: var(--paper); border-radius: 10px; font-weight: 800; cursor: pointer; color: var(--text); }
.icon-btn:hover { background: var(--tint-hay); }
.switch { display: inline-flex; gap: 10px; align-items: center; font-weight: 700; margin: 4px 0 12px; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--tractor-green); }

/* ---------- welcome ---------- */
.hero-s { background: var(--bg-sky); border-bottom: 3px solid var(--outline); position: relative; overflow: hidden; }
.hero-s::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: var(--hill-grass); -webkit-mask: var(--mask-hills-front) bottom / 100% 100% no-repeat; mask: var(--mask-hills-front) bottom / 100% 100% no-repeat; }
.hero-s-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 16px 48px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-s-text { flex: 1 1 340px; min-width: 0; }
.hero-s-sub { font-size: 1.15rem; margin: 10px 0 18px; max-width: 34em; }
.hero-s-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-s-art { flex: 0 1 360px; display: flex; align-items: flex-end; justify-content: center; margin: 0 auto; }
.hero-s-art img { width: 46%; height: auto; filter: drop-shadow(0 6px 0 rgba(43, 26, 16, .2)); }
.hero-s-art img:first-child { width: 58%; }
.feature h3 { font-size: 1.25rem; margin-bottom: 6px; }
.plan { text-align: left; }
.plan-price { font: 700 2rem var(--font-display); margin: 4px 0; }
.plan-price small { font-size: 1rem; font-weight: 600; color: var(--text-2); }
.plan-feature { background: var(--tint-hay); }
.school-band { background: var(--tint-grass); margin-top: 20px; }
.privacy { background: var(--paper); }

/* ---------- kid sign-in & picture codes ---------- */
.kid-card { text-align: center; background: var(--paper); }
.kid-ven { margin: 0 auto 8px; width: 110px; height: 110px; }
.kid-step { margin: 18px 0; }
.kid-q { font-size: 1.3rem; display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.step-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--barn-red); color: #fff; border: 3px solid var(--outline); font-size: 1.1rem; }
.family-code { font: 700 2rem var(--font-display) !important; letter-spacing: .35em; text-align: center; text-transform: uppercase; max-width: 340px !important; margin: 0 auto; display: block; }
.pic-slots { display: flex; gap: 10px; justify-content: center; margin: 8px 0 12px; }
.pic-slot { width: 76px; height: 76px; border: 3px dashed var(--outline-soft); border-radius: 18px; display: grid; place-items: center; background: #fff; font: 700 1.4rem var(--font-display); color: var(--text-2); }
.pic-slot.full { border-style: solid; background: var(--tint-hay); }
.pic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 0 auto 10px; }
.pic-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: #fff; border: 3px solid var(--outline); border-radius: 18px; box-shadow: 0 4px 0 var(--outline); cursor: pointer; font: 600 .95rem var(--font-display); color: var(--text); }
.pic-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
.pic-grid.big .pic-btn { min-height: 112px; }
.pic { display: block; width: 64px; height: 64px; }
.pic-grid.big .pic { width: 72px; height: 72px; }
.kid-go { margin-top: 8px; }
.family-code-show { font: 700 2.2rem var(--font-display); letter-spacing: .3em; text-align: center; margin: 8px 0; color: var(--barn-red-text); }

/* ---------- invite ---------- */
dl.facts, dl.doc-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0; }
dl.facts dt, dl.doc-facts dt { font-weight: 700; }
dl.facts dd, dl.doc-facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- family ---------- */
.student-top { display: flex; gap: 12px; align-items: center; }
.avatar { border-radius: 50%; background: var(--tint-sky); border: 3px solid var(--outline); object-fit: contain; flex: 0 0 auto; }
.student-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; border-top: 2px dashed var(--border-strong); padding-top: 8px; }
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px; cursor: pointer; font: 700 1.1rem var(--font-display); color: var(--text); background: var(--paper); border-style: dashed; }
.add-plus { font-size: 3rem; line-height: 1; color: var(--barn-red); }
.code-card { background: var(--paper); }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.av-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; cursor: pointer; font-size: .82rem; border: 2px solid transparent; }
.av-opt:has(input:checked) { border-color: var(--outline); background: var(--tint-hay); }
.av-opt:has(input:focus-visible) { outline: 3px solid var(--focus); }
.unread { background: var(--tint-barn); margin-top: 16px; }
.link-show code { display: block; overflow-wrap: anywhere; background: #fff; border: 2px solid var(--border-strong); border-radius: 10px; padding: 8px; font-size: .9rem; }

/* tabs */
.s-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px 8px; scrollbar-width: thin; }
.s-tab { flex: 0 0 auto; padding: 8px 16px; min-height: 44px; display: inline-flex; align-items: center; font: 700 1rem var(--font-display); color: var(--text); text-decoration: none; background: var(--paper); border: 2.5px solid var(--outline); border-radius: var(--r-pill); }
.s-tab.on { background: var(--tractor-yellow); box-shadow: 0 3px 0 var(--outline); }

/* planner */
.trip-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--tint-hay); border: 3px solid var(--outline); border-radius: var(--r-md); padding: 12px 14px; margin: 0 0 14px; box-shadow: var(--shadow-sticker-sm); }
.trip-banner p { margin: 2px 0; }
.trip-ico { font-size: 1.8rem; line-height: 1; }
.group-h { margin: 18px 0 8px; }
.group-h.late { color: var(--barn-red-text); }
.plan-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.plan-item { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; background: #fff; border: 2.5px solid var(--outline); border-radius: var(--r-md); text-decoration: none; color: var(--text); box-shadow: 0 3px 0 var(--outline); }
.plan-item:hover { background: var(--paper); }
.plan-ico { font-size: 1.4rem; flex: 0 0 auto; min-width: 2em; text-align: center; }
.plan-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.plan-title { font-size: 1.05rem; overflow-wrap: anywhere; }
.plan-class { font-size: .9rem; color: var(--text-2); }
.plan-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.due { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: .88rem; color: var(--text-2); }
.due.late .due-school { color: var(--barn-red-text); font-weight: 700; }
.due-local { color: var(--link); }
.pts { font-size: .85rem; font-weight: 700; }
.chip { font-size: .82rem; padding: 2px 10px; white-space: nowrap; }
.chip.tiny { font-size: .74rem; padding: 1px 8px; }
.packets { background: var(--tint-sky); }
/* K–3 simple view */
.day-h { margin-top: 18px; }
.big-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.big-row { display: flex; gap: 8px; align-items: stretch; }
.big-item { flex: 1 1 auto; display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 84px; background: #fff; border: 3px solid var(--outline); border-radius: var(--r-lg); box-shadow: 0 5px 0 var(--outline); text-decoration: none; color: var(--text); font-size: 1.15rem; min-width: 0; }
.big-pic { font-size: 2.4rem; line-height: 1; flex: 0 0 auto; }
.big-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.big-row .speak { flex: 0 0 auto; align-self: center; }
.big-help { font-size: 1.1rem; font-weight: 700; background: var(--tint-grass); border-radius: 12px; padding: 10px 12px; }

/* courses */
.course-card .course-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.progress { margin: 10px 0; }
.bar { height: 14px; background: var(--tint-sky); border: 2px solid var(--outline); border-radius: var(--r-pill); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--hill-grass), var(--tractor-green)); }
.units summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.unit-list { padding-left: 1.3em; }
.unit-list > li { margin: 8px 0; }
.lesson-list { padding-left: 1.1em; }
.lesson-list li { margin: 3px 0; }
.stats .stat { text-align: center; padding: 14px; }
.stat-n { display: block; font: 700 1.6rem var(--font-display); }
.stat-l { font-size: .9rem; color: var(--text-2); }
.stat.warn { background: var(--tint-hay); }
.carnegie li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) auto; gap: 10px; align-items: center; }
@media (max-width: 560px) { .carnegie li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 4px 0; } .carnegie li > span:first-child { grid-column: 1 / -1; font-weight: 600; } }
.hours-table .note { display: block; color: var(--text-2); font-size: .85rem; margin-top: 2px; }
.add-hours summary { cursor: pointer; list-style: none; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.s-table { width: 100%; border-collapse: collapse; background: #fff; border: 2.5px solid var(--outline); border-radius: 12px; overflow: hidden; font-size: .95rem; }
.s-table th, .s-table td { text-align: left; padding: 8px 10px; border-bottom: 1.5px solid var(--border); vertical-align: top; }
.s-table th { background: var(--cream); font-family: var(--font-display); }
.s-table tr.pending td { background: #fffbe8; }
.s-table caption { text-align: left; font: 700 1.1rem var(--font-display); padding: 8px 2px; }
td.actions { white-space: nowrap; }

/* ---------- class page ---------- */
.class-page { --school: var(--tractor-green-dark); }
.class-head { border-left: 8px solid var(--school); padding-left: 12px; }
.school-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: #fff; border: 2px solid var(--outline-soft); }
.edit-class { float: right; margin-top: -8px; }
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.roster-kid { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; background: #fff; border: 2px solid var(--outline-soft); border-radius: var(--r-pill); font-weight: 700; }
.roster-mini { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.rm { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; }
.class-card { text-decoration: none; color: var(--text); display: block; }
.class-card:hover { background: var(--paper); }
.counts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.school-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-card .section-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; border-bottom: 2px dashed var(--border-strong); padding-bottom: 6px; margin-bottom: 8px; }
.t-assign-list { list-style: none; padding: 0; }
.t-assign { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1.5px solid var(--border); }
.t-assign:last-child { border-bottom: 0; }
.t-assign-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.kinds { letter-spacing: .1em; }
.section-h { margin-top: 22px; }
.assign-list { display: grid; gap: 14px; }
.assign .assign-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.assign-title { font-size: 1.3rem; }
.assign-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.instructions p + p { margin-top: 8px; }
.items { display: grid; gap: 10px; margin: 12px 0; }
.item { background: var(--paper); border: 2px solid var(--border-strong); border-radius: var(--r-md); padding: 10px 12px; min-width: 0; }
.item-h { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; margin-bottom: 6px; }
.item-ico { font-size: 1.3rem; }
.platform { display: inline-block; background: var(--sky-top); border: 2px solid var(--outline); border-radius: var(--r-pill); padding: 0 10px; font-size: .95rem; }
.k-note .note-text { background: #fff; border-radius: 10px; padding: 10px; max-height: 360px; overflow: auto; font-size: .95rem; }
a.ext { font-weight: 700; overflow-wrap: anywhere; }
.ext-host { font-weight: 600; color: var(--text-2); }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 12px; min-height: 44px; background: #fff; border: 2px solid var(--outline-soft); border-radius: 12px; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.file-name { overflow-wrap: anywhere; font-weight: 600; }
.file-size { font-size: .82rem; color: var(--text-2); white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 6px 0; }
.thumb { position: relative; aspect-ratio: 3 / 4; background: #fff; border: 2px solid var(--outline-soft); border-radius: 10px; overflow: hidden; padding: 0; cursor: pointer; }
.thumb-img { width: 100%; height: 100%; object-fit: cover; }
.thumb-img:not([src]) { visibility: hidden; }
.thumb-n { position: absolute; left: 4px; bottom: 4px; background: rgba(255, 255, 255, .9); border-radius: 6px; padding: 0 6px; font-size: .78rem; font-weight: 700; }
.thumb.no-img::before { content: "🖼️"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; }
.lesson-links { padding-left: 1.2em; }
.sub-view { border-top: 2px dashed var(--border-strong); padding-top: 8px; margin-top: 8px; }
.grade-line { font-size: 1.05rem; }
.returned { background: var(--tint-barn); border-radius: 10px; padding: 6px 10px; font-weight: 600; }
details.turn-in { margin-top: 12px; border: 2.5px solid var(--outline); border-radius: var(--r-md); background: var(--tint-grass); }
details.turn-in > summary { cursor: pointer; padding: 12px 14px; font: 700 1.08rem var(--font-display); min-height: 48px; }
details.turn-in > .submit-box { padding: 0 14px 14px; }
.assign.young .assign-title { font-size: 1.5rem; }
.assign.young .speak { margin: 6px 0; }
.photo-picker .btn-row { margin: 4px 0; }
.photo-list { list-style: none; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.photo-item { display: grid; grid-template-rows: 110px auto auto; gap: 4px; background: #fff; border: 2px solid var(--outline-soft); border-radius: 12px; padding: 6px; }
.photo-item img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.photo-cap { font-weight: 700; font-size: .9rem; }
.photo-tools { display: flex; gap: 4px; }
.file-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--outline-soft); border-radius: var(--r-pill); padding: 2px 4px 2px 12px; font-size: .9rem; max-width: 100%; overflow-wrap: anywhere; }

/* editor */
.editor { border-color: var(--barn-red); background: var(--paper); }
.items-edit { display: grid; gap: 10px; margin-bottom: 10px; }
.item-editor { background: #fff; border: 2.5px solid var(--outline-soft); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.ie-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ie-kind { font: 700 1.02rem var(--font-display); }
.ie-tools { display: flex; gap: 4px; }
.adders { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-picks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.kid-picks.scroll { max-height: 320px; overflow: auto; flex-direction: column; flex-wrap: nowrap; }
.kid-pick { align-items: center; }
.kid-pick .avatar { border-width: 2px; }
.suggest { list-style: none; padding: 0; }
.suggest li { padding: 4px 0; }
.domain { font-weight: 700; }
/* grading */
.sub-list { display: grid; gap: 14px; margin-top: 12px; }
.sub-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sub-top > div { flex: 1 1 auto; }
.sub-text { background: var(--paper); border-radius: 10px; padding: 10px; margin: 8px 0; }
.grade-form { margin-top: 10px; border-top: 2px dashed var(--border-strong); padding-top: 10px; }
.grade-form .row > input { flex: 1 1 200px; }
/* messages */
.msgs { max-width: 720px; }
.msg-list { list-style: none; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.msg { background: #fff; border: 2px solid var(--outline-soft); border-radius: 14px 14px 14px 4px; padding: 8px 12px; max-width: 85%; }
.msg.mine { justify-self: end; background: var(--tint-sky); border-radius: 14px 14px 4px 14px; }
.msg-who { font-size: .8rem; color: var(--text-2); font-weight: 700; }
.kid-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.kid-tab { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px 4px 4px; border: 2px solid var(--outline-soft); border-radius: var(--r-pill); text-decoration: none; color: var(--text); background: #fff; flex: 0 0 auto; font-weight: 700; }
.kid-tab.on { background: var(--tractor-yellow); border-color: var(--outline); }
.packet-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }

/* ---------- lesson player ---------- */
.crumbs { font-size: .92rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.lesson-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.lesson-head > div { min-width: 0; flex: 1 1 260px; }
.timer-pill { background: var(--paper); border: 2.5px solid var(--outline); border-radius: var(--r-pill); padding: 4px 12px; font: 700 .95rem var(--font-display); white-space: nowrap; }
.objectives { background: var(--paper); border: 2px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 14px; margin: 10px 0 16px; }
.objectives summary { cursor: pointer; font-weight: 700; }
.objectives ul { padding-left: 1.2em; margin: 6px 0; }
.standards { display: flex; flex-wrap: wrap; gap: 4px; }
.standards .chip { background: var(--tint-sky); }
.item-card { background: #fff; border: 3px solid var(--outline); border-radius: var(--r-lg); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow-sticker-sm); min-width: 0; }
.reading { font-size: 1.08rem; line-height: 1.65; max-width: 42em; }
.reading p + p { margin-top: 12px; }
.career-note { margin-top: 14px; background: var(--tint-hay); border-left: 6px solid var(--wheel-orange); border-radius: 12px; padding: 10px 14px; }
.q { padding: 12px 0; border-bottom: 2px dashed var(--border); }
.q:last-of-type { border-bottom: 0; }
.q-prompt { font-weight: 700; font-size: 1.08rem; margin-bottom: 8px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; min-height: 48px; background: var(--paper); border: 2.5px solid var(--outline-soft); border-radius: 14px; font: inherit; color: var(--text); cursor: pointer; }
.opt:hover:not(:disabled) { background: var(--tint-hay); }
.opt.right { background: var(--tint-grass); border-color: var(--tractor-green); }
.opt.wrong { background: var(--tint-barn); border-color: var(--barn-red); }
.opt:disabled { cursor: default; opacity: .9; }
.opt-l { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--outline-soft); font-weight: 800; flex: 0 0 auto; }
.num-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.num-row .num-in { max-width: 12em !important; font-size: 1.1rem !important; }
.unit { font-weight: 700; }
.q-fb p { margin: 6px 0; }
.miss { color: var(--barn-red-text); font-weight: 700; }
.q-hint { background: var(--tint-sky); border-radius: 10px; padding: 6px 10px; }
.q-explain { background: var(--paper); border-radius: 10px; padding: 6px 10px; }
.q-working { font-family: var(--font-body); background: var(--tint-grass); border-radius: 10px; padding: 6px 10px; }
.quiz-score { font-weight: 700; margin-top: 8px; }
.steps { padding-left: 1.3em; margin: 8px 0; }
.steps li { margin: 4px 0; }
.record { background: var(--paper); border-radius: 12px; padding: 10px 12px; margin-top: 10px; display: grid; gap: 8px; }
.lesson-end { margin: 20px 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lesson-nav .btn { max-width: 100%; white-space: normal; }
.celebrate { text-align: center; background: var(--tint-hay); }
.celebrate img { margin: 0 auto; }
.soon, .locked { background: var(--paper); }
.grade-box { margin-top: 10px; background: var(--tint-grass); border-radius: 12px; padding: 8px 10px; }
.grade-box input { width: auto !important; flex: 1 1 100px; }
.young-kid .reading { font-size: 1.25rem; }
.young-kid .q-prompt { font-size: 1.25rem; }
.young-kid .opt { font-size: 1.15rem; min-height: 60px; }

/* ---------- print / doc pages ---------- */
.print-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.doc { background: #fff; border: 3px solid var(--outline); border-radius: var(--r-md); padding: 24px; max-width: 860px; margin: 0 auto; }
.doc-head { display: flex; gap: 16px; align-items: center; border-bottom: 3px solid var(--outline); padding-bottom: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.doc-head > div { flex: 1 1 260px; min-width: 0; }
.doc-brand { width: 110px; height: auto; }
.doc-logo { width: 64px; height: 64px; object-fit: contain; }
.doc-school { display: flex; gap: 8px; align-items: center; font: 700 1.1rem var(--font-display); }
.doc-title { font-size: 1.8rem; }
.doc-sub { color: var(--text-2); margin: 2px 0; }
.doc-table { margin: 14px 0; }
.doc-sec { margin: 16px 0; }
.doc-sec h2 { font-size: 1.2rem; margin-bottom: 6px; }
.doc-sign { margin-top: 28px; }
.sign-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 10px; margin: 18px 0; }
.sign-rule { flex: 1 1 160px; border-bottom: 1.5px solid var(--text); height: 1.4em; }
.sign-rule.short { flex: 0 1 120px; }
.print-bar > .btn-barn { margin-left: auto; }
.doc-disc { font-style: normal; font-weight: 700; color: var(--text); border-top: 2px solid var(--border-strong); padding-top: 10px; }
.portfolio { padding-left: 1.2em; }
.portfolio li { margin: 6px 0; }
ul.tight li { margin: 0; }
.packet-count { font: 700 1.1rem var(--font-display); background: var(--tint-grass); border-radius: 12px; padding: 6px 12px; display: inline-block; }
.pk-day { margin: 18px 0; break-inside: avoid; }
.pk-date { font-size: 1.25rem; border-bottom: 2px solid var(--outline); padding-bottom: 4px; margin-bottom: 8px; }
.pk-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.pk-item { display: flex; gap: 12px; align-items: flex-start; break-inside: avoid; }
.pk-check { position: relative; flex: 0 0 auto; cursor: pointer; }
.pk-check input { position: absolute; opacity: 0; width: 40px; height: 40px; margin: 0; cursor: pointer; }
.pk-box { display: block; width: 40px; height: 40px; border: 3px solid var(--outline); border-radius: 10px; background: #fff; }
.pk-check input:checked + .pk-box { background: var(--hill-grass); }
.pk-check input:checked + .pk-box::after { content: "✓"; display: grid; place-items: center; height: 100%; font: 800 1.6rem var(--font-display); }
.pk-check input:focus-visible + .pk-box { outline: 3px solid var(--focus); outline-offset: 2px; }
.pk-main { flex: 1 1 auto; min-width: 0; }
.pk-item.done .pk-title { text-decoration: line-through; color: var(--text-2); }
.packet.young .pk-title { font-size: 1.25rem; }

/* ---------- school office ---------- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.cal-wrap { overflow-x: auto; margin-bottom: 18px; }
.trip-list strong + .chip { margin-left: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(40px, 1fr)); gap: 4px; min-width: 300px; }
.cal-dow { text-align: center; font-weight: 700; font-size: .8rem; }
.cal-cell { min-height: 64px; background: #fff; border: 2px solid var(--border-strong); border-radius: 8px; padding: 2px 4px; display: flex; flex-direction: column; gap: 2px; font-size: .74rem; min-width: 0; overflow: hidden; }
.cal-cell.blank { background: transparent; border: 0; }
.cal-cell.busy { background: var(--tint-hay); border-color: var(--hay-dark); }
.cal-cell.today { border-color: var(--focus); border-width: 3px; }
.cal-d { font-weight: 800; }
.cal-n { font-weight: 700; color: var(--barn-red-text); }
.cal-trip { border-radius: 4px; padding: 0 3px; background: var(--tint-sky); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-sports { background: #ffd9b8 !important; } .k-ffa { background: #cfe3ff !important; } .k-4h { background: #d7f5c6 !important; } .k-school { background: #f6d6f0 !important; } .k-family { background: var(--tint-sky) !important; }
.trip-list > li { margin: 8px 0; }
.trip-card.active { border-color: var(--wheel-orange); }
.brand-preview { border: 2px solid var(--border-strong); border-radius: 12px; overflow: hidden; --bp1: #1f6e2c; --bp2: #f5c400; }
.bp-bar { height: 14px; background: linear-gradient(90deg, var(--bp1) 70%, var(--bp2) 70%); }
.bp-body { display: flex; align-items: center; gap: 12px; padding: 12px; }
.bp-name { font: 700 1.2rem var(--font-display); color: var(--bp1); }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--text); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 700; box-shadow: var(--shadow-2); transition: opacity .4s, transform .4s; }
.toast.good { background: var(--tractor-green-dark); }
.toast.bad { background: var(--barn-dark); }
.toast.out { opacity: 0; transform: translateY(10px); }
.modal-wrap { position: fixed; inset: 0; z-index: 250; background: rgba(43, 26, 16, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.modal-box { background: var(--paper); border: 3px solid var(--outline); border-radius: var(--r-lg); width: min(100%, 620px); max-height: 90vh; overflow: auto; padding: 18px 18px 14px; box-shadow: var(--shadow-3); }
.modal-title { font-size: 1.35rem; margin-bottom: 10px; }
.modal-body > * + * { margin-top: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; position: sticky; bottom: -14px; background: var(--paper); padding: 8px 0 0; }
@media (min-width: 640px) { .modal-wrap { align-items: center; } }

/* ---------- footer ---------- */
.s-foot { margin-top: 24px; background: var(--hill-deep); color: #fff; text-align: center; padding: 0 16px 84px; }
.s-foot .fence-strip { margin: 0 -16px 10px; background-color: var(--meadow); }
.s-foot p { margin: 6px auto; max-width: 46em; }
.s-foot a { color: #fff; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .s-logo { height: 36px; }
  .s-name { font-size: 1.08rem; }
  .snav { width: 100%; justify-content: flex-start; margin-left: 0; }
  .snav-link { min-height: 38px; padding: 2px 12px; font-size: .92rem; }
  .net-badge { top: 100px; }
  .s-card { padding: 16px; }
  .btn-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-item { grid-template-columns: 2.2em minmax(0, 1fr); }
  .plan-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .hero-s-art { display: none; }
  .hero-s-inner { padding-bottom: 44px; }
  .doc { padding: 14px; }
  .doc .s-table { display: block; overflow-x: auto; max-width: 100%; }
  .edit-class { float: none; margin: 0 0 8px; }
  .big-row { flex-direction: column; }
  .big-row .speak { align-self: flex-start; }
  dl.facts, dl.doc-facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dd, dl.doc-facts dd { margin-bottom: 6px; }
}

/* ---------- print ---------- */
@media print {
  body.school { background: #fff; }
  .s-top, .s-foot, .net-badge, .no-print, .print-bar, .askm-fab, .toasts, .s-tabs { display: none !important; }
  .wrap-s { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
  .s-table, .doc .s-table { border: 1px solid #000; display: table; }
  .s-table th { background: #eee; }
  .pk-box { width: 22px; height: 22px; border-width: 2px; }
  a { color: #000; text-decoration: none; }
  .thumb { break-inside: avoid; }
}

/* account deletion, school sign-in confirmations, school invitations */
.danger-zone summary { cursor: pointer; }
.danger-zone .btn.danger, .btn-link.danger { color: var(--barn-red-text, #a32020); }
.lti-ask, .invite-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 6px 0; }
