/*@3.SCEC.1*/

/*@3.SCEC.2*/

/*@3.SCEC.3*/
.sch-modal-editor {
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-width: 100%;
  height: min(760px, 90vh);
  /*@3.SCEC.4*/
  max-height: none;
  padding: 0;              /*@3.SCEC.5*/
  overflow: hidden;        /*@3.SCEC.6*/
}

.sch-ed-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1.1rem;
  border-block-end: 1px solid var(--border-color);
}
.sch-ed-head .sch-editor-close { margin-inline-start: auto; }
.sch-ed-title { display: grid; gap: .1rem; min-width: 0; }
.sch-ed-title h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  /*@3.SCEC.7*/
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--st-accent, #a78bfa) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sch-ed-title p { margin: 0; font-size: .72rem; color: var(--text-muted); }
.sch-ed-ic {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .9rem;
}

/*@3.SCEC.8*/

.sch-ed-scroll {
  flex: 1 1 auto;
  min-height: 0;           /*@3.SCEC.9*/
  overflow-y: auto;
  overscroll-behavior: contain;   /*@3.SCEC.10*/
  padding: .9rem 1.1rem 1.1rem;
  /*@3.SCEC.11*/
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.sch-ed-scroll > * { flex: 0 0 auto; }

/*@3.SCEC.12*/
.sch-ed-railwrap {
  position: sticky;
  top: -.9rem;             /*@3.SCEC.13*/
  z-index: 20;
  margin: -.9rem -1.1rem 0;
  padding: .9rem 1.1rem .35rem;
  background: linear-gradient(var(--bg-card) 78%, transparent);
}

/*@3.SCEC.14*/
.sch-ed-scroll .set-card { scroll-margin-top: calc(var(--sch-ed-rail, 4.8rem) + .45rem); }

/*@3.SCEC.15*/

.sch-ed-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.1rem;
  border-block-start: 1px solid var(--border-color);
  background: var(--bg-card);
}
.sch-ed-foot .sch-ed-spacer { flex: 1 1 auto; }

/*@3.SCEC.16*/

