/*
 * SAEUM — Student Planner reference layer
 * Structure and density are adapted from the supplied Figma community file.
 * The product language, Korean copy, data model and interactions remain SAEUM's.
 */

:root {
  --brand: #c94312;
  --brand-hover: #ad350c;
  --brand-soft: #fff1eb;
  --brand-line: #f7c8b6;
  --info: #007aff;
  --info-soft: #eef6ff;
  --ink: #111111;
  --text: #2c2c2e;
  --muted: rgba(60, 60, 67, .62);
  --subtle: rgba(60, 60, 67, .42);
  --line: rgba(60, 60, 67, .13);
  --line-strong: rgba(60, 60, 67, .22);
  --divider: rgba(60, 60, 67, .10);
  --canvas: #f7f7f8;
  --surface: #ffffff;
  --surface-alt: #f8f8f8;
  --sidebar-width: 224px;
  --topbar-height: 56px;
  --content-width: 1320px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .035);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .07);
  --shadow-lg: 0 22px 58px rgba(0, 0, 0, .16);
}

html,
body,
#appMain {
  background: var(--canvas);
}

body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.012em;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

:focus-visible {
  outline-color: rgba(201, 67, 18, .38);
}

::selection {
  background: #ffe0d4;
}

/* Compact application frame */

.sidebar {
  padding: 12px 10px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
}

.brand {
  min-height: 48px;
  padding: 0 10px;
  border-radius: 10px;
}

.landing-brand > span,
.brand-mark,
.mobile-home-button {
  border-radius: 10px;
  background: var(--brand);
  box-shadow: none;
}

.brand:hover {
  background: var(--surface-alt);
}

.brand strong {
  font-size: 16px;
  font-weight: 700;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

#mainNav {
  margin-top: 20px;
  gap: 2px;
}

.nav-item {
  min-height: 44px;
  padding: 0 12px;
  gap: 12px;
  border-radius: 10px;
  color: #68686d;
  font-size: 14px;
  font-weight: 600;
}

.nav-item:hover {
  color: var(--ink);
  background: #f7f7f8;
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-item .ui-icon {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.sidebar-save-state,
.sidebar-utility {
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
}

.sidebar-save-state strong,
.sidebar-utility strong {
  font-size: 13px;
}

.sidebar-save-state small,
.sidebar-utility small {
  font-size: 11px;
}

.sidebar-utility > span:first-child,
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.topbar {
  min-height: var(--topbar-height);
  padding: 0 max(24px, calc((100% - var(--content-width)) / 2));
  border-bottom: .5px solid var(--line);
  background: rgba(247, 247, 248, .92);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(160%);
}

.page-heading .eyebrow {
  font-size: 10px;
  font-weight: 600;
}

.page-heading h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -.025em;
}

.topbar .account-button,
.topbar #quickAddBtn,
.topbar .notification-button,
.topbar .settings-button {
  min-height: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: none;
}

.account-dot,
.google-mark,
.sidebar-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  color: #4285f4;
  font-size: 13px;
  font-weight: 750;
}

.account-dot::before,
.google-mark::before,
.sidebar-avatar::before {
  content: "G";
}

.account-dot img,
.google-mark img,
.sidebar-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.view {
  width: min(100%, var(--content-width));
  padding: 24px 24px 88px;
}

.view-intro,
.ai-hero {
  margin-bottom: 16px;
  gap: 16px;
}

.eyebrow,
.view-intro > div:first-child > .eyebrow,
.panel-head .eyebrow {
  color: var(--brand);
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
}

.view-intro h2,
.ai-hero h2 {
  margin-top: 2px;
  font-size: 24px;
  line-height: 30px;
  font-weight: 750;
}

.view-intro > div:first-child > span,
.view-intro > div:first-child > p:not(.eyebrow),
.ai-hero p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

/* Native-feeling controls */

.primary-button,
.soft-button,
.text-button,
.link-button,
.danger-button,
.icon-button,
.close-button,
.round-timer-button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: none;
}

.primary-button {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: none;
}

.primary-button:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
  box-shadow: none;
}

