/* 새움 v65 — mobile-first product design system */
:root {
  color-scheme: light;
  --app-bg: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f1f3f6;
  --text-strong: #172033;
  --text: #344054;
  --text-muted: #717b8c;
  --border: #e2e6ec;
  --border-strong: #cfd5df;
  --brand: #f26a21;
  --brand-strong: #dc4f0c;
  --brand-soft: #fff0e6;
  --secondary: #0b8f82;
  --secondary-soft: #e5f7f4;
  --success: #16866f;
  --success-soft: #e8f8f3;
  --danger: #d84c45;
  --danger-soft: #fff0ee;
  --warning: #b76a0b;
  --warning-soft: #fff5dc;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 10px;
  --radius-control: 12px;
  --radius-card: 16px;
  --radius-sheet: 24px;
  --shadow-float: 0 12px 34px rgba(23, 32, 51, .12);
  --shadow-soft: 0 4px 14px rgba(23, 32, 51, .045);
  --motion-fast: 160ms;
  --motion-base: 220ms;
  --motion-sheet: 260ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
  --bg: var(--app-bg);
  --panel: var(--surface);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --line: var(--border);
  --primary: var(--brand);
  --primary-soft: var(--brand-soft);
  --accent: var(--brand);
  --accent-strong: var(--brand-strong);
  --accent-soft: var(--brand-soft);
  --shadow: var(--shadow-soft);
  --topbar-height: 64px;
  --content-max: 1320px;
  --page-gutter: 24px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #10141c;
  --surface: #181e29;
  --surface-raised: #202735;
  --surface-muted: #252d3b;
  --text-strong: #f4f6fa;
  --text: #d6dbe5;
  --text-muted: #9aa5b5;
  --border: #303949;
  --border-strong: #465166;
  --brand: #ff8642;
  --brand-strong: #ff9d63;
  --brand-soft: #3b251d;
  --secondary: #43c8b9;
  --secondary-soft: #183633;
  --success: #63d5b9;
  --success-soft: #19372f;
  --danger: #ff7f79;
  --danger-soft: #3a2426;
  --warning: #f7bd62;
  --warning-soft: #392f1e;
  --shadow-float: 0 16px 42px rgba(0, 0, 0, .32);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, .18);
}