/*@3.SCEC.17*/
.sch-days { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; }
.sch-day {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: border-color .18s, color .18s, background-color .18s;
}
[dir="ltr"] .sch-day { font-family: 'Inter', 'Cairo', sans-serif; }
.sch-day input { position: absolute; opacity: 0; width: 0; height: 0; }
.sch-day-box {
  width: 15px; height: 15px;
  display: grid; place-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: 5px;
  color: transparent;
  font-size: .55rem;
  transition: background-color .15s, border-color .15s, color .15s;
}
.sch-day:hover { border-color: var(--text-secondary); color: var(--text-primary); }
/*@3.SCEC.18*/
.sch-day:has(input:checked) {
  background: color-mix(in srgb, var(--st-ok, #10b981) 10%, transparent);
  border-color: color-mix(in srgb, var(--st-ok, #10b981) 42%, transparent);
  color: var(--text-primary);
}
.sch-day:has(input:checked) .sch-day-box {
  background: var(--st-ok, #10b981);
  border-color: var(--st-ok, #10b981);
  color: #fff;
}
.sch-day:focus-within { outline: 2px solid var(--st-accent, #a78bfa); outline-offset: 2px; }

/*@3.SCEC.19*/
.sch-ed-scroll .set-card { transition: border-color .25s, box-shadow .25s; }
.sch-ed-scroll .set-card:hover {
  border-color: color-mix(in srgb, var(--st-accent, #a78bfa) 45%, var(--border-color));
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--st-accent, #a78bfa) 45%, transparent);
}
[data-theme="light"] .sch-ed-scroll .set-card:hover {
  box-shadow: 0 6px 18px -8px rgba(124, 58, 237, .22);
}
/*@3.SCEC.20*/
.sch-ed-scroll .set-card-head .set-card-ic { transition: color .25s, background-color .25s; }
.sch-ed-scroll .set-card:hover .set-card-ic {
  color: var(--st-accent, #a78bfa);
  background: color-mix(in srgb, var(--st-accent, #a78bfa) 14%, transparent);
}
/*@3.SCEC.21*/
.sch-ed-scroll .set-card.is-hit { border-color: var(--st-accent, #a78bfa); }

/*@3.SCEC.22*/

.sch-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; }
@media (max-width: 560px) { .sch-pair { grid-template-columns: 1fr; } }
.sch-pair-f { display: grid; gap: .3rem; min-width: 0; }
/*@3.SCEC.23*/
.sch-pair-l {
  display: flex; align-items: center; gap: .35rem;
  font-size: .66rem; font-weight: 800; letter-spacing: .03em;
  color: var(--text-secondary);
}
.sch-pair-l > i { font-size: .62rem; color: var(--text-muted); }
/*@3.SCEC.24*/
.sch-auto {
  margin-inline-start: auto;
  font-style: normal;
  font-size: .58rem; font-weight: 800;
  padding: .05rem .38rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
/*@3.SCEC.25*/
.sch-pair input[type="date"] { width: 100%; }

/*@3.SCEC.26*/
.set-row-c.is-full { width: 100%; }

/*@3.SCEC.27*/

.sch-focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: 100%; }
@media (max-width: 700px) { .sch-focus-grid { grid-template-columns: 1fr; } }
.sch-focus-box {
  margin: 0;
  padding: .55rem .7rem .7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  min-width: 0;
}
.sch-focus-box > legend {
  display: flex; align-items: center; gap: .35rem;
  padding-inline: .35rem;
  font-size: .68rem; font-weight: 800;
  color: var(--text-secondary);
}
.sch-focus-box > legend > i { font-size: .64rem; color: var(--text-muted); }
/*@3.SCEC.28*/
.sch-focus-box .sch-pair { grid-template-columns: 1fr 1fr; gap: .45rem; }

/*@3.SCEC.29*/
.sch-ed-scroll .sch-ecourse {
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}
.sch-ed-scroll .sch-editor-section { padding: 0; border: none; }
.sch-ed-scroll .sch-editor-hint { margin-bottom: .5rem; }

/*@3.SCEC.30*/
.sch-ed-scroll .sch-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: .8rem; font-weight: 700;
  line-height: 1.4;
  cursor: pointer; white-space: nowrap;
  transition: border-color .2s, color .2s, transform .2s, background-color .2s;
}
[dir="ltr"] .sch-ed-scroll .sch-btn { font-family: 'Inter', 'Cairo', sans-serif; }
.sch-ed-scroll .sch-btn:hover {
  border-color: var(--text-secondary); color: var(--text-primary);
  transform: translateY(-1px);
}
.sch-ed-scroll .sch-btn i { color: var(--text-muted); transition: color .2s; }
.sch-ed-scroll .sch-btn:hover i { color: var(--st-accent, #a78bfa); }
.sch-ed-scroll .sch-btn-xs { padding: .34rem .7rem; font-size: .74rem; }
.sch-ed-scroll .sch-btn-primary {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, .3);
}
.sch-ed-scroll .sch-btn-primary:hover { color: #fff; box-shadow: 0 8px 25px rgba(124, 58, 237, .35); }
.sch-ed-scroll .sch-btn-primary i { color: #fff; }
/*@3.SCEC.31*/
.sch-ed-scroll .sch-btn-danger {
  background: var(--bg-elevated);
  color: var(--st-danger, #ef4444);
  border-color: color-mix(in srgb, var(--st-danger, #ef4444) 35%, var(--border-color));
}
.sch-ed-scroll .sch-btn-danger i { color: var(--st-danger, #ef4444); }
.sch-ed-scroll .sch-btn-danger:hover {
  border-color: var(--st-danger, #ef4444);
  background: color-mix(in srgb, var(--st-danger, #ef4444) 8%, transparent);
  color: var(--st-danger, #ef4444);
}
.sch-ed-scroll .sch-btn-danger:hover i { color: var(--st-danger, #ef4444); }
.sch-ed-scroll .sch-btn-block { display: flex; width: 100%; justify-content: center; }
.sch-ed-scroll .sch-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/*@3.SCEC.32*/
.sch-ed-scroll .sch-input,
.sch-ed-scroll .sch-select {
  padding: .45rem .7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: .84rem; font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
[dir="ltr"] .sch-ed-scroll .sch-input,
[dir="ltr"] .sch-ed-scroll .sch-select { font-family: 'Inter', 'Cairo', sans-serif; }
.sch-ed-scroll .sch-input:focus,
.sch-ed-scroll .sch-select:focus {
  outline: none;
  border-color: var(--st-accent, #a78bfa);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-accent, #a78bfa) 16%, transparent);
}

/*@3.SCEC.33*/

/*@3.SCEC.34*/

.ics-steps {
  list-style: none;
  margin: .2rem 0 .8rem;
  padding: 0;
  display: grid;
  gap: .3rem;
  /*@3.SCEC.35*/
  position: relative;
}
.ics-steps[hidden] { display: none; }   /*@3.SCEC.36*/
.ics-step {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .5rem .65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  font-size: .8rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.ics-step b { color: var(--text-primary); font-weight: 800; }
.ics-step-n {
  flex: none;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--st-accent, #a78bfa) 16%, transparent);
  color: var(--st-accent, #a78bfa);
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem; font-weight: 700;
  margin-top: .15rem;
}
.ics-step > i { flex: none; color: var(--text-muted); font-size: .8rem; margin-top: .35rem; }

/*@3.SCEC.37*/

.ics-connect { display: flex; gap: .45rem; width: 100%; flex-wrap: wrap; }
/*@3.SCEC.38*/
.ics-connect #ics-url { flex: 1 1 22rem; min-width: 0; font-size: .76rem; }

.ics-msg {
  margin: .3rem 0 0;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text-muted);
  min-height: 1.2em;         /*@3.SCEC.39*/
}
.ics-msg[data-kind="ok"]  { color: var(--st-ok, #10b981); }
.ics-msg[data-kind="bad"] { color: var(--st-danger, #ef4444); }

/*@3.SCEC.40*/

.ics-inbox { display: grid; gap: .55rem; padding-block-start: .85rem; border-block-start: 1px solid var(--border-color); }
.ics-inbox-h {
  display: flex; align-items: center; gap: .45rem;
  font-size: .84rem; font-weight: 800; color: var(--text-primary);
}
.ics-inbox-h > i { color: var(--st-warn, #f59e0b); font-size: .82rem; }
.ics-count {
  margin-inline-start: auto;
  padding: .1rem .5rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--st-warn, #f59e0b) 14%, transparent);
  color: var(--st-warn, #f59e0b);
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; font-weight: 700;
}

.ics-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: .6rem .7rem;
  display: grid; gap: .5rem;
}
.ics-group-h { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ics-group-n { font-size: .74rem; font-weight: 800; color: var(--text-secondary); }
.ics-guess {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-inline-start: auto;
  font-size: .72rem; font-weight: 700;
  color: var(--text-muted);
}
.ics-guess > i { color: var(--st-warn, #f59e0b); font-size: .7rem; }
.ics-guess b { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: .74rem; }
.ics-score {
  font-family: 'JetBrains Mono', monospace; font-size: .64rem;
  color: var(--text-muted);
}

.ics-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.ics-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .76rem; color: var(--text-secondary);
  min-width: 0;
}
.ics-item-t {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  /*@3.SCEC.41*/
  direction: ltr; unicode-bidi: isolate; text-align: start;
  font-family: 'Inter', 'Cairo', sans-serif;
}
.ics-item-d {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; color: var(--text-muted);
}
.ics-badge {
  flex: none;
  padding: .1rem .45rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: .64rem; font-weight: 700; white-space: nowrap;
}
.ics-badge[data-k="quiz"], .ics-badge[data-k="exam"],
.ics-badge[data-k="midterm"], .ics-badge[data-k="final"] {
  color: var(--st-danger, #ef4444);
  border-color: color-mix(in srgb, var(--st-danger, #ef4444) 30%, transparent);
  background: color-mix(in srgb, var(--st-danger, #ef4444) 10%, transparent);
}
.ics-badge[data-k="assignment"], .ics-badge[data-k="project"] {
  color: var(--st-warn, #f59e0b);
  border-color: color-mix(in srgb, var(--st-warn, #f59e0b) 30%, transparent);
  background: color-mix(in srgb, var(--st-warn, #f59e0b) 10%, transparent);
}

.ics-item-c {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem; font-weight: 700;
  color: var(--text-secondary);
  padding: .06rem .38rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  direction: ltr; unicode-bidi: isolate;
}

/*@3.SCEC.51*/
.ics-teach { display: grid; gap: .55rem; padding-block-start: .85rem; border-block-start: 1px solid var(--border-color); }
.ics-teach .ics-inbox-h > i { color: var(--st-accent); }
.ics-teach-s { font-size: .74rem; color: var(--text-secondary); }
.ics-teach a.set-btn { text-decoration: none; }
.ics-bm { cursor: grab; border-style: dashed; }
.ics-paste {
  min-block-size: 4.6rem; block-size: auto; resize: vertical;
  font-family: 'JetBrains Mono', monospace; font-size: .7rem; line-height: 1.5;
  direction: ltr; text-align: start; padding-block: .5rem;
}

/*@3.SCEC.50*/
.ics-group.is-alien {
  border-color: color-mix(in srgb, var(--st-warn, #f59e0b) 40%, transparent);
  background: color-mix(in srgb, var(--st-warn, #f59e0b) 6%, var(--bg-elevated));
}
.ics-alien-t {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-inline-start: auto;
  font-size: .72rem; font-weight: 700;
  color: var(--st-warn, #f59e0b);
}
.ics-alien-t > i { font-size: .72rem; }
.ics-alien-t b {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: .74rem;
}
.ics-group-a > .ics-add { text-decoration: none; }

.ics-group-a { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.ics-group-a .ics-pick { flex: 1 1 9rem; min-width: 0; }

/*@3.SCEC.48*/
.ics-group[data-picked] {
  border-color: color-mix(in srgb, var(--st-ok, #10b981) 45%, transparent);
  background: color-mix(in srgb, var(--st-ok, #10b981) 6%, var(--bg-elevated));
}

/*@3.SCEC.49*/
.ics-batch {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .5rem .6rem;
  border: 1px solid color-mix(in srgb, var(--st-ok, #10b981) 35%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--st-ok, #10b981) 10%, var(--bg-card));
}
.ics-batch[hidden] { display: none; }
.ics-batch-t {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-inline-end: auto;
  font-size: .74rem; font-weight: 700; color: var(--text-secondary);
}
.ics-batch-t > i { color: var(--st-ok, #10b981); font-size: .74rem; }
.ics-batch-n {
  font-family: 'JetBrains Mono', monospace; font-size: .72rem;
  unicode-bidi: isolate; direction: ltr;
}

.ics-empty {
  display: grid; place-items: center; gap: .35rem;
  padding: 1.1rem .5rem;
  text-align: center;
  border-block-start: 1px solid var(--border-color);
}
.ics-empty > i { font-size: 1.5rem; opacity: .5; color: var(--text-muted); }
.ics-empty > p { margin: 0; font-size: .78rem; color: var(--text-muted); }

/*@3.SCEC.42*/

@media (max-width: 620px) {
  /*@3.SCEC.43*/
  #modal-editor { padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); }
  .sch-modal-editor {
    height: 100%;
    max-height: none;
    width: 100%;
    border-radius: 0;
    border: none;
  }
  .sch-ed-scroll { padding-inline: .8rem; }
  .sch-ed-railwrap { margin-inline: -.8rem; padding-inline: .8rem; }
  .sch-ed-head, .sch-ed-foot { padding-inline: .8rem; }
  /*@3.SCEC.44*/
  .sch-ed-foot { padding-block-end: .75rem; }
}

/*@3.SCEC.45*/
@media (pointer: coarse) {
  .sch-ed-scroll .set-btn,
  .sch-ed-foot .set-btn,
  .sch-ed-scroll .set-in,
  .sch-ed-scroll select.set-in,
  .sch-ed-scroll input[type="date"],
  .sch-day { min-height: 44px; }
  /*@3.SCEC.46*/
  .sch-ed-head .sch-editor-close { width: 44px; height: 44px; }
  .set-step button { min-width: 40px; min-height: 40px; }
}

/*@3.SCEC.47*/
.sch-ecourse-head { position: relative; padding-inline-end: 2rem; }
.sch-ecourse-nm { display: inline; }
.sch-ecourse-x {
  position: absolute; inset-inline-end: 0; inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: 1.6rem; block-size: 1.6rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; cursor: pointer;
  color: var(--text-muted); opacity: .6; font-size: .72rem;
  border-radius: var(--radius-md); transition: color .18s, opacity .18s, background .18s;
}
.sch-ecourse-x:hover, .sch-ecourse-x:focus-visible {
  opacity: 1; color: var(--st-danger, #ef4444); outline: none;
  background: color-mix(in oklab, var(--st-danger, #ef4444) 12%, transparent);
}
