/* Calm Account and Class menus, and the Classroom Tools grid (December 2026 menu update).
   Loads after classroom-theme.css. Light colours first, then Alpine Night (dark), then phones. */

/* ---- Shared: views, drill rows, Back header ---------------------------------------------------- */
.signed-in-dashboard .cc-menu .cc-view[hidden],
.signed-in-dashboard .cc-menu .cc-parking { display: none !important; }
.signed-in-dashboard .cc-menu .cc-view { display: grid; gap: 4px; align-content: start; }
.signed-in-dashboard .cc-menu .cc-view-body { display: grid; gap: 2px; }
.signed-in-dashboard .cc-menu .cc-view > *,
.signed-in-dashboard .cc-menu .cc-view-body > * { margin-block: 0; }

.signed-in-dashboard .cc-menu .cc-drill {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  padding: 7px 8px;
  color: #10284a;
}
.signed-in-dashboard .cc-menu .cc-drill[hidden] { display: none; }
.cc-drill-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: #7c3aed;
}
.cc-drill-icon svg { width: 20px; height: 20px; }
.cc-drill-icon[data-icon="security"] { background: #15803d; }
.cc-drill-icon[data-icon="prefs"] { background: #d97706; }
.cc-drill-icon[data-icon="more"] { color: #3f5574; background: #e9eef5; }
.cc-drill-copy { display: grid; gap: 2px; min-width: 0; text-align: start; }
.cc-drill-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.cc-drill-title strong { font-size: .95rem; font-weight: 750; line-height: 1.2; }
.cc-drill-copy small {
  overflow: hidden;
  font-size: .78rem;
  font-weight: 550;
  line-height: 1.25;
  color: #52667f;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cc-chevron { display: grid; place-items: center; color: #6a7f9b; }
.cc-chevron svg { width: 18px; height: 18px; }
[dir="rtl"] :is(.cc-chevron, .cc-back) svg { transform: scaleX(-1); }

.cc-pill,
.signed-in-dashboard #teacherMenuPanel .account-identity #ownerMenuStatus {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}
.cc-pill[hidden] { display: none; }
.cc-pill[data-tone="good"],
.signed-in-dashboard #teacherMenuPanel .account-identity #ownerMenuStatus { color: #146c3a; background: #dcf7e6; border-color: #b6e8c9; }
.cc-pill[data-tone="warn"] { color: #9a3412; background: #fff1e6; border-color: #fbd0ac; }

.signed-in-dashboard .cc-menu .cc-view-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-block-end: 4px;
  padding-block-end: 6px;
  border-block-end: 1px solid #e0e8f3;
}
.signed-in-dashboard .cc-menu .cc-view-head .cc-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  min-height: 34px;
  padding: 5px 9px 5px 6px;
  color: #1d4fa3;
  font-weight: 800;
  font-size: .88rem;
}
.cc-back svg { width: 18px; height: 18px; }
.cc-view-title { overflow: hidden; color: #10284a; font-size: .95rem; white-space: nowrap; text-overflow: ellipsis; }

.cc-section {
  margin: 6px 0 0;
  padding: 4px 8px 2px;
  color: #4d6685;
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.cc-section.cc-danger { margin-block-start: 6px; padding-block-start: 9px; border-block-start: 1px solid #e0e8f3; color: #a3263b; }

@media (prefers-reduced-motion: no-preference) {
  .cc-menu .cc-view.cc-enter-forward { animation: cc-enter-forward .2s cubic-bezier(.22, 1, .36, 1); }
  .cc-menu .cc-view.cc-enter-back { animation: cc-enter-back .2s cubic-bezier(.22, 1, .36, 1); }
  [dir="rtl"] .cc-menu .cc-view.cc-enter-forward { animation-name: cc-enter-back; }
  [dir="rtl"] .cc-menu .cc-view.cc-enter-back { animation-name: cc-enter-forward; }
}
@keyframes cc-enter-forward { from { opacity: 0; transform: translateX(18px); } }
@keyframes cc-enter-back { from { opacity: 0; transform: translateX(-18px); } }

/* ---- Account menu ------------------------------------------------------------------------------ */
.signed-in-dashboard #teacherMenuPanel.cc-menu {
  width: min(360px, calc(100vw - 24px));
  /* --cc-room is the space below the menu's top edge, measured when it opens. */
  max-height: min(calc(100dvh - 80px), var(--cc-room, 100dvh));
  padding: 10px;
}
.signed-in-dashboard #teacherMenuPanel .cc-root { gap: 7px; }
.signed-in-dashboard #teacherMenuPanel.cc-menu .account-identity { margin: 0; padding: 10px 12px; }
.signed-in-dashboard #teacherMenuPanel.cc-menu .account-identity > div { flex: 1; min-width: 0; }
.signed-in-dashboard #teacherMenuPanel.cc-menu :is(#teacherMenuName, #teacherMenuEmail) {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.signed-in-dashboard #teacherMenuPanel .account-identity #ownerMenuStatus { flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.signed-in-dashboard #teacherMenuPanel .account-identity #ownerMenuStatus:is(:empty, [hidden]) { display: none; }
.signed-in-dashboard #teacherMenuPanel .owner-account-access:not(:has(#ownerMenuLink:not([hidden]))) { display: none; }
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  color: #10284a;
  background: #f1f5fa;
  border: 1px solid #e1e8f1;
  border-radius: 11px;
  font-weight: 750;
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink > span[aria-hidden] { display: none; }
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::before,
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::after {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--cc-mask) center / contain no-repeat;
  mask: var(--cc-mask) center / contain no-repeat;
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::before {
  --cc-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='m11 4 1.9 5.8L19 12l-6.1 2.2L11 20l-1.9-5.8L3 12l6.1-2.2Z'/%3E%3Cpath d='M19 2v4M17 4h4M5 18v3M3.5 19.5h3'/%3E%3C/svg%3E");
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::after {
  --cc-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  margin-inline-start: auto;
  width: 18px;
  height: 18px;
  color: #6a7f9b;
}
[dir="rtl"] .signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::after { transform: scaleX(-1); }
.signed-in-dashboard #teacherMenuPanel.cc-menu #releaseMenuPlans:not([hidden]) { margin: 0; }
.signed-in-dashboard #teacherMenuPanel.cc-menu #dashboardAccountPreferences { padding: 0; border: 0; }
.signed-in-dashboard #teacherMenuPanel.cc-menu #dashboardAccountPreferences .panel-language { margin: 0; }
.signed-in-dashboard #teacherMenuPanel .cc-drill-list {
  display: grid;
  gap: 2px;
  padding-block: 6px;
  border-block: 1px solid #e0e8f3;
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #accountSignOutBtn {
  justify-content: center;
  min-height: 44px;
  margin-block-start: 2px;
  font-weight: 800;
  background: #ffeeee;
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #accountSignOutBtn:hover { background: #ffe1e1; }
/* Finish Journey Setup (shown while a class waits for its Journey) gets the same icon box as the other rows. */
.signed-in-dashboard #teacherMenuPanel.cc-menu #finishJourneySetupBtn {
  --action-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2034%22%3E%3Crect%20width%3D%2234%22%20height%3D%2234%22%20rx%3D%228%22%20fill%3D%22%23dcf7ef%22%2F%3E%3Cpath%20transform%3D%22translate%287%207%29%20scale%28.84%29%22%20stroke%3D%22%23147668%22%20fill%3D%22none%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22m2%2021%205-8%203%204%204-6%208%2010H2Zm12-10V3h6l-2%202%202%202h-6%22%2F%3E%3C%2Fsvg%3E");
  gap: 10px;
}
.signed-in-dashboard #teacherMenuPanel.cc-menu #finishJourneySetupBtn::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  margin-inline-end: 3px;
  border-radius: 7px;
  background: var(--action-icon) center / contain no-repeat;
}
/* Rows inside the sub views keep their icons; the phone row reads as a status row. */
.signed-in-dashboard #teacherMenuPanel .cc-view-body > :is(button, a) { min-height: 44px; }
.signed-in-dashboard #teacherMenuPanel .cc-view-body #phoneVerificationMenu:not([hidden]) { margin: 0 0 4px; }
.signed-in-dashboard #teacherMenuPanel .cc-view-body #pebbleVisibilityBtn { gap: 10px; }

/* ---- Class menu -------------------------------------------------------------------------------- */
.signed-in-dashboard #classMenuPanel.cc-menu {
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100dvh - 120px);
  padding: 10px;
}
.signed-in-dashboard #dashboardDock #classMenuPanel.cc-menu { width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 120px); }
.signed-in-dashboard #classMenuPanel.cc-menu .class-menu-identity { margin: 0 0 2px; padding: 10px 12px; }
.signed-in-dashboard #classMenuPanel .cc-rows { display: grid; gap: 2px; }
.signed-in-dashboard #classMenuPanel .cc-rows > :is(button, a) { min-height: 42px; gap: 10px; }
.signed-in-dashboard #classMenuPanel #classAttendanceBtn {
  display: flex;
  align-items: center;
  color: #18385d;
  --action-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2034%22%3E%3Crect%20width%3D%2234%22%20height%3D%2234%22%20rx%3D%228%22%20fill%3D%22%23d9f6f1%22%2F%3E%3Cpath%20transform%3D%22translate%287%207%29%20scale%28.84%29%22%20stroke%3D%22%230f766e%22%20fill%3D%22none%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20d%3D%22M2%2021v-2a4%204%200%200%201%204-4h6a4%204%200%200%201%204%204v2M13%207a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm3%204%202%202%204-4%22%2F%3E%3C%2Fsvg%3E");
}
.signed-in-dashboard #classMenuPanel #classAttendanceBtn::before {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  margin-inline-end: 3px;
  border-radius: 7px;
  background: var(--action-icon) center / contain no-repeat;
}
.signed-in-dashboard #classMenuPanel .cc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 2px 2px 4px;
}
.signed-in-dashboard #classMenuPanel .cc-grid > :is(button, a) {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 9px;
  border-radius: 11px;
  font-size: .87rem;
  font-weight: 750;
  line-height: 1.15;
  white-space: normal;
  color: var(--cc-pill-ink);
  background: var(--cc-pill-bg);
}
.signed-in-dashboard #classMenuPanel .cc-grid > :is(button, a)[hidden] { display: none; }
.signed-in-dashboard #classMenuPanel .cc-grid > :is(button, a):hover:not(:disabled) { background: var(--cc-pill-hover); }
.signed-in-dashboard #classMenuPanel .cc-grid > :is(button, a)::before { width: 24px; height: 24px; margin: 0; }
.signed-in-dashboard #classMenuPanel .cc-grid > #addClassBtn { --cc-pill-ink: #174d8e; --cc-pill-bg: #e9f3ff; --cc-pill-hover: #d9ebff; }
.signed-in-dashboard #classMenuPanel .cc-grid > #editClassBtn { --cc-pill-ink: #1d4b8f; --cc-pill-bg: #eaf0f8; --cc-pill-hover: #dbe5f2; }
.signed-in-dashboard #classMenuPanel .cc-grid > #editStudentNamesBtn { --cc-pill-ink: #4b36b0; --cc-pill-bg: #efecff; --cc-pill-hover: #e2dcff; }
.signed-in-dashboard #classMenuPanel .cc-grid > #editJourneyBtn { --cc-pill-ink: #8a4b05; --cc-pill-bg: #fdf1dc; --cc-pill-hover: #fbe6c3; }
.signed-in-dashboard #classMenuPanel .cc-divider { height: 1px; margin: 2px 4px; background: #e0e8f3; }
.signed-in-dashboard #classMenuPanel .cc-view-body > :is(button, a) { min-height: 42px; gap: 10px; }

