:root {
  color-scheme: light;
  --paper: #f7f8f3;
  --surface: #fff;
  --ink: #172f2b;
  --muted: #53655e;
  --line: #d9e1d8;
  --teal: #07594e;
  --jade: #e2f2e8;
  --rust: #a04626;
  --radius: 18px;
  --shadow: 0 10px 32px -24px #103a2a55;
  font: 16px/1.5 "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button, input, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #28947d; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .52; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(30px,4vw,48px); letter-spacing: -.05em; }
h2 { font-size: clamp(23px,3vw,32px); letter-spacing: -.045em; }
h3 { font-size: 18px; letter-spacing: -.025em; }
svg.i { width: 19px; height: 19px; flex: none; }
.frame { width: min(1180px,100%); padding-inline: clamp(16px,4vw,42px); margin-inline: auto; }
.mast { border-bottom: 1px solid var(--line); background: #fcfcf9; padding-top: env(safe-area-inset-top); }
.mast-inner, .mast-end, .brand, .pair, .actions, .legend, .tags { display: flex; align-items: center; }
.mast-inner { min-height: 70px; justify-content: space-between; gap: 12px; }
.brand { gap: 10px; font-size: 21px; font-weight: 800; letter-spacing: -.055em; }
.brand b { font-weight: 500; }
.mast-end, .pair, .actions, .legend, .tags { gap: 8px; }
.mast-end { font-size: 13px; color: var(--muted); }
.mast-end:has(button:not([hidden])) > span { padding-right: 10px; border-right: 1px solid var(--line); }
.loading { padding: 48px 0; color: var(--muted); }
.quiet, .button, .icon-button, .tab, .chip, .time-slot, .day { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 9px 15px; font-weight: 650; font-size: 14px; background: white; text-align: center; line-height: 1.35; }
.button:hover:enabled, .quiet:hover, .icon-button:hover, .chip:hover, .day:hover, .time-slot:hover { background: #eef4ed; border-color: #98b6a7; }
.button.primary { background: var(--teal); color: white; border-color: var(--teal); }
.button.primary:hover:enabled { background: #08483e; }
.button.secondary { color: var(--teal); background: var(--jade); border-color: #bddbc8; }
.danger { color: #982e24; }
.compact { font-size: 13px; padding: 7px 11px; }
.icon-button { padding: 0; width: 44px; color: var(--muted); flex-shrink: 0; }
.wide { width: 100%; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 14px; line-height: 1.55; }
.small { font-size: 13px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login { max-width: 960px; margin: clamp(30px,8vh,92px) auto; display: grid; grid-template-columns: 1.02fr 1fr; overflow: hidden; }
.login-art { background: #123f36; color: #faf9ed; display: flex; flex-direction: column; margin: 0; }
.login-art img { width: 100%; height: clamp(240px,30vw,340px); object-fit: cover; display: block; }
.login-art figcaption { padding: 28px 32px 34px; }
.login-art h2 { font-size: clamp(26px,3.2vw,37px); }
.login-art p { margin-top: 8px; color: #d3e5d7; }
.login-form { align-self: center; padding: clamp(24px,4vw,55px); }
.login-form h1 { margin-bottom: 8px; }
.login-form form { margin-top: 26px; }
.field { display: grid; gap: 7px; margin-bottom: 17px; font-size: 14px; font-weight: 650; }
.input-wrap { display: flex; align-items: center; gap: 10px; padding-inline: 13px 6px; border: 1px solid #bccbc0; background: #fff; border-radius: 10px; color: var(--muted); }
.input-wrap:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.input-wrap input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); min-height: 46px; padding: 6px 0; font-size: 16px; }
.input-wrap input:focus-visible { outline: 0; }
.input-wrap .icon-button { border: 0; }
.login-form .primary { min-height: 48px; justify-content: space-between; }
.form-error { margin: 14px 0; padding: 10px 12px; border-radius: 8px; background: #fff0eb; color: #8c3027; font-size: 14px; }
.hero { display: grid; grid-template-columns: 1fr minmax(180px,32%); background: #123f36; color: #f9faef; border-radius: 22px; overflow: hidden; margin: 26px 0 0; }
.hero-copy { align-self: center; padding: 24px 32px; }
.hero .term { color: #d0efbe; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.hero h1 { font-size: clamp(28px,3.7vw,44px); }
.hero .student { margin-top: 8px; color: #deebe1; font-size: 14px; }
.hero-img { width: 100%; height: 100%; max-height: 175px; object-fit: cover; object-position: center 55%; }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); margin: 14px 0 22px; padding: 14px 0; }
.metric { display: flex; gap: 12px; align-items: center; padding: 0 clamp(10px,2vw,24px); }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-icon, .cart-symbol, .empty-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--jade); color: var(--teal); }
.metric:nth-child(2) .metric-icon { background: #f2ecdb; color: #786235; }
.metric:nth-child(3) .metric-icon { background: #e8edf8; color: #405c8c; }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 20px; letter-spacing: -.04em; }
.metric strong span { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: normal; }
.nav { display: flex; border-bottom: 1px solid var(--line); gap: 20px; }
.tab { border: 0; border-radius: 0; background: transparent; color: var(--muted); min-height: 48px; padding-inline: 4px; border-bottom: 3px solid transparent; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.running-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #277b55; }
.work-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(245px,29%); gap: clamp(16px,2.2vw,28px); align-items: start; margin: 24px 0 60px; }
#appRoot, #cartPanel { min-width: 0; }
#cartPanel { position: sticky; top: 16px; }
.view-heading, .between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-heading { margin-bottom: 16px; }
.view-heading p, .panel-title p { margin-top: 5px; }
.filters { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.filters .input-wrap { flex: 1; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--teal); }
.course-stack, .group-list, .agenda, .scheduler { display: grid; gap: 10px; }
.course { overflow: hidden; }
.course.open { border-color: #9ab6a5; }
.course-toggle { border: 0; background: transparent; width: 100%; text-align: left; padding: 15px 18px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; align-items: center; }
.course-toggle:hover { background: #f8faf6; }
.course-toggle:focus-visible { outline-offset: -4px; }
.course-name { display: block; font-size: 17px; line-height: 1.4; font-weight: 700; margin-top: 4px; }
.course-toggle > .i { width: 16px; color: var(--muted); }
.course.open .course-toggle > .i { transform: rotate(180deg); }
.code { font-size: 12px; letter-spacing: .035em; color: var(--teal); font-weight: 750; }
.credit { font-size: 12px; color: var(--muted); }
.tags, .actions, .legend { flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; background: #eef1ed; color: #48574f; border-radius: 7px; padding: 4px 8px; font-size: 12px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.badge.green { background: #dff1e1; color: #21613c; }
.badge.blue { background: #e5edf9; color: #305987; }
.badge.amber { background: #fbefd9; color: #805418; }
.badge.red { background: #fde6df; color: #933923; }
.groups { padding: 16px 18px; border-top: 1px solid var(--line); background: #fafbf8; }
.groups > .actions { margin-bottom: 12px; }
.group { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.group.picked { border-color: #81ae98; box-shadow: inset 3px 0 #388367; }
.group .between { align-items: flex-start; }
.group-info { margin-top: 8px; display: grid; gap: 4px; }
.detail { display: flex; align-items: baseline; gap: 7px; font-size: 13px; color: var(--muted); }
.detail svg.i { width: 14px; height: 14px; align-self: flex-start; margin-top: 3px; }
.group .actions { margin-top: 12px; }
.alert-text { color: #9d392a; font-size: 13px; font-weight: 650; }
.cart { padding: 18px; }
.cart-toggle { display: flex; align-items: center; gap: 10px; width: 100%; }
.cart-toggle strong { flex: 1; font-size: 17px; }
.cart-mobile { display: none; }
.cart-count { background: #eef3ed; color: var(--teal); border-radius: 20px; min-width: 26px; text-align: center; font-size: 13px; font-weight: 700; padding: 3px 8px; }
.cart-list { padding: 0; margin: 14px 0; list-style: none; max-height: 35vh; overflow-y: auto; }
.cart-list li { border-top: 1px solid var(--line); padding: 9px 0; }
.cart-list strong, .cart-list small { display: block; overflow-wrap: anywhere; }
.cart-list strong { font-size: 14px; }
.cart-list small { color: var(--muted); }
.cart-help { margin: 16px 0; }
.cart-actions { display: grid; gap: 8px; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 16px; }
.empty .button { margin-top: 4px; }
.block { padding: 20px; }
.block + .block { margin-top: 14px; }
.panel-title { margin-bottom: 15px; }
.day-picker, .day-agenda { display: none; }
.legend { gap: 12px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: #79a1cd; }
.dot.reg { background: #6b9e78; }
.dot.conflict { background: #db8b74; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.tkb-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.tkb-grid th, .tkb-grid td { border: 1px solid #e2e8df; padding: 4px; vertical-align: top; height: 34px; }
.tkb-grid th { background: #f3f6ef; padding: 7px 3px; font-weight: 650; }
.tkb-grid thead th { white-space: nowrap; }
.tkb-grid td { min-width: 42px; }
.tkb-cell { display: block; margin-bottom: 2px; color: #31567f; background: #e6eef9; border-radius: 4px; padding: 3px; font-size: 11px; }
.tkb-cell.reg { background: var(--jade); color: #28603d; }
.tkb-cell.conflict { background: #fde6df; color: #933923; }
.schedule-entry { padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.schedule-entry h3 { font-size: 15px; margin: 5px 0; }
.segment { display: inline-flex; gap: 3px; padding: 3px; background: #eff2ec; border-radius: 10px; margin-bottom: 12px; }
.chip { border-color: transparent; background: transparent; }
.chip[aria-pressed="true"] { color: var(--teal); background: white; box-shadow: 0 1px 4px #163e271f; }
.slots { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.time-slot { flex-direction: column; gap: 2px; font-size: 17px; }
.time-slot small { font-size: 12px; color: var(--muted); font-weight: 500; }
.time-slot[aria-pressed="true"], .day[aria-pressed="true"] { border-color: var(--teal); background: var(--jade); color: var(--teal); }
.custom-slot { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.custom-slot .input-wrap { flex: 1; min-width: 0; }
.custom-slot .button { white-space: nowrap; }
.timer-note { margin-top: 14px; }
.timer-note .button { margin-top: 8px; }
.scheduler .block { margin: 0; }
.switch { min-width: 74px; }
.log { margin: 0; padding: 0; list-style: none; max-height: 230px; overflow: auto; font: 13px/1.5 ui-monospace, Consolas, monospace; }
.log li { padding-block: 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.toast { visibility: hidden; position: fixed; z-index: 8; max-width: min(calc(100% - 32px),480px); left: 50%; transform: translateX(-50%); bottom: max(20px,env(safe-area-inset-bottom)); background: #163e34; color: white; border-radius: 12px; padding: 11px 16px; box-shadow: 0 4px 18px #173c3933; text-align: center; font-size: 14px; pointer-events: none; }
.toast.visible { visibility: visible; }
@media (max-width: 800px) {
  .frame { padding-inline: 18px; }
  .work-grid { display: block; margin: 18px 0 0; padding-bottom: calc(95px + env(safe-area-inset-bottom)); }
  #cartPanel { position: fixed; inset: auto 0 0; z-index: 5; }
  .cart { padding: 5px 18px max(5px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border-inline: 0; border-bottom: 0; box-shadow: 0 -4px 22px #143d2814; }
  .cart-desktop { display: none; }
  .cart-mobile { display: flex; min-height: 51px; background: transparent; border: 0; padding: 0; text-align: left; }
  .cart-content { display: none; }
  .cart.expanded .cart-content { display: block; max-height: 54dvh; overflow-y: auto; padding-bottom: 8px; }
  .cart.expanded .cart-mobile > svg { transform: rotate(180deg); }
  .cart-list { max-height: 24dvh; }
  .cart-symbol { width: 32px; height: 32px; }
  body.signed-in .toast { top: 12px; bottom: auto; }
}
@media (max-width: 650px) {
  .mast-inner { min-height: 58px; }
  .brand { font-size: 18px; gap: 7px; }
  .brand img { width: 32px; height: 32px; }
  .mast-end { font-size: 12px; }
  .mast-end:has(button:not([hidden])) > span { display: none; }
  .login { grid-template-columns: 1fr; margin: 18px auto 28px; max-width: 460px; }
  .login-art img { height: clamp(95px,24vw,145px); object-position: 50% 61%; }
  .login-art figcaption { padding: 13px 19px; }
  .login-art h2 { font-size: 22px; }
  .login-art p { display: none; }
  .login-form { padding: 20px; }
  .login-form h1 { font-size: 28px; }
  .login-form form { margin-top: 17px; }
  .field { margin-bottom: 12px; }
  .hero { margin-top: 16px; grid-template-columns: 1fr 27%; border-radius: 15px; }
  .hero-copy { padding: 16px; }
  .hero h1 { font-size: 25px; }
  .hero .term { font-size: 12px; margin-bottom: 5px; }
  .hero .student { font-size: 12px; }
  .hero-img { max-height: none; min-height: 100%; }
  .metrics { padding: 10px 0; margin: 10px 0; border-radius: 12px; }
  .metric-icon { display: none; }
  .metric { padding-inline: 9px; }
  .metric strong { font-size: 17px; }
  .metric small, .metric strong span { font-size: 11px; }
  .nav { gap: 3px; justify-content: space-between; }
  .tab { font-size: 13px; gap: 5px; }
  .tab svg.i { width: 16px; }
  .view-heading { margin-bottom: 12px; }
  .view-heading h2 { font-size: 24px; }
  .view-heading .quiet span { display: none; }
  .filters { gap: 8px; }
  .filters .check { font-size: 12px; gap: 2px; }
  .course-toggle { padding: 12px; grid-template-columns: minmax(0,1fr) auto; gap: 3px 8px; }
  .course-toggle > .badge { grid-column: 1; }
  .course-toggle > .i { grid-column: 2; grid-row: 1 / 3; }
  .course-name { font-size: 16px; }
  .groups, .block { padding: 14px; }
  .group { padding: 11px; }
  .week-grid, .legend { display: none; }
  .day-picker { display: flex; gap: 4px; margin-bottom: 12px; }
  .day { flex: 1; min-width: 0; padding-inline: 2px; font-size: 13px; }
  .day-agenda { display: grid; gap: 8px; }
  .hint { font-size: 13px; }
}
@media (max-width: 360px) {
  .frame { padding-inline: 12px; }
  .tab { font-size: 12px; }
  .tab svg.i { display: none; }
  .metric { padding-inline: 6px; }
}
@media (max-height: 650px) and (max-width: 650px) {
  .login-art img { height: 70px; }
}