html {
  background: var(--app-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--app-bg);
  color: var(--text-strong);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea,
summary {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
summary:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 2px;
}

.sr-only {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry-app .app-shell {
  grid-template-columns: 208px minmax(0, 1fr);
  min-height: 100svh;
  background: var(--app-bg);
}

.entry-app .sidebar {
  padding: 20px 12px;
  background: var(--surface);
  border-color: var(--border);
}

.entry-app .brand {
  min-height: 48px;
  padding: 0 8px 18px;
}

.entry-app .brand-mark,
.entry-app .mobile-home-button {
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  box-shadow: none;
}

.entry-app .nav-item {
  min-height: 44px;
  padding: 10px 12px;
  gap: 11px;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  transition: color var(--motion-fast) var(--motion-ease), background var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.entry-app .nav-item .ui-icon {
  width: 22px;
  height: 22px;
}

.entry-app .nav-item:hover,
.entry-app .nav-item.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.entry-app #appMain {
  min-width: 0;
  padding: 0 var(--page-gutter) 48px;
}

.entry-app .topbar {
  height: var(--topbar-height);
  margin: 0 calc(var(--page-gutter) * -1) 12px;
  padding: 0 var(--page-gutter);
  gap: 14px;
  background: color-mix(in srgb, var(--app-bg) 88%, transparent);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
  backdrop-filter: blur(18px) saturate(125%);
}

.entry-app .topbar h1 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 20px;
  letter-spacing: -.025em;
}

.entry-app .brand strong,
.entry-app .page-heading {
  color: var(--text-strong);
}

.entry-app .brand small {
  color: var(--text-muted);
}

.entry-app .page-heading {
  padding-left: 16px;
  border-color: var(--border);
}

.entry-app .view,
.entry-app .section-nav {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.entry-app .view.active {
  animation: view-enter var(--motion-base) var(--motion-ease) both;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.entry-app .panel,
.entry-app .stat-card,
.entry-app .study-summary,
.entry-app .more-profile-card,
.entry-app .more-ai-usage,
.entry-app .more-menu,
.entry-app .mobile-schedule-overview,
.entry-app .mobile-timetable,
.entry-app dialog .modal-form {
  background: var(--surface);
  color: var(--text-strong);
  border-color: var(--border);
  box-shadow: none;
}

.entry-app .panel {
  padding: 16px;
  border-radius: var(--radius-card);
}

.entry-app .panel-head {
  min-height: 36px;
  margin-bottom: 12px;
}

.entry-app .panel-head h3,
.entry-app .panel h3 {
  margin: 2px 0 0;
  font-size: 16px;
  letter-spacing: -.018em;
}

.entry-app .eyebrow {
  color: var(--brand-strong);
  font-size: 10px;
  letter-spacing: .08em;
}

.entry-app .view-intro {
  min-height: 70px;
  padding: 10px 0 14px;
}

.entry-app .view-intro h2 {
  margin: 3px 0;
  font-size: 23px;
  letter-spacing: -.035em;
}

.entry-app .view-intro span,
.entry-app .helper,
.entry-app small {
  color: var(--text-muted);
}

.entry-app .primary-button,
.entry-app .soft-button,
.entry-app .icon-button,
.entry-app .link-button {
  min-height: 40px;
  border-radius: var(--radius-control);
  box-shadow: none;
  transition: transform var(--motion-fast) var(--motion-ease), background var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease);
}

.entry-app .primary-button {
  background: var(--brand);
  color: #fff;
}

.entry-app .primary-button:hover {
  background: var(--brand-strong);
}

.entry-app .soft-button,
.entry-app .icon-button {
  color: var(--text-strong);
  background: var(--surface-raised);
  border-color: var(--border);
}

.entry-app .link-button {
  color: var(--brand-strong);
}

.entry-app button:active {
  transform: scale(.98);
}

.entry-app input,
.entry-app textarea,
.entry-app select,
.entry-app .search-box {
  color: var(--text-strong);
  background: var(--surface-raised);
  border-color: var(--border);
  border-radius: var(--radius-control);
}

.entry-app input::placeholder,
.entry-app textarea::placeholder {
  color: color-mix(in srgb, var(--text-muted) 75%, transparent);
}

.entry-app .content-tabs,
.entry-app .filter-tabs,
.entry-app .section-nav {
  background: var(--surface-muted);
  border-color: var(--border);
}

.entry-app .content-tabs button.active,
.entry-app .filter-tabs button.active,
.entry-app .section-nav button.active {
  color: var(--brand-strong);
  background: var(--surface-raised);
  box-shadow: none;
}

/* Landing */
.landing-page {
  color: var(--text-strong);
  background: var(--surface);
}

.landing-header {
  height: 64px;
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-color: var(--border);
  backdrop-filter: blur(18px);
}

.landing-header nav a,
.landing-login {
  color: var(--text);
}

.landing-brand > span,
.landing-open,
.landing-primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
}

.landing-hero {
  min-height: min(720px, calc(100svh - 64px));
  color: var(--text-strong);
  background: radial-gradient(circle at 16% 22%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 28rem), radial-gradient(circle at 85% 68%, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 26rem), linear-gradient(150deg, var(--brand-soft), var(--surface) 62%, var(--secondary-soft));
}

.landing-hero :is(.landing-lead, .landing-note, .landing-scroll) {
  color: var(--text-muted);
}

.landing-badge {
  color: var(--brand-strong);
  background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.landing-secondary {
  color: var(--text-strong);
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  border-color: var(--border-strong);
}

.landing-problems,
.landing-flow {
  background: var(--app-bg);
}

.landing-features {
  background: var(--surface);
}

.landing-service-tabs {
  background: var(--surface-muted);
}

.landing-service-tabs button {
  color: var(--text-muted);
}

.landing-service-tabs button.active {
  color: var(--brand-strong);
  background: var(--surface-raised);
  box-shadow: none;
}

.landing-problem-card,
.landing-service-panel,
.landing-flow-grid article {
  background: var(--surface-raised);
  color: var(--text-strong);
  border-color: var(--border);
  box-shadow: none;
}

.landing-section-head span,
.landing-problem-card p,
.landing-service-panel li,
.landing-flow-grid p,
.landing-footer p {
  color: var(--text-muted);
}

/* Home */
#dashboardView.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-top: 4px;
}

.home-kpi-strip,
.record-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-kpi-strip > button,
.record-kpi-grid > button {
  min-width: 0;
  min-height: 76px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  text-align: left;
  color: var(--text-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.home-kpi-strip > button:first-child,
.record-kpi-grid > button:first-child {
  background: linear-gradient(145deg, var(--brand-soft), var(--surface));
  border-color: color-mix(in srgb, var(--brand) 24%, var(--border));
}

.home-kpi-strip span,
.record-kpi-grid span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.home-kpi-strip strong,
.record-kpi-grid strong {
  overflow: hidden;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-kpi-strip small,
.record-kpi-grid small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dashboardView .dashboard-week {
  min-height: 68px;
  margin: 0;
  padding: 8px 12px;
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-card);
}

.dashboard-week-strip {
  gap: 4px;
}

.dashboard-week-strip button {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
  border-color: transparent;
}

.dashboard-week-strip button.selected {
  color: #fff;
  background: var(--text-strong);
  border-color: var(--text-strong);
}

.dashboard-week-strip button.today:not(.selected) {
  box-shadow: inset 0 0 0 1px var(--brand);
}

.dashboard-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.entry-app #dashboardView .dashboard-top-grid .dday-widget {
  width: 100%;
  height: auto !important;
  min-height: 94px !important;
  padding: 14px 16px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  color: var(--text-strong);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 68%);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
  border-radius: var(--radius-card);
}

.entry-app #dashboardView .dashboard-top-grid .dday-widget > div:first-child {
  min-width: 0;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
}

.entry-app #dashboardView .dday-widget .eyebrow {
  grid-column: 1 / -1;
  display: block !important;
}

.entry-app #dashboardView .dday-widget strong {
  grid-row: 2 / 4;
  margin: 0 !important;
  color: var(--brand-strong);
  font-size: 27px !important;
  line-height: 1;
}

.entry-app #dashboardView .dday-widget h3 {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  font-size: 15px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-app #dashboardView .dday-widget span {
  grid-column: 2;
  margin: 0;
  font-size: 11px;
}