/* ---- Classroom Tools: 3 × 2 utilities, 3 stage rewards ------------------------------------------ */
.signed-in-dashboard #dashboardDock #quickToolsPanel { width: min(540px, calc(100vw - 24px)); }
.signed-in-dashboard #quickToolsList .quick-tool[data-state="utility"] { grid-column: span 2; }
.signed-in-dashboard #quickToolsList .quick-tool[data-state="utility"] .quick-tool-action { min-height: 76px; gap: 7px; padding: 9px 10px; }
.signed-in-dashboard #quickToolsList .quick-tool-status:empty { display: none; }
.signed-in-dashboard #quickToolsList .quick-tool-label { font-size: .9rem; }
.signed-in-dashboard #quickToolsList .quick-tool:not([data-state="utility"]) .quick-tool-action { min-height: 0; }
.signed-in-dashboard #quickToolsList .quick-tool:not([data-state="utility"]) .quick-tool-status {
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.signed-in-dashboard #quickToolsList [data-tool="seats"] { --tile-ink: #1d6f8c; --tile-bg: #ebf7fb; --tile-line: #addbe9; }

/* ---- Alpine Night (dark) -------------------------------------------------------------------------- */
:root[data-climb-theme="dark"] .signed-in-dashboard .cc-menu .cc-drill { color: var(--theme-ink); }
:root[data-climb-theme="dark"] .cc-drill-copy small { color: var(--theme-secondary); }
:root[data-climb-theme="dark"] :is(.cc-chevron, .cc-drill-icon[data-icon="more"]) { color: var(--theme-secondary); }
:root[data-climb-theme="dark"] .cc-drill-icon[data-icon="more"] { background: var(--theme-raised); }
:root[data-climb-theme="dark"] .cc-pill[data-tone="good"],
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel .account-identity #ownerMenuStatus {
  color: var(--theme-success-ink);
  background: var(--theme-success-surface);
  border-color: #487e6d;
}
:root[data-climb-theme="dark"] .cc-pill[data-tone="warn"] { color: var(--theme-warning-ink); background: var(--theme-warning-surface); border-color: #8a6a3c; }
:root[data-climb-theme="dark"] .signed-in-dashboard .cc-menu .cc-view-head { border-color: var(--theme-elevated-line); }
:root[data-climb-theme="dark"] .signed-in-dashboard .cc-menu .cc-view-head .cc-back { color: var(--theme-accent); }
:root[data-climb-theme="dark"] .cc-view-title { color: var(--theme-ink); }
:root[data-climb-theme="dark"] .cc-section { color: var(--theme-muted); }
:root[data-climb-theme="dark"] .cc-section.cc-danger { color: var(--theme-danger); border-color: var(--theme-elevated-line); }
:root[data-climb-theme="dark"] .signed-in-dashboard :is(#teacherMenuPanel .cc-drill-list, #classMenuPanel .cc-divider) {
  border-color: var(--theme-elevated-line);
}
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel .cc-divider { background: var(--theme-elevated-line); }
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink:not([hidden]) {
  color: var(--theme-control-ink);
  background: var(--theme-raised);
  border-color: var(--theme-elevated-line);
}
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink:not([hidden]):hover { background: var(--theme-hover); }
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink::after { color: var(--theme-secondary); }
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel.cc-menu #accountSignOutBtn { color: var(--theme-danger); background: var(--theme-danger-fill); }
:root[data-climb-theme="dark"] .signed-in-dashboard #teacherMenuPanel.cc-menu #accountSignOutBtn:hover { background: var(--theme-danger-hover); }
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel .cc-grid > :is(#addClassBtn, #editClassBtn, #editStudentNamesBtn, #editJourneyBtn) {
  --cc-pill-ink: var(--theme-control-ink);
  --cc-pill-bg: rgb(var(--cc-tint, 37 99 235) / .18);
  --cc-pill-hover: rgb(var(--cc-tint, 37 99 235) / .3);
}
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel .cc-grid > #editClassBtn { --cc-tint: 100 116 139; }
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel .cc-grid > #editStudentNamesBtn { --cc-tint: 124 58 237; }
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel .cc-grid > #editJourneyBtn { --cc-tint: 217 119 6; }
:root[data-climb-theme="dark"] .signed-in-dashboard #classMenuPanel #classAttendanceBtn { color: var(--theme-control-ink); }
:root[data-climb-theme="dark"] #quickToolsList [data-tool="whiteboard"] { --tool-tint: 8 145 178; }
:root[data-climb-theme="dark"] #quickToolsList [data-tool="quick-check"] { --tool-tint: 109 40 217; }
:root[data-climb-theme="dark"] #quickToolsList [data-tool="seats"] { --tool-tint: 14 116 144; }

/* ---- Phones ------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .signed-in-dashboard #teacherMenuWrap #teacherMenuPanel.cc-menu {
    max-height: var(--cc-room, calc(100dvh - 96px));
    padding: 10px 12px 12px;
  }
  /* The sheet's close button sits in the corner, so the profile card is the first row. */
  .signed-in-dashboard #teacherMenuPanel.cc-menu .mobile-panel-title {
    position: absolute;
    z-index: 2;
    inset-block-start: 14px;
    inset-inline-end: 16px;
    margin: 0;
  }
  .signed-in-dashboard #teacherMenuPanel.cc-menu .mobile-panel-title h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .signed-in-dashboard #teacherMenuPanel.cc-menu :is(.account-identity, .cc-view-head) { padding-inline-end: 50px; }
  .signed-in-dashboard #teacherMenuPanel .cc-root { gap: 4px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu #dashboardAccountPreferences { gap: 4px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu #releaseMenuPlans:not([hidden]) { padding-block: 7px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu .panel-language button { min-height: 32px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu :is(.dashboard-account-planner, #finishJourneySetupBtn) { min-height: 38px; padding-block: 4px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu .account-identity { padding-block: 8px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu #ownerMenuLink:not([hidden]) { min-height: 40px; padding-block: 6px; }
  .signed-in-dashboard #teacherMenuPanel .cc-drill-list { padding-block: 4px; }
  .signed-in-dashboard .cc-menu .cc-drill { min-height: 46px; padding-block: 4px; }
  .signed-in-dashboard #teacherMenuPanel.cc-menu #accountSignOutBtn { min-height: 42px; }
}
/* Narrow phones in portrait: two utility columns. */
@media (max-width: 520px) and (orientation: portrait) {
  .signed-in-dashboard #quickToolsList .quick-tool[data-state="utility"] { grid-column: span 3; }
  .signed-in-dashboard #quickToolsList .quick-tool[data-state="utility"] .quick-tool-action {
    flex-direction: row;
    align-items: center;
    min-height: 58px;
  }
}
/* On phones the floating theme button would sit on the Class menu's last row while the menu is open. */
@media (max-width: 760px) {
  body:has(.signed-in-dashboard #classMenuPanel:not([hidden])) .classroom-theme-floating { display: none; }
}
