/* Календарь курсов - дизайн-система.
   Светлая тема под iframe Bitrix24: нейтральный slate + один акцент, мягкие тени,
   плотная информативная сетка. Цвет курса приходит из B24 и задаёт плашки. */

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: #eff4ff;
  --danger: #dc2626;
  --danger-soft: #fef3f2;
  --ok: #16a34a;
  --warn: #b45309;
  --today: #2563eb;
  --radius: 12px;
  --radius-s: 8px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-2: 0 4px 12px -2px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --shadow-3: 0 20px 48px -12px rgba(16, 24, 40, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }

.cc-app { max-width: 1480px; margin: 0 auto; padding: 14px 16px 28px; }
.cc-viewport { position: relative; }

/* ================= toolbar ================= */

.cc-toolbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.cc-toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-toolbar-row + .cc-toolbar-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cc-toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.cc-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-period { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 4px 0 10px; white-space: nowrap; }
.cc-spacer { flex: 1; }

.cc-conflicts {
  border: 1px solid #fecaca; background: var(--danger-soft); color: var(--danger);
  font-weight: 600; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  transition: .15s;
}
.cc-conflicts:hover { border-color: var(--danger); }
.cc-conflicts.is-on { background: var(--danger); color: #fff; border-color: var(--danger); }

.cc-busy {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: ccspin .7s linear infinite;
}
@keyframes ccspin { to { transform: rotate(360deg); } }

.cc-demo-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--warn); background: #fffaeb; border: 1px solid #fedf89;
  padding: 3px 8px; border-radius: 999px; cursor: help;
}

