/* Shared interaction states; workspace controls retain their compact sizing. */
:where(button, a, summary, input, select, textarea):focus-visible {
  outline: 3px solid #ad781c;
  outline-offset: 4px;
}
:where(button, summary, a) { -webkit-tap-highlight-color: transparent; }
:where(button, summary) { touch-action: manipulation; }
:where(button):disabled { cursor: not-allowed; }
:where(main a:not([class])) {
  color: #285c3e;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: #8aa88d;
}
:where(main a:not([class])):hover { color: #183f2a; text-decoration-thickness: 2px; }
.site-header > nav a { min-height: 44px; display: inline-flex; align-items: center; }
.site-header > nav a:hover { color: #285c3e; }
.personal-links a[aria-current="page"] { background: #e8f0dc; font-weight: 700; }
.personal-links a:active { background: #dce8cd; }
a.primary { text-decoration: none; }
a.primary:hover, button.primary:not(:disabled):hover { background: #234f38; color: #fff; }
a.primary:active, button.primary:not(:disabled):active { background: #193e2a; }
.family-page form { gap: 18px; }
.family-page form > button { justify-self: start; }
.family-page input, .family-page select { background: #fff; color: #213e34; min-height: 46px; }
.family-page :is(button, a.primary, .button-link) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  margin: 0;
  border: 1px solid #b7cab7;
  border-radius: 11px;
  background: #fff;
  color: #284f38;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.family-page :is(button, .button-link):not(:disabled):hover { background: #e8f1e4; border-color: #729477; }
.family-page :is(button, .button-link):not(:disabled):active { background: #dcead8; }
.family-page :is(button.primary, a.primary) { background: #2d6547; border-color: #2d6547; color: #fff; }
.family-page :is(button.primary, a.primary):not(:disabled):hover { background: #234f38; border-color: #234f38; color: #fff; }
.family-page :is(button.primary, a.primary):not(:disabled):active { background: #193e2a; }
.family-page button:disabled { opacity: 1; background: #e6ebe3; color: #667363; border-color: #d5ded0; cursor: not-allowed; box-shadow: none; }
.family-page button.danger-button { color: #923a30; border-color: #d6b7ae; background: #fff8f5; }
.family-page button.danger-button:not(:disabled):hover { color: #7b2f26; background: #f7e5df; border-color: #b87e6e; }
.family-page .family-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.family-page .family-actions > .start { margin: 0; }
.family-page a:not(.primary):not(.button-link) { color: #285c3e; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #8aa88d; line-height: 1.7; }
.family-page a:not(.primary):not(.button-link):hover { color: #183f2a; text-decoration-thickness: 2px; }
.family-page .exam-problems { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.family-page .exam-problems button { justify-content: flex-start; min-width: 180px; flex: 1 1 220px; }
.family-page .exam-problems button[aria-pressed="true"] { color: #234d32; background: #dcebd4; border-color: #66865b; box-shadow: inset 0 0 0 1px #66865b; }
.family-page .exam-session-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.family-page [role="timer"] { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid #d1dec8; font-variant-numeric: tabular-nums; }
.family-page details > summary { min-height: 44px; padding: 12px 4px; color: #31583a; cursor: pointer; font-weight: 600; }
.family-page details > summary:hover { color: #183f2a; }
.family-page details > form { margin: 16px 0; }
.family-page .auth-toggle { margin-top: 18px; }
.family-page .save-help { color: #576d50; font-size: 14px; }
.family-page .save-help a { display: inline-block; padding: 6px 0; }
@media (max-width: 760px) {
  .site-header > nav { gap: clamp(14px, 4vw, 28px); overflow-x: auto; }
  .family-page .parent-overview, .family-page .parent-cards { grid-template-columns: minmax(0, 1fr); }
  .family-page .family-actions > :is(button, a.primary, .button-link) { flex: 1 1 160px; }
  .family-page form > button { justify-self: stretch; }
  .family-page .exam-problems button { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .family-page :is(button, a.primary, .button-link) { transition: none; }
}

/* Compact grade selector with a consistent popover on desktop and mobile. */
.grade-picker { position: relative; width: 280px; max-width: 100%; margin-bottom: 22px; }
.grade-label { display: block; margin-bottom: 9px; color: #60745e; font-size: 12px; font-weight: 700; letter-spacing: .4px; }
.family-page button.grade-trigger { width: 100%; justify-content: flex-start; padding: 12px 14px; gap: 12px; border: 1px solid #c3d4bc; background: #fff; border-radius: 14px; box-shadow: 0 2px 5px #213e3405; text-align: left; }
.grade-number { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 10px; background: #edf4e6; color: #315f3d; font-size: 21px; font-weight: 750; }
.grade-caption { display: flex; flex-direction: column; gap: 3px; }
.grade-caption strong { font-size: 15px; line-height: 1.3; }
.grade-caption small { color: #72806c; font-size: 11px; font-weight: 400; }
.grade-chevron { margin-left: auto; flex-shrink: 0; color: #6f8467; transition: transform .15s; }
.grade-trigger[aria-expanded=true] .grade-chevron { transform: rotate(180deg); }
.family-page button.grade-trigger[aria-expanded=true] { border-color: #6a8b5e; box-shadow: 0 0 0 3px #dce9d4; background: #fff; }
.grade-popover { position: absolute; top: calc(100% + 8px); left: 0; width: 310px; max-width: calc(100vw - 86px); z-index: 40; background: #fff; border: 1px solid #d7e2cf; border-radius: 16px; padding: 16px; box-shadow: 0 14px 36px #213e3424; }
.grade-popover-title { display: block; font-size: 12px; font-weight: 700; color: #63755a; margin: 0 0 12px; }
.grade-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.grade-grid [role=option] { min-height: 42px; padding: 10px 8px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #e2e9dc; border-radius: 9px; color: #4b6345; font-size: 13px; cursor: pointer; white-space: nowrap; }
.grade-grid [role=option][data-highlighted=true] { background: #f0f5e9; border-color: #99b18a; }
.grade-grid [role=option][aria-selected=true] { background: #2d6547; color: #fff; border-color: #2d6547; font-weight: 700; }
.family-page .grade-popover p { font-size: 10px; line-height: 1.8; color: #7b8873; margin: 12px 0 0; border-top: 1px solid #ecf0e6; padding-top: 10px; }
.family-page button.grade-trigger:disabled { background: #f1f4ec; box-shadow: none; }
@media(prefers-reduced-motion:reduce) { .grade-chevron { transition:none; } }

/* Inline Python is distinct from prose; full code blocks keep their own style. */
.python-inline,
.study-article :not(pre) > code {
  display: inline;
  padding: .12em .38em;
  border: 1px solid #d5e0ee;
  border-radius: 5px;
  background: #edf2fa;
  color: #3d4b97;
  font-family: Consolas, 'SFMono-Regular', monospace;
  font-size: .91em;
  font-weight: 700;
  line-height: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  overflow-wrap: anywhere;
}
