/* Copyright (c) 2026 Dismo Industries LLC. Proprietary - all rights reserved. */
/* The class space (/class/studio/): the class bar, its panels and the
   launcher additions. Tokens come from cf-kit.css. */

/* -- hidden in the class space -------------------------------------- */
body.cf-class-space #builder-generator-settings,
body.cf-class-space #cf-studio-share,
body.cf-class-space [data-studio-share],
body.cf-class-space #btn-flash,
body.cf-class-space #cf-studio-device,
body.cf-class-space #cf-rail-mount,
body.cf-class-space [data-settings-section="publish"],
body.cf-class-space [data-settings-section="sharing"],
body.cf-class-space [data-settings-section="listing"],
body.cf-class-space [data-wireframe-panel],
body.cf-class-space [data-wireframe-tab],
body.cf-class-space .cf-create-project-file-actions,
html.cf-class-no-generate body.cf-class-space .activity-button[data-panel="builder"],
html.cf-class-no-generate body.cf-class-space #cf-create-tabs [data-tab="builder"],
html.cf-class-no-art body.cf-class-space .activity-button[data-panel="pixel"],
html.cf-class-no-art body.cf-class-space #cf-create-tabs [data-tab="pixel"] {
  display: none !important;
}

/* -- class bar ------------------------------------------------------ */
.cf-class-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 18px;
  background: linear-gradient(90deg, rgba(104, 225, 253, .08), rgba(255, 43, 184, .06));
  border-bottom: 1px solid rgba(104, 225, 253, .25);
  color: var(--cf-ink);
  font-family: var(--cf-font-mono);
  font-size: 11px;
  box-sizing: border-box;
  min-width: 0;
}
.cf-class-bar [hidden] { display: none !important; }
.cf-class-bar-id { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cf-class-bar-kicker { color: var(--cf-cyan); font: 700 10px/1.2 var(--cf-font-mono); letter-spacing: .22em; margin: 0; white-space: nowrap; }
.cf-class-bar-name { font: 700 16px/1.2 var(--cf-font-display); color: var(--cf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.cf-class-bar-host { color: var(--cf-ink-dim); white-space: nowrap; }
.cf-class-bar-spacer { flex: 1 1 auto; }
.cf-class-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(104, 225, 253, .45);
  background: rgba(8, 5, 15, .6);
  color: var(--cf-ink);
  font: 700 11px/1.2 var(--cf-font-mono);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 4px;
}
.cf-class-step { cursor: pointer; color: var(--cf-cyan); }
.cf-class-step::after { content: '>'; color: var(--cf-ink-dim); }
.cf-class-step[aria-expanded="true"] { background: rgba(104, 225, 253, .14); }
.cf-class-timer { border-color: rgba(255, 216, 74, .5); color: var(--cf-yellow); font-variant-numeric: tabular-nums; }
.cf-class-usage { display: inline-flex; gap: 12px; color: var(--cf-ink-dim); white-space: nowrap; }
.cf-class-usage-generate { color: var(--cf-ink-mute); }
.cf-class-sync { color: var(--cf-yellow); white-space: nowrap; }
.cf-class-state, .cf-class-state-chip {
  padding: 4px 8px;
  border: 1px dashed var(--cf-cyan);
  color: var(--cf-cyan);
  font: 800 10px/1 var(--cf-font-mono);
  letter-spacing: .14em;
  white-space: nowrap;
}
.cf-class-state[data-state="submitted"], .cf-class-state-chip[data-state="submitted"] { border-style: solid; color: var(--cf-green); border-color: var(--cf-green); }
.cf-class-state[data-state="waiting"], .cf-class-state-chip[data-state="waiting"] { color: var(--cf-yellow); border-color: var(--cf-yellow); }
.cf-class-state[data-state="shown"], .cf-class-state-chip[data-state="shown"] { color: #08050f; background: var(--cf-green); border: 1px solid var(--cf-green); }
.cf-class-state[data-state="not-shown"], .cf-class-state-chip[data-state="not-shown"] { color: var(--cf-ink-dim); border-color: var(--cf-ink-mute); }
/* Buttons in the class space are the site's standard flat buttons (small radius, no cut corners), like Save and Get one. */
body.cf-class-space :is(.cf-btn, .builder-rebuild-button) { clip-path: none; border-radius: 4px; }
body.cf-class-space .cf-btn { box-shadow: none; }
body.cf-class-space .cf-btn-ghost { box-shadow: inset 0 0 0 1px rgba(104, 225, 253, .5); }
.cf-class-submit { align-self: center; font-size: 11px; padding: 7px 14px; }
.cf-class-submit:disabled { opacity: .5; cursor: default; }
.cf-class-mystudio { color: var(--cf-cyan); text-decoration: none; white-space: nowrap; font: 700 11px/1.2 var(--cf-font-mono); }
.cf-class-mystudio::before { content: '< '; }
.cf-class-mystudio:hover { text-decoration: underline; }
.cf-class-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Install on my Fidget, and the More menu (classmates' sharing). */
.cf-class-install { align-self: center; font-size: 11px; padding: 7px 14px; white-space: nowrap; background: transparent; color: var(--cf-cyan); box-shadow: inset 0 0 0 1px rgba(104, 225, 253, .7); }
.cf-class-install:hover { background: rgba(104, 225, 253, .12); }
.cf-class-install:disabled { opacity: .6; cursor: progress; }
.cf-class-more { cursor: pointer; color: var(--cf-ink-dim); }
.cf-class-more[aria-expanded="true"] { background: rgba(104, 225, 253, .14); color: var(--cf-ink); }
.cf-class-more-panel {
  flex: 0 0 auto;
  padding: 10px 18px;
  background: var(--cf-bg-card);
  border-bottom: 1px solid rgba(104, 225, 253, .25);
  font: 12px/1.5 var(--cf-font-mono);
  color: var(--cf-ink);
}
.cf-class-more-panel[hidden] { display: none; }
.cf-class-share { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.cf-class-share input { margin: 3px 0 0; accent-color: var(--cf-cyan); }
.cf-class-share-note { margin: 4px 0 0; color: var(--cf-ink-dim); min-height: 1em; }
.cf-class-banner.cf-class-install-panel { align-items: flex-start; background: rgba(104, 225, 253, .08); border-bottom-color: rgba(104, 225, 253, .3); }
.cf-class-install-panel .cf-class-banner-kicker { color: var(--cf-cyan); padding-top: 3px; }
.cf-class-install-body { flex: 1 1 auto; min-width: 0; }
.cf-class-install-body #cf-class-install-status:empty { display: none; }
.cf-class-install-panel .cf-sync-report { width: auto; max-width: 560px; margin-top: 0; }

/* The card's state chip sits where the publish chip was. */
.cf-create-item-card .cf-class-state-chip { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(2, 7, 8, .85); }
.cf-class-copied { margin: 10px 0 0; color: var(--cf-ink-dim); font: 11px/1.5 var(--cf-font-mono); }
.cf-class-copied a { color: var(--cf-cyan); }

/* -- banners -------------------------------------------------------- */
.cf-class-banner {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px;
  background: rgba(255, 216, 74, .1);
  border-bottom: 1px solid rgba(255, 216, 74, .35);
  color: var(--cf-ink);
  font: 12px/1.5 var(--cf-font-mono);
}
.cf-class-banner[hidden] { display: none; }
.cf-class-banner p { margin: 0; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cf-class-banner-kicker { color: var(--cf-yellow); font: 700 10px/1 var(--cf-font-mono); letter-spacing: .22em; }
.cf-class-banner-ended { background: rgba(255, 43, 184, .1); border-bottom-color: rgba(255, 43, 184, .35); }
.cf-class-banner-ended .cf-class-banner-kicker { color: var(--cf-magenta); }
.cf-class-banner-ended { flex-wrap: wrap; }
.cf-class-banner-ended p { flex: 1 1 260px; }
.cf-class-banner-ended .cf-btn { flex: 0 1 auto; max-width: 100%; font-size: 11px; padding: 7px 14px; text-decoration: none; white-space: normal; text-align: center; }
.cf-class-banner-ended .cf-btn[hidden] { display: none; }
.cf-class-banner-close { background: transparent; border: 0; color: var(--cf-ink-dim); font: 700 20px/1 var(--cf-font-mono); cursor: pointer; padding: 2px 6px; }
.cf-class-banner-close:hover { color: var(--cf-ink); }

/* -- instructions panel --------------------------------------------- */
.cf-class-instructions {
  position: fixed;
  z-index: 950;
  top: 120px; right: 18px;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding: 18px 20px 20px;
  background: var(--cf-bg-card);
  border: 1px solid rgba(104, 225, 253, .35);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  color: var(--cf-ink);
  box-sizing: border-box;
}
.cf-class-instructions[hidden] { display: none; }
.cf-class-instructions-head { display: flex; justify-content: space-between; align-items: center; }
.cf-class-instructions h2 { margin: 8px 0 6px; font: 700 22px/1.2 var(--cf-font-display); }
.cf-class-instructions-goal { margin: 0 0 12px; color: var(--cf-cyan); font: 12px/1.6 var(--cf-font-mono); }
.cf-class-instructions-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font: 12px/1.6 var(--cf-font-mono); color: var(--cf-ink); }
.cf-class-instructions-list li { padding-left: 2px; }
.cf-class-step-item { display: block; width: 100%; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cf-class-step-item:hover:not(:disabled) { color: var(--cf-cyan); }
.cf-class-step-item:focus-visible { outline: 2px solid var(--cf-cyan); outline-offset: 2px; }
.cf-class-step-item:disabled { cursor: default; }
.cf-class-instructions-list li.is-struck { color: var(--cf-ink-mute); }
.cf-class-instructions-list li.is-struck .cf-class-step-item { color: var(--cf-ink-mute); text-decoration: line-through; }
.cf-class-instructions-submit::marker { color: var(--cf-magenta); }
.cf-class-instructions-hint { margin: 12px 0 0; color: var(--cf-ink-dim); font: 11px/1.6 var(--cf-font-mono); }
/* Wide screens: the instructions sit under the emulator, in its column, instead of covering it. */
.cf-class-instructions.is-docked {
  position: static;
  z-index: auto;
  width: 100%;
  max-height: none;
  overflow-y: auto;
  padding: 14px 16px 16px;
  box-shadow: none;
  clip-path: none;
  border-radius: 4px;
}
.cf-class-instructions.is-docked h2 { font-size: 18px; }
/* Beside the emulator column (over the code), when a running app leaves no room under the emulator. */
.cf-class-instructions.is-beside { right: calc(var(--cf-studio-emulator-w, 421px) + 18px); }
.cf-class-instructions-welcome { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--cf-bg-line); color: var(--cf-ink-dim); font: 12px/1.6 var(--cf-font-mono); white-space: pre-line; }

/* -- paused overlay ------------------------------------------------- */
.cf-class-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(8, 5, 15, .86); }
.cf-class-overlay[hidden] { display: none; }
.cf-class-overlay-surface {
  width: min(460px, 100%);
  padding: 28px;
  background: var(--cf-bg-card);
  border: 1px solid rgba(255, 43, 184, .45);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  box-sizing: border-box;
}
.cf-class-overlay-surface h2 { margin: 10px 0; font: 700 26px/1.2 var(--cf-font-display); color: var(--cf-ink); }
.cf-class-overlay-surface p:last-child { margin: 0; color: var(--cf-ink-dim); font: 12px/1.6 var(--cf-font-mono); overflow-wrap: anywhere; }

/* -- launcher ------------------------------------------------------- */
.cf-class-step-list { display: grid; gap: 10px; }
.cf-class-step-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  background: var(--cf-bg-card);
  border: 1px solid var(--cf-bg-line);
  color: var(--cf-ink);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.cf-class-step-row:hover:not(:disabled) { background: var(--cf-bg-elev); }
.cf-class-step-row:disabled { opacity: .55; cursor: default; }
.cf-class-step-number { color: var(--cf-magenta); font: 700 18px/1 var(--cf-font-mono); }
.cf-class-step-text { display: grid; gap: 4px; min-width: 0; }
.cf-class-step-name { font: 700 17px/1.2 var(--cf-font-display); }
.cf-class-step-goal { color: var(--cf-ink-dim); font: 11px/1.5 var(--cf-font-mono); }
.cf-class-entries { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cf-class-entries .cf-create-entry { min-height: 150px; }
.cf-class-entries .cf-create-entry[hidden] { display: none; }
.cf-class-bring-picker {
  margin-top: 14px; padding: 14px 16px;
  background: var(--cf-bg-card);
  border: 1px solid var(--cf-bg-line);
  border-left: 3px solid var(--cf-cyan);
  display: grid; gap: 8px;
}
.cf-class-bring-picker[hidden] { display: none; }
.cf-class-picker-note { margin: 0 0 4px; color: var(--cf-ink-dim); font: 11px/1.6 var(--cf-font-mono); }
.cf-class-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--cf-bg-line); color: var(--cf-ink); font: 13px/1.4 var(--cf-font-display); }
.cf-class-picker-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-class-bring-picker > .cf-btn-dark { justify-self: start; margin-top: 4px; }
.cf-class-info h2 { line-height: 1.35; }
.cf-class-info .cf-btn { display: inline-block; }
/* Submit asks first when the build is older than the code. */
.cf-class-build-dialog .auth-dialog__surface { gap: 1rem; }
.cf-class-build-dialog h2 { font-size: 1.15rem; line-height: 1.3; }
.cf-class-build-dialog .auth-dialog__subtitle { margin: 0.4rem 0 0; line-height: 1.5; }
.cf-class-build-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.cf-class-build-actions .button { min-height: 44px; }
.cf-class-build-actions [hidden] { display: none; }

/* -- phone ---------------------------------------------------------- */
@media (max-width: 768px) {
  .cf-class-bar { padding: 6px 16px; gap: 6px 10px; }
  .cf-class-bar-host, .cf-class-usage-generate { display: none; }
  .cf-class-bar-name { font-size: 14px; max-width: 18ch; }
  .cf-class-bar-spacer { display: none; }
  .cf-class-step { flex: 1 1 100%; order: 5; }
  .cf-class-usage { font-size: 10px; }
  .cf-class-mystudio { margin-left: auto; }
  .cf-class-instructions {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    max-height: 70vh;
    max-height: 70svh;
    clip-path: none;
    border-width: 1px 0 0;
  }
  /* The kit hides launcher section heads on phone; the class sections need theirs. */
  body.cf-class-space .cf-class-kicker,
  body.cf-class-space #cf-class-steps .cf-create-section-head { display: block; }
  body.cf-class-space #cf-class-steps .cf-create-section-head > span { display: none; }
  body.cf-class-space #cf-class-steps .cf-create-section-head h2 { font-size: 13px; color: var(--cf-cyan); font-family: var(--cf-font-mono); letter-spacing: .22em; }
  body.cf-class-space .cf-create-projects::before { content: 'IN THIS CLASS'; }
  body.cf-class-space .cf-class-info:not([hidden]) { display: block; margin-top: 30px; }
  .cf-class-entries { grid-template-columns: 1fr; }
  .cf-class-entries .cf-create-entry { min-height: 0; }
  .cf-class-step-row { grid-template-columns: 30px minmax(0, 1fr); }
  .cf-class-step-row .cf-class-state-chip { grid-column: 2; justify-self: start; }
}
/* Phone workspace: the Studio's top bar is fixed over the top 56px, so the
   class bar sits under it as one compact row (step, timer, state, Submit). */
@media (max-width: 480px) {
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-bar { padding-top: 62px; flex-wrap: nowrap; }
  body.cf-class-space:not(.cf-create-launcher-mode) :is(.cf-class-bar-id, .cf-class-usage, .cf-class-mystudio, .cf-class-sync) { display: none; }
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-step { flex: 1 1 auto; order: 0; min-width: 0; }
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-step::after { content: none; }
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-timer { padding: 5px 6px; }
  /* Submit's own label (SUBMIT / UNSUBMIT) carries the state on a phone. */
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-state { display: none !important; }
  body.cf-class-space:not(.cf-create-launcher-mode) :is(.cf-class-timer, .cf-class-submit) { flex: 0 0 auto; }
  /* It gives way last, so a wider font (Safari) never pushes the row past the screen. */
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-install { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 7px 10px; }
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-more { display: none; }
  body.cf-class-space:not(.cf-create-launcher-mode) .cf-class-banner { padding: 8px 16px; }
}
/* The Code tab is not a fixed pane: the Studio gives it 56px under its top bar,
   and the class bar already clears that bar with its own top padding, so the
   Studio's 56px would leave a blank band under the class bar. */
@media (max-width: 480px) {
  body.cf-class-space:not(.cf-create-launcher-mode) .studio-layout[data-active-panel="ide"] { padding-top: 0; }
}
/* The phone 2D editor and the other fixed panes (Test, Generate) lay themselves
   out under the Studio's top bar and cover the class bar, so the bar shrinks
   to just Submit, floating in the top bar beside Save. */
@media (max-width: 992px) {
  body.cf-class-space.cf-art-phone .cf-class-bar { position: fixed; top: 2px; right: 104px; z-index: 1002; display: block; width: auto; min-width: 0; padding: 0; background: none; border: 0; }
  body.cf-class-space.cf-art-phone .cf-class-bar > :not(.cf-class-submit) { display: none !important; }
  body.cf-class-space.cf-art-phone .cf-studio-topbar .cf-studio-project { max-width: calc(100vw - 280px); }
  /* The same height as the Save button beside it. */
  body.cf-class-space.cf-art-phone .cf-class-submit { min-height: 44px; padding: 0 14px; }
}
@media (max-width: 480px) {
  body.cf-class-space:not(.cf-create-launcher-mode):has(#studio-layout:is([data-active-panel="emulator"], [data-active-panel="builder"], [data-active-panel="model"])) .cf-class-bar { position: fixed; top: 13px; right: 104px; z-index: 1002; display: block; width: auto; min-width: 0; padding: 0; background: none; border: 0; }
  body.cf-class-space:not(.cf-create-launcher-mode):has(#studio-layout:is([data-active-panel="emulator"], [data-active-panel="builder"], [data-active-panel="model"])) .cf-class-bar > :not(.cf-class-submit) { display: none !important; }
}
/* The phone top bar shows the Studio's back label as a bare arrow; in the class space it has room to say Class Studio. */
@media (max-width: 768px) {
  body.cf-class-space:not(.cf-art-phone) .cf-studio-back { font-size: 12px; min-width: 0; }
  body.cf-class-space:not(.cf-art-phone) .cf-studio-back::after { content: none; }
}
/* No publish state, and no "save to your account" notice: class work is
   shared with the host and copied out with Copy to my studio. */
body.cf-class-space :is(#cf-studio-draft-badge, #cf-studio-storage-notice) { display: none !important; }
