/*
  Reusable study UI components: courses, lists, forms, outputs, timetable, flashcards, streaks, and coaching cards.
  Extracted from snippetz-study-v5.html so the HTML can stay focused on markup.
  Keep this file loaded in the order declared in the HTML because later files refine earlier styles.
*/

    /* ─── COURSE CARDS ─── */
    .cgrid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 11px;
      margin-bottom: 16px
    }

    .cc {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--r);
      padding: 18px 16px;
      cursor: pointer;
      transition: all .17s;
      position: relative;
      overflow: hidden;
      box-shadow: var(--sh);
      min-height: 140px;
      display: flex;
      flex-direction: column
    }

    .cc:hover {
      border-color: var(--ab);
      transform: translateY(-1px);
      box-shadow: var(--shm)
    }

    .cc-bar {
      height: 3px;
      position: absolute;
      top: 0;
      left: 0;
      right: 0
    }

    .cc-ic {
      font-size: 20px;
      margin: 4px 0 8px
    }

    .cc-nm {
      font-size: 13.5px;
      font-weight: 700;
      margin-bottom: 1px
    }

    .cc-cd {
      font-size: 10px;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace;
      margin-bottom: 9px
    }

    .pb-wrap {
      height: 4px;
      background: var(--bg2);
      border-radius: 2px;
      margin-bottom: 6px;
      overflow: hidden
    }

    .pb-fill {
      height: 100%;
      border-radius: 2px;
      transition: width .4s
    }

    .cc-meta {
      display: flex;
      justify-content: space-between;
      font-size: 11px;
      color: var(--text3)
    }

    /* ─── LIST ITEMS ─── */
    .li {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 12px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 6px;
      cursor: pointer;
      transition: all .13s;
      box-shadow: var(--sh)
    }

    .li:hover {
      border-color: var(--ab);
      background: var(--al)
    }

    .li-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .li-info {
      flex: 1;
      min-width: 0
    }

    .li-name {
      font-size: 12.5px;
      font-weight: 600;
      margin-bottom: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .li-sub {
      font-size: 11px;
      color: var(--text3)
    }

    .li-end {
      font-size: 11px;
      color: var(--text3);
      white-space: nowrap;
      font-family: 'JetBrains Mono', monospace
    }

    .pill {
      display: inline-flex;
      align-items: center;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 20px;
      font-family: 'JetBrains Mono', monospace;
      white-space: nowrap
    }

    .pb {
      background: var(--al);
      color: var(--accent);
      border: 1px solid var(--ab)
    }

    .pg_ {
      background: var(--gl);
      color: var(--green);
      border: 1px solid var(--gb)
    }

    .pr_ {
      background: var(--rl);
      color: var(--red);
      border: 1px solid var(--rb)
    }

    .po {
      background: var(--ol);
      color: var(--orange);
      border: 1px solid var(--ob)
    }

    .pp {
      background: var(--pl);
      color: var(--purple);
      border: 1px solid var(--pb)
    }

    /* ─── FORMS ─── */
    .fg {
      display: flex;
      flex-direction: column;
      gap: 4px
    }

    .fl {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text2)
    }

    .fi {
      background: var(--bg);
      border: 1px solid var(--border2);
      border-radius: var(--rs);
      padding: 8px 11px;
      color: var(--text);
      font-family: 'Plus Jakarta Sans', sans-serif;
      font-size: 12.5px;
      outline: none;
      transition: border-color .13s;
      width: 100%
    }

    .fi:focus {
      border-color: var(--accent);
      background: var(--white)
    }

    .fi::placeholder {
      color: var(--text3)
    }

    textarea.fi {
      resize: none;
      min-height: 70px
    }

    select.fi {
      cursor: pointer
    }

    .gbtn {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: var(--rs);
      padding: 10px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
      font-family: 'Plus Jakarta Sans', sans-serif;
      width: 100%;
      box-shadow: 0 10px 26px rgba(37, 99, 235, .16)
    }

    .gbtn::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, .24) 45%, transparent 70%);
      transform: translateX(-120%);
      animation: edithButtonFlow 6s ease-in-out infinite;
      pointer-events: none
    }

    .gbtn:hover {
      transform: translateY(-1px);
      filter: saturate(1.08);
      box-shadow: 0 14px 32px rgba(37, 99, 235, .22)
    }

    @keyframes edithButtonFlow {
      0%, 62% { transform: translateX(-130%); opacity: 0 }
      72% { opacity: 1 }
      100% { transform: translateX(130%); opacity: 0 }
    }

    /* ─── OUTPUT ─── */
    .oe {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      gap: 9px;
      color: var(--text3)
    }

    .oe .oi {
      font-size: 32px;
      opacity: .2
    }

    .oe p {
      font-size: 12.5px;
      text-align: center;
      max-width: 180px;
      line-height: 1.6
    }

    .or {
      display: none
    }

    .or.on {
      display: block;
      animation: fi .28s ease
    }

    .ot {
      font-family: 'Instrument Serif', serif;
      font-size: 20px;
      color: var(--text);
      margin-bottom: 13px;
      display: flex;
      align-items: center;
      justify-content: space-between
    }

    .os {
      margin-bottom: 14px
    }

    .osl {
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 1.5px;
      color: var(--accent);
      text-transform: uppercase;
      font-family: 'JetBrains Mono', monospace;
      margin-bottom: 7px
    }

    .otxt {
      font-size: 12.5px;
      color: var(--text2);
      line-height: 1.75
    }

    .olist {
      display: flex;
      flex-direction: column;
      gap: 5px
    }

    .oi_ {
      background: var(--bg);
      border: 1px solid var(--border);
      border-left: 3px solid var(--accent);
      border-radius: var(--rs);
      padding: 8px 11px;
      font-size: 12px;
      color: var(--text2);
      line-height: 1.5
    }

    .oi_ strong {
      color: var(--text);
      display: block;
      font-size: 11.5px;
      margin-bottom: 1px
    }

    /* ─── LOADING ─── */
    .ld {
      display: none;
      align-items: center;
      gap: 5px;
      width: fit-content;
      max-width: 100%;
      margin-top: 10px;
      padding: 7px 10px;
      background: var(--al);
      border: 1px solid var(--ab);
      border-radius: 999px;
      color: var(--accent);
      box-shadow: 0 8px 20px rgba(37, 99, 235, .08)
    }

    .ld.on {
      display: flex
    }

    .ld > span:not(.ld-t) {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--accent);
      flex: 0 0 5px;
      animation: bop 1.2s infinite
    }

    .ld > span:not(.ld-t):nth-child(2) {
      animation-delay: .2s
    }

    .ld > span:not(.ld-t):nth-child(3) {
      animation-delay: .4s
    }

    @keyframes bop {

      0%,
      60%,
      100% {
        transform: translateY(0)
      }

      30% {
        transform: translateY(-5px)
      }
    }

    .ld-t {
      font-size: 11.5px;
      color: var(--accent);
      margin-left: 4px
    }

    .centre-rejected-banner {
      background: var(--rl);
      border: 1px solid var(--rb);
      border-radius: var(--rs);
      padding: 10px 12px;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: var(--red);
      font-size: 12.5px
    }

    .centre-rejected-banner div {
      flex: 1;
      min-width: 220px
    }

    .centre-rejected-banner strong,
    .centre-rejected-banner span {
      display: block
    }

    .centre-rejected-banner span {
      margin-top: 2px;
      color: var(--text2);
      line-height: 1.5
    }

    /* ─── PROGRESS RINGS ─── */
    .rings {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 16px
    }

    .ring {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--r);
      padding: 14px 12px;
      flex: 1;
      min-width: 110px;
      text-align: center;
      box-shadow: var(--sh);
      cursor: pointer;
      transition: all .15s
    }

    .ring:hover {
      border-color: var(--ab);
      transform: translateY(-1px)
    }

    .ring-c {
      width: 60px;
      height: 60px;
      margin: 0 auto 8px;
      position: relative
    }

    .ring-c svg {
      transform: rotate(-90deg)
    }

    .ring-pct {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-family: 'Instrument Serif', serif;
      font-size: 15px
    }

    .ring-nm {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text2)
    }

    .ring-d {
      font-size: 9px;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace;
      margin-top: 1px
    }

    /* ─── GRAPH BARS ─── */
    .bar-chart {
      display: flex;
      align-items: flex-end;
      gap: 6px;
      height: 90px;
      margin-bottom: 6px
    }

    .bc-bar {
      flex: 1;
      border-radius: 4px 4px 0 0;
      background: var(--al);
      border-top: 2px solid var(--accent);
      cursor: pointer;
      transition: all .2s;
      position: relative
    }

    .bc-bar:hover {
      background: rgba(37, 99, 235, .15)
    }

    .bc-bar.hi {
      background: var(--al);
      border-color: var(--accent)
    }

    .bc-lbls {
      display: flex;
      gap: 6px
    }

    .bc-lbl {
      flex: 1;
      text-align: center;
      font-size: 9px;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace
    }

    /* ─── TOPIC LIST ─── */
    .topic-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 5px;
      transition: all .13s
    }

    .topic-item:hover {
      border-color: var(--ab)
    }

    .topic-check {
      width: 15px;
      height: 15px;
      border-radius: 4px;
      border: 1.5px solid var(--border2);
      flex-shrink: 0;
      cursor: pointer;
      transition: all .13s;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px
    }

    .topic-check:hover {
      border-color: var(--accent)
    }

    .topic-check.done {
      background: var(--green);
      border-color: var(--green);
      color: #fff
    }

    .topic-check.partial {
      background: var(--yellow);
      border-color: var(--yellow);
      color: #fff
    }

    .topic-nm {
      flex: 1;
      font-size: 12.5px;
      font-weight: 500
    }

    .topic-nm.done {
      text-decoration: line-through;
      color: var(--text3)
    }

    .topic-wt {
      font-size: 10px;
      font-family: 'JetBrains Mono', monospace;
      color: var(--text3)
    }

    .topic-imp {
      font-size: 9px;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 4px
    }

    .ti-hi {
      background: var(--rl);
      color: var(--red)
    }

    .ti-md {
      background: var(--ol);
      color: var(--orange)
    }

    .ti-lo {
      background: var(--gl);
      color: var(--green)
    }

    /* ─── TIMETABLE ─── */
    .tt-grid {
      display: grid;
      grid-template-columns: 50px repeat(6, 1fr);
      gap: 4px
    }

    .tt-head {
      background: var(--bg2);
      border-radius: 5px;
      padding: 7px 6px;
      text-align: center;
      font-size: 10px;
      font-weight: 700;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace
    }

    .tt-time {
      background: var(--bg2);
      border-radius: 5px;
      padding: 7px 5px;
      text-align: center;
      font-size: 9px;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace;
      display: flex;
      align-items: center;
      justify-content: center
    }

    .tt-cell {
      border-radius: 5px;
      padding: 5px 7px;
      min-height: 44px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      cursor: pointer;
      transition: all .13s;
      border: 1px solid transparent
    }

    .tt-cell:hover {
      transform: scale(1.02)
    }

    .tt-cell.empty {
      background: var(--bg2);
      border: 1px dashed var(--border2)
    }

    .tt-cell .tc-sub {
      font-size: 10.5px;
      font-weight: 700;
      line-height: 1.3
    }

    .tt-cell .tc-rm {
      font-size: 9px;
      opacity: .7;
      margin-top: 1px
    }

    /* ─── ASSIGNMENT ─── */
    .asgn-item {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 10px 13px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 6px;
      box-shadow: var(--sh)
    }

    .asgn-icon {
      font-size: 16px;
      flex-shrink: 0
    }

    .asgn-info {
      flex: 1
    }

    .asgn-name {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 1px
    }

    .asgn-meta {
      font-size: 11px;
      color: var(--text3)
    }

    .asgn-due {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      white-space: nowrap
    }

    /* ─── GRADE TABLE ─── */
    .gtable {
      width: 100%;
      border-collapse: collapse
    }

    .gtable th {
      background: var(--bg);
      padding: 8px 12px;
      text-align: left;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 1px;
      color: var(--text3);
      border-bottom: 1px solid var(--border);
      font-family: 'JetBrains Mono', monospace
    }

    .gtable td {
      padding: 9px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 12.5px;
      transition: background .13s
    }

    .gtable tr:hover td {
      background: var(--bg)
    }

    .gtable tr:last-child td {
      border-bottom: none
    }

    .grade-pill {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 5px;
      font-family: 'JetBrains Mono', monospace
    }

    /* ─── FLASHCARD ─── */
    .fc-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 18px
    }

    .fc {
      width: 440px;
      height: 190px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: var(--shm);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform .35s;
      transform-style: preserve-3d;
      position: relative;
      font-family: 'Instrument Serif', serif
    }

    .fc.fl {
      transform: rotateY(180deg)
    }

    .cf {
      position: absolute;
      backface-visibility: hidden;
      text-align: center;
      padding: 22px;
      width: 100%
    }

    .cb {
      transform: rotateY(180deg)
    }

    .fq {
      font-size: 16px;
      color: var(--text);
      line-height: 1.4
    }

    .fa {
      font-size: 14px;
      color: var(--accent);
      line-height: 1.4
    }

    .fh {
      font-size: 10px;
      color: var(--text3);
      margin-top: 5px;
      font-family: 'JetBrains Mono', monospace
    }

    .fc-ctrl {
      display: flex;
      justify-content: center;
      gap: 8px;
      align-items: center
    }

    /* ─── STREAK ─── */
    .streak {
      display: flex;
      gap: 3px
    }

    .sd {
      width: 13px;
      height: 13px;
      border-radius: 3px;
      background: var(--bg2)
    }

    .sd.y {
      background: var(--accent)
    }

    .sd.t {
      background: var(--accent);
      box-shadow: 0 0 0 2px var(--ab)
    }

    /* ─── COACHING ─── */
    .inst-head {
      background: linear-gradient(135deg, #1e3a5f, #2563eb);
      border-radius: var(--r);
      padding: 18px 20px;
      margin-bottom: 16px;
      color: #fff
    }

    .ih-top {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 12px
    }

    .ih-title {
      font-family: 'Instrument Serif', serif;
      font-size: 22px;
      margin-bottom: 2px
    }

    .ih-sub {
      font-size: 12px;
      opacity: .7
    }

    .inst-stats {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px
    }

    .is-box {
      background: rgba(255, 255, 255, .12);
      border-radius: var(--rs);
      padding: 9px 11px
    }

    .is-val {
      font-family: 'Instrument Serif', serif;
      font-size: 24px;
      color: #fff;
      line-height: 1
    }

    .is-lbl {
      font-size: 9px;
      opacity: .65;
      margin-top: 2px;
      font-family: 'JetBrains Mono', monospace
    }

    .msg-item {
      display: flex;
      align-items: flex-start;
      gap: 9px;
      padding: 10px 12px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 6px;
      box-shadow: var(--sh);
      cursor: pointer;
      transition: all .13s
    }

    .msg-item:hover {
      border-color: var(--ab);
      background: var(--al)
    }

    .msg-av {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 700;
      color: #fff;
      flex-shrink: 0
    }

    .msg-info {
      flex: 1
    }

    .msg-name {
      font-size: 12.5px;
      font-weight: 700;
      margin-bottom: 1px
    }

    .msg-preview {
      font-size: 11.5px;
      color: var(--text3);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 180px
    }

    .msg-time {
      font-size: 10px;
      color: var(--text3);
      font-family: 'JetBrains Mono', monospace;
      white-space: nowrap
    }

    .msg-unread {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--accent);
      flex-shrink: 0;
      margin-top: 4px
    }

    .cls-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 13px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 6px;
      box-shadow: var(--sh)
    }

    .cls-time {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      color: var(--text3);
      min-width: 70px
    }

    .cls-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .cls-info {
      flex: 1
    }

    .cls-name {
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 1px
    }

    .cls-meta {
      font-size: 11px;
      color: var(--text3)
    }

    .risk-b {
      font-size: 10px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 4px;
      font-family: 'JetBrains Mono', monospace
    }

    .rk-h {
      background: var(--rl);
      color: var(--red)
    }

    .rk-m {
      background: var(--ol);
      color: var(--orange)
    }

    .rk-l {
      background: var(--gl);
      color: var(--green)
    }

    .stu-table {
      width: 100%;
      border-collapse: collapse
    }

    .stu-table th {
      background: var(--bg);
      padding: 8px 12px;
      text-align: left;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 1px;
      color: var(--text3);
      border-bottom: 1px solid var(--border);
      font-family: 'JetBrains Mono', monospace
    }

    .stu-table td {
      padding: 9px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 12.5px;
      transition: background .13s
    }

    .stu-table tr:hover td {
      background: var(--bg)
    }

    .stu-table tr:last-child td {
      border-bottom: none
    }

    .mini-bar {
      height: 5px;
      background: var(--bg2);
      border-radius: 2px;
      width: 80px
    }

    .mini-fill {
      height: 100%;
      border-radius: 2px
    }

    .notif-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--red);
      margin-left: auto
    }

    .div {
      height: 1px;
      background: var(--border);
      margin: 13px 0
    }

    .tab-row {
      display: flex;
      gap: 3px;
      margin-bottom: 14px
    }

    .tab {
      padding: 6px 14px;
      border-radius: var(--rs);
      cursor: pointer;
      font-size: 12px;
      font-weight: 600;
      color: var(--text3);
      transition: all .13s;
      border: 1px solid transparent
    }

    .tab:hover {
      background: var(--bg);
      color: var(--text)
    }

    .tab.on {
      background: var(--al);
      color: var(--accent);
      border-color: var(--ab)
    }

    .note-it {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 12px;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--rs);
      margin-bottom: 6px;
      cursor: pointer;
      transition: all .13s;
      box-shadow: var(--sh)
    }

    .note-it:hover {
      border-color: var(--ab);
      background: var(--al)
    }
