@font-face {
  font-family: "SchoolXNew";
  src: url("assets/SchoolKX_New.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --ink: #20334d;
  --ink-soft: #5d6d7f;
  --paper: #fff;
  --canvas: #eef3f7;
  --line: #d7e1e8;
  --mustard: #f5bc46;
  --mustard-dark: #9f6810;
  --teal: #51aaa5;
  --teal-dark: #166a67;
  --coral: #e87865;
  --green: #4c9a65;
  --blue: #508bd2;
  --red: #c34e43;
  --shadow: 0 10px 32px rgba(32, 51, 77, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(245, 188, 70, .19), transparent 28rem),
    radial-gradient(circle at 100% 0%, rgba(81, 170, 165, .13), transparent 30rem),
    var(--canvas);
  font: 16px/1.45 Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(80, 139, 210, .45);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.02em; }
h3 { font-size: 1.02rem; }
.muted { color: var(--ink-soft); }
.eyebrow { margin: 0 0 6px; color: var(--teal-dark); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.child-copy, .child-name, .activity-name, .assigned-name { font-family: "SchoolXNew", "Comic Sans MS", sans-serif; font-weight: 400; letter-spacing: .01em; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 66px;
  padding: 8px clamp(16px, 3vw, 38px);
  color: #fff;
  background: rgba(32, 51, 77, .97);
  box-shadow: 0 6px 20px rgba(20, 34, 51, .18);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 12px); gap: 3px; width: 31px; height: 31px; padding: 2px; }
.brand-mark i { display: block; border-radius: 4px; background: var(--mustard); }
.brand-mark i:nth-child(2) { background: var(--teal); }
.brand-mark i:nth-child(3) { background: var(--coral); }
.brand-mark i:nth-child(4) { background: #fff; }
.brand strong { display: block; font-size: 1.03rem; letter-spacing: -.01em; }
.brand small { display: block; color: #bfccd8; font-size: .75rem; }
.main-nav { display: flex; justify-content: center; gap: 7px; }
.nav-button { border: 0; border-radius: 999px; padding: 9px 16px; color: #dce6ef; background: transparent; font-weight: 750; cursor: pointer; }
.nav-button:hover { background: rgba(255,255,255,.08); }
.nav-button.active { color: var(--ink); background: var(--mustard); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.privacy-pill { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 8px 12px; color: #e8f1f6; font-size: .83rem; white-space: nowrap; }
.privacy-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6ed58a; }
.teacher-button { min-height: 40px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 8px 13px; color: #fff; background: rgba(255,255,255,.09); font-weight: 800; cursor: pointer; white-space: nowrap; }
.teacher-button:hover { background: rgba(255,255,255,.16); }
body.teacher-mode .teacher-button { color: var(--ink); background: #fff; }

main { width: min(1600px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 34px); }
.view { animation: reveal .2s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }
.surface-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.surface-header p:last-child { margin-bottom: 0; }
.board-heading { margin-bottom: 15px; }
.compact-heading { align-items: center; margin: 18px 0 14px; }
.compact-heading h2 { margin-bottom: 3px; }
.button-row, .settings-actions, .admin-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toolbar, .panel { border: 1px solid rgba(32,51,77,.08); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 12px 14px; margin-bottom: 12px; }
.field { display: grid; gap: 5px; }
.field label, .field-label, legend { color: var(--ink-soft); font-size: .78rem; font-weight: 800; }
input, select, textarea { min-height: 43px; border: 1px solid #cbd7df; border-radius: 11px; padding: 8px 11px; color: var(--ink); background: #fff; }
textarea { min-height: 145px; resize: vertical; }
.spacer { flex: 1 1 auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border: 1px solid transparent; border-radius: 12px; padding: 9px 14px; background: #e9eef2; font-weight: 800; cursor: pointer; }
.button:hover { filter: brightness(.98); transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--ink); }
.button.mustard { color: #382609; background: var(--mustard); }
.button.ghost { border-color: var(--line); background: #fff; }
.button.danger { color: #8b2e26; background: #fff0ee; }
.button.small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: .86rem; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.help-button { display: grid; place-items: center; align-self: center; width: 43px; height: 43px; flex: 0 0 43px; border: 0; border-radius: 50%; color: #fff; background: var(--ink); font-size: 1.1rem; font-weight: 900; cursor: pointer; }

.date-field input { width: 158px; }
.choice-rules { min-width: 510px; margin: 0; border: 0; padding: 0; }
.choice-rules legend { margin-bottom: 5px; padding: 0; }
.segmented { display: flex; min-height: 43px; overflow: hidden; border: 1px solid #cbd7df; border-radius: 11px; background: #f5f8fa; }
.segmented button { border: 0; border-right: 1px solid #dbe3e9; padding: 8px 11px; background: transparent; font-size: .79rem; font-weight: 800; cursor: pointer; white-space: nowrap; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { color: #fff; background: var(--teal-dark); }
.custom-days span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.custom-days input { width: 62px; }
.date-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; border: 1px solid #cfe0e4; border-radius: 13px; padding: 10px 13px; color: #31576a; background: #f1fafb; font-size: .86rem; }
.date-status.special { border-color: #e8cf82; color: #63460e; background: #fff8df; }
.date-status.locked { border-color: #b9c6d0; color: var(--ink); background: #f1f4f6; }
.date-status strong { color: inherit; }

.board-layout { display: grid; grid-template-columns: minmax(330px, 365px) 1fr; gap: 18px; align-items: start; }
.roster-panel { position: sticky; top: 84px; overflow: hidden; }
.panel-head { padding: 15px 16px 10px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 2px; }
.panel-head p { margin-bottom: 0; }
.selection-note { min-height: 46px; padding: 10px 13px; color: var(--ink-soft); background: #f6f9fb; border-bottom: 1px solid var(--line); font-size: .94rem; }
.selection-note strong { color: var(--ink); }
.roster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 11px; max-height: calc(100vh - 245px); overflow: auto; }
.roster-empty { grid-column: 1 / -1; padding: 15px 8px; color: var(--green); text-align: center; }
.student-card { position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; border: 2px solid transparent; border-radius: 13px; padding: 8px 4px 7px; background: #f4f7f9; cursor: grab; user-select: none; touch-action: manipulation; }
.student-card:hover { background: #edf3f7; }
.student-card.selected { border-color: var(--blue); background: #edf5ff; box-shadow: 0 0 0 4px rgba(80,139,210,.12); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; color: #fff; background: var(--avatar, var(--teal)); box-shadow: 0 2px 8px rgba(32,51,77,.16); font-size: .78rem; font-weight: 900; }
.student-card .child-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; line-height: 1.1; white-space: nowrap; }

.activity-grid { display: grid; grid-template-columns: repeat(4, minmax(175px, 1fr)); gap: 14px; align-items: stretch; }
.activity-card { position: relative; display: grid; grid-template-rows: 112px auto; min-width: 0; overflow: hidden; border: 2px solid transparent; border-radius: 19px; background: #fff; box-shadow: var(--shadow); transition: opacity .18s, filter .18s, transform .18s, border-color .18s; }
.activity-card.can-drop { border-color: var(--teal); transform: translateY(-2px); }
.activity-card.full { box-shadow: inset 0 0 0 2px rgba(232,120,101,.42), var(--shadow); }
.activity-card.blocked { opacity: .33; filter: grayscale(.78); }
.activity-card.blocked::after { content: attr(data-block-reason); position: absolute; inset: 44px 10px auto; z-index: 5; border-radius: 10px; padding: 7px 9px; color: #fff; background: rgba(32,51,77,.92); text-align: center; font-size: .77rem; font-weight: 850; pointer-events: none; }
.activity-visual { position: relative; display: grid; place-items: center; width: 100%; height: 112px; border: 0; padding: 0; background: var(--activity-color, var(--mustard)); cursor: default; overflow: hidden; }
body.teacher-mode .activity-visual.editable { cursor: pointer; }
.activity-visual img { width: 100%; height: 100%; object-fit: cover; }
.activity-icon { font-size: 3.15rem; filter: drop-shadow(0 3px 0 rgba(255,255,255,.3)); }
.capacity-badge { position: absolute; top: 8px; right: 8px; z-index: 3; min-width: 48px; border: 2px solid rgba(255,255,255,.8); border-radius: 999px; padding: 4px 8px; color: #111; background: rgba(255,255,255,.91); box-shadow: 0 2px 8px rgba(0,0,0,.15); font-size: .9rem; font-weight: 950; text-align: center; }
.camera-badge { position: absolute; right: 8px; bottom: 8px; z-index: 3; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #fff; background: rgba(32,51,77,.78); font-size: .9rem; }
.activity-remove { position: absolute; top: 8px; left: 8px; z-index: 6; display: grid; place-items: center; width: 31px; height: 31px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: rgba(151,49,42,.92); font-size: 1.08rem; font-weight: 900; cursor: pointer; }
.activity-body { min-width: 0; padding: 10px 12px 11px; }
.activity-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.activity-title, .activity-title-button { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: "SchoolXNew", "Comic Sans MS", sans-serif; font-size: 1.13rem; font-weight: 400; line-height: 1.1; }
.activity-title-button { border: 0; border-radius: 7px; padding: 2px 4px 2px 0; background: transparent; text-align: left; cursor: pointer; }
.activity-title-button:hover { color: var(--blue); text-decoration: underline; }
.assigned-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; margin-top: 9px; }
.assigned-tile { display: inline-grid; grid-template-columns: auto 0fr; align-items: center; overflow: hidden; border: 2px solid #d9e3e9; border-radius: 10px; background: #f3f7f9; box-shadow: 0 2px 5px rgba(32,51,77,.08); cursor: grab; transition: grid-template-columns .16s, border-color .16s, background .16s; }
.assigned-tile.selected { grid-template-columns: auto 31px; border-color: var(--blue); background: #edf5ff; }
.assigned-name { border: 0; padding: 7px 9px; background: transparent; font-size: 1rem; line-height: 1.05; cursor: grab; white-space: nowrap; }
.assigned-remove { width: 29px; height: 29px; margin-right: 2px; overflow: hidden; border: 0; border-radius: 7px; color: #fff; background: var(--red); font-size: 1rem; font-weight: 900; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .12s; }
.assigned-tile.selected .assigned-remove { opacity: 1; pointer-events: auto; }
.empty-slot { color: #91a0ad; font-size: .78rem; }
.add-activity-tile { min-height: 174px; border: 3px dashed #b9c8d2; border-radius: 19px; background: rgba(255,255,255,.62); box-shadow: none; }
.add-activity-tile button { display: grid; place-items: center; align-content: center; gap: 8px; width: 100%; height: 100%; min-height: inherit; border: 0; color: var(--ink-soft); background: transparent; cursor: pointer; }
.add-activity-tile b { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; color: #fff; background: var(--ink); font-size: 2rem; }
.add-activity-tile span { font-weight: 850; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 17px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.stat-card .number { display: block; font-size: 1.75rem; line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.stat-card .label { display: block; margin-top: 7px; color: var(--ink-soft); font-size: .82rem; font-weight: 750; }
.table-panel { overflow: hidden; }
.table-info { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.table-info h2 { margin-bottom: 3px; }
.table-info p { margin-bottom: 0; }
.table-scroll { max-height: calc(100vh - 310px); overflow: auto; }
table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
th, td { border-right: 1px solid #e4eaee; border-bottom: 1px solid #e4eaee; padding: 10px 8px; text-align: center; }
th { color: var(--ink-soft); background: #f4f7f9; font-size: .76rem; font-weight: 850; }
thead th { position: sticky; top: 0; z-index: 4; }
.activity-cell { position: sticky; left: 0; z-index: 3; min-width: 205px; padding-left: 15px; background: #fff; text-align: left; font-weight: 850; }
thead .activity-cell { z-index: 6; background: #f4f7f9; }
.student-col { width: 45px; min-width: 45px; padding: 5px 3px; vertical-align: bottom; }
.vertical-button { display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 95px; width: 100%; border: 0; padding: 2px; color: var(--ink); background: transparent; cursor: pointer; }
.vertical-button:hover { color: var(--blue); }
.vertical-button span { display: block; height: 12px; font-size: .68rem; line-height: 12px; }
.count-cell { font-variant-numeric: tabular-nums; font-weight: 800; }
.count-cell.zero { color: #aeb9c2; font-weight: 600; }
.total-cell { min-width: 70px; background: #faf4e4; font-weight: 900; }
.offered-badge { display: inline-block; min-width: 29px; border-radius: 999px; padding: 3px 7px; color: var(--teal-dark); background: #e7f6f4; font-size: .75rem; font-weight: 900; text-align: center; }

.subnav { display: inline-flex; gap: 5px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 5px; background: rgba(255,255,255,.8); }
.subnav-button { min-height: 40px; border: 0; border-radius: 10px; padding: 8px 14px; background: transparent; font-weight: 850; cursor: pointer; }
.subnav-button.active { color: #fff; background: var(--ink); }
.activity-admin-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 14px; }
.admin-card { display: grid; grid-template-columns: 82px 1fr; min-height: 126px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(32,51,77,.06); }
.admin-card.inactive { opacity: .68; }
.admin-visual { display: grid; place-items: center; border: 0; background: var(--activity-color); font-size: 2.4rem; cursor: pointer; overflow: hidden; }
.admin-visual img { width: 100%; height: 100%; object-fit: cover; }
.admin-body { min-width: 0; padding: 11px 12px; }
.admin-body h3 { margin-bottom: 3px; }
.admin-meta { margin-bottom: 7px; color: var(--ink-soft); font-size: .77rem; }
.weekday-summary { display: inline-flex; margin-bottom: 8px; border-radius: 999px; padding: 3px 8px; color: var(--teal-dark); background: #e8f6f4; font-size: .72rem; font-weight: 850; }
.source-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 7px; color: #5b4c1d; background: #fff3ce; font-size: .68rem; font-weight: 850; }
.settings-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 15px; margin-top: 20px; }
.settings-grid.no-top-margin { margin-top: 14px; }
.settings-card { padding: 18px; }
.settings-card.full { grid-column: 1 / -1; }
.storage-track { height: 9px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #e6edf1; }
.storage-fill { width: 1%; height: 100%; border-radius: inherit; background: var(--teal); }
#storage-text { margin: 7px 0 0; }
.compact-form { display: grid; gap: 10px; }
.student-admin { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 9px; margin-top: 14px; }
.student-admin-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 9px; background: #f8fafb; }
.student-admin-row.inactive { opacity: .58; }
.student-admin-row .avatar { width: 38px; height: 38px; }
.student-admin-copy { min-width: 0; }
.student-admin-copy strong, .student-admin-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.student-admin-copy small { color: var(--ink-soft); font-size: .72rem; }
.pin-note { border-radius: 11px; padding: 10px 12px; color: #5f4a16; background: #fff7dc; font-size: .82rem; }

.special-date-list { display: grid; grid-template-columns: repeat(2, minmax(280px,1fr)); gap: 12px; }
.special-date-card { display: grid; grid-template-columns: auto 1fr; gap: 13px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; box-shadow: 0 6px 20px rgba(32,51,77,.06); }
.calendar-block { display: grid; place-items: center; align-content: center; width: 64px; min-height: 68px; border-radius: 13px; color: #fff; background: var(--ink); text-align: center; }
.calendar-block b { font-size: 1.45rem; line-height: 1; }
.calendar-block small { text-transform: uppercase; }
.special-copy h3 { margin-bottom: 2px; }
.special-copy p { margin-bottom: 9px; }
.special-state { display: inline-flex; border-radius: 999px; padding: 3px 8px; color: #77520a; background: #fff2c5; font-size: .72rem; font-weight: 850; }
.special-state.locked { color: #31576a; background: #e9f1f5; }
.empty-panel { grid-column: 1 / -1; border: 2px dashed #bdcad3; border-radius: 17px; padding: 32px 18px; color: var(--ink-soft); background: rgba(255,255,255,.6); text-align: center; }

.profile-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 16px; }
.profile-card { padding: 18px; }
.profile-card.wide { grid-column: 1 / -1; }
.plain-note { border-left: 4px solid var(--mustard); padding: 11px 13px; color: #596878; background: #fff8e7; font-size: .9rem; }
.goal-groups { display: grid; gap: 12px; }
.goal-group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.goal-group summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 13px; background: #f7f9fa; font-weight: 850; cursor: pointer; }
.goal-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.goal-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 13px; border-top: 1px solid var(--line); }
.goal-list small { color: var(--ink-soft); }
.goal-count { align-self: center; border-radius: 999px; padding: 4px 7px; color: var(--teal-dark); background: #e8f5f4; font-size: .74rem; font-weight: 900; }
.partner-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 9px; margin: 10px 0; }
.bar-track { height: 12px; overflow: hidden; border-radius: 99px; background: #e8edf1; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #79c7bd); }
.profile-activity-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.profile-activity-row:last-child { border-bottom: 0; }
.recent-list { display: grid; gap: 8px; }
.recent-item { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 9px 10px; border-radius: 10px; background: #f5f8fa; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(20,34,51,.58); backdrop-filter: blur(4px); }
.modal { width: min(800px, 100%); max-height: min(840px, calc(100vh - 28px)); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(10,20,30,.28); }
.modal.wide-modal { width: min(1040px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 9; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.modal-header h2 { margin: 0; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf2f5; font-size: 1.25rem; cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.choice-button { display: grid; justify-items: start; gap: 5px; min-height: 110px; border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: #fff; text-align: left; cursor: pointer; }
.choice-button:hover { border-color: var(--teal); background: #f4fbfa; }
.choice-button .choice-icon { font-size: 1.65rem; }
.choice-button strong { font-size: .95rem; }
.choice-button small { color: var(--ink-soft); }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.library-item { display: grid; place-items: center; gap: 6px; min-height: 110px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: var(--tile-color, #f4f7f9); cursor: pointer; text-align: center; }
.library-item:hover { transform: translateY(-1px); box-shadow: 0 5px 15px rgba(32,51,77,.09); }
.library-item span { font-size: 2.1rem; }
.library-item strong { font-size: .8rem; }
.library-item small { color: var(--ink-soft); }
.qr-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: center; }
.fake-qr { position: relative; display: grid; grid-template-columns: repeat(21, 1fr); width: 230px; aspect-ratio: 1; padding: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 7px 24px rgba(32,51,77,.1); }
.fake-qr i { background: transparent; }
.fake-qr i.on { background: #14263c; }
.fake-qr::after { content: "NOG NIET ACTIEF"; position: absolute; inset: auto 12px 18px; border-radius: 6px; padding: 5px; color: #fff; background: rgba(32,51,77,.92); font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-align: center; }
.demo-badge { display: inline-block; margin-bottom: 8px; border-radius: 999px; padding: 5px 9px; color: #7c4f0b; background: #fff0c8; font-size: .76rem; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-row { display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; background: #fff; cursor: pointer; }
.check-row input { min-height: auto; margin-top: 3px; }
.check-row strong { color: var(--ink); }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-option { position: relative; }
.weekday-option input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-option span { display: grid; place-items: center; min-width: 48px; min-height: 43px; border: 2px solid var(--line); border-radius: 11px; background: #fff; font-weight: 900; cursor: pointer; }
.weekday-option input:checked + span { border-color: var(--teal-dark); color: #fff; background: var(--teal-dark); }
.weekday-option input:focus-visible + span { outline: 3px solid rgba(80,139,210,.45); outline-offset: 2px; }
.goal-picker-head { position: sticky; top: 72px; z-index: 5; display: flex; align-items: end; gap: 10px; margin: 4px 0 10px; padding: 9px; border-radius: 12px; background: #f5f8fa; }
.goal-picker-head .field { flex: 1; }
.goal-area { margin: 10px 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.goal-area summary { padding: 11px 12px; background: #f5f8fa; font-weight: 900; cursor: pointer; }
.goal-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; padding: 9px; }
.goal-option { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: .8rem; }
.goal-option input { min-height: auto; margin-top: 3px; }
.goal-option small { color: var(--ink-soft); }
.source-note { border-radius: 11px; padding: 10px 12px; color: #31576a; background: #eef7f8; font-size: .82rem; }
.source-note a { color: inherit; font-weight: 850; }

.import-start { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop-zone { display: grid; place-items: center; align-content: center; min-height: 190px; border: 3px dashed #b9c8d2; border-radius: 16px; padding: 20px; background: #f8fafb; text-align: center; cursor: pointer; }
.drop-zone.dragover { border-color: var(--teal); background: #edf9f7; }
.drop-zone b { font-size: 1.05rem; }
.privacy-note { display: flex; gap: 8px; margin: 12px 0 0; border-radius: 11px; padding: 10px 12px; color: #2d6540; background: #edf8f0; font-size: .82rem; }
.mapping-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin: 12px 0; }
.data-preview { max-height: 270px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.data-preview table { width: 100%; min-width: 600px; }
.data-preview td, .data-preview th { padding: 7px; font-size: .76rem; text-align: left; }
.import-review { display: grid; gap: 7px; max-height: 420px; overflow: auto; padding-right: 4px; }
.import-row { display: grid; grid-template-columns: 1.1fr .7fr 1.2fr auto; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 7px; }
.import-row input { min-width: 0; min-height: 38px; }
.import-row.duplicate { opacity: .58; background: #f4f5f6; }
.row-status { min-width: 74px; color: var(--green); font-size: .75rem; font-weight: 850; text-align: right; }
.row-status.warn { color: #9b5a0b; }
.row-status.error { color: var(--red); }
.import-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; border-radius: 11px; padding: 10px 12px; background: #f5f8fa; }
.image-library-note { grid-column: 1 / -1; margin: 0; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; align-items: center; gap: 12px; max-width: 460px; border-radius: 13px; padding: 12px 15px; color: #fff; background: var(--ink); box-shadow: 0 12px 40px rgba(10,20,30,.25); font-weight: 750; animation: toast-in .2s ease both; }
.toast button { border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: 5px 8px; color: #fff; background: rgba(255,255,255,.12); font-weight: 900; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.footer-note { margin: 24px 0 4px; color: #758593; font-size: .78rem; text-align: center; }
.footer-note a { color: #536a7d; font-weight: 750; }
.screen-reader-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1320px) {
  .activity-grid { grid-template-columns: repeat(3, minmax(175px, 1fr)); }
  .choice-rules { min-width: auto; }
  .segmented { flex-wrap: wrap; overflow: visible; border: 0; gap: 5px; background: transparent; }
  .segmented button { border: 1px solid var(--line) !important; border-radius: 9px; background: #fff; }
}
@media (max-width: 1120px) {
  .activity-admin-grid { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .student-admin { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .privacy-pill { display: none; }
  .library-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 880px) {
  .app-header { position: static; grid-template-columns: 1fr; gap: 7px; }
  .brand { justify-content: center; }
  .header-actions { justify-content: center; }
  .main-nav { overflow-x: auto; justify-content: center; }
  main { padding: 15px; }
  .surface-header { display: block; }
  .button-row { margin-top: 10px; }
  .board-layout { grid-template-columns: 1fr; }
  .roster-panel { position: static; }
  .roster { grid-template-columns: repeat(4, minmax(0,1fr)); max-height: none; }
  .activity-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(130px,1fr)); }
  .profile-grid, .settings-grid { grid-template-columns: 1fr; }
  .profile-card.wide, .settings-card.full { grid-column: auto; }
  .qr-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .special-date-list { grid-template-columns: 1fr; }
  .goal-options { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 580px) {
  .nav-button { padding: 8px 11px; font-size: .86rem; }
  .roster { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 9px; }
  .activity-grid, .activity-admin-grid, .student-admin { grid-template-columns: 1fr; }
  .activity-card { grid-template-rows: 105px auto; }
  .activity-visual { height: 105px; }
  .choice-grid, .library-grid, .form-grid, .import-start { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .toolbar .field { width: 100%; }
  .toolbar input, .toolbar select { width: 100%; }
  .spacer { display: none; }
  .toolbar .button { flex: 1 1 140px; }
  .choice-rules { width: 100%; }
  .segmented button { flex: 1 1 130px; white-space: normal; }
  .subnav { display: flex; overflow-x: auto; }
  .subnav-button { white-space: nowrap; }
  .mapping-grid { grid-template-columns: 1fr; }
  .import-row { grid-template-columns: 1fr 1fr; }
  .row-status { text-align: left; }
}
