/* ==========================================================================
   RocketBook — design system
   Clean & simple (ClassDojo feel) + per-teacher theme colour/background.
   ========================================================================== */
:root {
  --accent: #1772eb;
  --accent-fg: #ffffff;
  --accent-soft: #e7f0fd;
  --accent-border: #bed7f9;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1d1b2e;
  --muted: #6b6880;
  --faint: #9b98ad;
  --border: #e7e5ef;
  --border-strong: #cfcbe0;
  --input: #ffffff;
  --success: #12805c;
  --success-soft: #e5f6ef;
  --warning: #9a5b00;
  --warning-soft: #fff4e0;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --shadow: 0 1px 2px rgba(29, 27, 46, .04), 0 4px 16px rgba(29, 27, 46, .05);
  --shadow-lg: 0 12px 40px rgba(29, 27, 46, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 640px; }
.container-mid { max-width: 820px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.page { padding-top: 24px; padding-bottom: 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 20px; }
.card-section { padding: 20px; border-top: 1px solid var(--border); }
.card-section:first-child { border-top: 0; }
.card h2, .card h3 { margin-bottom: .35rem; }
.card-link { display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
@media (max-width: 520px) { .card-body, .card-section { padding: 16px; } }

.stat { padding: 18px 20px; }
.stat .num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.2;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  background: var(--accent); color: var(--accent-fg);
  transition: filter .12s ease, background .12s ease, transform .05s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-light { background: #f1f0f6; color: var(--text); }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: .85rem; }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; border-radius: 14px; background: #f1f0f6; color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-danger { color: var(--danger); }
form.inline { display: inline; }

/* ---------------------------------------------------------------- forms */
label, .label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field-hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.field-error { color: var(--danger); font-size: .875rem; margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; min-width: 0; min-height: 50px;
  padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6880' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.is-invalid { border-color: var(--danger) !important; }
input[type=color] { width: 54px; height: 44px; padding: 3px; border-radius: 12px; border: 1px solid var(--border-strong); background: #fff; cursor: pointer; }
input[type=file] { font: inherit; font-size: .9rem; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 3px; flex: none; }

/* Code input on the landing page */
.code-input {
  text-align: center; font-size: 1.6rem !important; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; min-height: 64px !important;
}

/* iOS-style toggle (screenshots: "All day", reminders) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.toggle-row .label { margin: 0; font-size: 1.02rem; }
.toggle { position: relative; display: inline-block; width: 54px; height: 32px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .slider {
  position: absolute; inset: 0; border-radius: 999px; background: #e3e1ea; cursor: pointer;
  transition: background .15s ease;
}
.toggle .slider::before {
  content: ""; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(22px); }
.toggle input:focus-visible + .slider { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Chips (template buttons, filters) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: none !important;
}
.chip:hover { filter: brightness(.98); }
.chip.is-active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip-plain { background: #f1f0f6; color: var(--text); border-color: var(--border); }

/* ---------------------------------------------------------------- badges & alerts */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #f1f0f6; color: var(--muted); white-space: nowrap; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #bfe8d6; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f5c6c0; }
.alert-info { background: var(--accent-soft); color: #0f52ab; border-color: var(--accent-border); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: #f5dcae; }
.flash-stack { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; width: min(560px, calc(100% - 32px)); }
.flash-stack .alert { box-shadow: var(--shadow-lg); animation: flash-in .25s ease; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-muted td { color: var(--faint); }
.table .actions { text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table-stack td { display: block; padding: 2px 0; border: 0; }
  .table-stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  .table-stack .actions { text-align: left; padding-top: 8px; }
}

/* ---------------------------------------------------------------- parent top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 1rem; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a, .topnav button { white-space: nowrap; padding: 8px 12px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .92rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
.topnav a:hover, .topnav button:hover { background: #f1f0f6; text-decoration: none; }
.topnav a.is-active { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 520px) {
  .topnav .hide-sm { display: none; }
  .topbar .brand-name { display: none; }
  .topnav a, .topnav button { padding: 8px 10px; font-size: .9rem; }
}

/* Teacher theme: full-page background picture or banner */
body.theme-full { background-attachment: fixed; background-size: cover; background-position: center; }
body.theme-full .page-overlay { background: linear-gradient(rgba(246,245,251,.35), rgba(246,245,251,.75)); min-height: calc(100vh - 60px); }
.theme-banner { height: 180px; background-size: cover; background-position: center; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 640px) { .theme-banner { height: 120px; border-radius: 0; } }
.theme-banner + .container .teacher-hero { margin-top: -48px; }

.teacher-hero { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; border: 3px solid #fff; box-shadow: var(--shadow); overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img.avatar-logo { object-fit: contain; background: #fff; padding: 10%; }   /* no profile photo yet: the RocketBook logo */
.avatar-lg { width: 84px; height: 84px; font-size: 1.7rem; }
.avatar-sm { width: 36px; height: 36px; font-size: .85rem; border-width: 2px; }

/* ---------------------------------------------------------------- event covers */
.cover { height: 128px; border-radius: var(--radius) var(--radius) 0 0; background: var(--accent-soft); background-size: cover; background-position: center; position: relative; }
.cover-lg { height: 200px; border-radius: var(--radius); }
@media (max-width: 640px) { .cover-lg { height: 150px; } }
.cover-pattern { background-image: radial-gradient(rgba(255,255,255,.35) 2px, transparent 2.5px); background-size: 18px 18px; }
.event-card .card-body { padding: 16px 18px 18px; }
.event-card h3 { margin-bottom: 4px; }
.event-meta { color: var(--muted); font-size: .9rem; display: flex; flex-direction: column; gap: 2px; }

/* ---------------------------------------------------------------- slot picker */
.day-group { margin-bottom: 22px; }
.day-group h3 { font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; padding: 8px 10px; border-radius: 14px;
  border: 1.5px solid var(--accent-border); background: #fff; color: var(--accent);
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center;
  transition: background .1s ease, transform .05s ease;
}
.slot:hover { background: var(--accent-soft); }
.slot small { font-weight: 600; color: var(--muted); font-size: .75rem; }
.slot.is-selected { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.slot.is-selected small { color: inherit; opacity: .85; }
.slot.is-taken, .slot:disabled { background: #f1f4f9; border-color: #ebe9f2; color: var(--faint); cursor: not-allowed; text-decoration: line-through; }
.slot.is-mine { background: var(--success-soft); border-color: #9fdcc2; color: var(--success); cursor: default; text-decoration: none; }

.spot-list { display: flex; flex-direction: column; gap: 10px; }
.spot-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: #fff;
}
.spot-item.is-selectable { cursor: pointer; }
.spot-item.is-selectable:hover { border-color: var(--accent-border); background: #fafcff; }
.spot-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.spot-item.is-full { opacity: .6; }
.spot-item .spot-title { font-weight: 700; }
.spot-item .spot-sub { color: var(--muted); font-size: .88rem; }
.progress { height: 6px; border-radius: 999px; background: #eeedf4; overflow: hidden; width: 90px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* Booking bar that slides up after choosing a slot */
.book-panel { position: sticky; bottom: 0; z-index: 20; margin-top: 16px; }
.book-panel .card { box-shadow: var(--shadow-lg); border-color: var(--accent-border); }

/* ---------------------------------------------------------------- list items */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); color: inherit; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: #faf9fd; text-decoration: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; }
.list-item .sub { color: var(--muted); font-size: .9rem; }
.date-tile { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 6px 0; line-height: 1.1; }
.date-tile .m { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.date-tile .d { font-size: 1.35rem; font-weight: 800; }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .icon { font-size: 2.2rem; margin-bottom: 8px; }

/* ---------------------------------------------------------------- auth / landing */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .card-body { padding: 32px 28px; }
@media (max-width: 520px) { .auth-card .card-body { padding: 24px 20px; } }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; text-align: center; }
.auth-logo .brand-mark { width: 56px; height: 56px; border-radius: 18px; font-size: 1.6rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .85rem; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--muted); background: #faf9fd; border-radius: 12px; padding: 12px 14px; }

/* ---------------------------------------------------------------- staff shell */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { padding: 4px 8px 18px; }
.nav-section { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; }
.nav a, .nav .nav-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav .nav-btn:hover { background: #f1f4f9; text-decoration: none; }
.nav a.is-active, .nav .nav-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.nav form { margin: 0; }
.nav .nav-btn { width: 100%; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
/* notification bell (next to Office hours, and in the phone top bar) */
.nav-row { display: flex; align-items: center; gap: 4px; }
.nav-row > a:first-child { flex: 1; }
.bell { position: relative; display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0 !important; border-radius: 12px; font-size: 1.15rem; text-decoration: none !important; }
.bell:hover { background: #f1f4f9; }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; line-height: 18px; text-align: center; }
.nav .ico { width: 20px; text-align: center; }
.nav .count { margin-left: auto; background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-size: .72rem; padding: 1px 7px; font-weight: 800; }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); font-size: .9rem; }
.main { min-width: 0; }
.main-top { display: none; }
.nav-close { display: none !important; }
.impersonation-bar { background: #1d1b2e; color: #fff; padding: 8px 16px; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.impersonation-bar .link-btn { color: #b9d5ff; }
.assist-bar { background: #14532d; }
.assist-bar a.link-btn { color: #bbf7d0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .nav-close { display: inline-flex !important; margin-bottom: 14px; }
  .nav a, .nav .nav-btn { padding: 12px 12px; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 50; }
  .main-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
}

/* ---------------------------------------------------------------- event editor */
.editor { max-width: 760px; margin: 0 auto; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.editor-head h1 { font-size: 1.35rem; margin: 0; text-align: center; flex: 1; }
.cover-picker { position: relative; height: 170px; border-radius: 16px; background-size: cover; background-position: center; overflow: hidden; }
.cover-picker .cover-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.cover-tool { width: 60px; height: 60px; border-radius: 12px; background: #fff; border: 3px solid #fff; box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; overflow: hidden; position: relative; font-size: 1.4rem; }
.cover-tool input[type=file], .cover-tool input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cover-tool .swatch { width: 100%; height: 100%; border-radius: 8px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.swatch-btn.is-active { box-shadow: 0 0 0 2px var(--text); }

.spot-editor { display: flex; flex-direction: column; gap: 10px; }
.spot-row { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: #fcfcfe; }
.spot-row.has-bookings { border-color: var(--accent-border); }
.spot-row.is-removed { display: none; }
.removed-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--warning-soft); color: var(--warning); font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.spot-row-grid { display: grid; grid-template-columns: 1.6fr 1fr .8fr .8fr 90px auto; gap: 8px; align-items: end; }
.spot-row-grid label { font-size: .75rem; color: var(--muted); margin-bottom: 3px; font-weight: 700; }
.spot-row-grid input { min-height: 42px; padding: 8px 10px; font-size: .95rem; }
@media (max-width: 720px) {
  .spot-row-grid { grid-template-columns: 1fr 1fr; }
  .spot-row-grid .span-2 { grid-column: span 2; }
}
.spot-empty { border: 2px dashed #dcd9e6; border-radius: 14px; background: #f7f6fa; min-height: 72px; display: grid; place-items: center; color: var(--faint); font-size: .9rem; padding: 16px; text-align: center; }
.add-spot { display: flex; justify-content: center; margin-top: 8px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(29,27,46,.45); }
.modal.is-open { display: flex; }
.modal .card { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; animation: flash-in .2s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }

/* Weekday picker */
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { margin: 0; }
.weekdays input { position: absolute; opacity: 0; }
.weekdays span { display: inline-grid; place-items: center; width: 46px; height: 40px; border-radius: 12px; border: 1.5px solid var(--border-strong); font-weight: 700; font-size: .85rem; cursor: pointer; background: #fff; }
.weekdays input:checked + span { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Code slips */
.code-slips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.code-slip { border: 2px dashed var(--border-strong); border-radius: 14px; padding: 16px; break-inside: avoid; }
.code-slip .code { font-size: 1.6rem; font-weight: 800; letter-spacing: .12em; margin: 6px 0; }

/* Calendar (FullCalendar tweaks) */
.fc { --fc-border-color: var(--border); --fc-today-bg-color: var(--accent-soft); --fc-event-bg-color: var(--accent); --fc-event-border-color: var(--accent); font-size: .9rem; }
.fc .fc-button-primary { background: #fff; color: var(--text); border-color: var(--border-strong); border-radius: 10px; font-weight: 700; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fc .fc-toolbar-title { font-size: 1.2rem; font-weight: 800; }
.fc-event.is-open-slot { background: #fff !important; color: var(--accent) !important; border: 1px dashed var(--accent) !important; }
@media (max-width: 640px) { .fc .fc-toolbar { flex-direction: column; gap: 8px; } }

.footer { padding: 28px 0; color: var(--faint); font-size: .85rem; text-align: center; }

/* ---------------------------------------------------------------- print */
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; font-size: 11pt; }
  .no-print, .sidebar, .topbar, .main-top, .flash-stack, .impersonation-bar, .btn, .footer { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border-color: #bbb; }
  .page { padding: 0; }
  a { color: inherit; }
  .table th, .table td { padding: 6px 8px; }
  .print-break { page-break-before: always; }
}


/* ==========================================================================
   Mobile-first refinements (most parents use phones)
   ========================================================================== */
body { padding-bottom: env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
button, a, label, .slot, .spot-item { touch-action: manipulation; }
.book-panel { padding-bottom: env(safe-area-inset-bottom); }

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.15rem; }
  .page { padding-top: 16px; padding-bottom: 48px; }
  .page-head { margin-bottom: 14px; align-items: flex-start; }
  .page-head > .row, .page-head > .btn, .page-head > form, .page-head > a.btn { width: 100%; }
  .page-head > .row > .btn, .page-head > .row > form, .page-head > .row > button { flex: 1 1 auto; }
  .page-head > .row > form .btn { width: 100%; }
  .grid { gap: 12px; }
  .card { border-radius: 16px; }
  .list-item { padding: 12px 16px; }
  .stat { padding: 14px 16px; }
  .stat .num { font-size: 1.5rem; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .slot { min-height: 58px; padding: 8px 4px; font-size: .92rem; }
  .spot-item { padding: 14px; }
  .date-tile { width: 46px; }
  .teacher-hero .avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
  .auth-wrap { justify-content: flex-start; padding-top: 24px; }
  .row-between > .row { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .editor .chips { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }
  /* Modals become bottom sheets */
  .modal { align-items: flex-end; padding: 0; }
  .modal .card { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  /* Sticky save bar in long forms */
  .sticky-actions { position: sticky; bottom: 0; background: var(--card); z-index: 5; box-shadow: 0 -6px 16px rgba(29,27,46,.06); }
  .cover-picker { height: 140px; }
  .cover-tool { width: 52px; height: 52px; }
  .editor-head h1 { font-size: 1.15rem; }
  .table td, .table th { padding: 10px 12px; }
  .toggle-row .label { font-size: .98rem; }
  .code-slips { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media print { .code-slips { grid-template-columns: repeat(2, 1fr) !important; } }

/* Grid/flex children must be allowed to shrink (date/time inputs have a wide intrinsic size) */
.grid > *, .row > input, .row > select, .spot-row-grid > * { min-width: 0; }
.row > input, .row > select { flex: 1 1 160px; }
input[type=date], input[type=time], input[type=datetime-local] { min-height: 50px; }
@media (max-width: 720px) {
  .spot-row-grid { grid-template-columns: 1fr 1fr 1fr; }
  .spot-row-grid > div:first-child { grid-column: 1 / -1; }
  .spot-row-grid > div:nth-child(2) { grid-column: 1 / -1; }
  .spot-row-grid > div:nth-child(5) { grid-column: span 2; }
}
@media (max-width: 640px) {
  .row[style*="nowrap"] { flex-wrap: wrap !important; }
}

.slot-time { flex: none; min-width: 150px; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .slot-time { min-width: 0; font-size: .92rem; } }

/* Avatars overlapping a card cover sit on top of it */
.card .avatar { position: relative; z-index: 1; }

/* Event editor: meeting options + wizard */
.meet-options { display: flex; flex-direction: column; gap: 6px; }
.meet-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--border); border-radius: 12px; }
.meet-row.is-on { border-color: var(--accent-border); background: var(--accent-soft); }
.meet-row input[type=text], .meet-row input:not([type]) { flex: 1 1 200px; min-height: 40px; padding: 8px 10px; }
.wizard { border: 1.5px solid var(--accent-border); border-radius: 14px; padding: 10px; background: #fafcff; }
.wizard textarea { min-height: 56px; border: 0; box-shadow: none !important; background: transparent; padding: 4px 6px; }

/* Signups: meeting/appointment time slots vs volunteer jobs / items to bring */
.signups.is-meeting .only-items, .signups.is-items .only-meeting { display: none !important; }
.signups.is-meeting .spot-row-grid { grid-template-columns: 1.2fr .9fr .9fr 90px auto; }
.signups.is-items .spot-row-grid { grid-template-columns: 1fr 96px 90px auto; }
.spot-img { position: relative; display: grid; place-items: center; width: 96px; height: 42px; border: 1.5px dashed var(--border-strong); border-radius: 10px; cursor: pointer; overflow: hidden; background: #fff; color: var(--muted); font-size: .82rem; font-weight: 700; margin: 0; }
.spot-img img { width: 100%; height: 100%; object-fit: cover; }
.spot-img input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.spot-img-rm { font-size: .75rem; margin-top: 2px; }
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; margin: 0; font-weight: 400; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card strong { display: block; color: var(--text); margin-bottom: 2px; }
.type-card .small { display: block; line-height: 1.4; }
.type-card .type-ico { font-size: 1.6rem; line-height: 1; }
.type-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, #fff4ec); box-shadow: 0 0 0 3px rgba(0,0,0,.03); }
.type-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  .type-pick { grid-template-columns: 1fr; }
  .signups.is-meeting .spot-row-grid { grid-template-columns: 1fr 1fr auto; }
  .signups.is-items .spot-row-grid { grid-template-columns: 1fr 96px; }
  .signups.is-items .spot-row-grid > div:first-child { grid-column: 1 / -1; }
}


/* Segmented pill selector (e.g. Meeting / Appointment / Conference) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #f1f0f6; border-radius: 999px; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); transition: background .15s, color .15s; }
.seg input:checked + span { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(20,16,50,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpl-chip { gap: 6px; }
.tpl-chip .link-btn { color: inherit; text-decoration: none; }
.tpl-chip .tpl-x { font-size: .8rem; opacity: .6; }
.tpl-chip .tpl-x:hover { opacity: 1; }

/* Customer logo (RocketBook) */
.brand-logo { height: 46px; width: auto; display: block; }
.brand-logo-sm { height: 34px; }
.topbar .brand-logo { height: 40px; }
.auth-brand { width: 170px; height: auto; display: block; margin: 0 auto; }
.auth-icon { width: 72px; height: auto; display: block; margin: 0 auto; }

/* Settings: "Both" = header picture + background picture */
.header-pick { display: none; }
.is-both .header-pick { display: block; }
.is-both .not-both, .card:not(.is-both) .only-both { display: none; }

/* Volunteer / items: one date & time for every spot */
.all-time-link > .check { font-size: .92rem; font-weight: 600; }
.all-time { border: 1px dashed var(--accent-border); border-radius: 14px; padding: 12px 14px; background: #fafcff; }
.all-time-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.all-time-grid input { min-height: 42px; }
@media (max-width: 480px) { .all-time-grid { grid-template-columns: 1fr 1fr; } .all-time-grid > div:first-child { grid-column: 1 / -1; } }

/* Sidebar: "Support us — Buy me a coffee" donation link */
.sidebar .nav { flex: 1 0 auto; display: flex; flex-direction: column; }
.sidebar .portal-switch { margin-top: 18px; border: 1.5px solid var(--accent); color: var(--accent) !important; font-weight: 800; letter-spacing: .02em; }
.sidebar .portal-switch small { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); letter-spacing: 0; }
.sidebar .portal-switch:hover { background: var(--accent-soft); }
.sidebar .support-link { margin-top: auto; margin-bottom: 14px; border: 1px dashed var(--accent-border); background: var(--accent-soft); color: var(--accent) !important; font-weight: 800; }
.sidebar .support-link small { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); }
.sidebar .support-link:hover { filter: brightness(.98); }

.spot-thumb { flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-right: 4px; }
.spot-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* meeting notes: formatting toolbar + "Take notes" */
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f8f9fc; }
.rte-bar button { min-width: 36px; height: 32px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.rte-bar button:hover { background: #fff; border-color: var(--border); }
.rte-area { min-height: 120px; max-height: 480px; overflow: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: 0 0 12px 12px; background: #fff; outline: none; line-height: 1.55; }
.rte-area:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rte-area.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte-view h3, .rte-view h4 { margin: 8px 0 4px; font-size: 1.05rem; }
.rte-view ul, .rte-view ol { margin: 4px 0 4px 22px; padding: 0; }
.rte-view p { margin: 0 0 6px; }
.take-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; padding: 10px 12px; border: 1px dashed var(--accent-border); border-radius: 12px; background: var(--accent-soft); }
.take-notes.is-recording { border-style: solid; border-color: var(--danger); background: var(--danger-soft); }
.take-notes [data-tn-status] { flex: 1 1 260px; }
.tn-live { flex-basis: 100%; font-style: italic; color: var(--muted); }
.tn-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-right: 4px; animation: tn-blink 1s infinite; }
@keyframes tn-blink { 50% { opacity: .2; } }

/* Quill editor inside the app */
.rte .ql-toolbar.ql-snow { border: 1px solid var(--border); border-radius: 12px 12px 0 0; background: #f8f9fc; font-family: inherit; }
.rte .ql-container.ql-snow { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; background: #fff; font-family: inherit; font-size: 1rem; }
.rte .ql-editor { min-height: 120px; max-height: 520px; overflow-y: auto; line-height: 1.55; }
.rte .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.rte:focus-within .ql-container.ql-snow { border-color: var(--accent); }
.notes-h { margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--border); font-size: 1.05rem; }
.notes-h:first-of-type { margin-top: 6px; }
.rte-view h2 { font-size: 1.2rem; margin: 8px 0 4px; }

/* My schedule: weekly timetable (view only) */
.wk { display: grid; grid-template-columns: repeat(var(--wk-cols, 5), minmax(0, 1fr)); gap: 10px; }
.wk-day { background: #f8f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 8px; min-width: 0; }
.wk-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.wk-head { font-weight: 800; font-size: .92rem; padding: 2px 4px 8px; }
.wk-today { font-size: .7rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.wk-block { background: #fff; border-left: 4px solid var(--wk-c); border-radius: 10px; padding: 7px 9px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.wk-time { font-size: .75rem; font-weight: 700; color: var(--muted); }
.wk-title { font-weight: 800; font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.wk-loc { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.wk-actions { font-size: .78rem; margin-top: 4px; }
.wk-none { color: var(--muted); font-size: .85rem; padding: 4px; }
@media (max-width: 760px) { .wk { grid-template-columns: 1fr; } .wk-day { padding: 8px 10px; } }

/* teacher page (parents): Office hours + My schedule cards beside the name, stacked on phones */
.teacher-hero { flex-wrap: wrap; }
.hero-cards { display: flex; gap: 12px; flex: 1 1 380px; min-width: 0; align-items: stretch; }
.hero-cards > .card { flex: 1 1 0; min-width: 0; margin: 0 !important; }
@media (max-width: 640px) { .hero-cards { flex-basis: 100%; flex-direction: column; } .hero-cards > .card { flex: none; } }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.wk-clear button { font-size: .75rem; font-weight: 600; }

/* Event banner: the same shape in the editor, on the teacher's event page and for parents,
   so the zoom / position the teacher picks looks the same everywhere */
.cover-frame { aspect-ratio: 4 / 1; height: auto !important; min-height: 0; }
@media (max-width: 640px) { .cover-frame { aspect-ratio: 3 / 1; } }

/* Small weekly timetable on the dashboard (like the paper one): coloured day headers, centred entries */
.wt-wrap { overflow-x: auto; }
.wt-title { text-align: center; font-weight: 900; font-size: 1.25rem; color: #1a2a6c; margin: 2px 0 6px; }
.wt { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .68rem; line-height: 1.2; }
.wt th { color: #fff; font-weight: 800; font-size: .74rem; padding: 4px 2px; text-align: center; border: 1px solid #fff; }
.wt td { border: 1px solid #d9dde6; padding: 3px 2px; text-align: center; vertical-align: top; overflow-wrap: anywhere; }
.wt td strong { display: block; font-weight: 800; }
.wt td span { display: block; color: #4b5563; }
.wt-6, .wt-7 { font-size: .6rem; }
.wt-6 th, .wt-7 th { font-size: .66rem; padding: 4px 1px; }
.wt-6 td, .wt-7 td { padding: 3px 1px; }
@media (max-width: 600px) { .wt-6, .wt-7 { min-width: 460px; } }   /* phones: weekend columns scroll inside the box */
.oht { width: 100%; border-collapse: collapse; font-size: .82rem; }
.oht th { background: #1a2a6c; color: #fff; font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; text-align: left; }
.oht th:first-child { border-radius: 8px 0 0 0; } .oht th:last-child { border-radius: 0 8px 0 0; text-align: right; }
.oht td { padding: 7px 8px; border-bottom: 1px solid #e5e8ef; vertical-align: middle; }
.oht td:last-child { text-align: right; }
.oht tr:nth-child(even) td { background: #f8f9fc; }
.oht tr.is-today td { background: var(--accent-soft); }
.oht-day { font-weight: 800; white-space: nowrap; }
.oht-day span { display: block; font-weight: 600; font-size: .72rem; color: var(--muted); }
.oht-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--success-soft); color: var(--success); white-space: nowrap; }
.oht-pill.is-booked { background: var(--accent-soft); color: var(--accent); }
/* day colours: coloured day header and entry stripe; colour circle to pick it on My week */
.wk-day { border-top: 5px solid var(--wk-day, var(--border)); }
.wk-day .wk-block { border-left-color: var(--wk-day, #1772eb); }
.wk-name { display: inline-flex; align-items: center; gap: 6px; color: var(--wk-day, inherit); }
.wk-color { position: relative; width: 20px; height: 20px; margin: 0; border-radius: 50%; cursor: pointer; flex: none;
  background: conic-gradient(#e53935, #fb8c00, #fdd835, #43a047, #00897b, #1e88e5, #8e24aa, #d81b60, #e53935); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--border); }
.wk-color::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--wk-day); box-shadow: 0 0 0 1px #fff; }
.wk-color input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.wk-head { flex-wrap: wrap; row-gap: 2px; }
.wk-name { min-width: 0; white-space: nowrap; }
/* Time picker with OK (computers) — replaces the browser's time dropdown */
.tp-on input[type=time]::-webkit-calendar-picker-indicator { display: none; }
.tp-on input[type=time] { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.tp-pop { position: absolute; z-index: 1000; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.18); padding: 8px; width: 236px; }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.tp-col { max-height: 222px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; }
.tp-col button { border: 0; background: transparent; border-radius: 8px; padding: 7px 0; font: inherit; font-size: .95rem; font-weight: 600; color: var(--text); cursor: pointer; }
.tp-col button:hover { background: #f1f4f9; }
.tp-col button.is-on { background: var(--accent); color: #fff; }
.tp-bar { display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }

/* Top bar (computers): Notifications with the bell, and "Back to my classroom" for admins who teach */
.main-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 12px; }
.main-bar + .page { padding-top: 0; margin-top: -10px; }   /* less space under Notifications */
.bell-ico { position: relative; display: inline-flex; }
.bell.bell-bar { width: auto !important; height: 38px; padding: 0 14px !important; gap: 8px; border: 1px solid var(--border); background: #fff; border-radius: 999px; font-size: 1.05rem; color: var(--text); }
.bell.bell-bar .bell-word { font-size: .9rem; font-weight: 700; }
.bell.bell-bar .bell-count { top: -6px; right: -10px; }
.bell.bell-bar.is-active { border-color: var(--accent); color: var(--accent); }
.bell-top .bell-count { top: -4px; right: -8px; }
@media (max-width: 900px) { .main-bar { display: none; } }
.table th.center, .table td.center, .oht th.center, .oht td.center { text-align: center; }
@media (max-width: 760px) { .table-stack td.center { text-align: left; } }
/* Calendar: titles readable in Week/Day (less squished) */
.fc .fc-timegrid-slot { height: 1.9em; }
.fc .fc-timegrid-event .fc-event-title { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.fc .fc-daygrid-event { white-space: normal; }
.fc .fc-daygrid-day:hover, .fc .fc-timegrid-slot-lane:hover { background: rgba(23,114,235,.04); cursor: pointer; }
.fc-event.is-open-slot .fc-event-main, .fc-event.is-open-slot .fc-event-title, .fc-event.is-open-slot .fc-event-time { color: var(--accent) !important; }
/* Dashboard: Office hours week grid (‹ week ›) */
.ohw-bar { display: flex; align-items: center; justify-content: center; gap: 18px; background: #1a2a6c; color: #fff; border-radius: 10px 10px 0 0; padding: 7px 10px; font-weight: 800; font-size: .92rem; }
.ohw-nav { border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; padding: 0 8px; cursor: pointer; font-weight: 800; }
.ohw-nav:disabled { opacity: .3; cursor: default; }
.ohw-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: .74rem; }
.ohw-table th { padding: 8px 2px 4px; font-size: .84rem; font-weight: 800; text-align: center; border-bottom: 1px solid #e5e8ef; }
.ohw-table th span { display: block; font-size: .7rem; font-weight: 600; color: var(--muted); }
.ohw-table th.is-today { color: var(--accent); }
.ohw-table td { padding: 6px 2px; text-align: center; border-bottom: 1px solid #e5e8ef; }
.ohw-table tr:nth-child(even) td { background: #f8f9fc; }
.ohw-table td .is-booked { color: var(--accent); font-weight: 800; }
.ohw-6 td, .ohw-7 td { font-size: .66rem; white-space: normal; }
.ohw-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); vertical-align: -1px; }
/* Calendar: + in each date to add an appointment */
.fc-plus { border: 0; background: transparent; color: var(--accent); font-weight: 900; font-size: 1.05rem; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.fc-plus:hover { background: var(--accent-soft); }
.fc .fc-daygrid-day-top { justify-content: space-between; align-items: center; }
.fc .fc-col-header-cell-cushion { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 480px) { .wt th { font-size: .6rem; padding: 4px 1px; letter-spacing: -.01em; } }

/* ---- field trips (editor) */
.editor.is-trip .not-trip, .editor:not(.is-trip) .only-trip { display: none !important; }
.trip-edit { border: 2px solid var(--accent-border); border-radius: 14px; padding: 16px; margin-bottom: 8px; background: #fbfcff; }
.trip-field-row { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.trip-coteachers { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 6px; }
@media (max-width: 960px) { .type-pick { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .trip-field-row { grid-template-columns: 1fr auto; } .trip-field-row select { grid-column: 1; } }
.trip-edit [data-when-section] { padding: 0 0 14px; border: 0; margin-bottom: 4px; }
.cot-drop { position: relative; max-width: 460px; }
.cot-drop summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; }
.cot-drop summary::-webkit-details-marker { display: none; }
.cot-drop[open] summary { border-color: var(--accent); }
.cot-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(20,20,50,.14); padding: 8px 12px; max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
/* ---- field trip permission form (uploaded form with boxes on top) */
.td-doc { max-width: 820px; margin: 0 auto; }
.td-page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 14px rgba(20,20,50,.14); border-radius: 4px; overflow: hidden; line-height: 1.2; user-select: none; }
.td-page > img { display: block; width: 100%; height: 100%; pointer-events: none; }
.td-doc.is-placing .td-page { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: -3px; }
.td-f { position: absolute; border-radius: 3px; display: flex; align-items: center; }
.td-edit .td-f { border: 1.5px solid #1772eb; background: rgba(23,114,235,.13); cursor: move; justify-content: center; touch-action: none; }
.td-edit .td-f.is-active { box-shadow: 0 0 0 3px rgba(23,114,235,.3); }
.td-edit .td-t-label { background: rgba(242,161,0,.15); border-color: #e09400; padding-top: 1.1em; }
.td-edit .td-t-label textarea { width: 100%; height: 100%; border: 0; background: transparent; resize: none; font: inherit; padding: 2px 4px; min-height: 0; }
.td-tag { font-size: .7em; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #1772eb; pointer-events: none; }
.td-x { position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; }
.td-h { position: absolute; right: -5px; bottom: -5px; width: 12px; height: 12px; background: #1772eb; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; }
.td-fill .td-f { border: 1.5px dashed #1772eb; background: rgba(23,114,235,.06); }
.td-fill .td-f input, .td-fill .td-f textarea { width: 100%; height: 100%; min-height: 0; border: 0; background: transparent; font: inherit; font-size: 1em; padding: 0 4px; border-radius: 0; color: #0b2a6b; resize: none; }
.td-fill .td-f input:focus, .td-fill .td-f textarea:focus { background: rgba(255,255,255,.85); outline: 2px solid #1772eb; }
.td-fill .td-t-label, .td-view .td-t-label { border: 0; background: transparent; }
.td-t-signature { justify-content: center; }
.td-sig { max-width: 100%; max-height: 100%; object-fit: contain; }
.td-text { padding: 0 4px; width: 100%; color: #0b2a6b; overflow: hidden; white-space: normal; overflow-wrap: anywhere; }
.td-view .td-f { border: 0; }
.td-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; position: sticky; top: 0; z-index: 5; background: #fbfcff; padding: 6px 0; }
.td-tools .btn.is-on { background: var(--accent); color: #fff; }
@media print { .td-page { box-shadow: none; break-inside: avoid; } }
.signups.is-meeting .tpl-chip[data-type=items], .signups.is-items .tpl-chip[data-type=meeting] { display: none; }
.cot-email summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.signups.is-template > h2, .signups.is-template > p.mb-1, .signups.is-template > .type-pick { display: none; }
.form-pick { grid-template-columns: 1fr 1fr; }
.trip-field-row { grid-template-columns: 1fr 140px auto auto auto; }
.trip-field-row.is-note .trip-req { visibility: hidden; }
.trip-req { white-space: nowrap; }
.td-req { position: absolute; left: -2px; bottom: -18px; border: 0; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; cursor: pointer; background: #e5484d; color: #fff; line-height: 16px; white-space: nowrap; }
.td-req.is-opt { background: #8a8fa3; }
.td-fill .td-f.is-req { border-color: #e5484d; }
.trip-field-move { display: inline-flex; gap: 2px; }
@media (max-width: 560px) { .form-pick { grid-template-columns: 1fr; } .trip-field-row { grid-template-columns: 1fr auto auto; } .trip-field-row select { grid-column: 1; } .trip-req { grid-column: 2 / -1; } }
/* ---- staff RSVP (editor) */
.editor.is-rsvp .not-rsvp, .editor:not(.is-rsvp) .only-rsvp { display: none !important; }
.rsvp-edit { border: 2px solid var(--accent-border); border-radius: 14px; padding: 16px; margin-bottom: 8px; background: #fbfcff; }
.rsvp-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; }
.rsvp-list { display: flex; flex-direction: column; gap: 6px; }
.rsvp-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; padding: 6px 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.pv-sig { height: 110px; display: flex; align-items: center; justify-content: center; }
#form-preview .req, .req { color: var(--danger); font-weight: 800; }
#form-preview .trip-note { background: #fff8e6; border-left: 4px solid #e09400; border-radius: 8px; padding: 10px 12px; }
#form-preview .sig-box { border: 2px dashed var(--border); border-radius: 12px; background: #fff; }
.rsvp-item-row { display: grid; grid-template-columns: 1fr 90px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.rsvp-choice { padding: 10px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.rsvp-choice-head { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.rsvp-choice textarea { margin-top: 8px; }
.rsvp-choice-warn { color: #9a5b00; }
.rsvp-choice:has(select[name="choice_type[]"] option[value=text]:checked) textarea { display: none; }
@media (max-width: 560px) { .rsvp-choice-head { grid-template-columns: 1fr 1fr auto; } .rsvp-choice-head input { grid-column: 1 / -1; } }
/* ---- event editor: 4 kinds of event, compact */
.type-pick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.type-pick-4 .type-card { padding: 10px 12px; gap: 8px; border-radius: 12px; }
.type-pick-4 .type-ico { font-size: 1.3rem; }
.type-pick-4 strong { font-size: .95rem; }
.type-pick-4 .small { font-size: .8rem; }
@media (max-width: 960px) { .type-pick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .type-pick-4 { grid-template-columns: 1fr; } }
.signups.is-rsvp .only-meeting, .signups.is-rsvp .only-items { display: none !important; }
.editor.is-noslots .signups.is-meeting .spot-editor, .editor.is-noslots .signups.is-meeting .add-spot > :not(.no-slots), .editor.is-noslots .signups.is-meeting .wizard, .editor.is-noslots .signups.is-meeting .removed-note { opacity: .35; pointer-events: none; }
.no-slots { font-weight: 400; }
.type-card.is-locked { opacity: .55; cursor: not-allowed; }
.card-section.type-section { border-top: 0; padding-top: 0; }

/* Event editor: Remove ▾ (banner picture / background colour / both) */
.rm-menu { position: relative; }
.rm-menu > summary { list-style: none; cursor: pointer; }
.rm-menu > summary::-webkit-details-marker { display: none; }
.rm-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--border, #e4e2ec); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; min-width: 200px; display: flex; flex-direction: column; }
.rm-pop button { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text, #222); }
.rm-pop button:hover { background: #f4f3f8; }
/* an uploaded picture shows once (zoomed out: the colour shows around it, not copies of the picture) */
.cover-picker:not(.cover-pattern), .cover:not(.cover-pattern) { background-repeat: no-repeat; }
@media (max-width: 480px) { .editor-head .row .btn { padding: 8px 11px; font-size: .86rem; } .editor-head h1 { font-size: 1.05rem; } }

/* Event editor: drag / zoom / stretch the banner picture */
.cover-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.cover-adjust label.row { display: inline-flex; flex-wrap: nowrap; align-items: center; }
.cover-adjust input[type=range] { width: 140px; flex: none; padding: 0; }
@media (max-width: 480px) { .cover-adjust input[type=range] { width: 120px; } .cover-adjust label .muted { font-size: .82rem; } }
/* Parent top bar on phones: Dashboard · Archive · Account · Sign out all fit, logo keeps its shape */
.topbar .brand { flex: none; }
.topbar .brand-logo { max-width: none; }
@media (max-width: 480px) { .topbar .brand-logo { height: 30px; } .topnav { gap: 0; } .topnav a, .topnav button { padding: 7px 8px; font-size: .86rem; } .topnav .hide-xs { display: none; } }
/* event editor: banner picture / colour / background picture tools with a caption, and the background picture row */
.cover-tool .cover-tool-cap { position: absolute; left: 0; right: 0; bottom: 2px; font-size: .58rem; font-weight: 700; line-height: 1; text-align: center; color: #333; text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.cover-tools .cover-tool { padding: 0 5px 10px; width: auto; min-width: 64px; }
.bg-row .grow { flex: 1; min-width: 0; }
.bg-row [data-bg-remove] { white-space: nowrap; }
.bg-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border, #e4e2ec); border-radius: 12px; }
.bg-thumb { width: 64px; height: 44px; flex: none; border-radius: 8px; background: #eee center/cover no-repeat; }
