/* Student cards — the approved Booki library palette, without folder tabs.
   Presentation only. Existing ids, identity checks, roster events and data stay intact.
   Personal slot colours stay on the avatar tile; they are NOT reading-format dots.
   Scoped ID selectors deliberately outrank the late-loaded slot theme's !important rules. */
:is(#screen-who-reads, #screen-club-students, #screen-create-members) {
  background: #faf7ec;
  color: #244b3d;
  font-family: Arial, sans-serif;
}
:is(#screen-who-reads, #screen-club-students, #screen-create-members) .screen-header {
  box-sizing: border-box;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 24px 16px;
  background: #faf7ec;
  border-bottom: 1px solid #dce3d5;
  box-shadow: none;
}
:is(#screen-who-reads, #screen-club-students, #screen-create-members) .header-row {
  gap: 14px;
  flex-wrap: wrap;
}
:is(#screen-who-reads, #screen-club-students, #screen-create-members) .screen-header h2 {
  color: #244b3d;
  font: 700 clamp(23px, 4vw, 32px)/1.45 Arial, sans-serif;
  overflow-wrap: anywhere;
}
:is(#screen-who-reads, #screen-club-students, #screen-create-members) .btn-back {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #c8d5c9;
  border-radius: 30px;
  background: #fffef9;
  color: #285540;
  font: 700 15px/1.4 Arial, sans-serif;
}
:is(#screen-who-reads, #screen-club-students) .who-reads-club {
  color: #526b59;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#screen-who-reads #who-reads-grid,
#screen-club-students #club-students-grid {
  box-sizing: border-box;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 24px 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
:is(#who-reads-grid, #club-students-grid) > :not(.profile-card) { grid-column: 1 / -1; }
#screen-who-reads #who-reads-grid > .profile-card,
#screen-club-students #club-students-grid > .profile-card {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
  min-height: 186px !important;
  margin: 0;
  padding: 22px 14px 20px;
  border: 1px solid #d6ddcd !important;
  border-radius: 24px;
  background: #fffef9 !important;
  color: #244b3d !important;
  box-shadow: 0 5px 0 #ede9db, 0 10px 22px #2b493508 !important;
  font-family: Arial, sans-serif;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card::before,
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card::after {
  content: none;
  display: none;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card[hidden] {
  display: none !important;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card .profile-avatar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  max-width: 100%;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 24px;
  background: var(--booki-slot-a, #f4f2e9);
  box-shadow: inset 0 -3px 0 var(--booki-slot-b, #d6ddcd);
  font-size: 46px;
  line-height: 1;
  object-fit: contain;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card .profile-name {
  max-width: 100%;
  margin: 0;
  color: #244b3d;
  font: 700 22px/1.5 Arial, sans-serif;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card .profile-pts {
  color: #526b59;
  background: #f4f2e9;
  font: 14px/1.5 Arial, sans-serif;
}
:is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card.booki-open-slot-card {
  border: 2px dashed #aabca8 !important;
}
#screen-who-reads #who-reads-grid > .profile-card:focus-visible {
  outline: 3px solid #245d8f;
  outline-offset: 4px;
}
@media (hover: hover) {
  #screen-who-reads #who-reads-grid > .profile-card:not(:disabled):hover {
    transform: translateY(-3px) !important;
    border-color: #7caa8e !important;
    box-shadow: 0 5px 0 #e4e3d5, 0 13px 25px #2b493514 !important;
  }
}
/* The teacher's roster preview is intentionally not an identity-selection control. */
#screen-club-students #club-students-grid[data-roster-managed] > .profile-card {
  cursor: default;
  transform: none !important;
}
#screen-who-reads .who-reads-footer {
  box-sizing: border-box;
  max-width: 980px;
  margin: auto;
  padding: 18px 24px 4px;
}
/* The native search region now precedes the cards in the document. */
#screen-who-reads .who-reads-footer:empty { display: none; }
#screen-who-reads .who-reads-search-label { color: #244b3d; font: 700 17px/1.5 Arial, sans-serif; }
#screen-who-reads .who-reads-search {
  box-sizing: border-box;
  border: 1px solid #b8cbbb;
  border-radius: 18px;
  background: #fffef9;
  color: #244b3d;
  font: 18px/1.5 Arial, sans-serif;
}
#screen-who-reads #booki-open-slots-intro {
  box-sizing: border-box;
  max-width: 932px;
  margin: 20px auto 0;
  padding: 18px 20px;
  border: 1px solid #d6ddcd;
  border-radius: 24px;
  background: #fffef9;
  color: #526b59;
  font: 16px/1.65 Arial, sans-serif;
}
/* Confirmation keeps the same title, yes/no buttons and focus behaviour. */
#reader-confirm-overlay { background: #183c3266; padding: 18px; font-family: Arial, sans-serif; }
#reader-confirm-overlay .reader-confirm-card {
  box-sizing: border-box;
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: #fffef9;
  border: 1px solid #d6ddcd;
  border-radius: 24px;
  box-shadow: 0 12px 40px #18392d26;
}
#reader-confirm-overlay .reader-confirm-avatar { background: #f4f2e9; border-radius: 24px; }
#reader-confirm-overlay h2 { color: #244b3d; font: 700 clamp(24px, 5vw, 30px)/1.5 Arial, sans-serif; overflow-wrap: anywhere; }
#reader-confirm-overlay p { color: #526b59; font-weight: 400; }
#reader-confirm-overlay .reader-confirm-yes {
  background: #28664d;
  border: 1px solid #28664d;
  border-radius: 30px;
  box-shadow: none;
  font: 700 18px/1.5 Arial, sans-serif;
}
#reader-confirm-overlay .reader-confirm-no {
  background: #fffef9;
  color: #285540;
  border: 1px solid #c8d5c9;
  border-radius: 30px;
  font: 700 17px/1.5 Arial, sans-serif;
}
#reader-confirm-overlay button:focus-visible { outline: 3px solid #245d8f; outline-offset: 3px; }
/* Both new-class setup and existing-class card creation use this same native editor. */
#screen-create-members #booki-roster-setup,
#screen-club-students #booki-roster-existing {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: 932px;
  margin: 24px auto 6px;
  padding: 24px;
  border: 1px solid #d6ddcd;
  border-radius: 24px;
  background: #fffef9;
  color: #244b3d;
  box-shadow: 0 5px 0 #ede9db, 0 10px 22px #2b493508;
  font-family: Arial, sans-serif;
}
:is(#booki-roster-setup, #booki-roster-existing) .br-photo-pick {
  background: #f4f2e9;
  border: 1px solid #d6ddcd;
  border-radius: 24px;
  box-shadow: none;
}
:is(#booki-roster-setup, #booki-roster-existing) .br-photo-pick:hover { background: #edf1e5; }
:is(#booki-roster-setup, #booki-roster-existing) .br-photo-icon { background: #fffef9; border-radius: 20px; }
:is(#booki-roster-setup, #booki-roster-existing) .br-name-row {
  border-color: #d6ddcd;
  border-radius: 16px;
}
:is(#booki-roster-setup, #booki-roster-existing) .br-name-number { color: #526b59; }
:is(#booki-roster-setup, #booki-roster-existing) .br-save {
  background: #28664d;
  border-radius: 30px;
  border: 1px solid #28664d;
  box-shadow: none;
}
@media (max-width: 600px) {
  :is(#screen-who-reads, #screen-club-students, #screen-create-members) .screen-header { padding: 18px 16px 12px; }
  #screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; padding: 22px 16px 26px;
  }
  :is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card {
    min-height: 166px !important; padding: 18px 10px 16px; gap: 12px;
  }
  :is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card .profile-avatar {
    flex-basis: 66px; width: 66px; height: 66px; border-radius: 20px; font-size: 40px;
  }
  :is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card .profile-name { font-size: 20px; }
  #screen-who-reads #booki-open-slots-intro { margin: 16px 16px 0; padding: 16px; }
  #screen-create-members #booki-roster-setup, #screen-club-students #booki-roster-existing {
    width: calc(100% - 32px); margin-top: 20px; padding: 18px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(#screen-who-reads #who-reads-grid, #screen-club-students #club-students-grid) > .profile-card { transition: none; }
  #screen-who-reads #who-reads-grid > .profile-card:hover { transform: none !important; }
}