/* buttons */
.cc-btn {
  cursor: pointer; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  padding: 6px 12px; border-radius: var(--radius-s); font-weight: 500; font-size: 13px;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.cc-btn:hover { border-color: var(--accent); color: var(--accent); }
.cc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cc-btn:disabled { opacity: .55; cursor: default; }
.cc-btn-ico { padding: 6px 10px; font-size: 16px; line-height: 1; font-weight: 400; }
.cc-btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.cc-btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.cc-btn-ghost:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.cc-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cc-btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

/* view switcher */
.cc-switch { display: inline-flex; background: #f2f4f7; border-radius: 9px; padding: 3px; gap: 2px; }
.cc-switch-btn {
  cursor: pointer; border: 0; background: transparent; color: var(--muted);
  padding: 5px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; transition: .15s;
}
.cc-switch-btn:hover { color: var(--ink); }
.cc-switch-btn.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }

/* filters */
.cc-toolbar-filters { row-gap: 6px; }
.cc-fsel {
  font: inherit; font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  padding: 4px 26px 4px 12px; cursor: pointer; max-width: 190px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2398a2b3' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color .15s;
}
.cc-fsel:hover { border-color: var(--line-2); }
.cc-fsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cc-fsel.is-active { border-color: var(--accent); color: var(--accent); background-color: var(--accent-soft); font-weight: 600; }

.cc-toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-2); border: 1px solid transparent;
  padding: 4px 10px; border-radius: 999px; user-select: none; transition: .15s;
}
.cc-toggle:hover { background: #f2f4f7; }
.cc-toggle.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cc-toggle input { accent-color: var(--accent); margin: 0; }

/* legend popover */
.cc-legend-wrap { position: relative; }
.cc-legend-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-2); padding: 12px 14px; width: 250px;
  display: none; flex-direction: column; gap: 8px;
}
.cc-legend-wrap:hover .cc-legend-pop, .cc-legend-wrap:focus-within .cc-legend-pop { display: flex; }
.cc-leg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.cc-leg-m { width: 16px; height: 12px; border-radius: 4px; border: 1px solid var(--line-2); flex: 0 0 auto; }
.cc-leg-m.m-learn { background: #dbeafe; border-left: 3px solid #2563eb; }
.cc-leg-m.m-held { background: #dcfce7; border-left: 3px solid #16a34a; }
.cc-leg-m.m-cancelled { background: #f2f4f7; border-left: 3px solid #98a2b3; }
.cc-leg-m.m-pause { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #f2f4f7 3px, #f2f4f7 6px); }
.cc-leg-m.m-conflict { background: var(--danger-soft); border-color: var(--danger); }
.cc-leg-m.m-today { background: #fff; box-shadow: inset 0 0 0 2px var(--today); }
.cc-leg-hint { color: var(--faint); font-size: 12px; padding-top: 2px; border-top: 1px solid var(--line); }

/* chips */
.cc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.cc-chip-sm { padding: 1px 8px; font-size: 11.5px; }
.cc-chip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ================= month grid ================= */

.cc-cal {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-1);
}
.cc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cc-grid-head { border-bottom: 1px solid var(--line); background: #fcfcfd; }
.cc-wd {
  padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .05em;
}
.cc-wd.is-weekend { color: #f04438; }

.cc-month .cc-grid:not(:first-child) { border-top: 1px solid var(--line); }
.cc-cell {
  min-height: 118px; border-right: 1px solid var(--line);
  padding: 6px; display: flex; flex-direction: column; gap: 3px;
  cursor: pointer; transition: background .12s, box-shadow .12s; position: relative;
  background: var(--card);
}
.cc-cell:last-child { border-right: 0; }
.cc-cell:hover { background: #f8fafc; }
.cc-cell.is-weekend { background: #f9fafb; }
.cc-cell.is-weekend:hover { background: #f4f6f8; }
.cc-cell.is-out { background: #fcfcfd; }
.cc-cell.is-out .cc-cell-body { opacity: .45; }
.cc-cell.is-out .cc-cell-d { color: #d0d5dd; }
.cc-cell.is-today { background: #fbfdff; box-shadow: inset 0 2px 0 var(--today); }
.cc-cell.has-conflict { box-shadow: inset 2px 0 0 var(--danger); }
.cc-cell.is-today.has-conflict { box-shadow: inset 0 2px 0 var(--today), inset 2px 0 0 var(--danger); }
.cc-cell.is-free-hl { background: #f3fbf5; }
.cc-cell.is-dim { opacity: .38; }
.cc-cell.cc-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; z-index: 1; }

.cc-cell-h { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.cc-cell-d {
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-variant-numeric: tabular-nums;
}
.cc-cell-d.is-today { background: var(--today); color: #fff; font-weight: 700; }
.cc-cell-warn {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--danger); background: var(--danger-soft); border: 1px solid #fecaca;
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; cursor: help;
}
.cc-cell-body { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }

/* pills */
.cc-pill {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; line-height: 1.3; padding: 3px 7px 3px 8px;
  border-left: 3px solid transparent; border-radius: 6px;
  cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: filter .12s, transform .12s, box-shadow .12s;
}
.cc-pill:hover { filter: saturate(1.15) brightness(.985); box-shadow: var(--shadow-1); }
.cc-pill.is-draggable:active { cursor: grabbing; }
.cc-pill-t { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cc-pill-i {
  margin-left: auto; font-size: 10.5px; font-weight: 700; opacity: .9;
  font-variant-numeric: tabular-nums; letter-spacing: .02em; flex: 0 0 auto;
}
.cc-pill-check { font-size: 10px; font-weight: 800; color: var(--ok); flex: 0 0 auto; }
.cc-pill.is-held { opacity: .72; }
.cc-pill.is-cancelled { opacity: .55; background: #f2f4f7 !important; border-left-color: var(--faint) !important; color: var(--muted) !important; }
.cc-pill.is-cancelled .cc-pill-t { text-decoration: line-through; }
.cc-pill.is-pause {
  background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f5f6f8 4px, #f5f6f8 8px);
  border: 1px dashed var(--line-2); border-left: 1px dashed var(--line-2);
  color: var(--faint); cursor: default; padding: 2px 7px;
}
.cc-pill.is-pause .cc-pill-t { font-weight: 500; font-style: italic; }
.cc-pill.is-pause .cc-pill-i { font-weight: 600; font-style: italic; }

.cc-more {
  align-self: flex-start; border: 0; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 700; color: var(--accent); padding: 1px 6px; border-radius: 5px;
}
.cc-more:hover { background: var(--accent-soft); }

/* ================= week ================= */

.cc-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-1); min-height: 420px;
}
.cc-wcol { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.cc-wcol:last-child { border-right: 0; }
.cc-wcol.is-weekend { background: #f9fafb; }
.cc-wcol.is-today { background: #fbfdff; }
.cc-wcol.cc-drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cc-wcol-h {
  display: flex; align-items: center; gap: 7px; width: 100%;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer;
  padding: 9px 10px; text-align: left;
}
.cc-wcol-h:hover { background: #f4f6f8; }
.cc-wcol-wd { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.cc-wcol-d {
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
}
.cc-wcol-d.is-today { background: var(--today); color: #fff; }
.cc-wcol-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cc-wcol-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 18px 0; }

.cc-wcard {
  border-left: 3px solid transparent; border-radius: 8px; padding: 7px 9px;
  cursor: pointer; transition: box-shadow .12s, transform .12s;
}
.cc-wcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.cc-wcard-t { font-size: 12.5px; font-weight: 700; }
.cc-wcard-num { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-wcard-topic { font-size: 12px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-wcard-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.cc-wcard.is-held { opacity: .72; }
.cc-wcard.is-cancelled { opacity: .55; background: #f2f4f7 !important; border-left-color: var(--faint) !important; }
.cc-wcard.is-cancelled .cc-wcard-t { text-decoration: line-through; color: var(--muted) !important; }
.cc-wcard.is-pause { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f5f6f8 4px, #f5f6f8 8px); border: 1px dashed var(--line-2); cursor: default; }
.cc-wcard.is-pause .cc-wcard-t { color: var(--faint); font-style: italic; font-weight: 600; }

/* ================= list (потоки) ================= */

.cc-list { display: flex; flex-direction: column; gap: 10px; }
.cc-lcard {
  display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.cc-lcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.cc-lcard.is-cancelled { opacity: .6; }
.cc-lcard-bar { width: 5px; flex: 0 0 auto; }
.cc-lcard-main { padding: 12px 16px; flex: 1; min-width: 0; }
.cc-lcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-lcard-title { font-size: 14.5px; font-weight: 700; }
.cc-lcard-flow { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 8px; }
.cc-lcard-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; color: var(--ink-2); font-size: 12.5px; }
.cc-meta-item { white-space: nowrap; }
.cc-meta-next { color: var(--accent); font-weight: 600; }
.cc-lcard-bars { display: flex; gap: 22px; margin-top: 10px; flex-wrap: wrap; }
.cc-bar { min-width: 180px; flex: 0 1 240px; }
.cc-bar-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.cc-bar-track { height: 5px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.cc-bar-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.cc-bar-fill.is-fill { background: #94a3b8; }

/* ================= overlays / panels ================= */

/* The app lives in a tall Bitrix24 iframe (fitWindow), so 100vh ≈ full content height -
   panels are capped in px and anchored to the top so they stay in the visible part. */
.cc-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, .40);
  display: flex; justify-content: flex-end; align-items: flex-start;
  animation: ccfade .16s ease;
}
@keyframes ccfade { from { opacity: 0; } }

.cc-panel {
  width: 420px; max-width: 94vw;
  height: auto; max-height: min(100vh, 780px); min-height: 320px;
  background: var(--card); box-shadow: var(--shadow-3);
  border-radius: 0 0 0 14px;
  display: flex; flex-direction: column;
  animation: ccslide .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes ccslide { from { transform: translateX(24px); opacity: .4; } }

.cc-panel-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.cc-panel-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.cc-panel-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cc-x {
  border: 0; background: transparent; cursor: pointer; color: var(--faint);
  font-size: 14px; padding: 6px 8px; border-radius: 7px; flex: 0 0 auto;
}
.cc-x:hover { background: #f2f4f7; color: var(--ink); }
.cc-panel-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.cc-panel-foot {
  display: flex; gap: 8px; padding: 12px 18px;
  border-top: 1px solid var(--line); background: #fcfcfd;
}
.cc-panel-empty { color: var(--faint); font-size: 13px; padding: 14px 0; text-align: center; }
.cc-mini-loading { color: var(--faint); font-size: 12.5px; padding: 10px 0; }

/* conflicts box */
.cc-conflict-box { margin: 12px 18px 0; background: var(--danger-soft); border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; }
.cc-conflict-t { font-weight: 700; color: var(--danger); font-size: 12.5px; margin-bottom: 4px; }
.cc-conflict-i { font-size: 12.5px; color: #7f1d1d; }

/* day cards in the day panel */
.cc-dcard { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 10px; background: var(--card); }
.cc-dcard.is-cancelled { opacity: .6; }
.cc-dcard-bar { width: 4px; flex: 0 0 auto; }
.cc-dcard-main { padding: 10px 12px; flex: 1; min-width: 0; }
.cc-dcard-title {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 700; padding: 0;
}
.cc-dcard-title:hover { color: var(--accent); }
.cc-dcard-num { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.cc-dcard-topic { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.cc-dcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.cc-dcard-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.cc-dcard-moverow { display: flex; gap: 6px; margin-top: 9px; align-items: center; }
.cc-dcard-moverow .cc-input { max-width: 170px; padding: 5px 8px; }

.cc-pause-group { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.cc-pause-group-t { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.cc-pause-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.cc-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.cc-pause-name { font-weight: 600; }
.cc-pause-note { color: var(--faint); }

/* ================= drawer (event card) ================= */

.cc-drawer { width: 460px; }
.cc-drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cc-drawer-swatch { width: 14px; height: 40px; border-radius: 5px; flex: 0 0 auto; margin-top: 2px; }
.cc-drawer-ht { flex: 1; min-width: 0; }

.cc-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; flex: 1; }
.cc-row2 { display: flex; gap: 10px; }
.cc-lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cc-input {
  font: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-s); background: #fff;
  padding: 7px 10px; width: 100%;
}
.cc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cc-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 6px 0 14px; }
.cc-meta-l { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.cc-meta-v { font-size: 13px; font-weight: 500; margin-top: 1px; }

.cc-days-t { font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 8px; }
.cc-days { display: flex; flex-direction: column; }
.cc-dayrow { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; }
.cc-dayrow:hover { background: #f8fafc; }
.cc-dayrow.is-today { background: var(--accent-soft); }
.cc-dayrow.is-cancelled { opacity: .55; }
.cc-dayrow-num {
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: 0 0 auto; font-variant-numeric: tabular-nums;
}
.cc-dayrow-main { flex: 1; min-width: 0; }
.cc-dayrow-date { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cc-today-tag {
  font-size: 10px; font-weight: 800; color: var(--accent); text-transform: uppercase;
  letter-spacing: .05em; margin-left: 7px;
}
.cc-dayrow-topic { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-dayrow-st { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.cc-dayrow.is-cancelled .cc-dayrow-date { text-decoration: line-through; }

.cc-editbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 4px 0 10px; background: #fcfcfd; }
.cc-editbox-note { font-size: 11.5px; color: var(--faint); margin: 2px 0 10px; }

.cc-students { display: flex; flex-direction: column; gap: 2px; }
.cc-student { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; }
.cc-student:hover { background: #f8fafc; }
.cc-student-main { flex: 1; min-width: 0; }
.cc-student-name { font-size: 13px; font-weight: 600; }
.cc-student-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.cc-ava {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  background: #eef2ff; color: #4f46e5; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; letter-spacing: .02em;
}

/* ================= modals ================= */

.cc-modal {
  margin: auto; width: 560px; max-width: 94vw; max-height: 88vh;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; overflow: hidden;
  animation: ccpop .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes ccpop { from { transform: scale(.97) translateY(6px); opacity: .5; } }
.cc-overlay:has(.cc-modal) { justify-content: center; align-items: flex-start; padding-top: 42px; }
.cc-modal { max-height: min(88vh, 720px); }

.cc-form { width: 520px; }
.cc-move { width: 470px; }

.cc-preview { border: 1px solid var(--line); background: #fcfcfd; border-radius: 10px; padding: 10px 12px; margin-top: 2px; }
.cc-preview-t { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.cc-preview-g { color: var(--muted); font-weight: 500; }
.cc-preview-days { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-preview-day {
  border: 1px solid; border-radius: 6px; padding: 2px 7px;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}

.cc-move-p { margin: 2px 0 12px; font-size: 13.5px; }
.cc-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; cursor: pointer; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 14px; margin-bottom: 8px;
  transition: .15s;
}
.cc-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.cc-choice-t { font-weight: 700; font-size: 13.5px; }
.cc-choice-d { font-size: 12px; color: var(--muted); }

/* ================= attendance ================= */

.cc-att { width: 640px; }
.cc-att-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px 0; }
.cc-att-stat { font-size: 12.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-att-search { margin: 10px 18px 4px; width: calc(100% - 36px); }
.cc-att-body { padding: 8px 18px 16px; overflow-y: auto; }
.cc-att-cell { border-bottom: 1px solid var(--line); }
.cc-att-cell:last-child { border-bottom: 0; }
.cc-att-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cc-att-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.cc-att-comment { font-size: 11.5px; color: var(--warn); font-weight: 500; }

.cc-seg { display: inline-flex; gap: 4px; }
.cc-seg.is-saving { opacity: .5; pointer-events: none; }
.cc-seg-btn {
  cursor: pointer; border: 1px solid var(--line-2); background: #fff; color: var(--muted);
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; transition: .12s;
}
.cc-seg-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.cc-seg-btn.is-active { color: #fff; }
.cc-has-note { color: var(--warn); }

.cc-att-note { padding: 0 0 10px 38px; }
.cc-att-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.cc-reason {
  cursor: pointer; border: 1px solid var(--line); background: #f8fafc; color: var(--ink-2);
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
}
.cc-reason:hover { border-color: var(--accent); color: var(--accent); }
.cc-att-note-row { display: flex; gap: 6px; }

/* ================= states / skeleton / toasts ================= */

.cc-state {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 60px 20px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cc-state-ic { font-size: 32px; }
.cc-state-t { font-size: 14px; }
.cc-state-err .cc-state-ic { color: var(--danger); }

.cc-skel { display: flex; flex-direction: column; gap: 12px; }
.cc-skel-bar, .cc-skel-cell {
  background: linear-gradient(90deg, #eceef1 25%, #f5f6f8 50%, #eceef1 75%);
  background-size: 400% 100%; animation: ccshimmer 1.3s ease infinite;
  border-radius: 10px;
}
@keyframes ccshimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.cc-skel-bar { height: 56px; }
.cc-skel-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cc-skel-cell { height: 104px; }

.cc-toasts {
  position: fixed; right: 18px; top: 14px; z-index: 300; /* top: the iframe bottom is usually off-screen */
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.cc-toast {
  background: var(--card); border: 1px solid var(--line); border-left-width: 4px;
  border-radius: 10px; box-shadow: var(--shadow-2);
  font-size: 13px; font-weight: 500; padding: 10px 16px; min-width: 220px; max-width: 360px;
  animation: cctoast .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes cctoast { from { transform: translateY(8px); opacity: 0; } }
.cc-toast.is-ok { border-left-color: var(--ok); }
.cc-toast.is-err { border-left-color: var(--danger); }

/* ================= responsive ================= */

@media (max-width: 1000px) {
  .cc-cell { min-height: 96px; }
  .cc-bar { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .cc-app { padding: 8px; }
  .cc-period { font-size: 15px; }
  .cc-cell { min-height: 76px; padding: 3px; }
  .cc-pill-i { display: none; }
  .cc-week { grid-template-columns: 1fr; }
  .cc-wcol { border-right: 0; border-bottom: 1px solid var(--line); }
  .cc-panel, .cc-drawer { width: 100vw; max-width: 100vw; }
  .cc-meta-grid { grid-template-columns: 1fr; }
}

/* scrollbars (WebKit) */
.cc-panel-body::-webkit-scrollbar, .cc-att-body::-webkit-scrollbar { width: 8px; }
.cc-panel-body::-webkit-scrollbar-thumb, .cc-att-body::-webkit-scrollbar-thumb {
  background: #d0d5dd; border-radius: 999px;
}