.entry-app #dashboardView .dday-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 6px;
}

.entry-app #dashboardView .dday-actions button {
  width: auto !important;
  min-height: 40px !important;
  padding: 0 12px !important;
}

.dashboard-agenda-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.entry-app #dashboardView .dashboard-agenda-grid > .panel {
  height: 174px !important;
  min-height: 174px !important;
  overflow: hidden;
}

.dashboard-day-events,
.dashboard-timetable-panel .today-schedule {
  max-height: 112px;
  overflow: auto;
  overscroll-behavior: contain;
}

.home-more-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.home-more-summary > summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 750;
}

.home-more-summary > summary::-webkit-details-marker,
.calendar-sync-details > summary::-webkit-details-marker,
.mobile-google-details > summary::-webkit-details-marker,
.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.home-more-summary > summary small {
  font-size: 11px;
}

.home-more-summary .stats-grid {
  margin: 0;
  padding: 0 12px 12px;
  gap: 8px;
}

.home-more-summary .stat-card {
  min-height: 66px;
  padding: 10px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
}

#dashboardView .dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}

#dashboardView .dashboard-grid .panel {
  min-height: 0;
}

/* Schedule */
.schedule-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-workspace > .panel {
  height: clamp(500px, calc(100vh - 196px), 604px);
  min-height: 500px;
}

.calendar-sync-details {
  margin-bottom: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.calendar-sync-details > summary,
.mobile-google-details > summary {
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  gap: 9px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.calendar-sync-details > summary > span:nth-child(2),
.mobile-google-details > summary > span:nth-child(2) {
  min-width: 0;
}

.calendar-sync-details strong,
.calendar-sync-details small,
.mobile-google-details strong,
.mobile-google-details small {
  display: block;
}

.calendar-sync-details small,
.mobile-google-details small {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-sync-details > summary > .ui-icon,
.mobile-google-details > summary > .ui-icon {
  width: 18px;
  transition: transform var(--motion-base) var(--motion-ease);
}

.calendar-sync-details[open] > summary > .ui-icon,
.mobile-google-details[open] > summary > .ui-icon {
  transform: rotate(180deg);
}

.calendar-sync-actions,
.mobile-google-details > div {
  padding: 0 10px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.calendar-sync-actions button,
.mobile-google-details > div button {
  min-height: 38px;
  flex: 1 1 110px;
  padding: 0 9px;
  font-size: 11px;
}

.schedule-calendar-panel .calendar-head {
  grid-template-columns: 36px minmax(120px, 1fr) 36px auto;
}

.schedule-calendar-panel .calendar-day {
  color: var(--text-strong);
  background: var(--surface-raised);
  border-color: var(--border);
}

.schedule-calendar-panel .calendar-day.other {
  color: var(--text-muted);
  background: var(--surface-muted);
}

.schedule-calendar-panel .calendar-day.selected {
  background: var(--brand-soft) !important;
  box-shadow: inset 0 0 0 1px var(--brand) !important;
}

.calendar-agenda-item,
.task-card {
  color: var(--text-strong);
  background: var(--surface-raised);
  border-color: var(--border);
}

.task-card {
  border-radius: var(--radius-control);
}

.task-due-progress {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 99px;
}

.task-due-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--brand));
  border-radius: inherit;
  transition: width var(--motion-base) var(--motion-ease);
}

/* Focus */
#timerView .study-summary {
  min-height: 68px !important;
  padding: 10px 14px !important;
  display: grid !important;
  grid-template-columns: minmax(150px, 1fr) 44px auto auto !important;
  gap: 12px !important;
  align-items: center;
  color: #fff;
  background: linear-gradient(120deg, #253246, #174f4a) !important;
  border: 0;
  border-radius: var(--radius-card) !important;
}

#timerView .study-summary > div:first-child {
  min-width: 0;
}

#timerView .study-summary > div:first-child strong {
  font-size: 22px !important;
  line-height: 1.1;
}

#timerView .study-summary > div:first-child span {
  margin-left: 8px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
}

#timerView .study-summary .eyebrow {
  margin-bottom: 2px;
  color: rgba(255,255,255,.72);
}

#timerView .goal-ring {
  width: 42px !important;
  height: 42px !important;
  background: conic-gradient(#fff var(--goal), rgba(255,255,255,.2) 0);
}

#timerView .goal-ring::after {
  inset: 4px;
  background: #223b40;
}

#timerView .goal-ring span {
  font-size: 10px;
}

#timerView .level-summary {
  min-width: 0;
  padding: 0 !important;
  display: flex !important;
  background: transparent !important;
}

#timerView .level-summary small {
  max-width: 150px;
  color: rgba(255,255,255,.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#timerView .goal-setting {
  min-height: 40px;
  padding: 0 9px !important;
  display: flex !important;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.1) !important;
  border-color: rgba(255,255,255,.16) !important;
}

#timerView .goal-setting input {
  width: 42px;
  min-height: 32px;
  color: #fff;
  background: transparent;
  border: 0;
}

