/* =========================================================
   Class Schedule (School hub, version 40)
   Loaded after theme.css on the tool pages. Same frame as Break Board (.tk): the form on the left, the week on the
   right. School green takes the place of safety yellow inside this tool. On phones the Schedule and Add a class tabs
   switch panes, and the week shows one day at a time.
   ========================================================= */
@media screen {

#panel-schedule {
  --mascot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 58'%3E%3Cellipse cx='25' cy='54' rx='18' ry='3' fill='%231B2125' opacity='.15'/%3E%3Cg transform='translate(1 4)'%3E%3Cpath d='M11 8h24a3 3 0 0 1 3 3v35H14a3 3 0 0 1-3-3z' fill='%236BCB77' stroke='%231B2125' stroke-width='2.4' stroke-linejoin='round'/%3E%3Cpath d='M16 8v38' stroke='%231B2125' stroke-width='2'/%3E%3Cpath d='M29 8v11l3-3 3 3V8' fill='%23fff' stroke='%231B2125' stroke-width='1.8' stroke-linejoin='round'/%3E%3Ccircle cx='22' cy='24' r='2.2' fill='%231B2125'/%3E%3Ccircle cx='31' cy='24' r='2.2' fill='%231B2125'/%3E%3Cpath d='M24 29q2.5 2.8 5 0' fill='none' stroke='%231B2125' stroke-width='2' stroke-linecap='round'/%3E%3Cellipse cx='19' cy='29' rx='2.4' ry='1.5' fill='%23F4B6B0'/%3E%3Cellipse cx='34' cy='29' rx='2.4' ry='1.5' fill='%23F4B6B0'/%3E%3C/g%3E%3C/svg%3E"); --mascot-w: 52px; --mascot-h: 60px; --note: "your week on one page";
  /* the tool's accent: School green (ink text on it is 7:1 or better) */
  --yel: #6bcb77; --yel-hover: #84d58e; --yel-soft: #ddf2e0; --yel-line: #b5e3bb; --yel-ink: #1f5a28; --on-yel: #1b2125; --hl: #6bcb77;
}
:root:lang(es) #panel-schedule { --note: "su semana en una hoja"; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-tc-theme="light"]) #panel-schedule { --yel-soft: #15301a; --yel-line: #2a5531; --yel-ink: #a8e2b0; --hl: #2e6b37; }
}
:root[data-theme="dark"]:not([data-tc-theme="light"]) #panel-schedule, :root[data-tc-theme="dark"] #panel-schedule { --yel-soft: #15301a; --yel-line: #2a5531; --yel-ink: #a8e2b0; --hl: #2e6b37; }

