/* Class Ping on the web: a Windows-standard look on the site's tokens (style.css defines --bg,
   --sidebar, --accent ... for every look). A grey sidebar, a white page, 4px corners, posts as
   rows with a hairline between them. Round only: switches, avatars and class dots. */

html { scrollbar-gutter: stable; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 var(--ui); background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
/* Button-like links, nav rows and tiles are never underlined (not even with "Underline every link" on);
   only links inside running text are, and a link row gets one on hover or focus. */
a.ap-btn, a.ap-nav, a.ap-brand, a.ap-file, a.ap-back { text-decoration: none; }
a.ap-btn:hover, a.ap-nav:hover, a.ap-brand:hover, a.ap-file:hover, a.ap-back:hover { text-decoration: none; }

.ap {
  --ap-side: 256px;
  min-height: calc(100vh / var(--zoom, 1));       /* the text-size setting zooms the page (style.css), so viewport units are divided back */
  display: grid;
  grid-template-columns: var(--ap-side) minmax(0, 1fr);
}

/* -- sidebar ----------------------------------------------------------------------------- */
.ap-side {
  position: sticky; top: 0; height: calc(100vh / var(--zoom, 1)); overflow-y: auto;
  background: var(--sidebar); border-right: 1px solid var(--divider);
  padding: 16px 10px 10px; display: flex; flex-direction: column;
}
.ap-brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 0 6px; margin-bottom: 14px;
  color: var(--text); text-decoration: none; font: 600 16px/1 var(--ui); white-space: nowrap;
}
.ap-brand img { border-radius: 4px; display: block; }
.ap-beta { margin-left: 2px; padding: 2px 6px 3px; border: 1px solid var(--edge); border-radius: 3px; color: var(--muted); font: 600 11px/1.25 var(--ui); }
.ap-checkrow { padding: 0 4px 12px; }
.ap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--edge); border-radius: var(--r); background: var(--card); color: var(--text);
  font: 600 13px/1 var(--ui); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ap-btn:hover { background: color-mix(in srgb, var(--text) 7%, var(--card)); color: var(--text); }
.ap-btn.strong { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ap-btn.strong:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.ap-btn.big { height: 34px; width: 100%; font-size: 14px; }
.ap-btn.wide { width: auto; height: 36px; margin-top: 14px; }
.ap-btn:disabled { opacity: 0.6; cursor: default; }

#ap-nav { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-height: 120px; overflow-y: auto; overflow-x: hidden; }
.ap-nav {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 32px; padding: 5px 10px;
  border: 0; border-radius: var(--r); background: transparent;
  color: var(--text); font: 14px/1.2 var(--ui); cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease;
}
.ap-nav span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-nav em { font-style: normal; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ap-nav:hover { background: var(--hover); }
.ap-nav:focus-visible { outline-offset: -2px; }
.ap-nav.on { background: var(--sel); font-weight: 600; }
.ap-nav.on em { color: var(--text); }
.ap-heading { margin: 16px 10px 4px; font: 600 13px/1.2 var(--ui); color: var(--muted); }
.ap-heading:first-child { margin-top: 4px; }
.ap-class i { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-right: 0; }
.ap-side-foot { flex: none; margin-top: 6px; padding-top: 8px; }
#ap-foot { padding: 0 10px 6px; color: var(--muted); font-size: 12.5px; }
#ap-foot p { margin: 0 0 2px; }
.ap-legal { margin: 2px 0 0; padding: 4px 10px 0; font-size: 12px; line-height: 1.2; color: var(--muted); }
.ap-legal a { display: inline-block; padding: 6px 0; color: var(--muted); text-decoration: none; }
.ap-legal a:hover, .ap-legal a:focus-visible { color: var(--text); text-decoration: underline; }
.ap-legal i { font-style: normal; padding: 0 5px; color: var(--faint); }
/* a very short window: the whole sidebar scrolls instead of squeezing the list */
@media (max-height: 420px) { #ap-nav { flex: none; overflow: visible; min-height: 0; } }

/* -- page -------------------------------------------------------------------------------- */
.ap-main { min-width: 0; }
#ap-page { max-width: 944px; margin: 0 auto; padding: 24px 32px 80px; }
.ap-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.ap-head h1 { margin: 0; font: 600 26px/1.2 var(--ui); }
.ap-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ap-tools { display: flex; gap: 10px; align-items: center; margin: 14px 0 12px; flex-wrap: wrap; }
#ap-search {
  flex: 1 1 240px; height: 34px; padding: 0 10px; border: 1px solid var(--edge); border-radius: var(--r);
  background: var(--card); color: var(--text); font: 14px var(--ui);
}
#ap-search::placeholder { color: var(--faint); }
#ap-range, .ap-pick, .ap-move select {
  height: 34px; padding: 0 8px; border: 1px solid var(--edge); border-radius: var(--r);
  background-color: var(--card); color: var(--text); font: 14px var(--ui); cursor: pointer; max-width: 100%; min-width: 0;
}
.ap-pick, .ap-move select { height: 32px; font-size: 13px; }
.ap-pick:disabled { color: var(--faint); cursor: default; }
.ap-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; color: var(--muted); cursor: pointer; font-size: 14px; user-select: none; }
.ap-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ap-switch span { width: 34px; height: 20px; border-radius: 10px; background: var(--card); border: 1px solid var(--edge); position: relative; }
.ap-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 0.15s ease; }
.ap-switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.ap-switch input:checked + span::after { transform: translateX(14px); background: var(--accent-text); }
.ap-switch input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }

/* a note across the top of the list: one flat strip, a hairline and nothing inside it */
.ap-note-bar {
  display: flex; gap: 8px 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--divider); border-radius: var(--r);
  background: var(--sidebar); color: var(--muted); font-size: 14px;
}
.ap-note-bar.warn { border-color: var(--due); color: var(--text); }

/* the one-time question about old work */
.ap-ask {
  display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--divider); border-radius: var(--r); background: var(--sidebar);
  font-size: 14px;
}
.ap-ask .ap-asktext { flex: 1 1 320px; min-width: 0; color: var(--muted); }
.ap-ask b { font-weight: 600; color: var(--text); }
.ap-askrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; max-width: 100%; }

/* -- posts: a row each, a hairline between ------------------------------------------------- */
.ap-listing { display: flex; flex-direction: column; margin-top: 4px; }
.ap-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: start;
  padding: 14px 0;
}
.ap-card + .ap-card { border-top: 1px solid var(--divider); }
.ap-card.done h3 { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.ap-text { min-width: 0; }
.ap-card h3 { margin: 0; font: 600 16px/1.35 var(--ui); overflow-wrap: anywhere; }
.ap-new { display: inline-block; margin-left: 6px; padding: 2px 6px 3px; border: 1px solid var(--text); border-radius: 3px; font: 600 11px/1.25 var(--ui); vertical-align: 2px; }
.ap-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ap-meta { margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 13.5px; }
.ap-meta > div { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; margin-left: -16px; }
.ap-meta > div > span { position: relative; display: inline-flex; align-items: center; gap: 6px; padding-left: 16px; }
.ap-meta > div > span::before { content: "\B7"; position: absolute; left: 5px; color: var(--faint); }
.ap-meta b { color: var(--text); font-weight: 600; }
/* "Deleted by teacher": a post Classroom no longer has, in the late colour (6:1 or more on every look) */
.ap-meta .ap-gone { color: var(--warn); font-weight: 600; }
.ap-due { margin: 4px 0 0; color: var(--due); font-weight: 600; font-size: 13.5px; }
.ap-due.late { color: var(--warn); }
.ap-body { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.ap-body.clamp { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.ap-more { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--link); font: 13.5px var(--ui); cursor: pointer; }
.ap-more:hover { text-decoration: underline; }
.ap-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ap-file {
  display: flex; align-items: center; gap: 10px; width: 260px; max-width: 100%; padding: 6px 10px 6px 6px;
  border: 1px solid var(--divider); border-radius: var(--r); background: var(--sidebar); color: var(--text); text-decoration: none;
}
a.ap-file:hover { border-color: var(--edge); color: var(--text); }
.ap-thumb {
  position: relative; flex: none; width: 64px; height: 44px; border-radius: 3px; overflow: hidden; display: grid; place-items: center;
  background: var(--raised); color: var(--muted);
}
.ap-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-thumb b { font: 600 11px/1 var(--ui); }
.ap-ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-fname { font-size: 13.5px; line-height: 1.3; overflow: hidden; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ap-fkind { font: 600 11px/1 var(--ui); color: var(--muted); }

.ap-empty { padding: 36px 0; color: var(--muted); }
.ap-empty h2 { margin: 0 0 6px; font: 600 18px var(--ui); color: var(--text); }
.ap-empty p { margin: 0; }

/* -- welcome ----------------------------------------------------------------------------- */
.ap.welcome-mode { grid-template-columns: minmax(0, 1fr); }
.ap.welcome-mode .ap-side, .ap.welcome-mode .ap-bar { display: none; }
.ap-welcome { min-height: calc(90vh / var(--zoom, 1)); display: flex; align-items: center; justify-content: center; }
.ap-wcard { width: 100%; max-width: 480px; }
.ap-wcard img { display: block; margin-bottom: 16px; }
.ap-wcard h1 { margin: 0 0 8px; font: 600 28px/1.2 var(--ui); }
.ap-wcard .lead { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.ap-wcard ul { margin: 0 0 20px; padding: 0 0 0 20px; }
.ap-wcard li { padding: 2px 0; color: var(--text); font-size: 14.5px; margin: 0; }
.ap-wcard .small, .ap-set .small { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.ap-wcard .small.beta-note { margin: 0 0 16px; }
.ap-warn-text { color: var(--warn); font-size: 14px; margin: 10px 0; }
.ap-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 40px; padding: 0 14px;
  border: 1px solid #747775; border-radius: var(--r); background: #fff; color: #1f1f1f;
  font: 500 14px/1 Roboto, var(--ui); cursor: pointer;
}
.ap-google svg { width: 18px; height: 18px; flex: none; }
.ap-google:hover { background: #F0F1F1; }
.ap-google:disabled { opacity: 0.6; cursor: default; background: #fff; }

/* -- settings ---------------------------------------------------------------------------- */
.ap-settings { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.ap-set { border: 1px solid var(--divider); border-radius: var(--r); padding: 16px 18px; }
.ap-set h2 { margin: 0 0 4px; font: 600 18px var(--ui); }
.ap-set > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ap-row b { display: block; font-weight: 600; }
.ap-row small { display: block; color: var(--muted); font-size: 13px; }
.ap-rowbtns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; max-width: 100%; }
.ap-row.gap { margin-top: 16px; }
.ap-linkrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.ap-linkrow a { display: inline-block; padding: 4px 0; text-decoration: none; }
.ap-linkrow a:hover, .ap-linkrow a:focus-visible { text-decoration: underline; }
.ap-wcard .ap-linkrow { margin-top: 4px; }
.ap-linkrow i { font-style: normal; color: var(--faint); }
/* the notify and remove-deleted checkboxes are the same switch as "Show done" */
#ap-notify, #ap-remove-deleted, [data-mute] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: 10px; background: var(--card); border: 1px solid var(--edge); cursor: pointer; }
#ap-notify::after, #ap-remove-deleted::after, [data-mute]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 0.15s ease; }
#ap-notify:checked, #ap-remove-deleted:checked, [data-mute]:checked { background: var(--accent); border-color: var(--accent); }
#ap-notify:checked::after, #ap-remove-deleted:checked::after, [data-mute]:checked::after { transform: translateX(14px); background: var(--accent-text); }
#ap-notify:disabled { opacity: 0.5; cursor: default; }
label.ap-row:has(#ap-notify:not(:disabled)), label.ap-row:has(#ap-remove-deleted), label.ap-row:has([data-mute]) { cursor: pointer; }
.ap-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
.ap-choice { position: relative; display: block; padding: 8px; border: 2px solid var(--divider); border-radius: var(--r); cursor: pointer; }
.ap-choice:hover { border-color: var(--edge); }
.ap-choice input { position: absolute; opacity: 0; }
.ap-choice b { display: block; font-weight: 400; font-size: 13.5px; }
.ap-choice:has(input:checked) { border-color: var(--accent); }
.ap-choice:has(input:checked) b { font-weight: 600; }
.ap-choice:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }

/* -- toasts ------------------------------------------------------------------------------ */
#ap-toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(360px, calc((100vw - 32px) / var(--zoom, 1))); }
.ap-toast { padding: 10px 14px; border: 1px solid var(--edge); border-radius: var(--r-pop); background: var(--card); color: var(--text); font-size: 14px; }

/* -- phone and narrow windows ------------------------------------------------------------- */
.ap-bar { display: none; }
#ap-scrim { display: none; }
@media (max-width: 860px) {
  .ap { grid-template-columns: minmax(0, 1fr); }
  .ap-bar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px;
    background: var(--sidebar); border-bottom: 1px solid var(--divider);
  }
  .ap-bar .ap-brand { margin: 0; font-size: 16px; }
  /* closed: off screen and hidden, so the keyboard cannot tab into it */
  .ap-side {
    position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: min(290px, calc(86vw / var(--zoom, 1))); z-index: 50;
    transform: translateX(-102%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  .ap-side .ap-brand { margin-top: 2px; }
  .ap.drawer-open .ap-side { transform: none; visibility: visible; transition: transform 0.2s ease; }
  #ap-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.5); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
  .ap.drawer-open #ap-scrim { opacity: 1; visibility: visible; transition: opacity 0.2s ease; }
  #ap-page { padding: 16px 16px 70px; }
  .ap-head h1 { font-size: 24px; }
  .ap-card { grid-template-columns: minmax(0, 1fr); }
  .ap-acts { justify-content: flex-start; }
  /* finger-sized targets */
  .ap-btn, .ap-btn.big, .ap-btn.wide { height: 44px; }
  #ap-search, #ap-range, .ap-pick, .ap-move select { height: 44px; font-size: 16px; }
  .ap-nav { min-height: 44px; }
  .ap-more { min-height: 44px; padding: 0 4px 0 0; }
  .ap-link { min-height: 44px; }
  .ap-google { height: 44px; }
  .ap-agree { padding: 11px 0; margin-bottom: 3px; }
  .ap-switch { min-height: 44px; }
  .ap-back { min-height: 44px; }
  .ap-brand { min-height: 44px; }
  .ap-legal a, .ap-linkrow a { min-height: 44px; display: inline-flex; align-items: center; }
  /* on a phone the whole drawer scrolls (the rows are tall), with the footer after the list */
  #ap-nav { flex: none; overflow: visible; min-height: 0; }
  .ap-side-foot { margin-top: auto; }
}

/* -- teacher pictures: initials, with the photo laid over them when Google gives one ----------- */
.ap-ava {
  position: relative; flex: none; align-self: center; width: 22px; height: 22px; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; background: var(--raised); color: #fff;
  font: 600 10px/1 var(--ui); letter-spacing: 0;
}
.ap-ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ap-agree { display: flex; gap: 10px; align-items: flex-start; max-width: 440px; margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.ap-agree input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.ap-agree a { color: var(--link); }
.ap-link:disabled, .ap-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ap-link { display: block; margin: 10px 0 0; padding: 4px 0; border: 0; background: none; color: var(--link); font: 14px var(--ui); cursor: pointer; }
.ap-link:hover { text-decoration: underline; }
.ap-wcard .ap-btn.wide { width: 100%; height: 40px; margin-top: 10px; }

/* A way back to the site from the welcome screen, which hides the sidebar. */
.ap-back {
  position: fixed; top: 16px; left: 20px; z-index: 5; display: inline-flex; align-items: center; height: 34px; padding: 0 12px;
  border: 1px solid var(--edge); border-radius: var(--r); background: var(--card); color: var(--text);
  font: 14px/1 var(--ui); text-decoration: none;
}
.ap-back:hover { background: color-mix(in srgb, var(--text) 7%, var(--card)); }


/* -- motion: short, opacity and transform only (the one exception is a row closing up after it is ticked off) -- */
@keyframes ap-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ap-pop { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1); } }
@keyframes ap-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* rows rise in when a list is opened (not on every repaint), a few at a time */
.ap-listing.enter .ap-card, .ap-listing.enter .ap-empty { animation: ap-rise 0.2s ease backwards; animation-delay: calc(var(--i, 0) * 30ms); }
.ap-wcard.enter, .ap-settings.enter .ap-set { animation: ap-rise 0.22s ease backwards; }
.ap-settings.enter .ap-set:nth-child(2) { animation-delay: 30ms; } .ap-settings.enter .ap-set:nth-child(3) { animation-delay: 60ms; }
.ap-settings.enter .ap-set:nth-child(4) { animation-delay: 90ms; } .ap-settings.enter .ap-set:nth-child(5) { animation-delay: 120ms; }
.ap-toast { animation: ap-rise 0.2s ease backwards; transition: opacity 0.25s ease; }
.ap-toast.out { opacity: 0; }

/* ticking a post off: the check pops, the row fades and slides a little, then the list closes up */
.ap-card.ticking { position: relative; overflow: hidden; opacity: 0; transition: opacity 0.12s ease 0.06s, transform 0.2s ease, height 0.2s ease 0.02s, padding 0.2s ease 0.02s; transform: translateX(10px); height: 0 !important; padding-top: 0; padding-bottom: 0; border-width: 0; pointer-events: none; }
.ap-card.ticking::after {
  content: "\2713"; position: absolute; right: 4px; top: 14px; width: 26px; height: 26px; border-radius: 4px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font: 700 15px/1 var(--ui);
  animation: ap-pop 0.18s ease both;
}
.ap-card.popped .ap-btn { animation: ap-pop 0.2s ease both; }

/* a plain progress line while Classroom is being read: one bar slides along the top (transform only) */
.ap::before { content: ""; position: fixed; top: 0; left: 0; width: 38%; height: 2px; z-index: 70; background: var(--accent); opacity: 0; transform: translateX(-100%); pointer-events: none; }
.ap.busy::before { opacity: 1; animation: ap-run 1.3s ease-in-out infinite; }

/* theme change: colours ease over (the class is only there for a moment when the look is changed) */
html.theme-fade, html.theme-fade * { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ap.busy::before { transform: none; width: 100%; opacity: 0.55; }
}

/* narrow screens: the way back sits above the card instead of floating over it */
@media (max-width: 860px) {
  .ap-back { position: static; margin: 0 0 14px; }
  .ap-wcard .ap-btn.wide { height: 44px; }
  .ap-welcome { min-height: 0; padding-bottom: 24px; display: block; }
}

/* waiting work: a small card under the sections, one row per to-do */
.ap-wait { margin: 12px 0 2px; padding: 5px 4px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--card); font-size: 13px; line-height: 1.35; }
.ap-wait-head { display: flex; align-items: center; gap: 8px; padding: 0 0 2px 8px; }
.ap-wait-head svg { flex: none; color: var(--due); }
.ap-wait-head strong { flex: 1; color: var(--text); font-weight: 600; font-size: 14px; }
.ap-wait-row { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 3px; background: none;
  font: 14px var(--ui); color: var(--muted); text-align: left; cursor: pointer; }
.ap-wait-row span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap-wait-row em { flex: none; font-style: normal; font-size: 13px; color: var(--due); }
.ap-wait-row:hover { background: color-mix(in srgb, var(--text) 7%, var(--card)); color: var(--text); }
.ap-wait-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ap-later { height: 26px; padding: 0 8px; background: none; border: 0; border-radius: var(--r); font: 600 12.5px/1 var(--ui); color: var(--faint); cursor: pointer; }
.ap-later:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, var(--card)); }
.ap-later:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a post the waiting card pointed to, lit up for a moment */
.ap-card.ap-lit { background: color-mix(in srgb, var(--due) 12%, transparent); transition: background-color 0.4s ease; }

/* Settings: Save and Reset to defaults, kept at the foot of the window while you scroll */
.ap-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; margin-top: 24px; padding: 12px 0 14px;
  border-top: 1px solid var(--divider); background: var(--bg); }
.ap-savebar p { flex: 1; margin: 0; color: var(--muted); font-size: 13.5px; }
.ap-savebar p.ok { color: var(--ok, var(--accent)); }
.ap-savebar .ap-btn[disabled] { opacity: 0.45; cursor: default; }

/* Leaving Settings with changes not saved */
.ap-saveask { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(0 0 0 / 0.45); }
.ap-saveask-card { width: min(440px, 100%); padding: 20px 22px 18px; border: 1px solid var(--edge); border-radius: 8px; background: var(--card); color: var(--text); }
.ap-saveask-card h2 { margin: 0; font: 600 19px/1.3 var(--ui); }
.ap-saveask-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ap-saveask-actions { display: flex; gap: 8px; margin-top: 18px; }
.ap-saveask-actions [data-ask="keep"] { margin-right: auto; }

/* -- Grades: the calculator for marks you type in -------------------------------------- */
.ap-grades .ap-gpick { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; margin-bottom: 16px; }
.ap-grades label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.ap-grades .ap-gpick small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.ap-gsheet { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ap-gname input, .ap-gfield {
  height: 32px; padding: 0 8px; border: 1px solid var(--edge); border-radius: var(--r);
  background: var(--card); color: var(--text); font: 14px var(--ui); min-width: 0; box-sizing: border-box;
}
.ap-gname input { width: 150px; }
.ap-gfield::placeholder { color: var(--faint); }
.ap-gfield.num { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
.ap-gwrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ap-gtable { width: 100%; border-collapse: collapse; }
.ap-gtable th { text-align: left; font: 13px var(--ui); color: var(--muted); padding: 0 8px 4px 0; white-space: nowrap; }
.ap-gtable td { padding: 3px 8px 3px 0; vertical-align: middle; font-size: 14px; }
.ap-gtable td:first-child .ap-gfield { width: 100%; min-width: 120px; }
.ap-gtable .pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-gtable td[data-cell^="grade"] { min-width: 96px; }
.ap-gtable .world { color: var(--muted); min-width: 96px; }
.ap-gtable .warn { color: var(--warn); }
.ap-gx { width: 30px; height: 30px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; }
.ap-gx:hover { background: var(--hover); }
.ap-gadd { margin-top: 10px; display: flex; gap: 8px; }
.ap-gresult { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--divider); }
.ap-gtotal { margin: 0; font: 600 16px/1.4 var(--ui); }
.ap-gresult .small { margin-top: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* A phone: each subject is a small block (name and remove, then marks, then the grades),
   so nothing hides off the right edge. */
@media (max-width: 600px) {
  .ap-gtable thead { display: none; }
  .ap-gtable, .ap-gtable tbody { display: block; }
  .ap-gtable tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
  .ap-gtable td { padding: 0; min-width: 0 !important; }
  .ap-gtable td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .ap-gtable td:nth-child(7) { grid-column: 3; grid-row: 1; justify-self: end; }
  .ap-gtable td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .ap-gtable td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .ap-gtable td:nth-child(4) { grid-column: 3; grid-row: 2; align-self: end; padding-bottom: 6px; }
  .ap-gtable td:nth-child(5) { grid-column: 1 / 3; grid-row: 3; }
  .ap-gtable td:nth-child(6) { grid-column: 3; grid-row: 3; }
  .ap-gtable td:nth-child(5):empty, .ap-gtable td:nth-child(6):empty { display: none; }
  .ap-gtable .ap-gfield.num { width: 100%; }
  .ap-gtable td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
  .ap-gtable td[data-label=""]::before { display: none; }
}

/* A muted class: the crossed-out bell in the sidebar, and its switch in Settings. */
.ap-quiet { display: inline-flex; align-items: center; margin-left: auto; padding-right: 6px; color: var(--faint); font-weight: 400; }
.ap-quiet + em { margin-left: 0; }
.ap-muterow { padding: 6px 0 6px 14px; }
.ap-muterow span { font-size: 14px; }
.ap-mutehead { margin-top: 14px; }