.soft-button {
  border-color: var(--line);
  background: var(--surface);
}

.text-button,
.link-button {
  color: var(--brand);
}

.text-button:hover,
.link-button:hover {
  background: var(--brand-soft);
}

.icon-button,
.close-button,
.notification-button,
.settings-button {
  width: 44px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  min-height: 48px;
  padding: 0 14px;
  border-color: var(--line-strong);
  border-radius: 14px;
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 67, 18, .11);
}

/* Grouped list surfaces */

.panel,
.stat-card,
.task-card,
.grade-term-card,
.exam-plan-card,
.mistake-card,
.pro-panel,
.weekly-planner-panel,
.study-pack-panel,
.flashcard-library {
  border: .5px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.panel {
  padding: 18px 20px;
}

.panel-head {
  min-height: 40px;
  gap: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}

.panel-head small,
.helper {
  font-size: 12px;
  line-height: 17px;
}

.content-tabs {
  margin-bottom: 16px;
  padding: 3px;
  border-radius: 10px;
  background: #ececee;
}

.content-tabs button,
.pack-tabs button,
.filter-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
}

.content-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .10);
}

.pack-tabs button.active,
.filter-tabs button.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.empty,
.empty-state,
.compact-empty,
.task-first-empty,
.dashboard-empty,
.records-empty-state {
  min-height: 96px;
  padding: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-alt);
  font-size: 13px;
}

.toast[popover] {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
}

/* Today: one priority, then two compact lists */

.home-primary-grid {
  margin-bottom: 14px;
}

.today-priority-card {
  min-height: 0;
  padding: 22px 24px;
  border: .5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.today-next-task {
  gap: 16px;
}

#ddayCount {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  color: #fff;
  background: var(--brand);
  font-size: 16px;
}

.today-next-task small,
.today-progress-copy .eyebrow {
  color: var(--muted);
  font-size: 11px;
}

.today-next-task h3 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
}

.today-primary-actions {
  margin-top: 16px;
}

.today-card-stats {
  margin-top: 18px;
  padding-top: 14px;
}

.today-card-stats small {
  font-size: 11px;
}

.today-card-stats strong {
  font-size: 16px;
}

.dashboard-agenda-grid {
  gap: 14px;
}

.dashboard-agenda-panel,
.dashboard-timetable-panel {
  min-height: 260px;
  padding: 16px 20px;
}

.task-row,
.schedule-row {
  min-height: 58px;
  border-bottom: .5px solid var(--divider);
  border-radius: 0;
}

.home-more-summary {
  margin-top: 14px;
  border-radius: 14px;
}

.stats-grid {
  gap: 10px;
}

.stat-card {
  min-height: 92px;
  padding: 16px;
}

.stat-card small {
  font-size: 11px;
}

.stat-card strong {
  font-size: 21px;
}

/* Schedule and calendar */

.schedule-workspace {
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .78fr);
}

.schedule-calendar-panel,
.schedule-agenda-panel {
  min-height: 520px;
}

.calendar-day {
  min-height: 68px;
  border-radius: 7px;
}

.calendar-day.selected {
  color: #fff;
  background: var(--brand);
  box-shadow: none;
}

.calendar-day > span,
.calendar-weekdays span,
.agenda-time,
.calendar-agenda-item small {
  font-size: 12px;
}

.calendar-agenda-item {
  min-height: 56px;
  border-radius: 10px;
  border-bottom: .5px solid var(--divider);
}

.task-board {
  gap: 10px;
}

.task-card {
  padding: 16px;
}

.subject-badge {
  min-height: 24px;
  padding-inline: 9px;
  font-size: 11px;
}

.timetable-cell,
.timetable-head {
  min-height: 52px;
  font-size: 13px;
}

/* Stopwatch keeps the measured action dominant */

.stopwatch-layout {
  gap: 14px;
}

