:root {
  color-scheme: light;
  --ink: #10172a;
  --ink-2: #18213a;
  --paper: #f4f4ef;
  --card: #ffffff;
  --muted: #687086;
  --line: #e5e5df;
  --cyan: #49d6c6;
  --violet: #9a7cff;
  --orange: #ff825e;
  --lime: #d7f76f;
  --shadow: 0 18px 50px rgba(16, 23, 42, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.eyebrow { margin: 0 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .13em; color: var(--muted); }

.login-view { min-height: 100vh; display: grid; place-items: center; overflow: hidden; position: relative; padding: 24px; background: var(--ink); }
.login-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; filter: blur(10px); opacity: .27; }
.login-glow-one { left: -190px; top: -220px; background: radial-gradient(circle, var(--violet), transparent 67%); }
.login-glow-two { right: -180px; bottom: -220px; background: radial-gradient(circle, var(--cyan), transparent 67%); }
.login-card { width: min(510px, 100%); position: relative; padding: 54px; border: 1px solid rgba(255,255,255,.12); border-radius: 28px; background: rgba(255,255,255,.07); color: white; box-shadow: 0 40px 100px rgba(0,0,0,.35); backdrop-filter: blur(18px); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 34px; border-radius: 18px; color: var(--ink); background: var(--lime); font: 800 26px/1 Georgia, serif; transform: rotate(-3deg); }
.login-card .eyebrow { color: var(--cyan); }
.login-card h1 { margin: 0; font-size: clamp(38px, 8vw, 58px); letter-spacing: -.055em; }
.login-copy { max-width: 400px; margin: 15px 0 34px; line-height: 1.65; color: #c9cfdd; }
.login-card label { display: block; margin-bottom: 9px; color: #e9ecf4; font-size: 13px; font-weight: 700; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-row input { min-width: 0; height: 54px; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; padding: 0 16px; background: rgba(9,14,27,.55); color: white; outline: none; }
.code-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(73,214,198,.13); }
.code-row button { min-height: 54px; border: 0; border-radius: 14px; padding: 0 20px; background: var(--lime); color: var(--ink); font-weight: 800; cursor: pointer; }
.form-error { min-height: 20px; color: #ffad98; font-size: 13px; }
.privacy-note { margin: 24px 0 0; font-size: 12px; color: #8f98ad; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px 22px; background: var(--ink); color: white; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; margin: 0 8px 42px; }
.brand-mark-small { width: 38px; height: 38px; margin: 0; border-radius: 12px; font-size: 19px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 3px; color: #a5aec2; font-size: 12px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border-radius: 13px; color: #9da6bb; text-decoration: none; font-size: 14px; font-weight: 650; }
.nav-item span { width: 22px; color: #747e95; font-size: 18px; text-align: center; }
.nav-item:hover, .nav-item:focus-visible { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: white; color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.nav-item.active span { color: var(--ink); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.specialization-chip { display: flex; align-items: center; gap: 8px; color: #b3bbcc; font-size: 11px; }
.specialization-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(73,214,198,.14); }
.specialization-chip.quantum i { background: var(--violet); box-shadow: 0 0 0 3px rgba(154,124,255,.14); }
.logout-button { margin-top: 14px; min-height: 42px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: transparent; color: #c9cfdb; cursor: pointer; }

.main-content { max-width: 1480px; width: 100%; margin: 0 auto; padding: 42px clamp(28px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3.1vw, 44px); letter-spacing: -.045em; }
.topbar h1 span { color: #9aa0ae; font-weight: 480; }
.date-pill { min-width: 112px; display: flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); }
.date-pill span { font-size: 26px; font-weight: 850; }
.date-pill small { font-size: 10px; font-weight: 800; line-height: 1.25; color: var(--muted); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; }
.credit-card, .next-card, .panel, .roadmap-preview { border-radius: 24px; box-shadow: var(--shadow); }
.credit-card, .panel, .roadmap-preview { background: var(--card); }
.credit-card { padding: 25px 28px; }
.card-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.card-heading h2, .section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.trend { padding: 7px 10px; border-radius: 999px; background: #edf9f5; color: #167a69; font-size: 10px; font-weight: 750; }
.credit-body { display: flex; align-items: center; gap: clamp(25px, 5vw, 68px); margin-top: 19px; }
.progress-ring { --size: 136px; width: var(--size); height: var(--size); flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--cyan) calc(var(--progress) * 1%), #e9ece8 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 13px; border-radius: inherit; background: white; }
.progress-ring div { z-index: 1; display: flex; flex-direction: column; align-items: center; }
.progress-ring strong { font-size: 38px; line-height: 1; letter-spacing: -.05em; }
.progress-ring span { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.credit-legend { flex: 1; display: grid; gap: 13px; }
.credit-legend div { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.credit-legend i { width: 8px; height: 8px; border-radius: 50%; }
.credit-legend i.done { background: var(--cyan); }
.credit-legend i.current { background: var(--violet); }
.credit-legend i.later { background: #d9dce2; }
.credit-legend span { color: var(--muted); }
.credit-legend strong { font-size: 13px; }

.next-card { min-height: 264px; padding: 25px 27px; color: white; background: var(--ink-2); position: relative; overflow: hidden; }
.next-card::after { content: ""; position: absolute; width: 210px; height: 210px; right: -90px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(154,124,255,.42), transparent 68%); }
.card-heading.light .eyebrow { color: #8f9ab1; }
.card-heading.light h2 { font-size: 19px; }
.live-dot { z-index: 1; padding: 6px 9px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 10px; font-weight: 850; }
.next-time { display: flex; align-items: baseline; gap: 9px; margin-top: 26px; }
.next-time strong { font-size: 44px; letter-spacing: -.06em; }
.next-time span { color: #8993a8; font-size: 13px; }
.next-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.next-meta span { padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.07); color: #b8c0d0; font-size: 10px; }
.open-course { position: absolute; left: 27px; bottom: 24px; z-index: 1; border: 0; background: none; color: var(--cyan); font-weight: 750; font-size: 12px; cursor: pointer; padding: 0; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; margin-top: 20px; }
.panel { padding: 25px 28px; }
.section-heading a { color: var(--ink); font-size: 12px; font-weight: 750; text-decoration: none; }
.today-list { margin-top: 20px; display: grid; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: 72px 4px 1fr auto; gap: 15px; align-items: center; min-height: 64px; padding: 8px 11px; border-radius: 15px; background: #f8f8f5; }
.schedule-row time { font-size: 12px; font-weight: 800; }
.schedule-row time small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.schedule-row .stripe { align-self: stretch; border-radius: 99px; background: var(--cyan); }
.schedule-row.violet .stripe { background: var(--violet); }
.schedule-row h3 { margin: 0 0 4px; font-size: 13px; }
.schedule-row p { margin: 0; color: var(--muted); font-size: 10px; }
.schedule-row .room { padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 700; }
.count-badge { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: #f0efff; color: #6650ba; font-size: 11px; font-weight: 850; }
.focus-list { margin-top: 18px; display: grid; }
.focus-item { display: grid; grid-template-columns: 28px 1fr; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.focus-item:last-child { border: 0; }
.focus-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; background: #fff0eb; color: #bc4c30; font-size: 12px; font-weight: 900; }
.focus-item.watch .focus-icon { background: #f1edff; color: #6550b6; }
.focus-item.ok .focus-icon { background: #e9f8f4; color: #147362; }
.focus-item h3 { margin: 0 0 4px; font-size: 12px; }
.focus-item p { margin: 0; color: var(--muted); font-size: 10px; }

.roadmap-preview { margin-top: 20px; padding: 25px 28px 29px; }
.semester-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 25px; position: relative; }
.semester-line::before { content: ""; position: absolute; left: 5%; right: 5%; top: 18px; height: 2px; background: var(--line); }
.semester { min-width: 0; position: relative; padding-right: 18px; }
.semester > span { width: 36px; height: 36px; display: grid; place-items: center; position: relative; z-index: 1; margin-bottom: 13px; border: 4px solid white; border-radius: 50%; background: #e6e7e5; color: #6e7481; font-size: 9px; font-weight: 900; box-shadow: 0 0 0 1px var(--line); }
.semester.active > span { background: var(--cyan); color: var(--ink); }
.semester.finish > span { background: var(--lime); color: var(--ink); }
.semester small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.semester h3 { margin: 5px 0 5px; font-size: 13px; }
.semester p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.mobile-nav { display: none; }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 80px 1fr; }
  .sidebar { padding-inline: 14px; }
  .brand { justify-content: center; margin-inline: 0; }
  .brand > span:last-child, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item span { font-size: 18px; }
  .specialization-chip, .logout-button { font-size: 0; justify-content: center; }
  .logout-button::after { content: "↪"; font-size: 18px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 26px 16px 104px; }
  .topbar { align-items: flex-start; }
  .topbar h1 span { display: block; margin-top: 3px; }
  .date-pill { min-width: auto; }
  .hero-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .credit-body { gap: 24px; }
  .progress-ring { --size: 116px; }
  .progress-ring strong { font-size: 32px; }
  .semester-line { grid-template-columns: 1fr; gap: 12px; }
  .semester-line::before { top: 15px; bottom: 15px; left: 17px; right: auto; width: 2px; height: auto; }
  .semester { padding: 0 0 9px 51px; }
  .semester > span { position: absolute; left: 0; top: 0; }
  .mobile-nav { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(16,23,42,.95); box-shadow: 0 18px 60px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
  .mobile-nav a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 12px; color: #8f99ad; text-decoration: none; font-size: 9px; font-weight: 750; }
  .mobile-nav a span { font-size: 17px; }
  .mobile-nav a.active { background: white; color: var(--ink); }
}

@media (max-width: 470px) {
  .login-card { padding: 36px 24px; }
  .code-row { grid-template-columns: 1fr; }
  .date-pill small { display: none; }
  .credit-card, .panel, .roadmap-preview { padding-inline: 20px; }
  .credit-body { align-items: flex-start; }
  .credit-legend div { grid-template-columns: 8px 1fr; }
  .credit-legend strong { grid-column: 2; }
  .schedule-row { grid-template-columns: 60px 4px 1fr; gap: 10px; }
  .schedule-row .room { display: none; }
}

/* Full portal surfaces */
.portal-section { scroll-margin-top: 24px; margin-top: 70px; }
.section-heading-large { align-items: flex-end; margin-bottom: 24px; }
.section-heading-large h2 { font-size: clamp(27px, 3.4vw, 43px); letter-spacing: -.048em; }
.section-copy { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 13px; padding: 0 17px; font-size: 12px; font-weight: 800; cursor: pointer; }
.primary-button { border: 1px solid var(--ink); background: var(--ink); color: white; }
.primary-button:hover { background: #26314d; }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.secondary-button:hover { border-color: #c7c9c4; background: #fafaf8; }
.link-button { display: inline-flex; align-items: center; text-decoration: none; }

.week-grid { display: grid; grid-template-columns: repeat(5, minmax(145px, 1fr)); gap: 12px; }
.day-column { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.68); }
.day-column.today { border-color: rgba(73,214,198,.75); box-shadow: 0 12px 32px rgba(40,147,137,.1); }
.day-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; padding: 0 3px; }
.day-heading h3 { margin: 0; font-size: 14px; }
.day-heading span { color: var(--muted); font-size: 10px; font-weight: 700; }
.day-events { display: grid; gap: 9px; }
.week-event { width: 100%; min-height: 112px; padding: 14px; border: 0; border-top: 4px solid var(--cyan); border-radius: 15px; background: white; color: inherit; text-align: left; box-shadow: 0 7px 24px rgba(16,23,42,.06); cursor: pointer; }
.week-event.violet { border-color: var(--violet); }
.week-event.lime { border-color: var(--lime); }
.week-event.orange { border-color: var(--orange); }
.week-event.quantum { border-color: #b58cff; }
.week-event time { color: var(--muted); font-size: 10px; font-weight: 750; }
.week-event h4 { margin: 10px 0 8px; font-size: 12px; line-height: 1.35; }
.week-event p { margin: 0; color: var(--muted); font-size: 10px; }
.empty-day { display: grid; place-items: center; min-height: 112px; border: 1px dashed #d9dbd6; border-radius: 15px; color: #a1a5ae; font-size: 11px; }

.credit-total { display: flex; align-items: baseline; gap: 5px; }
.credit-total strong { font-size: 35px; letter-spacing: -.05em; }
.credit-total span { color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-bar { display: grid; grid-template-columns: 180px 180px minmax(210px, 1fr); gap: 12px; margin-bottom: 17px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.55); }
.filter-bar label, .app-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .035em; }
.filter-bar select, .filter-bar input, .app-dialog select, .app-dialog input, .app-dialog textarea { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; background: white; color: var(--ink); outline: none; }
.app-dialog textarea { padding-block: 11px; resize: vertical; line-height: 1.5; }
.filter-bar select:focus, .filter-bar input:focus, .app-dialog select:focus, .app-dialog input:focus, .app-dialog textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(73,214,198,.12); }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.course-card { min-width: 0; display: flex; flex-direction: column; min-height: 230px; padding: 19px; border: 1px solid var(--line); border-radius: 20px; background: white; color: inherit; text-align: left; box-shadow: 0 10px 34px rgba(16,23,42,.045); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(16,23,42,.085); }
.course-card-head { display: flex; justify-content: space-between; gap: 10px; }
.course-code { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.status-pill { flex: 0 0 auto; padding: 5px 8px; border-radius: 99px; background: #f1f1ee; color: #6a6e78; font-size: 9px; font-weight: 800; }
.status-pill.completed { background: #e6f8f3; color: #12705f; }
.status-pill.active, .status-pill.enrolled { background: #efecff; color: #6450b2; }
.status-pill.retry { background: #fff0eb; color: #b54b31; }
.course-card h3 { margin: 15px 0 7px; font-size: 16px; line-height: 1.28; }
.course-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10px; }
.course-meta span { padding: 4px 7px; border-radius: 7px; background: #f5f5f2; }
.course-card-progress { margin-top: auto; padding-top: 19px; }
.progress-caption { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #eceeea; }
.progress-track i { display: block; width: var(--value); height: 100%; border-radius: inherit; background: var(--cyan); }
.course-card.violet .progress-track i { background: var(--violet); }
.course-card.quantum .progress-track i { background: #ae86ff; }
.course-card.lime .progress-track i { background: #b9dc3f; }
.course-card.orange .progress-track i { background: var(--orange); }
.empty-state { grid-column: 1 / -1; padding: 45px 24px; border: 1px dashed #d7d9d4; border-radius: 20px; color: var(--muted); text-align: center; }

.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plan-card { min-height: 250px; display: flex; flex-direction: column; padding: 21px; border-radius: 21px; background: white; border: 1px solid var(--line); box-shadow: 0 10px 32px rgba(16,23,42,.04); }
.plan-card.active { border: 0; background: var(--ink-2); color: white; }
.plan-index { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #efefec; color: #676d79; font-size: 9px; font-weight: 900; }
.plan-card.active .plan-index { background: var(--lime); color: var(--ink); }
.plan-card small { margin-top: 22px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.plan-card.active small { color: #9fa8ba; }
.plan-card h3 { margin: 6px 0 9px; font-size: 17px; }
.plan-card > p { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.plan-card.active > p { color: #b8c0cf; }
.plan-course-list { display: grid; gap: 6px; margin-top: auto; }
.plan-course-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }
.plan-card.active .plan-course-list span { color: #cbd1dd; }
.plan-credit { margin-top: 14px; font-size: 11px; font-weight: 850; }
.milestone-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 18px; margin-top: 22px; }
.milestone-layout > div, .language-card { padding: 24px; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.subsection-title { margin: 0; font-size: 22px; }
.milestone-list { display: grid; margin-top: 19px; }
.milestone-row { display: grid; grid-template-columns: 29px 1fr auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.milestone-row:last-child { border: 0; }
.milestone-check { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; background: white; color: #8b909b; cursor: pointer; }
.milestone-row.completed .milestone-check { border-color: var(--cyan); background: var(--cyan); color: var(--ink); }
.milestone-row.active .milestone-check { border-color: var(--violet); box-shadow: inset 0 0 0 5px #f0ecff; }
.milestone-row h4 { margin: 0 0 4px; font-size: 12px; }
.milestone-row p { margin: 0; color: var(--muted); font-size: 9px; }
.milestone-row time { color: var(--muted); font-size: 9px; font-weight: 750; }
.language-card { position: relative; overflow: hidden; background: linear-gradient(145deg, #f0ecff, #ffffff 72%); }
.language-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -82px; bottom: -88px; border-radius: 50%; background: rgba(154,124,255,.16); }
.language-badge { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 34px; border-radius: 16px; background: var(--violet); color: white; font-size: 18px; font-weight: 900; transform: rotate(-4deg); }
.language-card h3 { margin: 0; max-width: 340px; font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
.language-card p:not(.eyebrow) { color: var(--muted); font-size: 11px; line-height: 1.6; }
.language-card a { position: relative; z-index: 1; color: #5d48ad; font-size: 11px; font-weight: 800; text-decoration: none; }

.material-filters { grid-template-columns: minmax(220px, 1fr) 240px; }
.material-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.material-card { min-width: 0; display: grid; grid-template-columns: 43px 1fr auto; gap: 12px; align-items: center; min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.material-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: #eefaf7; color: #157463; font-size: 11px; font-weight: 900; }
.material-card.file .material-icon { background: #f1edff; color: #6450b5; }
.material-card.note .material-icon { background: #fff1eb; color: #b95338; }
.material-card h3 { overflow: hidden; margin: 0 0 5px; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.material-card p { overflow: hidden; margin: 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.material-card-main { min-width: 0; color: inherit; text-decoration: none; cursor: pointer; }
.material-actions { display: flex; gap: 4px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--muted); cursor: pointer; }
.icon-button:hover { color: var(--ink); border-color: #c6c8c3; }

.task-section { margin-bottom: 0; }
.task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; min-height: 72px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.task-toggle { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.task-toggle::after { content: "✓"; color: transparent; font-weight: 900; }
.task-row.completed { opacity: .6; }
.task-row.completed .task-toggle { border-color: var(--cyan); background: var(--cyan); }
.task-row.completed .task-toggle::after { color: var(--ink); }
.task-row.completed h3 { text-decoration: line-through; }
.task-row h3 { margin: 0 0 5px; font-size: 12px; }
.task-row p { margin: 0; color: var(--muted); font-size: 9px; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; background: #bec2c9; }
.priority-dot.high { background: var(--orange); }
.priority-dot.low { background: var(--cyan); }

.app-dialog { width: min(590px, calc(100% - 28px)); max-height: calc(100vh - 28px); overflow: auto; padding: 0; border: 0; border-radius: 24px; background: white; color: var(--ink); box-shadow: 0 35px 100px rgba(8,12,24,.28); }
.app-dialog-small { width: min(510px, calc(100% - 28px)); }
.app-dialog::backdrop { background: rgba(10,15,28,.64); backdrop-filter: blur(4px); }
.app-dialog form, .app-dialog:not(:has(form)) { padding: 27px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 24px; }
.dialog-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.dialog-heading .icon-button { flex: 0 0 auto; font-size: 21px; }
.app-dialog form { display: grid; gap: 15px; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.range-label > span { display: flex; justify-content: space-between; }
.range-label input { padding: 0; accent-color: var(--violet); }
.dialog-error { min-height: 18px; margin: 0; color: #b84d34; font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.note-content { white-space: pre-wrap; color: #444c5d; font-size: 13px; line-height: 1.7; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(360px, calc(100% - 32px)); transform: translateY(20px); opacity: 0; pointer-events: none; padding: 13px 16px; border-radius: 13px; background: var(--ink); color: white; box-shadow: 0 18px 50px rgba(0,0,0,.24); font-size: 11px; font-weight: 700; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.schedule-row, .focus-item { width: 100%; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(73,214,198,.48); outline-offset: 2px; }

@media (max-width: 1180px) {
  .course-grid, .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .portal-section { margin-top: 52px; }
  .section-heading-large { align-items: flex-start; }
  .filter-bar, .material-filters { grid-template-columns: 1fr; }
  .course-grid, .material-grid, .task-list { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 215px; }
  .milestone-layout { grid-template-columns: 1fr; }
  .toast { right: 16px; bottom: 82px; }
}

@media (max-width: 470px) {
  .section-heading-large { display: grid; }
  .credit-total { margin-top: 4px; }
  .dialog-grid { grid-template-columns: 1fr; }
  .app-dialog form, .app-dialog:not(:has(form)) { padding: 22px 18px; }
}