/* ---------- the frame: the form on the left, the week on the right ---------- */
.cl .tk-main { grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); }
.cl-form-pane { background: var(--canvas); }
@media (min-width: 921px) { .cl-form-pane { border-right: 2px solid var(--edge); border-radius: 16px 0 0 16px; } }
.cl .tk-try, .cl .notice, .cl .warn { margin: 6px 0 0; }
.cl-print-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- the form ---------- */
.cl-form { display: grid; gap: 14px; margin-top: 8px; }
.cl-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cl-form .tk-l em { font-style: normal; font-weight: 400; color: var(--muted); }   /* muted, not soft: the form sits on the gray canvas */
.cl-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.cl-form legend { padding: 0; margin-bottom: 6px; }
.cl-daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-dchip { position: relative; flex: 1 0 48px; min-height: 44px; padding: 0 6px; border: 2px solid var(--edge); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: 600 14px/1 var(--f-ui); cursor: pointer; }
.cl-dchip:hover { background: var(--yel-soft); }
/* a picked day: green fill and an underline (a border, so it still shows in forced colors) */
.cl-dchip[aria-pressed="true"] { background: var(--yel); color: #1b2125; }
.cl-dchip[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 9px 6px; border-bottom: 2px solid currentColor; }
.cl-swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.cl-sw { width: 36px; height: 36px; padding: 0; border: 2px solid #1b2125; border-radius: 50%; background: var(--c) center / 18px no-repeat; cursor: pointer; }
.cl-sw[aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--edge);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8.4 3.2 3.2L13 4.8' fill='none' stroke='%231B2125' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cl-form-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tk .cl-del { margin-left: auto; min-height: 40px; }
.cl-form-pane .tk-err { margin-top: 2px; }

/* ---------- the week on a PC ---------- */
.cl-daytabs, .cl-daylist { display: none; }
.cl-grid { display: grid; grid-template-columns: 48px repeat(5, minmax(0, 1fr)); gap: 0 6px; margin-top: 12px; }
.cl-gh { height: 34px; margin: 0; display: flex; align-items: center; justify-content: center; border-bottom: 2px solid var(--edge);
  font: 700 17px/1 var(--f-cond); color: var(--ink); }
.cl-hours .cl-gh { border-bottom-color: transparent; }
.cl-hcol { position: relative; }
.cl-hcol span { position: absolute; right: 4px; padding-top: 4px; font-size: 11.5px; line-height: 1; color: var(--muted); white-space: nowrap; }
.cl-gday { min-width: 0; }
.cl-gcol { position: relative; list-style: none; margin: 0; padding: 0; border-radius: 0 0 8px 8px; background-color: var(--surface-2);
  background-image: repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px var(--px)); }
.cl-gcol > li { position: absolute; }
/* a class keeps its soft color in both themes, so its text is ink */
.cl-block { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 7px; overflow: hidden;
  border: 2px solid #1b2125; border-radius: 8px; background: var(--c); color: #1b2125; font: inherit; text-align: left; cursor: pointer; }
.cl-block:hover { box-shadow: 2px 2px 0 var(--drop); }
.cl-block.sel { box-shadow: 3px 3px 0 var(--drop); outline: 3px solid var(--yel); outline-offset: 1px; }
.cl-b-n { font: 700 13.5px/1.2 var(--f-ui); overflow-wrap: anywhere; }
.cl-b-m { max-width: 100%; font-size: 11.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* the time comes first; the full details are in the button's name */
.cl-block.tiny { padding: 2px 7px; justify-content: center; }
.cl-block.tiny .cl-b-m { display: none; }
.cl-heads { margin-top: 14px; padding: 10px 14px; border: 2px solid var(--edge); border-radius: 10px; background: var(--warn-bg); color: var(--ink); font-size: 14px; }
.cl-heads ul { margin: 4px 0 0; padding-left: 18px; }
.cl-empty { margin: 14px 0 4px; padding: 20px; border: 2px dashed var(--line-2); border-radius: 12px; display: grid; gap: 12px; justify-items: start; }
.cl-empty p { margin: 0; color: var(--muted); }

/* ---------- phones: one pane, one day at a time ---------- */
@media (max-width: 920px) {
  .cl .tk-main { display: block; }
  .cl[data-pane="week"] .cl-form-pane, .cl[data-pane="form"] .cl-week-pane { display: none; }
  .cl-form-pane { background: var(--surface); }
  .cl-grid { display: none; }
  .cl-daytabs { --fade-size: 2rem; display: flex; gap: 6px; margin: 0 calc(-1 * var(--gutter)) 10px; padding: 11px var(--gutter) 4px; overflow-x: auto; scrollbar-width: none;
    scroll-padding-inline: var(--fade-size); }
  .cl-daytabs[hidden] { display: none; }
  .cl-daytabs::-webkit-scrollbar { display: none; }
  .cl-daytabs button { position: relative; flex: 1 0 auto; min-height: 46px; padding: 0 10px; border: 2px solid var(--edge); border-radius: 10px;
    background: var(--surface); color: var(--ink); font: 600 14px/1 var(--f-ui); cursor: pointer; }
  .cl-daytabs button:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
  .cl-daytabs button[aria-selected="true"] { background: var(--yel); color: #1b2125; }
  .cl-daytabs button[aria-selected="true"]::after { content: ""; position: absolute; inset: auto 10px 5px; border-bottom: 3px solid currentColor; border-radius: 2px; }
  .cl-dt-c { position: absolute; top: -10px; right: -5px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    border: 2px solid var(--surface); border-radius: 99px; background: var(--ink); color: var(--surface); font: 700 12px/1 var(--f-ui); }
  .cl-dt-c.zero { background: var(--surface-2); color: var(--muted); box-shadow: 0 0 0 1px var(--line-2); }
  .cl-daylist { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
  .cl-daylist[hidden] { display: none; }
  .cl-row { width: 100%; min-height: 66px; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: stretch; gap: 12px; padding: 0 10px 0 0;
    border: 2px solid var(--edge); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; overflow: hidden; cursor: pointer; }
  .cl-row.sel { box-shadow: var(--pop-sm); }
  .cl-row-time { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; border-right: 2px solid #1b2125; background: var(--c);
    color: #1b2125; font: 700 13px/1.25 var(--f-ui); }
  .cl-row-time span { font-weight: 500; }
  .cl-row-info { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 8px 0; min-width: 0; }
  .cl-row-info b { font-size: 16px; overflow-wrap: anywhere; }
  .cl-row-info span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
  .cl-row svg { align-self: center; width: 18px; height: 18px; color: var(--muted); }
  .cl-none { padding: 16px; border: 2px dashed var(--line-2); border-radius: 12px; color: var(--muted); text-align: center; }
}

} /* end screen */

/* the day tabs fade out at an edge with more past it (scroll-driven, where the browser has it; the properties are registered in desk-board.css) */
@supports (animation-timeline: scroll()) {
  @media (max-width: 920px) {
    .cl-daytabs { mask: linear-gradient(black, black) no-clip subtract,
        linear-gradient(to right, black, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
        linear-gradient(to right, transparent, black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
      animation: db-fade-start linear both, db-fade-end linear both; animation-timeline: scroll(self inline);
      animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%; }
  }
}

/* ---------- the printed week (screen preview and paper), letter sideways ---------- */
.st-paper .cl-sheet { width: 1056px; padding: 48px; box-shadow: 0 1px 2px rgba(17, 22, 24, .14), 0 10px 26px rgba(17, 22, 24, .14); }
.cl-s-grid { display: grid; grid-template-columns: 54px repeat(5, minmax(0, 1fr)); margin-top: 14px; border: 1.5px solid var(--pt-head); border-radius: 6px; overflow: hidden;
  break-inside: avoid; page-break-inside: avoid; }
.cl-s-dh { height: 30px; display: flex; align-items: center; justify-content: center; border-bottom: 1.5px solid var(--pt-head); background: var(--pt-band);
  font: 700 14px/1.1 var(--f-cond); color: var(--pt-head); text-align: center; }
.cl-s-day { min-width: 0; border-left: 1px solid var(--pt-rule); }
.cl-s-col { position: relative; background-image: repeating-linear-gradient(to bottom, var(--pt-rule) 0 1px, transparent 1px var(--px)); }
.cl-s-hcol { position: relative; }
.cl-s-hcol span { position: absolute; right: 6px; padding-top: 3px; font-size: 10.5px; line-height: 1; color: var(--pt-label); white-space: nowrap; }
.cl-s-block { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 4px 6px; overflow: hidden; border: 1.5px solid var(--pt-head); border-radius: 5px;
  background: var(--c); color: #1b2125; }
.cl-s-block b { font-size: 12px; line-height: 1.15; }
.cl-s-block span { font-size: 10px; line-height: 1.2; color: #2d363c; }
[data-pt="ink"] .cl-s-block { background: #fff; }
.cl-sheet .ss-foot { margin-top: 10px; }

/* Ctrl+P on the Class Schedule: the week without the form or buttons */
@media print {
  .cl-form-pane, .cl-daytabs, .cl-daylist, .cl-print-btn, .cl-empty { display: none !important; }
  .cl-grid { display: grid !important; }
  .cl-week-pane { display: block !important; }
}