.timer-hero-card,
.subject-timer-panel {
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.timer-hero-card {
  min-height: 300px;
}

.timer-display,
.focus-room-time {
  letter-spacing: -.045em;
}

.timer-subject-row {
  min-height: 60px;
  padding: 4px 6px;
  border-bottom: .5px solid var(--divider);
  border-radius: 0;
}

.timer-subject-row:hover {
  background: #fafafa;
}

.timer-subject-row.active {
  background: var(--brand-soft);
}

.subject-play {
  width: 42px;
  height: 42px;
}

.timer-subject-row strong {
  font-size: 15px;
}

.timer-subject-row small,
.subject-action-label {
  font-size: 12px;
}

/* Records and learning tools */

.record-primary-grid {
  gap: 10px;
}

.record-primary-grid > * {
  min-height: 96px;
  border-radius: 14px;
}

.record-primary-grid span,
.record-primary-grid small {
  font-size: 11px;
}

.record-primary-grid strong {
  font-size: 22px;
}

.grade-summary-panel,
.panel[data-content-panel="grade-records"],
.study-pack-panel,
.flashcard-library,
.weekly-planner-panel,
.pro-panel {
  padding: 18px 20px;
}

.grade-row,
.focus-row,
.school-event-row {
  min-height: 56px;
  border-bottom: .5px solid var(--divider);
}

.ai-source-card,
.ai-control-card,
.ai-planner-panel {
  padding: 18px 20px;
  border-radius: 14px;
}

.ai-maker .upload-zone {
  min-height: 116px;
}

.study-upload-zone,
.ai-plan-file {
  border-radius: 12px;
}

/* Sheets and dialogs */

dialog {
  max-width: min(560px, calc(100vw - 32px));
  border-radius: 18px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .34);
  backdrop-filter: blur(2px);
}

.modal-form {
  padding: 20px;
}

.modal-head {
  margin-bottom: 16px;
}

.modal-head h2 {
  font-size: 22px;
  line-height: 28px;
}

.dialog-actions,
.modal-actions {
  padding-top: 16px;
}

/* Landing: same compact system, SAEUM's warm accent */

.landing-page {
  background:
    radial-gradient(circle at 78% 12%, rgba(201, 67, 18, .10), transparent 28rem),
    linear-gradient(180deg, #fff 0%, #fffaf7 52%, #f7f7f8 100%);
}

.landing-header {
  height: 60px;
  border-bottom: .5px solid var(--line);
  background: rgba(255, 255, 255, .9);
}

.landing-hero {
  min-height: min(700px, calc(100dvh - 60px));
}

.landing-hero h1 {
  max-width: 680px;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.1;
}

.landing-hero p {
  max-width: 560px;
  font-size: 16px;
  line-height: 1.6;
}

.ai-maker .primary-button,
.ai-planner-panel .primary-button {
  min-width: 120px;
  white-space: nowrap;
}

.landing-primary,
.landing-open,
.landing-service-panel button {
  background: var(--brand);
  border-color: var(--brand);
}

@media (max-width: 960px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 44px;
    padding-top: 76px;
    padding-bottom: 64px;
  }

  .landing-hero-copy {
    width: min(100%, 640px);
  }

  .landing-hero h1 {
    max-width: 640px;
    font-size: clamp(42px, 8vw, 58px);
  }

  .landing-app-preview {
    width: min(100%, 640px);
    justify-self: center;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .dashboard-agenda-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-agenda-panel,
  .dashboard-timetable-panel {
    min-height: 220px;
  }

  .topbar .account-button,
  .topbar #quickAddBtn {
    width: auto;
    min-width: 44px;
    padding-inline: 12px;
  }

  .account-button > span:last-child,
  #quickAddBtn > span {
    display: inline;
  }
}

/* Phone layout follows the supplied 375 px screens */

