/* Schedule: tell the kinds apart without opening them, and a session popup
   that looks finished (2026-09-29). Every width; schedule-look-20260929.js
   places the popup and adds the legend.

   Colour stays the SUBJECT's (--sc-accent); the kind is the shape:
     class   - filled with the subject colour, solid edge: fixed, you attend it
     review  - dashed outline: goes back over a class you had
     study   - plain card with a colour rail: practice Kavvi placed
     exam    - amber, bold edge
     event   - striped: something you added yourself */

html body .kv-app-shell .sc-block[data-kind] { --sm-accent: var(--sc-accent, var(--kv-on-violet, #2bb3a3)); }

/* ---- class -------------------------------------------------------------- */
html body .kv-app-shell .sc-block[data-kind="class"] {
  background: color-mix(in srgb, var(--sm-accent) 26%, var(--kv-card)) !important;
  border: 1px solid color-mix(in srgb, var(--sm-accent) 62%, transparent) !important;
  border-inline-start: 5px solid var(--sm-accent) !important;
}
html body .kv-app-shell .sc-block[data-kind="class"] .sc-block__rail { display: none; }
html body .kv-app-shell .sc-block[data-kind="class"] .sc-block__title { font-weight: 750 !important; }
html body .kv-app-shell .sc-block[data-kind="class"] .sc-block__kind {
  padding: 2px 7px; border-radius: 999px; background: var(--sm-accent); color: #fff !important;
}
html body .kv-app-shell .sc-block[data-kind="class"] .sc-block__kind svg { color: #fff; }

/* ---- review ------------------------------------------------------------- */
html body .kv-app-shell .sc-block[data-kind="review"] {
  background: color-mix(in srgb, var(--sm-accent) 5%, var(--kv-card)) !important;
  border: 1.5px dashed color-mix(in srgb, var(--sm-accent) 80%, transparent) !important;
}
html body .kv-app-shell .sc-block[data-kind="review"] .sc-block__rail { display: none; }
html body .kv-app-shell .sc-block[data-kind="review"] .sc-block__kind { color: color-mix(in srgb, var(--sm-accent) 75%, var(--kv-text)) !important; font-weight: 700; }

/* ---- study -------------------------------------------------------------- */
html body .kv-app-shell .sc-block[data-kind="study"] {
  background: var(--kv-card) !important;
  border: 1px solid color-mix(in srgb, var(--sm-accent) 22%, var(--kv-line)) !important;
  border-inline-start: 3px solid var(--sm-accent) !important;
}
html body .kv-app-shell .sc-block[data-kind="study"] .sc-block__rail { display: none; }

/* ---- exam (a real exam block, or an exam deadline) ---------------------- */
html body .kv-app-shell .sc-block[data-kind="exam"] {
  --sm-exam: var(--kv-warning, #d98a1c);
  background: color-mix(in srgb, var(--sm-exam) 20%, var(--kv-card)) !important;
  border: 2px solid var(--sm-exam) !important;
}
html body .kv-app-shell .sc-block[data-kind="exam"] .sc-block__rail { display: none; }
html body .kv-app-shell .sc-block[data-kind="exam"] .sc-block__kind { color: var(--sm-exam) !important; font-weight: 800; }
html body .kv-app-shell .sc-block[data-kind="exam"] .sc-block__title { font-weight: 800 !important; }

/* ---- your own events and tasks ------------------------------------------ */
html body .kv-app-shell .sc-block[data-kind="custom"],
html body .kv-app-shell .sc-block[data-kind="coursework"] {
  background-color: var(--kv-card) !important;
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(var(--kv-ink-rgb, 20, 30, 25), .055) 7px 13px) !important;
  border: 1px solid var(--kv-line-3, var(--kv-line)) !important;
}
html body .kv-app-shell .sc-block[data-kind="custom"] .sc-block__rail,
html body .kv-app-shell .sc-block[data-kind="coursework"] .sc-block__rail { display: none; }

/* Done / missed stay readable whatever the kind. */
html body .kv-app-shell .sc-block.is-completed { opacity: .55; }
html body .kv-app-shell .sc-block.is-missed { opacity: .7; }

/* ---- month: the dot's shape is the kind --------------------------------- */
html body .kv-app-shell .sc-block--chip[data-kind] .sc-block__dot { background: var(--sm-accent); }
html body .kv-app-shell .sc-block--chip[data-kind="class"] .sc-block__dot { border-radius: 2px; }
html body .kv-app-shell .sc-block--chip[data-kind="review"] .sc-block__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sm-accent); }
html body .kv-app-shell .sc-block--chip[data-kind="exam"] .sc-block__dot { background: var(--kv-warning, #d98a1c); border-radius: 1px; transform: rotate(45deg) scale(.85); }
html body .kv-app-shell .sc-block--chip[data-kind] { background: transparent !important; border: 0 !important; background-image: none !important; }
@media (max-width: 639px) {
  html body .kv-app-shell .sc-month__chips .sc-block--chip[data-kind="class"] { border-radius: 2px; }
  html body .kv-app-shell .sc-month__chips .sc-block--chip[data-kind="review"] { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--sm-accent); }
  html body .kv-app-shell .sc-month__chips .sc-block--chip[data-kind="exam"] { background: var(--kv-warning, #d98a1c) !important; border-radius: 1px; transform: rotate(45deg) scale(.85); }
  html body .kv-app-shell .sc-month__chips .sc-block--chip[data-kind="custom"],
  html body .kv-app-shell .sc-month__chips .sc-block--chip[data-kind="coursework"] { background: var(--kv-text-muted) !important; }
}

/* ---- legend ------------------------------------------------------------- */
.sm-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; padding: 2px 2px 0;
  color: var(--kv-text-muted); font-size: 12px; line-height: 1;
}
.sm-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sm-legend i { flex: none; display: inline-block; width: 16px; height: 11px; border-radius: 3px; box-sizing: border-box; }
.sm-legend .k-class { background: color-mix(in srgb, var(--kv-on-violet, #2bb3a3) 30%, var(--kv-card)); border: 1px solid var(--kv-on-violet, #2bb3a3); border-inline-start-width: 4px; }
.sm-legend .k-review { border: 1.5px dashed var(--kv-on-violet, #2bb3a3); }
.sm-legend .k-study { background: var(--kv-card); border: 1px solid var(--kv-line-3, var(--kv-line)); border-inline-start: 3px solid var(--kv-on-violet, #2bb3a3); }
.sm-legend .k-exam { background: color-mix(in srgb, var(--kv-warning, #d98a1c) 22%, var(--kv-card)); border: 2px solid var(--kv-warning, #d98a1c); }
.sm-legend .k-event { background-color: var(--kv-card); background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(var(--kv-ink-rgb, 20, 30, 25), .18) 3px 5px); border: 1px solid var(--kv-line-3, var(--kv-line)); }
@media (max-width: 639px) {
  .sm-legend { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding-inline: 14px; }
  .sm-legend::-webkit-scrollbar { display: none; }
}

/* ---- the session popup -------------------------------------------------- */
html body .kv-app-shell .sc-pop {
  --sm-accent: var(--sm-pop-accent, var(--sc-accent, var(--kv-on-violet, #2bb3a3)));
  gap: 10px !important; padding: 0 18px 18px !important; overflow: hidden auto;
  border: 1px solid var(--kv-line-2) !important; border-radius: 18px !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .08) !important;
}
html body .kv-app-shell .sc-pop::after {
  content: ''; order: -1; display: block; height: 5px; margin: 0 -18px 4px; background: var(--sm-accent);
}
html body .kv-app-shell .sc-pop[data-sm-kind="review"]::after { background: repeating-linear-gradient(90deg, var(--sm-accent) 0 10px, transparent 10px 16px); }
html body .kv-app-shell .sc-pop[data-sm-kind="exam"]::after { background: var(--kv-warning, #d98a1c); }
html body .kv-app-shell .sc-pop__head { margin-top: 6px; }
html body .kv-app-shell .sc-pop__kind {
  font-family: inherit !important; font-size: 11.5px !important; font-weight: 700; letter-spacing: .04em !important; text-transform: uppercase;
  padding: 4px 10px !important; background: color-mix(in srgb, var(--sm-accent) 16%, transparent) !important;
  color: color-mix(in srgb, var(--sm-accent) 70%, var(--kv-text)) !important;
}
html body .kv-app-shell .sc-pop__head button { width: 32px !important; height: 32px !important; border-radius: 10px !important; }
html body .kv-app-shell .sc-pop__title { font-size: 19px !important; line-height: 1.25; font-weight: 700 !important; margin: 0 !important; }
html body .kv-app-shell .sc-pop__when { font-family: inherit !important; font-size: 13.5px !important; letter-spacing: 0 !important; font-variant-numeric: tabular-nums; color: var(--kv-text-2) !important; margin: 0 !important; }
html body .kv-app-shell .sc-pop__reason, html body .kv-app-shell .sc-pop__note { border-radius: 10px !important; font-size: 13px !important; line-height: 1.45; padding: 9px 11px !important; }
html body .kv-app-shell .sc-pop__actions { gap: 8px !important; margin-top: 4px !important; }
html body .kv-app-shell .sc-pop__actions button {
  min-height: 38px !important; border-radius: 10px !important; font-size: 13.5px !important; font-weight: 600;
  border: 1px solid var(--kv-line-2) !important; background: transparent !important; color: var(--kv-text-2) !important;
}
html body .kv-app-shell .sc-pop__actions button:hover { background: rgba(var(--kv-ink-rgb, 20, 30, 25), .05) !important; color: var(--kv-text) !important; }
html body .kv-app-shell .sc-pop .sc-pop__actions button.is-focus {
  grid-column: 1 / -1; min-height: 42px !important; border: 0 !important;
  background: var(--kv-primary, var(--kv-on-violet, #1f5c45)) !important; color: var(--kv-on-primary, #fff) !important;
}
html body .kv-app-shell .sc-pop .sc-pop__actions button.is-focus:hover { filter: brightness(1.08); }
html body .kv-app-shell .sc-pop .sc-pop__actions button.is-danger { color: var(--kv-danger, #c0392b) !important; border-color: color-mix(in srgb, var(--kv-danger, #c0392b) 30%, transparent) !important; }
html body .kv-app-shell .sc-pop__edit input { min-height: 40px; border-radius: 10px; }
@media (min-width: 640px) {
  /* placed by schedule-look-20260929.js from its real size (the page assumed 260px) */
  html body .kv-app-shell .sc-pop { width: 320px !important; max-height: calc(100vh - 24px); }
  html body .kv-app-shell .sc-pop.sm-placed { top: var(--sm-top) !important; left: var(--sm-left) !important; bottom: auto !important; right: auto !important; }
}
@media (max-width: 639px) {
  html body .kv-app-shell .sc-pop::after { margin: -18px -16px 8px; }
  html body .kv-app-shell .sc-pop { padding: 18px 16px calc(16px + var(--kv-safe-b, 0px)) !important; }
}
/* Move / edit form inside the popup */
html body .kv-app-shell .sc-pop__edit { display: grid; gap: 10px; }
html body .kv-app-shell .sc-pop__edit label { display: grid; gap: 5px; font-size: 12.5px; color: var(--kv-text-muted); }
html body .kv-app-shell .sc-pop__edit input {
  width: 100%; box-sizing: border-box; padding: 8px 11px; border: 1px solid var(--kv-line-2); border-radius: 10px;
  background: var(--kv-card-sunken, var(--kv-card)); color: var(--kv-text); font: inherit; font-size: 14px;
}
html body .kv-app-shell .sc-pop__edit input:focus { outline: 0; border-color: var(--sm-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sm-accent) 20%, transparent); }
html body .kv-app-shell .sc-pop__edit-actions { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
html body .kv-app-shell .sc-pop__edit-actions button {
  min-height: 40px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 650; cursor: pointer;
  border: 1px solid var(--kv-line-2); background: transparent; color: var(--kv-text-2);
}
html body .kv-app-shell .sc-pop__edit-actions button.is-primary {
  order: 2; border: 0; background: var(--kv-primary, var(--kv-on-violet, #1f5c45)); color: var(--kv-on-primary, #fff);
}
html body .kv-app-shell .sc-pop__edit-actions button:disabled { opacity: .6; cursor: default; }
