/* Light-only classtable-aligned UI + 2-row circular-check capsule todos + touch pickers + form voice. */
:root {
  color-scheme: light;
  --viewport-font-unit: .24rem;
  --time-width: 4.5rem;
  --header-height: 3.625rem;
  --period-height: 3.5rem;
}

h1, h2, h3 { margin: 0; }
button, input, textarea, select { font: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.week-control, .menu-control { position: relative; }
.header-inner { padding-bottom: 10px; }
.header-inner .desktop-week-nav { display: flex; margin-left: -4px; }
.header-inner .week-step { width: 28px; height: 28px; }
.header-date-range { color: #8b9199; font-size: .8125rem; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }

.page-status { width: calc(100% - 64px); max-width: 1368px; margin: 0 auto 10px; padding: 8px 14px; border-radius: 14px; background: var(--accent-soft); color: #445775; font-size: .75rem; }

.popover { position: absolute; top: calc(100% + 10px); }
.week-popover { left: 0; }
.action-popover { right: 0; left: auto; width: 196px; max-width: calc(100vw - 24px); transform-origin: right top; }
.action-popover > button svg { flex: none; color: #535c69; }
.week-options { max-height: calc(100dvh - 170px); overflow: auto; }
.week-option[aria-current] { background: var(--accent-soft); color: var(--accent); }
.week-select-trigger[aria-expanded="true"] .select-chevron { transform: rotate(180deg); }

/* Compact 2-Row Rounded-Capsule Todo Strip + Circular Straight-Check Checkboxes */
.timetable-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.weekly-strip {
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--table-surface, #fff);
}
.strip-rows {
  flex: 1;
  min-width: 0;
  height: 58px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  overflow: hidden;
}

.strip-todo {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: #f2f4f8;
  color: #2c333d;
}
.strip-todo:hover { background: #e9eef6; }
.strip-todo.is-ddl:not(.completed) {
  background: #fff2e8;
  color: #6e3a1e;
}
.strip-todo.is-ddl:not(.completed):hover { background: #ffe7d6; }
.strip-todo.completed {
  opacity: .56;
  background: #eff2f6;
  color: #7b838f;
}
.strip-todo.completed strong {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.todo-check {
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid #b8c2d0;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  transition: background 140ms, border-color 140ms, transform 120ms var(--ease);
}
.todo-check:active { transform: scale(.9); }
.strip-todo.is-ddl:not(.completed) .todo-check { border-color: #dba384; }
.todo-check[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.check-icon { display: block; width: 11px; height: 11px; }

.strip-item-btn {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 1px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: .75rem;
}
.strip-item-btn strong {
  font-weight: 600;
  max-width: 210px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strip-meta { flex: none; font-size: .6875rem; opacity: .76; white-space: nowrap; }

.strip-empty-btn {
  height: 26px;
  padding: 0 12px;
  border: 1px dashed #cfd6e2;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
}
.strip-empty-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.strip-overview-btn {
  flex: none;
  min-height: 28px;
  padding: 3px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 140ms, transform 140ms var(--ease);
}
.strip-overview-btn:hover { background: var(--accent-hover); }
.strip-overview-btn:active { transform: scale(.96); }
.strip-chevron { font-size: .9375rem; line-height: 1; margin-top: -1px; }

/* Todo Overview Half-Modal + Bottom Undo Bar */
.overview-body { display: grid; gap: 16px; padding: 4px 2px 2px; }
.overview-empty { margin: 12px 4px; color: var(--muted); font-size: .8125rem; text-align: center; }
.overview-group { display: grid; gap: 8px; }
.overview-group-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.overview-group-head h3 { font-size: .75rem; font-weight: 650; color: #5c6675; }
.overview-list { border-radius: 20px; background: #ffffffb8; padding: 2px 12px; }
.overview-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.overview-row + .overview-row { border-top: 1px solid #e9edf290; }
.overview-item-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.overview-item-btn:hover { background: #8793a00f; }
.overview-item-copy { min-width: 0; display: grid; gap: 3px; }
.overview-item-copy strong { font-size: .875rem; font-weight: 600; color: #2b313a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-item-copy small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview-row.completed .overview-item-copy strong {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.countdown-tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .6875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.countdown-tag[data-tone="urgent"] { background: #fde8e5; color: #c43c2f; }
.countdown-tag[data-tone="soon"] { background: #fff2e8; color: #a94717; }
.countdown-tag[data-tone="calm"] { background: #edf1f7; color: #556173; }
.countdown-tag[data-tone="done"] { background: #eaedf2; color: #8b93a0; }

.overview-undo-bar {
  flex: none;
  margin-top: 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: #364150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.overview-undo-text {
  min-width: 0;
  font-size: .8125rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-undo-btn {
  flex: none;
  min-height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 650;
}
.overview-undo-btn:hover { filter: brightness(.95); }

/* Calendar Week Grid (classtable rhythm + 5-day touch-scrollable window) */
.timetable-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  touch-action: pan-x pan-y;
  padding-bottom: 84px;
  scroll-padding-bottom: 84px;
}
#weekGrid { --day-count: 7; position: relative; }
#weekGrid .corner { z-index: 8; }
#weekGrid .time-cell { z-index: 6; }
#weekGrid .day-head { z-index: 5; }
.now-line { z-index: 3; }
#weekGrid .course-card { z-index: 2; }

#weekGrid .day-head { border-top: 0; border-left: 0; padding: 0; gap: 2px; }
#weekGrid .day-head:hover { background: #f7f9fb; }
#weekGrid .day-head strong { font-size: 1.0625rem; font-weight: 700; }
#weekGrid .day-head .day-date { font-size: .8125rem; }
#weekGrid .grid-cell { cursor: cell; }
#weekGrid .grid-cell.today-col { background: color-mix(in srgb, #ec6b55 2.5%, var(--table-surface, #fff)); }
#weekGrid .grid-cell.edge-bottom { border-bottom: 1px solid var(--line); }
#weekGrid .time-cell {
  justify-content: flex-start;
  padding: 6px 0 4px;
  color: #9a9fa5;
  border-bottom-color: transparent;
}
#weekGrid .time-cell.edge-bottom { justify-content: space-between; }
#weekGrid .time-cell strong {
  margin: 0;
  color: #333638;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#weekGrid .time-cell .end-hour-label {
  margin: 0;
  color: #8b9199;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#weekGrid .course-card { min-height: 18px; margin-top: 2px; margin-bottom: 2px; padding: 6px 10px; border-radius: 10px; }
#weekGrid .course-card strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.25;
}
#weekGrid .course-card.tall strong { -webkit-line-clamp: 2; }
#weekGrid .course-card .desktop-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  line-height: 1.25;
}
#weekGrid .course-card .course-time {
  margin-top: auto;
  padding-top: 2px;
  font-size: .6875rem;
  line-height: 1.2;
  white-space: nowrap;
}
#weekGrid .course-card .mobile-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#weekGrid .course-card[data-lanes="multi"] { padding: 5px 6px; }
#weekGrid .course-card[data-lanes="multi"] strong { font-size: .8125rem; }
#weekGrid .course-card[data-lanes="multi"] .course-time { font-size: .625rem; letter-spacing: -.02em; }
#weekGrid .course-card.compact { min-height: 16px; margin-top: 1px; margin-bottom: 1px; padding: 2px 8px; justify-content: center; }
#weekGrid .course-card.compact strong { -webkit-line-clamp: 1; font-size: .75rem; white-space: nowrap; }

/* Live Now Indicator */
.now-line {
  position: relative;
  height: 2px;
  align-self: start;
  background: #ec6b55;
  pointer-events: none;
  margin-top: -1px;
}
.now-dot {
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ec6b55;
}

/* Bottom-Right Hold-to-Speak Button + Floating Voice HUD */
.hold-voice-btn {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 32;
  width: 52px;
  height: 52px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #ffffffe6;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffffde 0%, #eff3f7b8 55%, #dbe3ed96 100%);
  color: var(--accent);
  box-shadow: 0 12px 32px #14203920, inset 0 1px 0 #fff, inset 0 -1px 0 #ffffff70;
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 180ms var(--ease), background 160ms, color 160ms, box-shadow 180ms;
}
.hold-voice-btn:hover { transform: scale(1.04); }
.hold-voice-btn.is-holding {
  transform: scale(1.07);
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 36%, transparent);
}
.hold-voice-btn.is-holding[data-cancel="true"] {
  background: #ec6b55;
  box-shadow: 0 10px 28px #ec6b5548;
}
.hold-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 36%, transparent);
  opacity: 0;
  pointer-events: none;
}
:is(.hold-voice-btn, .form-voice-btn).is-holding .hold-ring {
  opacity: 1;
  animation: holdPulse 1.1s ease-out infinite;
}
:is(.hold-voice-btn, .form-voice-btn).is-holding[data-cancel="true"] .hold-ring {
  border-color: #ec6b5560;
}
@keyframes holdPulse {
  0% { transform: scale(0.98); opacity: .65; }
  100% { transform: scale(1.24); opacity: 0; }
}

.voice-hud {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(82px, calc(env(safe-area-inset-bottom) + 80px));
  z-index: 33;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 6px 12px;
  border: 1px solid var(--notice-edge);
  border-radius: 999px;
  background: var(--notice-material);
  color: var(--notice-ink);
  box-shadow: 0 8px 24px #1420391c, inset 0 1px 0 #fff;
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
}
.hud-holding, .hud-recognizing { display: none; }
.voice-hud[data-state="holding"] .hud-holding { display: inline-flex; align-items: center; gap: 8px; height: 22px; }
.voice-hud[data-state="recognizing"] .hud-recognizing { display: inline-flex; align-items: center; gap: 7px; height: 22px; min-height: 0; }
.hud-waveform { width: 44px; height: 16px; display: inline-flex; align-items: center; justify-content: space-between; gap: 2px; flex: none; }
.wave-bar {
  flex: none;
  width: 2.5px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  transform: scaleY(0.22);
  transition: transform 70ms linear, background 140ms;
}
.voice-hud[data-cancel="true"] .wave-bar { background: #ec6b55; }
.hud-timer { color: #4b5563; font-size: .75rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
.hud-hint { color: #76808f; font-size: .6875rem; font-weight: 550; line-height: 1; white-space: nowrap; }
.voice-hud[data-cancel="true"] .hud-hint { color: #d94838; font-weight: 650; }

.dock-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.8px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
.hud-status { font-size: .75rem; font-weight: 550; color: #3d4654; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fly-Into-Card Landing Animation */
.card-awaiting-land { opacity: 0 !important; }
.card-just-landed { animation: cardSettle 280ms var(--ease); }
@keyframes cardSettle {
  0% { transform: scale(1); }
  45% { transform: scale(1.016); }
  100% { transform: scale(1); }
}

/* Buttons & Forms */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 22px; background: transparent; color: #353b45; font-size: .875rem; font-weight: 600; white-space: nowrap; }
.button:not(:disabled):hover { background: #e9edf4; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:not(:disabled):hover { background: #084ece; }
.button.secondary { background: #e9edf3; border-color: transparent; color: #4f5968; }

.startup, .login { width: min(420px, calc(100% - 32px)); margin: clamp(32px, 13vh, 135px) auto 24px; }
.startup { text-align: center; color: var(--muted); }
.login { padding: 28px; border: 1px solid #fff; border-radius: 28px; background: var(--material); box-shadow: var(--material-shadow); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-badge { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; flex: none; }
.login-badge img { width: 44px; height: 44px; display: block; }
.login h1 { font-size: 22px; letter-spacing: -.03em; }
.login-sub { margin: 3px 0 0; color: var(--muted); font-size: .8125rem; }
.login form { display: grid; gap: 10px; }
.login .primary { margin-top: 6px; border-radius: 22px; height: 44px; }
.login-remember { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

label { display: grid; gap: 5px; min-width: 0; color: #353b45; font-size: .8125rem; font-weight: 650; }
input:not([type=checkbox]), textarea, select { width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid #e6eaf0; border-radius: 14px; background: #f5f7fa; color: #242629; font-size: 16px; font-weight: 450; }
textarea { line-height: 1.5; resize: vertical; }
textarea::placeholder { color: #858d98; }
input:not([type=checkbox]):focus, select:focus, textarea:focus { outline: 2px solid #93b5fc; outline-offset: -1px; }
.form-detail, .error { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.error, .is-error { color: #a13e38; }

/* Dialogs & Read-Only Summary / Unified Touch Editor */
dialog.course-detail {
  width: min(460px, calc(100% - 32px));
  max-height: min(86dvh, 760px);
  padding: 24px;
  border: 1px solid #ffffffd9;
  border-radius: 32px;
  background: var(--material);
  color: inherit;
  box-shadow: 0 32px 100px #14203930, inset 0 1px 0 #fff;
}
dialog.course-detail::backdrop {
  background: #1a223138;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
dialog.course-detail .detail-header { padding-bottom: 12px; }
dialog.course-detail .detail-header .icon-button {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ffffffcc 0%, #eff3f78c 55%, #dbe3ed66 100%);
  border: 1px solid #ffffffe6;
  box-shadow: 0 4px 14px #26395210, inset 0 1px 0 #fff, inset 0 -1px 0 #ffffff70;
  color: #353d47;
}
.dialog-body { display: grid; gap: 12px; padding: 6px 0 0; }
.editor-surface[open] { display: flex; flex-direction: column; overflow: hidden; }
.editor-surface .detail-header { flex: none; }
.editor-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.editor-fields { display: grid; gap: 12px; }

.summary-hero { margin-top: 2px; }
.summary-list { margin-top: 2px; }
.summary-list .summary-note { white-space: pre-wrap; text-align: right; }

/* Pill Segmented Controls */
.seg-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: var(--accent-soft);
}
.seg-control.seg-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-control button {
  min-height: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #555e6b;
  font-size: .8125rem;
  font-weight: 550;
  transition: background 160ms, color 160ms, box-shadow 160ms;
}
.seg-control button[aria-checked="true"] {
  background: var(--material);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 6px #17253b12;
}

.editor-fields .detail-course { --course-color: #2b76a5; --course-bg: #eef6fc; margin-top: 2px; display: grid; gap: 6px; padding: 18px 20px; }
.editor-fields .detail-course[data-type="task"] { --course-color: #5e4ca0; --course-bg: #f4f1fc; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-fields .detail-course .course-eyebrow { margin: 0; flex: 1; min-width: 0; }
.form-voice-btn {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #ffffffe6;
  border-radius: 50%;
  background: #ffffffd9;
  color: var(--course-color);
  box-shadow: 0 4px 12px #14203914, inset 0 1px 0 #fff;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 160ms var(--ease), background 160ms, color 160ms;
}
.form-voice-btn:active { transform: scale(.94); }
.form-voice-btn.is-holding {
  transform: scale(1.1);
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.form-voice-btn.is-holding[data-cancel="true"] {
  background: #ec6b55;
  color: #fff;
}

.editor-fields .detail-course input[name="title"] {
  min-height: 36px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--course-color);
  font-size: calc(1.375rem * var(--text-scale));
  font-weight: 650;
  letter-spacing: -.03em;
}
.editor-fields .detail-course textarea[name="note"] {
  min-height: 42px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: color-mix(in srgb, var(--course-color) 85%, #242629);
  font-size: .875rem;
  line-height: 1.45;
  resize: none;
}
.editor-fields .detail-course :is(input, textarea):focus { outline: none; }
.editor-fields .detail-course :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--course-color) 55%, #7a8594); }

/* Touch-Friendly Inline Accordion Pickers */
.touch-detail-list { margin: 0; padding: 4px 16px; }
.touch-row {
  grid-template-columns: minmax(64px, 78px) minmax(0, 1fr);
  align-items: center;
  min-height: 50px;
  padding: 6px 0;
  font-weight: 500;
}
.touch-row > span { color: #687485; }
.touch-row + .touch-row,
.inline-picker + .touch-row { border-top: 1px solid #e9edf2; }

.time-pill-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.picker-pill {
  justify-self: end;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: #eff3f8;
  color: #2b3340;
  font-size: .875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background 140ms, color 140ms, transform 120ms var(--ease);
}
.picker-pill:active { transform: scale(.96); }
.picker-pill.is-open { background: var(--accent-soft); color: var(--accent); }
.time-range-sep { color: #8c95a3; font-size: .875rem; flex: none; }
.clear-pill-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #edf1f6;
  color: #6f7886;
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex: none;
}
.clear-pill-btn:hover { background: #f3e4e4; color: #b53d35; }

.inline-picker {
  padding: 10px 0 12px;
  border-top: 1px dashed #e6ebf2;
  display: grid;
  gap: 10px;
}
.picker-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chip {
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: #eff3f8;
  color: #3f4754;
  font-size: .75rem;
  font-weight: 550;
}
.picker-chip:hover { background: #e4eaf3; }
.picker-chip.is-active { background: var(--accent); color: #fff; font-weight: 600; }

.date-quick-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cal-month-nav { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.cal-month-nav strong { font-size: .8125rem; font-weight: 650; color: #363d47; min-width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-nav-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #eff3f8;
  color: #424b58;
  font-size: 1rem;
  display: grid;
  place-items: center;
}
.cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-weekdays span { font-size: .6875rem; color: var(--muted); padding: 2px 0; }
.cal-pad { height: 36px; }
.cal-day {
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2f3640;
  font-size: .8125rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: #eff3f8; }
.cal-day.is-today { color: #ec6b55; font-weight: 700; }
.cal-day[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 650; }

.time-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.time-col-wrap { display: grid; gap: 4px; }
.time-col-wrap small { text-align: center; color: var(--muted); font-size: .6875rem; font-weight: 600; }
.time-col {
  height: 164px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
  display: grid;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #f3f6fa;
  scrollbar-width: none;
}
.time-col::-webkit-scrollbar { display: none; }
.time-opt {
  height: 38px;
  scroll-snap-align: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #363e4a;
  font-size: .875rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.time-opt[aria-selected="true"] {
  background: #fff;
  color: var(--accent);
  font-weight: 650;
  box-shadow: 0 2px 6px #17253b12;
}

/* Draft Fallback Sheet */
.capture-hero { padding: 18px 20px; }
.capture-hero textarea { font-size: .9375rem; min-height: 68px; border: 0; background: transparent; padding: 2px; }
.draft-review { display: grid; gap: 8px; padding-top: 4px; }
.draft-review-head { display: flex; align-items: center; justify-content: space-between; font-size: .8125rem; color: #454d59; }
.text-link-btn { border: 0; padding: 4px 6px; background: transparent; color: var(--accent); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.draft-list { display: grid; gap: 8px; }
.draft-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-inline-start: 3px solid #3385b7;
  border-radius: 16px;
  background: #f0f7fc;
}
.draft-card.task { border-inline-start-color: #7c6db5; background: #f6f4fc; }
.draft-card-main { min-width: 0; display: grid; gap: 4px; }
.draft-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.draft-card-top strong { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-badge { flex: none; padding: 1px 6px; border-radius: 5px; background: #dcecf8; color: #246894; font-size: .6875rem; font-weight: 650; }
.draft-badge.task { background: #e8e3f8; color: #5b489d; }
.draft-card-main small { color: #67707e; font-size: .75rem; }
.draft-card-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.draft-edit-btn { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: #ffffffcc; color: #3d4654; font-size: .75rem; font-weight: 600; }
.draft-remove-btn { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #8c95a3; font-size: 1rem; }
.draft-remove-btn:hover { background: #f3e4e4; color: #b53d35; }

.editor-footer { flex: none; }
.editor-footer button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding-inline: 12px; }
.editor-footer [data-confirming] { background: #d94838; color: #fff; }

/* Apple Calendar ICS Sync */
.strip-todo.is-ics { background: #edf5fd; color: #2b5c8a; padding-left: 8px; }
.strip-todo.is-ics:hover { background: #e1eefb; }
.ics-cal-dot { width: 13px; height: 13px; flex: none; opacity: .82; }
#weekGrid .course-card.is-ics {
  border-inline-start: 3px solid color-mix(in srgb, var(--course-color) 65%, transparent);
}
.ics-body { display: grid; gap: 14px; padding: 6px 2px 2px; }
.ics-form { display: grid; gap: 8px; }
.ics-form-row { display: flex; gap: 8px; align-items: center; }
.ics-form-row input { flex: 1; min-width: 0; }
.ics-form-row button { flex: none; min-height: 40px; padding: 0 14px; }
.ics-feed-section { display: grid; gap: 8px; }
.ics-feed-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; font-size: .8125rem; color: #454d59; }
.ics-feed-list { display: grid; gap: 8px; }
.ics-feed-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #ffffffc4;
  border: 1px solid #e9eef5;
}
.ics-feed-meta { min-width: 0; display: grid; gap: 3px; }
.ics-feed-meta strong { font-size: .875rem; font-weight: 600; color: #2b313a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ics-feed-meta small { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ics-feed-meta .is-error { color: #a13e38; }
.ics-feed-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ics-sync-btn { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600; }
.ics-sync-btn:hover { background: var(--accent-hover); }
.ics-remove-btn { min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: #f2f4f8; color: #67707e; font-size: .75rem; font-weight: 550; }
.ics-remove-btn:hover { background: #f6e6e6; color: #b53d35; }
.ics-hint { margin: 0; padding: 0 4px; color: var(--muted); font-size: .75rem; }
.ics-guide .install-steps { margin: 8px 0 4px; gap: 12px; }

/* Install Guide Dialog */
.install-guide .install-ready { margin: 4px 0 0; }
#installDialog .install-ready img { border-radius: 0; }
.install-guide .install-steps { margin: 4px 0 0; }

/* Adaptive Frosted Glass Toast */
.toast {
  position: fixed;
  z-index: 80;
  bottom: max(26px, env(safe-area-inset-bottom));
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 96px);
  padding: 10px 16px;
  border-radius: 28px;
  background: var(--notice-material);
  color: var(--notice-ink);
  border: 1px solid var(--notice-edge);
  font-size: .8125rem;
  box-shadow: var(--notice-shadow);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(.98);
  transition: opacity 140ms, transform 220ms var(--ease);
}
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.toast-action {
  border: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 650;
}
.toast-action:hover { background: var(--accent-hover); }

/* Responsive adjustments */
@media (min-width: 640px) and (max-width: 1050px) {
  :root { --time-width: 4rem; --header-height: 3.5rem; --period-height: 3.25rem; }
}

@media (max-width: 639px) {
  :root { --time-width: 42px; --header-height: 44px; --period-height: 46px; }
  .week-popover { left: -40px; }
  .page-status { width: calc(100% - 24px); }
  .header-inner { min-height: 52px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  .header-inner .icon-button { width: 34px; height: 34px; }
  .header-inner .desktop-week-nav,
  .header-date-range { display: none; }
  .title-cluster { flex: 1; gap: 6px; }
  .title-cluster > strong { font-size: 1.1875rem; line-height: 34px; }
  .weekly-strip { padding: 7px 10px; gap: 8px; }
  .strip-item-btn strong { max-width: 156px; }
  .strip-overview-btn { padding: 3px 10px; }
  #weekGrid .time-cell { padding: 4px 0 3px; }
  #weekGrid .time-cell strong { font-size: .6875rem; font-weight: 650; }
  #weekGrid .time-cell .end-hour-label { font-size: .625rem; }
  #weekGrid .day-head strong { font-size: .8125rem; white-space: nowrap; }
  #weekGrid .day-head .day-date { font-size: .6875rem; }
  #weekGrid .course-card { margin-top: 2px; margin-bottom: 2px; padding: 3px 4px; border-radius: 7px; }
  #weekGrid .course-card strong { font-size: .6875rem; line-height: 1.16; -webkit-line-clamp: 2; }
  #weekGrid .course-card.tall strong { -webkit-line-clamp: 3; }
  #weekGrid .course-card .desktop-meta { display: none; }
  #weekGrid .course-card .mobile-meta {
    display: block;
    font-size: .59375rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: auto;
    padding-top: 1px;
  }
  #weekGrid .course-card.compact { padding: 1px 4px; }
  #weekGrid .course-card.compact strong { -webkit-line-clamp: 1; }
  #weekGrid .course-card.compact .mobile-meta { display: none; }
  #weekGrid .course-card[data-lanes="multi"] { padding: 3px 2px; }
  #weekGrid .course-card[data-lanes="multi"] strong { font-size: .625rem; line-height: 1.15; -webkit-line-clamp: 3; }
  #weekGrid .course-card[data-lanes="multi"] .mobile-meta { display: none; }
  .hold-voice-btn { right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); }
  .voice-hud {
    right: 16px;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 76px));
  }
  .toast { bottom: max(26px, env(safe-area-inset-bottom)); }
  dialog.course-detail {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    padding: 10px 20px max(24px, env(safe-area-inset-bottom));
    border-radius: 32px 32px 0 0;
    border-bottom: 0;
  }
  .editor-surface { width: 100%; }
  .editor-footer { gap: 8px; }
  .editor-footer button { padding-inline: 10px; font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hold-voice-btn.is-holding .hold-ring,
  .form-voice-btn.is-holding .hold-ring,
  .card-just-landed { animation: none; }
}