@media (max-width: 767px) {
  :root {
    --topbar-height: 54px;
  }

  body.entry-app {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .sidebar {
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 3px 10px env(safe-area-inset-bottom);
    border-top: .5px solid var(--line);
    background: rgba(247, 247, 248, .96);
    box-shadow: none;
    backdrop-filter: blur(20px) saturate(180%);
  }

  #mainNav {
    gap: 8px;
  }

  #mainNav .nav-item {
    min-height: 56px;
    padding: 3px 1px;
    gap: 0;
    border-radius: 10px;
    color: #8e8e93;
    font-size: 10px;
    font-weight: 550;
    line-height: 12px;
  }

  #mainNav .nav-item .ui-icon {
    width: 26px;
    height: 26px;
    margin-bottom: 1px;
    stroke-width: 1.8;
  }

  #mainNav .nav-item.active {
    color: var(--brand);
    background: transparent;
  }

  #appMain {
    height: calc(var(--app-viewport-height) - 64px - env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 54px;
    padding: 0 16px;
    background: rgba(247, 247, 248, .94);
  }

  .page-heading {
    position: absolute;
    left: 72px;
    right: 72px;
    margin: 0;
    text-align: center;
    pointer-events: none;
  }

  .page-heading h1 {
    overflow: hidden;
    font-size: 17px;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .account-button,
  #quickAddBtn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border: 0;
    background: transparent;
  }

  #quickAddBtn {
    margin-left: auto;
    color: var(--brand);
  }

  .section-nav {
    top: 54px;
    padding: 6px 16px;
    gap: 4px;
    border-bottom: .5px solid var(--line);
    background: rgba(247, 247, 248, .96);
  }

  .section-nav button {
    min-height: 34px;
    padding-inline: 13px;
    border-radius: 9px;
    font-size: 12px;
  }

  .view {
    padding: 16px 12px calc(84px + env(safe-area-inset-bottom));
  }

  .view-intro,
  .ai-hero {
    gap: 10px;
    margin: 0 4px 14px;
  }

  .view-intro h2,
  .ai-hero h2 {
    font-size: 22px;
    line-height: 28px;
  }

  .toolbar-actions {
    gap: 6px;
  }

  .toolbar-actions > button {
    min-height: 40px;
  }

  .panel,
  .grade-summary-panel,
  .panel[data-content-panel="grade-records"],
  .study-pack-panel,
  .flashcard-library,
  .weekly-planner-panel,
  .pro-panel {
    padding: 14px 16px;
    border-radius: 12px;
  }

  .panel-head {
    min-height: 36px;
  }

  .panel-head h3 {
    font-size: 15px;
    line-height: 20px;
  }

  .home-primary-grid {
    margin: 0 0 10px;
  }

  .today-priority-card {
    padding: 16px;
    border-radius: 12px;
  }

  .today-next-task {
    align-items: center;
    gap: 12px;
  }

  #ddayCount {
    width: 58px;
    height: 58px;
    border-radius: 13px;
    font-size: 13px;
  }

  .today-next-task h3 {
    font-size: 20px;
    line-height: 25px;
  }

  .today-primary-actions {
    margin-top: 12px;
  }

  .today-primary-actions .primary-button,
  .today-primary-actions .text-button {
    min-height: 40px;
  }

  .today-card-stats {
    margin-top: 12px;
    padding-top: 10px;
  }

  .today-card-stats strong {
    font-size: 14px;
  }

  .dashboard-agenda-grid {
    gap: 10px;
  }

  .dashboard-agenda-panel,
  .dashboard-timetable-panel {
    min-height: 180px;
    padding: 13px 16px;
  }

  .task-row,
  .schedule-row {
    min-height: 56px;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 82px;
    padding: 13px;
  }

  .mobile-schedule-overview,
  .mobile-timetable {
    border-radius: 12px;
    box-shadow: none;
  }

  .mobile-period-row {
    min-height: 62px;
    border-radius: 0;
    border-bottom: .5px solid var(--divider);
  }

  .calendar-day {
    min-height: 46px;
    border-radius: 7px;
  }

  .calendar-day > span,
  .calendar-weekdays span {
    font-size: 11px;
  }

  .timer-hero-card {
    min-height: 250px;
    padding: 18px 16px;
  }

  .timer-display {
    font-size: clamp(44px, 14vw, 62px);
  }

  .timer-subject-row {
    min-height: 60px;
    padding: 4px 0;
  }

  .record-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .record-primary-grid > * {
    min-height: 84px;
  }

  .ai-source-card,
  .ai-control-card,
  .ai-planner-panel {
    padding: 14px 16px;
  }

  dialog {
    width: 100%;
    max-height: min(90dvh, 780px);
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .modal-form {
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-head {
    min-height: 42px;
  }

  .modal-head h2 {
    font-size: 20px;
    line-height: 26px;
  }

  .toast[popover] {
    inset: auto 12px calc(74px + env(safe-area-inset-bottom)) 12px;
    text-align: center;
  }

  .landing-header {
    height: 56px;
    padding-inline: 16px;
  }

  .landing-hero {
    padding: 64px 16px 52px;
  }

  .landing-hero h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .landing-hero p {
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .view {
    padding-inline: 8px;
  }

  .topbar {
    padding-inline: 10px;
  }

  #mainNav {
    gap: 2px;
  }

  #mainNav .nav-item {
    font-size: 10px;
  }

  .today-card-stats small {
    font-size: 10px;
  }
}

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