.achievement-strip {
  margin: 10px 0 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.achievement-strip::-webkit-scrollbar {
  display: none;
}

.mobile-focus-settings {
  display: none;
}

.achievement-chip {
  min-width: max-content;
  min-height: 44px;
  padding: 7px 10px;
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  opacity: .7;
}

.achievement-chip.unlocked {
  color: var(--text-strong);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  opacity: 1;
}

.achievement-chip > b {
  font-size: 16px;
}

.achievement-chip strong,
.achievement-chip small {
  display: block;
  font-size: 10px;
  line-height: 1.25;
}

.stopwatch-layout {
  gap: 12px;
}

#timerView .stopwatch-card,
#timerView .subject-timers {
  min-height: 360px;
}

#timerView .stopwatch-display {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

#timerView .round-timer-button {
  background: var(--brand);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 28%, transparent);
}

.timer-subject-list {
  display: grid;
  gap: 8px;
}

.entry-app .timer-subject-row,
.entry-app .subject-timers .timer-subject-row:nth-child(n+4) {
  width: 100%;
  min-height: 52px;
  padding: 8px 9px;
  display: grid !important;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  text-align: left;
  color: var(--text-strong);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.entry-app .timer-subject-row.active {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 44%, var(--border));
}

.entry-app .subject-play {
  min-width: 48px;
  min-height: 32px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  color: var(--brand-strong);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

/* Records */
.record-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.records-empty-state {
  min-height: 84px;
  margin-bottom: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.records-empty-state[hidden] {
  display: none;
}

.records-empty-state strong,
.records-empty-state span {
  display: block;
}

.records-empty-state span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

#gradesView.has-no-grades > .content-tabs,
#gradesView.has-no-grades > [data-content-panel] {
  display: none !important;
}

.collapsible-panel {
  overflow: hidden;
}

.collapsible-panel > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.collapsible-panel > summary span:first-child small,
.collapsible-panel > summary span:first-child strong {
  display: block;
}

.collapsible-panel > summary span:last-child {
  color: var(--text-muted);
  font-size: 11px;
}

.collapsible-panel:not([open]) > summary span:last-child {
  font-size: 0;
}

.collapsible-panel:not([open]) > summary span:last-child::after {
  content: "펼치기";
  font-size: 11px;
}

.entry-app .grade-list .grade-row:nth-child(n+9) {
  display: flex !important;
}

/* More and feedback */
.theme-mode-badge {
  min-width: 52px;
  padding: 5px 8px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.more-menu-icon.school {
  color: var(--secondary);
  background: var(--secondary-soft);
}

.app-fab {
  display: none;
}

.xp-reward-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  min-height: 48px;
  padding: 9px 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #fff;
  background: #172033;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translate(-50%, 10px) scale(.96);
  transition: opacity var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
}

.xp-reward-toast[hidden] {
  display: none;
}

.xp-reward-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.xp-reward-toast > span {
  color: #ffbd6e;
  font-size: 18px;
}

/* Dark theme hard-coded surface recovery */
html[data-theme="dark"] .entry-app :is(.topbar, .sidebar, .panel, .stat-card, .task-card, .calendar-day, .calendar-agenda-item, .mobile-period-row, .grade-term-card, .grade-row, .focus-row, .queue-item, .exam-plan-card, .mistake-card, .school-event-row, .weekly-plan-day, .upload-zone, .ocr-source-preview, .auth-provider, .cloud-sync-card, .sync-center-list section, dialog .modal-form) {
  color: var(--text-strong);
  background-color: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .entry-app :is(.soft-button, .icon-button, input, textarea, select, .search-box, .content-tabs button.active, .filter-tabs button.active, .section-nav button.active) {
  color: var(--text-strong);
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .entry-app :is(.more-menu > button, .more-profile-card, .more-ai-usage, .home-kpi-strip > button, .record-kpi-grid > button, .mobile-schedule-overview, .mobile-google-details, .home-more-summary) {
  color: var(--text-strong);
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .entry-app .more-menu > button + button {
  border-color: var(--border) !important;
}

html[data-theme="dark"] .entry-app .more-menu-icon.setting {
  color: var(--text);
  background: var(--surface-muted) !important;
}

html[data-theme="dark"] .entry-app :is(.empty, .compact-empty, .helper, small, .view-intro span, .task-card p) {
  color: var(--text-muted);
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, .62);
}

html[data-theme="dark"] .landing-hero::before {
  opacity: .16;
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 56px;
    --page-gutter: 12px;
  }

  body.entry-app {
    min-height: var(--app-viewport-height, 100svh);
    overflow: hidden;
  }

  .entry-app .app-shell {
    display: block;
    min-height: var(--app-viewport-height, 100svh);
  }

  .entry-app #appMain {
    height: var(--app-viewport-height, 100svh);
    padding: 0 var(--page-gutter) calc(88px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom));
  }

  .entry-app .topbar {
    min-height: 56px !important;
    height: 56px !important;
    margin-bottom: 0;
    padding-inline: 12px;
    gap: 8px;
  }

  .entry-app .menu-button {
    display: none !important;
  }

  .entry-app .mobile-home-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 11px;
  }

  .entry-app .page-heading {
    min-width: 0;
    padding-left: 0;
    border: 0;
  }

  .entry-app .page-heading .eyebrow {
    display: none;
  }

  .entry-app .topbar h1 {
    overflow: hidden;
    font-size: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .entry-app .top-actions {
    gap: 6px;
  }

  .entry-app #quickAddBtn {
    display: none !important;
  }

  .entry-app .account-button {
    width: 40px;
    min-width: 40px !important;
    height: 40px;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border-radius: 50%;
  }

  .entry-app .account-button #accountLabel {
    display: none;
  }

  .entry-app .account-dot {
    margin: 0;
  }

  .entry-app .sidebar {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    z-index: 60;
    width: auto !important;
    height: calc(64px + env(safe-area-inset-bottom)) !important;
    padding: 0 6px env(safe-area-inset-bottom) !important;
    display: block !important;
    background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
    border: 0 !important;
    border-top: 1px solid var(--border) !important;
    transform: none !important;
    backdrop-filter: blur(18px) saturate(130%);
  }

  .entry-app .sidebar > .brand,
  .entry-app .sidebar-foot {
    display: none !important;
  }

  .entry-app .sidebar nav {
    height: 64px;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .entry-app .nav-item {
    position: relative;
    min-width: 0;
    height: 60px;
    min-height: 60px;
    padding: 7px 2px 5px;
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    border-radius: 0;
    background: transparent !important;
    font-size: 10px;
  }

  .entry-app .nav-item::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 30px;
    height: 3px;
    background: var(--brand);
    border-radius: 99px;
    opacity: 0;
    transform: translate(-50%, -3px) scaleX(.45);
    transition: opacity var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
  }

  .entry-app .nav-item.active::before {
    opacity: 1;
    transform: translate(-50%, 0) scaleX(1);
  }

  .entry-app .nav-item .ui-icon {
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px;
  }

  .entry-app .nav-item.active {
    color: var(--brand-strong);
  }

  .entry-app .section-nav {
    position: sticky;
    top: 56px;
    z-index: 18;
    width: calc(100% + 24px);
    min-height: 44px;
    margin: 0 -12px;
    padding: 5px 12px;
    display: flex !important;
    gap: 5px;
    overflow-x: auto;
    background: color-mix(in srgb, var(--app-bg) 94%, transparent);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    backdrop-filter: blur(14px);
    scrollbar-width: none;
  }

  .entry-app .section-nav[hidden] {
    display: none !important;
  }

  .entry-app .section-nav::-webkit-scrollbar {
    display: none;
  }

  .entry-app .section-nav button,
  .entry-app #sectionNav [data-route="school"] {
    min-width: max-content;
    min-height: 34px;
    padding: 0 12px;
    display: inline-grid !important;
    place-items: center;
    border-radius: 999px;
  }

  .entry-app .view {
    padding-bottom: 8px;
  }

  .entry-app .view.active {
    animation-duration: var(--motion-fast);
  }

  .entry-app .view-intro {
    min-height: 0 !important;
    padding: 12px 0 10px !important;
    align-items: center;
    gap: 8px;
  }

  .entry-app .view-intro .eyebrow,
  .entry-app .view-intro > div:first-child > span {
    display: none !important;
  }

  .entry-app .view-intro h2 {
    margin: 0;
    font-size: 20px !important;
    line-height: 1.25;
  }

  .entry-app .view-intro .toolbar-actions {
    gap: 5px;
  }

  .entry-app .view-intro .toolbar-actions button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }

  .entry-app .view-intro .toolbar-actions button span {
    display: none;
  }

  .entry-app .panel {
    padding: 12px !important;
  }

  .entry-app .panel-head {
    min-height: 34px;
    margin-bottom: 8px !important;
  }

  .entry-app .panel-head h3,
  .entry-app .panel h3 {
    font-size: 14px;
  }

  /* Home: study -> D-Day -> agenda -> next task -> optional details */
  #dashboardView.active {
    gap: 9px !important;
    padding-top: 10px !important;
  }

  #dashboardView .home-kpi-strip { order: 1; }
  #dashboardView .dashboard-top-grid { order: 2; }
  #dashboardView .dashboard-agenda-grid { order: 3; }
  #dashboardView .dashboard-grid { order: 4; }
  #dashboardView .dashboard-week { order: 5; }
  #dashboardView .home-more-summary { order: 6; }

  .home-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .home-kpi-strip > button {
    min-height: 68px;
    padding: 9px 10px;
    border-radius: 13px;
  }

  .home-kpi-strip span {
    font-size: 9px;
  }

  .home-kpi-strip strong {
    font-size: clamp(16px, 5vw, 20px);
  }

  .home-kpi-strip small {
    font-size: 9px;
  }

  .entry-app #dashboardView .dashboard-top-grid .dday-widget {
    min-height: 78px !important;
    height: 78px !important;
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .entry-app #dashboardView .dday-widget .eyebrow,
  .entry-app #dashboardView .dday-widget span {
    display: none !important;
  }

  .entry-app #dashboardView .dday-widget strong {
    grid-row: auto;
    font-size: 21px !important;
  }

  .entry-app #dashboardView .dday-widget h3 {
    grid-column: 2;
    font-size: 12px !important;
  }

  .entry-app #dashboardView .dday-actions .soft-button {
    display: none;
  }

  .entry-app #dashboardView .dday-actions .primary-button {
    min-width: 78px;
    height: 44px;
    padding-inline: 10px !important;
    font-size: 10px;
  }

  #dashboardView .dashboard-agenda-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  .entry-app #dashboardView .dashboard-agenda-grid > .panel {
    height: 142px !important;
    min-height: 142px !important;
    padding: 10px !important;
  }

  #dashboardView .dashboard-agenda-grid .panel-head {
    height: 32px;
    min-height: 32px;
    margin-bottom: 4px !important;
  }

  #dashboardView .dashboard-agenda-grid .panel-head .eyebrow {
    display: none;
  }

  #dashboardView .dashboard-agenda-grid .panel-head h3 {
    max-width: 92px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #dashboardView .dashboard-agenda-grid .link-button {
    min-width: 36px;
    min-height: 36px;
    padding: 0 4px;
    font-size: 9px;
  }

  #dashboardView .dashboard-day-events,
  #dashboardView .dashboard-timetable-panel .today-schedule {
    max-height: 87px !important;
    gap: 4px !important;
  }

  #dashboardView .dashboard-day-events button,
  #dashboardView .dashboard-day-events > div,
  #dashboardView .dashboard-timetable-panel .schedule-row {
    min-height: 38px !important;
    padding: 5px 6px !important;
  }

  #dashboardView .dashboard-day-events strong,
  #dashboardView .dashboard-timetable-panel strong {
    font-size: 10px;
  }

  #dashboardView .dashboard-day-events span,
  #dashboardView .dashboard-timetable-panel span {
    font-size: 8px;
  }

  #dashboardView .dashboard-grid .panel {
    padding: 11px !important;
  }

  #dashboardView .dashboard-grid .task-row:nth-child(n+2) {
    display: none;
  }

  #dashboardView .dashboard-grid .task-row {
    min-height: 52px;
    padding: 7px;
  }

  #dashboardView .dashboard-week {
    min-height: 64px;
    padding: 7px 8px;
  }

  #dashboardView .dashboard-week > div:first-child {
    display: none;
  }

  #dashboardView .dashboard-week-strip {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 3px !important;
    overflow: visible !important;
  }

  #dashboardView .dashboard-week-strip button {
    min-width: 0 !important;
    min-height: 48px;
    padding: 3px 1px;
  }

  #dashboardView .dashboard-week-strip button small {
    font-size: 9px !important;
  }

  #dashboardView .dashboard-week-strip button strong {
    font-size: 13px !important;
  }

  .home-more-summary > summary {
    min-height: 46px;
  }

  .home-more-summary .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-more-summary .stat-card {
    display: flex !important;
  }

  /* Schedule */
  #tasksView .mobile-schedule-overview {
    margin: 10px 0 9px;
    padding: 10px;
    display: grid !important;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
  }

  #tasksView #addTaskBtn {
    display: none !important;
  }

  .mobile-today-head,
  .mobile-schedule-head {
    min-height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-today-head small,
  .mobile-today-head strong,
  .mobile-schedule-head small,
  .mobile-schedule-head strong {
    display: block;
  }

  .mobile-today-head small,
  .mobile-schedule-head small {
    font-size: 9px;
  }

  .mobile-today-head strong,
  .mobile-schedule-head strong {
    font-size: 13px;
  }

  .mobile-today-head .icon-button,
  .mobile-schedule-head .icon-button {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .mobile-today-agenda {
    max-height: 108px;
    display: grid;
    gap: 5px;
    overflow-y: auto;
  }

  .mobile-today-agenda .calendar-agenda-item {
    min-height: 48px;
    padding: 7px 9px;
  }

  .mobile-schedule-week {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 3px !important;
    overflow: visible !important;
  }

  .mobile-schedule-week button {
    min-width: 0 !important;
    min-height: 48px !important;
    padding: 4px 1px !important;
  }

  .mobile-schedule-week button small {
    font-size: 9px !important;
  }

  .mobile-schedule-week button strong {
    font-size: 13px !important;
  }

  .mobile-schedule-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .mobile-schedule-actions button {
    min-height: 40px;
  }

  .mobile-google-details {
    display: block !important;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
  }

  .schedule-workspace {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px;
  }

  .schedule-workspace > .panel {
    height: auto !important;
    min-height: 0 !important;
  }

  #tasksView .schedule-calendar-panel {
    display: none !important;
    height: 382px !important;
    min-height: 382px !important;
    padding: 10px !important;
  }

  #tasksView.mobile-month-open .schedule-calendar-panel {
    display: flex !important;
  }

  #tasksView .schedule-calendar-panel .calendar-sync-details {
    display: none;
  }

  #tasksView .schedule-agenda-panel {
    display: grid !important;
    grid-template-rows: auto auto auto !important;
    gap: 8px;
    padding: 10px !important;
    overflow: visible;
  }

  #tasksView .schedule-agenda-head,
  #tasksView #calendarAgendaList {
    display: none !important;
  }

  #tasksView .schedule-task-divider {
    margin: 0;
    align-items: center;
  }

  #tasksView .schedule-task-divider .eyebrow {
    display: none;
  }

  #tasksView .schedule-search {
    min-height: 44px;
  }

  #tasksView .schedule-task-list {
    max-height: none;
    display: grid;
    gap: 7px;
    overflow: visible;
  }

  #tasksView .task-card {
    min-height: 0 !important;
    padding: 10px !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
  }

  #tasksView .task-card > p,
  #tasksView .task-focus-time {
    display: none;
  }

  #tasksView .task-card-top,
  #tasksView .task-card h3,
  #tasksView .task-meta,
  #tasksView .task-due-progress {
    grid-column: 1 / -1;
  }

  #tasksView .task-card h3 {
    margin: 1px 0;
    font-size: 14px;
  }

  #tasksView .task-meta {
    margin-top: 2px;
  }

  #tasksView .task-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #tasksView .task-actions button {
    min-height: 40px !important;
  }

  .app-fab:not([hidden]) {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 55;
    min-width: 52px;
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border: 0;
    border-radius: 999px;
    box-shadow: var(--shadow-float);
    font-size: 12px;
    font-weight: 800;
    animation: fab-in var(--motion-base) var(--motion-ease) both;
  }

  .app-fab .ui-icon {
    width: 20px;
  }

  @keyframes fab-in {
    from { opacity: 0; transform: translateY(8px) scale(.94); }
  }

  /* Focus */
  #timerView .view-intro {
    padding-bottom: 7px !important;
  }

  #timerView .study-summary {
    min-height: 58px !important;
    height: 58px !important;
    padding: 8px 10px !important;
    grid-template-columns: minmax(0, 1fr) 40px auto !important;
    gap: 8px !important;
  }

  #timerView .study-summary .eyebrow {
    display: none !important;
  }

  #timerView .study-summary > div:first-child {
    display: flex !important;
    gap: 7px;
    align-items: baseline;
    flex-wrap: nowrap;
  }

  #timerView .study-summary > div:first-child strong {
    font-size: 20px !important;
  }

  #timerView .study-summary > div:first-child span {
    display: inline !important;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #timerView .study-summary > .level-summary {
    width: auto !important;
    min-height: 36px !important;
    display: flex !important;
    grid-column: auto !important;
    grid-row: auto !important;
    border: 0 !important;
  }

  #timerView .level-summary > span,
  #timerView .level-summary small,
  #timerView .level-info-button,
  #timerView .study-summary > .goal-setting {
    display: none !important;
  }

  #timerView .level-summary strong {
    font-size: 11px;
  }

  #timerView .achievement-strip {
    margin: 7px 0 8px;
  }

  #timerView .mobile-focus-settings {
    margin: 0 0 8px;
    display: block;
    color: var(--text-strong);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
  }

  #timerView .mobile-focus-settings > summary {
    min-height: 44px;
    padding: 0 11px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
  }

  #timerView .mobile-focus-settings > summary::-webkit-details-marker {
    display: none;
  }

  #timerView .mobile-focus-settings > summary small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
  }

  #timerView .mobile-focus-settings > div {
    padding: 0 10px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  #timerView .mobile-focus-settings label {
    min-height: 44px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    background: var(--surface-muted);
    border-radius: var(--radius-control);
    font-size: 12px;
    font-weight: 750;
  }

  #timerView .mobile-focus-settings label span {
    display: inline-flex;
    align-items: center;
  }

  #timerView #mobileDailyGoalInput {
    width: 48px;
    min-height: 36px;
    padding: 0 4px;
    text-align: right;
    background: transparent;
    border: 0;
  }

  #timerView .achievement-chip {
    min-height: 40px;
  }

  #timerView .stopwatch-layout {
    display: flex !important;
    flex-direction: column;
    gap: 8px !important;
  }

  #timerView .subject-timers {
    order: 1;
    min-height: 0 !important;
    padding: 10px !important;
  }

  #timerView .subject-timers .panel-head {
    margin-bottom: 7px !important;
  }

  #timerView .timer-subject-list {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #timerView .timer-subject-list::-webkit-scrollbar {
    display: none;
  }

  .entry-app #timerView .timer-subject-row,
  .entry-app #timerView .subject-timers .timer-subject-row:nth-child(n+4) {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 92px;
    min-height: 44px !important;
    padding: 7px 9px !important;
    display: grid !important;
    grid-template-columns: 6px minmax(0, 1fr) !important;
    gap: 7px !important;
    border-radius: 999px;
  }

  #timerView .timer-subject-row div strong {
    font-size: 11px;
  }

  #timerView .timer-subject-row div small,
  #timerView .timer-subject-row .subject-total,
  #timerView .timer-subject-row .subject-play {
    display: none !important;
  }

  #timerView .stopwatch-card {
    order: 2;
    min-height: 300px !important;
    padding: 14px !important;
  }

  #timerView .stopwatch-card-head {
    min-height: 36px;
  }

  #timerView .current-subject {
    margin: 15px 0 4px;
    font-size: 16px;
  }

  #timerView .task-link-label {
    margin: 8px auto;
  }

  #timerView .stopwatch-display {
    margin: 10px 0 4px;
    font-size: clamp(43px, 13vw, 58px) !important;
  }

  #timerView .stopwatch-actions {
    grid-template-columns: 1fr 72px 1fr !important;
    gap: 8px !important;
  }

  #timerView .round-timer-button {
    width: 72px !important;
    height: 72px !important;
  }

  /* Records */
  .record-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 4px 0 10px;
  }

  .record-kpi-grid > button {
    min-height: 68px;
    padding: 9px 10px;
    border-radius: 13px;
  }

  .record-kpi-grid strong {
    font-size: 17px;
  }

  .records-empty-state {
    min-height: 92px;
    padding: 12px;
  }

  .records-empty-state span {
    display: none;
  }

  #gradesView .content-tabs {
    margin-bottom: 8px;
  }

  #gradesView .grade-term-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  #gradesView .grade-term-card {
    min-height: 76px;
    padding: 9px;
  }

  #gradesView .bar-chart {
    height: 210px;
  }

  .entry-app #gradesView .grade-list .grade-row:nth-child(n+9) {
    display: flex !important;
  }

  /* More */
  #moreView .more-intro {
    padding-bottom: 4px !important;
  }

  #moreView .more-profile-card,
  #moreView .more-ai-usage {
    margin-bottom: 8px;
  }

  #moreView .more-section {
    margin-top: 14px;
  }

  #moreView .more-section > h3 {
    margin: 0 4px 6px;
    font-size: 11px;
  }

  #moreView .more-menu > button {
    min-height: 58px;
  }

  #moreView #themeToggleBtn {
    grid-template-columns: 38px minmax(0, 1fr) auto !important;
  }

  .xp-reward-toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 28px);
    font-size: 12px;
  }

  dialog {
    color: var(--text-strong);
  }

  dialog .modal-form {
    max-height: min(88svh, calc(var(--app-viewport-height, 100svh) - 24px - var(--mobile-keyboard-inset, 0px)));
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0 !important;
  }
}