/* Figma reference geometry repair: 375px mobile, 44px rows, 78px tab-bar rhythm */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{font-family:"Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px;line-height:1.4;letter-spacing:-.01em}
button,a,input,select,textarea{line-height:1.25}
.primary-button,.soft-button,.text-button,.link-button,.danger-button,.icon-button,.close-button{align-items:center;justify-content:center}
.primary-button,.soft-button,.text-button,.link-button,.danger-button{gap:6px;white-space:nowrap}
.primary-button>span,.soft-button>span,.text-button>span,.link-button>span,.danger-button>span,.nav-label{display:block;min-width:0;line-height:1}
.ui-icon{display:block;flex:0 0 auto}
.panel-head,.view-intro,.toolbar-actions,.top-actions{align-items:center}
.panel-head>*,.view-intro>*,.calendar-head>*,.task-row>*,.schedule-row>*{min-width:0}
.panel-head h3,.view-intro h2,.page-heading h1,.toolbar-actions button,.top-actions button{word-break:keep-all;overflow-wrap:normal}
.table-wrap{min-width:0}
.timetable-grid{width:100%;min-width:720px;grid-template-columns:52px repeat(var(--timetable-days,5),minmax(112px,1fr));align-items:stretch}
.time-cell,.time-head,.period-cell,.timetable-cell,.timetable-head{min-width:0;margin:0;border-radius:0;line-height:1.25}
.time-head,.period-cell{display:grid;place-items:center;text-align:center}
.time-cell:is(button){display:grid;align-content:center;justify-items:start;gap:3px;overflow:hidden}
.time-cell:is(button) strong,.time-cell:is(button) small{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-weekdays,.calendar-grid{width:100%;grid-template-columns:repeat(7,minmax(0,1fr))}
.calendar-day{width:auto;min-width:0;margin:0;overflow:hidden}
@media (min-width:768px){.view{width:min(100%,1180px);padding-inline:24px}.dashboard-agenda-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.panel-head{min-height:36px;margin-bottom:8px}.panel-head h3{font-size:15px;line-height:20px}.link-button,.text-button{min-height:36px;padding-inline:10px;font-size:12px}}
@media (max-width:767px){
:root{--topbar-height:52px;--mobile-tabbar-height:72px}
html,body{width:100%;min-width:0;overflow-x:hidden}
body.entry-app{height:var(--app-viewport-height);padding:0;overflow:hidden}
.app-shell{width:100%;height:var(--app-viewport-height);min-height:0;overflow:hidden}
#appMain{width:100%;height:calc(var(--app-viewport-height) - var(--mobile-tabbar-height) - env(safe-area-inset-bottom,0px));min-height:0;padding:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:none}
#appMain::-webkit-scrollbar{display:none}
.sidebar{z-index:1000;top:auto;right:0;bottom:0;left:0;width:100%;height:calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom,0px));min-height:var(--mobile-tabbar-height);padding:4px max(8px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));overflow:visible;border-top:.5px solid var(--line);border-right:0;background:rgba(248,248,248,.96);box-shadow:0 -1px 10px rgba(0,0,0,.035);backdrop-filter:blur(18px) saturate(160%)}
#mainNav{width:100%;height:62px;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;overflow:visible}
#mainNav .nav-item{width:100%;height:62px;min-width:0;min-height:62px;margin:0;padding:5px 2px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden;border-radius:10px;color:#8e8e93;background:transparent;font-size:10px;font-weight:600;line-height:12px;white-space:nowrap}
#mainNav .nav-item .ui-icon{width:26px;height:26px;margin:0;stroke-width:1.8}
#mainNav .nav-item .nav-label{height:12px;max-width:100%;overflow:hidden;line-height:12px;text-overflow:ellipsis;white-space:nowrap}
#mainNav .nav-item.active{color:var(--brand);background:transparent}
.topbar{min-height:var(--topbar-height);height:var(--topbar-height);padding:0 12px;gap:8px;background:rgba(248,248,248,.96)}
.mobile-home-button,.account-button{width:38px;min-width:38px;height:38px;min-height:38px;padding:0;border-radius:10px}
.account-button>span:last-child{display:none}
.page-heading{display:block;position:absolute;right:58px;left:58px;text-align:center}
.page-heading .eyebrow{display:none}.page-heading h1{margin:0;overflow:hidden;font-size:17px;font-weight:700;line-height:24px;letter-spacing:-.02em;text-overflow:ellipsis;white-space:nowrap}
.section-nav{top:var(--topbar-height);min-height:44px;height:44px;padding:5px 12px;gap:4px}.section-nav button{min-height:34px;height:34px;padding:0 12px;border-radius:9px;font-size:12px;line-height:1}
.view,.section-nav:not([hidden])~.view{width:100%;height:auto;min-height:calc(100% - var(--topbar-height));margin:0;padding:14px 12px 28px;overflow:visible}.section-nav:not([hidden])~.view{min-height:calc(100% - var(--topbar-height) - 44px)}
.view-intro,.ai-hero{min-height:42px;margin:0 0 10px;gap:8px}.view-intro h2,.ai-hero h2{margin:0;font-size:19px;line-height:24px;letter-spacing:-.025em}.view-intro .eyebrow,.view-intro>div:first-child>span,.view-intro>div:first-child>p:not(.eyebrow){display:none}
.toolbar-actions{gap:4px}.toolbar-actions .primary-button,.toolbar-actions .soft-button,.toolbar-actions .text-button{width:auto;min-width:38px;min-height:38px;height:38px;padding:0 9px;border-radius:10px;font-size:11px}
.panel,.grade-summary-panel,.panel[data-content-panel="grade-records"],.study-pack-panel,.flashcard-library,.weekly-planner-panel,.pro-panel{padding:12px;border:.5px solid var(--line);border-radius:12px;box-shadow:none}
.panel-head{min-height:36px;margin-bottom:6px;gap:8px}.panel-head h3{overflow:hidden;font-size:15px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.panel-head .eyebrow{font-size:10px;line-height:12px}.panel-head .link-button,.panel-head .text-button,.panel-head .soft-button{flex:0 0 auto;min-height:34px;height:34px;padding:0 8px;font-size:11px}
.task-row,.schedule-row,.calendar-agenda-item,.grade-row,.focus-row,.school-event-row{min-height:52px;margin:0;border-radius:0}
.mobile-schedule-overview,.mobile-timetable{margin-inline:-12px;border:0;border-radius:0;background:var(--surface)}.mobile-schedule-overview{padding-inline:12px}.mobile-schedule-head{min-height:44px}.mobile-schedule-week{width:100%;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px}.mobile-week-day button,.mobile-schedule-week>div>button{min-width:0;min-height:58px;padding:4px 1px;border-radius:10px}
.mobile-timetable{padding:0 12px}.mobile-timetable-tools{min-height:44px}.mobile-timetable-days{width:100%;grid-template-columns:repeat(var(--timetable-days,5),minmax(0,1fr));gap:2px;padding:3px;border-radius:10px;background:#ececee}.mobile-timetable-days button{width:100%;min-width:0;min-height:36px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;font-size:12px;line-height:1}.mobile-timetable-days button.active{color:var(--ink);background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.10)}
.mobile-timetable-list{margin:8px -12px 0;display:block;border-top:.5px solid var(--line)}.mobile-timetable-item,.mobile-period-row{width:100%;min-height:76px;margin:0;padding:10px 14px;grid-template-columns:46px minmax(0,1fr) 20px;gap:10px;overflow:hidden;border:0;border-bottom:.5px solid var(--line);border-radius:0;background:#fff}.mobile-period-number{width:46px;height:46px;border-radius:10px}.mobile-period-copy{align-self:center;overflow:hidden}.mobile-period-copy strong{font-size:14px;line-height:18px}.mobile-period-copy small{font-size:11px;line-height:16px}.mobile-period-action{width:20px;height:20px}
.calendar-head{min-height:42px;grid-template-columns:38px minmax(0,1fr) 38px auto}.calendar-head h2{overflow:hidden;font-size:17px;line-height:24px;text-overflow:ellipsis;white-space:nowrap}.calendar-weekdays{margin-top:4px}.calendar-weekdays span{padding-block:5px;font-size:10px;line-height:14px}.calendar-day{min-height:44px;padding:4px 2px}.calendar-day>span:first-child{width:22px;height:22px;margin-inline:auto;display:grid;place-items:center;font-size:11px;line-height:22px}.calendar-event-dots,.calendar-day-events{margin-top:2px;justify-content:center}
.timer-hero-card{min-height:300px;padding:14px 12px}.timer-display,.stopwatch-display{font-variant-numeric:tabular-nums;white-space:nowrap}
dialog{max-height:calc(100dvh - env(safe-area-inset-top,0px) - 12px)}.modal-head h2{font-size:19px;line-height:24px}.toast[popover]{inset:auto 12px calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom,0px) + 8px) 12px}
}
@media (max-width:374px){.view{padding-inline:10px}.mobile-schedule-overview,.mobile-timetable{margin-inline:-10px;padding-inline:10px}.mobile-timetable-list{margin-inline:-10px}#mainNav .nav-item{font-size:9px}#mainNav .nav-item .ui-icon{width:24px;height:24px}}

/* Figma mobile surface mapping: full-width grouped lists instead of dashboard cards */
@media (max-width:767px){
#dashboardView{padding:10px 0 28px;background:var(--canvas)}
#dashboardView .home-primary-grid{margin:0 0 10px}
#dashboardView .today-priority-card{margin:0;padding:16px 20px;border:0;border-radius:0;box-shadow:none;background:#fff}
#dashboardView .today-next-task{grid-template-columns:58px minmax(0,1fr);gap:12px}
#dashboardView #ddayCount{width:58px;height:58px;min-width:58px;min-height:58px;border-radius:12px;font-size:12px}
#dashboardView .today-next-task h3{font-size:17px;line-height:24px;font-weight:650}
#dashboardView .today-next-task small{font-size:10px;line-height:12px}
#dashboardView .today-primary-actions{margin-top:12px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}
#dashboardView .today-primary-actions button{min-height:40px;height:40px;border-radius:10px;font-size:13px}
#dashboardView .today-progress-copy{margin:12px -20px 0;padding:12px 20px 0;border-top:.5px solid var(--line);border-radius:0;background:#fff;grid-template-columns:auto auto minmax(0,1fr)}
#dashboardView .dashboard-agenda-grid{gap:10px}
#dashboardView .dashboard-agenda-panel,#dashboardView .dashboard-timetable-panel{padding:12px 20px;border:0;border-radius:0;box-shadow:none;background:#fff}
#dashboardView .dashboard-agenda-panel .empty,#dashboardView .dashboard-timetable-panel .empty,#dashboardView .dashboard-empty{margin-inline:-8px;border-radius:10px}
#dashboardView .home-more-summary{margin:10px 0 0;border-width:.5px 0;border-radius:0;box-shadow:none}
#dashboardView .stats-grid{padding:0 12px}
#dashboardView .task-row,#dashboardView .schedule-row{min-height:60px;padding-block:10px;border-bottom:.5px solid var(--line)}
#tasksView{padding:0 0 28px}
#tasksView .view-intro{padding:10px 12px 0}
#tasksView .mobile-schedule-overview{margin:0;padding:0 12px 12px;border-bottom:10px solid var(--canvas)}
#tasksView .schedule-task-collection{margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:#fff}
#tasksView .schedule-task-collection>summary{min-height:44px;padding:0 20px;border-bottom:.5px solid var(--line);font-size:12px}
#tasksView .schedule-task-tools{padding:10px 12px;border-bottom:.5px solid var(--line)}
#tasksView .schedule-task-list{padding:0;gap:0}
#tasksView .task-card{margin:0;padding:12px 20px;border:0;border-bottom:.5px solid var(--line);border-radius:0;box-shadow:none}
#gradesView{padding:10px 0 28px}
#gradesView .view-intro,#gradesView>.content-tabs,#gradesView .record-primary-grid,#gradesView .records-empty-state{margin-inline:12px}
#gradesView .record-primary-grid{gap:4px}
#gradesView .record-primary-grid>button{min-height:80px;padding:10px;border:.5px solid var(--line);border-radius:10px;box-shadow:none}
#gradesView .grade-summary-panel,#gradesView .grade-whatif-panel,#gradesView .panel[data-content-panel="grade-records"]{margin-top:10px;padding:12px 20px;border:0;border-radius:0;box-shadow:none}
#gradesView .grade-term-card,#gradesView .grade-row{margin:0;border-width:0 0 .5px;border-radius:0;box-shadow:none}
#timerView{padding:0 0 28px}
#timerView .stopwatch-layout{gap:10px}
#timerView .timer-hero-card,#timerView .subject-timers{margin:0;padding:16px 20px;border:0;border-radius:0;box-shadow:none;background:#fff}
#timerView .timer-hero-card{min-height:300px;border-bottom:10px solid var(--canvas)}
#timerView .subject-timers{padding-top:10px}
#timerView .timer-subject-row{min-height:64px;margin:0;padding:6px 0;border-bottom:.5px solid var(--line);border-radius:0}
#timerView .focus-progress-details{margin:10px 0 0;border-width:.5px 0;border-radius:0;box-shadow:none}
#aiView{padding:0 0 28px}
#aiView .ai-hero{margin:0;padding:14px 20px;border:0;border-bottom:10px solid var(--canvas);border-radius:0;background:#fff}
#aiView>.content-tabs{margin:10px 12px}
#aiView .ai-maker,#aiView .study-pack-panel,#aiView .flashcard-library{margin:0;padding:14px 20px;border:0;border-radius:0;box-shadow:none;background:#fff}
#aiView .ai-maker-grid{gap:10px}
#aiView .ai-source-card,#aiView .ai-control-card{padding:12px;border:.5px solid var(--line);border-radius:10px;box-shadow:none}
#moreView,#proView{padding:10px 0 28px}
#moreView .view-intro,#proView .view-intro,#moreView>.content-tabs,#proView>.content-tabs,#moreView .more-ai-usage{margin-inline:12px}
#moreView .more-menu,#proView .weekly-planner-panel,#proView .pro-panel{margin-top:10px;padding:0 20px;border:0;border-radius:0;box-shadow:none;background:#fff}
#moreView .more-menu button{min-height:60px;margin:0;border-bottom:.5px solid var(--line);border-radius:0}
#proView .weekly-planner-panel,#proView .pro-panel{padding-block:14px}
}
@media (max-width:767px){#timerView .timer-intro{display:none}#timerView .stopwatch-display{height:auto;min-height:0;line-height:1;padding-block:2px;overflow:visible}}
@media (max-width:767px){#timerView .stopwatch-display{height:66px;min-height:66px;padding:0;line-height:66px;overflow:hidden}}
@media (max-width:767px){:root{--topbar-height:44px}.topbar{height:44px;min-height:44px}.mobile-home-button,.account-button{width:36px;min-width:36px;height:36px;min-height:36px;border-radius:9px}.page-heading{right:52px;left:52px}.section-nav{top:44px}}