@media (max-width: 359px) {
  #dashboardView .dashboard-week-strip,
  .mobile-schedule-week {
    grid-template-columns: repeat(7, 44px) !important;
    overflow-x: auto !important;
    scrollbar-width: none;
  }

  #dashboardView .dashboard-agenda-grid {
    grid-template-columns: 1fr !important;
  }

  .entry-app #dashboardView .dashboard-agenda-grid > .panel {
    height: 126px !important;
    min-height: 126px !important;
  }

  .home-kpi-strip > button {
    padding-inline: 7px;
  }

  .home-kpi-strip small {
    display: none;
  }
}

@media (min-width: 600px) and (max-width: 720px) {
  .home-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #dashboardView .dashboard-agenda-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #timerView .stopwatch-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 240px !important;
  }

  #timerView .subject-timers {
    order: 2;
  }

  #timerView .stopwatch-card {
    order: 1;
  }

  #timerView .timer-subject-list {
    display: grid !important;
    overflow: visible;
  }

  .entry-app #timerView .timer-subject-row,
  .entry-app #timerView .subject-timers .timer-subject-row:nth-child(n+4) {
    width: 100% !important;
  }

  .record-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .entry-app .nav-item,
  .entry-app .view-intro .toolbar-actions button,
  .entry-app .link-button,
  .entry-app .dashboard-week-strip button,
  .entry-app #dashboardView .dday-actions button,
  .entry-app .mobile-google-details > div button,
  .entry-app .theme-mode-badge,
  .entry-app .more-section > h3,
  .entry-app .collapsible-panel > summary span:last-child,
  .entry-app .collapsible-panel:not([open]) > summary span:last-child::after {
    font-size: 12px !important;
  }

  .entry-app #appMain small,
  .entry-app #appMain .eyebrow,
  .entry-app .home-kpi-strip span,
  .entry-app .record-kpi-grid span,
  .entry-app .dashboard-week-strip button span,
  .entry-app .dashboard-day-events span,
  .entry-app .dashboard-day-events strong,
  .entry-app .dashboard-timetable-panel span,
  .entry-app .dashboard-timetable-panel strong,
  .entry-app .mobile-schedule-week button,
  .entry-app #timerView .study-summary > div:first-child span,
  .entry-app #timerView .goal-ring span,
  .entry-app #timerView .achievement-chip strong,
  .entry-app #timerView .achievement-chip small,
  .entry-app #timerView .timer-subject-row div strong,
  .entry-app .weekly-focus-chart strong,
  .entry-app .weekly-focus-chart span {
    font-size: 12px !important;
  }

  .entry-app .mobile-home-button,
  .entry-app .account-button,
  .entry-app .view.active button,
  .entry-app .view.active summary,
  .entry-app .link-button,
  .entry-app #timetableSettingsBtn,
  .entry-app #addTimerSubjectBtn {
    min-width: 44px;
    min-height: 44px !important;
  }

  .entry-app .mobile-today-head .icon-button,
  .entry-app .mobile-schedule-head .icon-button {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .entry-app .section-nav button,
  .entry-app #sectionNav [data-route="school"] {
    min-height: 44px !important;
  }

  .entry-app .calendar-sync-actions button,
  .entry-app .mobile-google-details > div button,
  .entry-app #tasksView .task-actions button {
    min-height: 44px !important;
  }

  .landing-page :is(.landing-brand, .landing-open, .landing-login, .landing-scroll, .landing-service-panel button, .landing-privacy, #landingFooterLoginBtn) {
    min-height: 44px;
  }

  .landing-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .landing-privacy {
    display: inline-flex;
    align-items: center;
  }

  .landing-service-panel button,
  .landing-privacy,
  #landingFooterLoginBtn {
    padding-block: 10px;
  }
}

body:not(.entry-app) .app-fab {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@supports (content-visibility: auto) {
  .entry-app .view:not(.active),
  .landing-section,
  .entry-app .study-pack-panel,
  .entry-app .flashcard-library {
    content-visibility: auto;
    contain-intrinsic-size: 1px 540px;
  }
}
