:root {
  color-scheme: light;
  --brand: #c84f12;
  --brand-hover: #a93e09;
  --brand-soft: #fff1e7;
  --brand-line: #f4c9ad;
  --secondary: #176d64;
  --secondary-soft: #eaf6f3;
  --ink: #192230;
  --text: #283445;
  --muted: #667085;
  --subtle: #8b95a5;
  --line: #e5e1da;
  --line-strong: #d7d1c8;
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --surface-alt: #fbfaf8;
  --danger: #ba2f2f;
  --danger-soft: #fff0ef;
  --warning: #a55a08;
  --warning-soft: #fff6df;
  --success: #187253;
  --success-soft: #eaf7f0;
  --google: #2563eb;
  --sidebar-width: 220px;
  --topbar-height: 64px;
  --content-width: 1180px;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(31, 24, 18, .04);
  --shadow-md: 0 10px 28px rgba(31, 24, 18, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --app-viewport-height: 100dvh;
  --mobile-keyboard-inset: 0px;
  font-family: Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

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

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

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

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  color: #fff;
  background: var(--ink);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .34);
  outline-offset: 2px;
}

.ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Landing */

.entry-app .landing-page,
.entry-landing .app-shell,
.entry-landing .app-fab,
.entry-landing .app-update-banner {
  display: none;
}

.landing-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 82% 9%, rgba(244, 153, 85, .13), transparent 28rem),
    linear-gradient(180deg, #fff 0, #fbfaf7 55%, #f5f3ef 100%);
}

.landing-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.landing-header.scrolled {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.landing-brand,
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.landing-brand > span,
.brand-mark,
.mobile-home-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #e26520, #b73e0b);
  box-shadow: 0 8px 18px rgba(193, 65, 12, .2);
}

.brand-glyph {
  width: 21px;
  height: 21px;
}

.landing-brand strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -.03em;
}

.landing-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #4e5968;
  font-size: 14px;
  font-weight: 650;
}

.landing-header nav a:hover {
  color: var(--brand);
}

.landing-header-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.landing-login,
.landing-open,
.landing-primary,
.landing-secondary,
.landing-service-panel button,
.landing-final-cta button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
}

.landing-login,
.landing-secondary {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.landing-open,
.landing-primary,
.landing-service-panel button,
.landing-final-cta button {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(193, 65, 12, .16);
}

.landing-open:hover,
.landing-primary:hover,
.landing-service-panel button:hover,
.landing-final-cta button:hover {
  background: var(--brand-hover);
}

.landing-hero {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  min-height: 650px;
  margin: 0 auto;
  padding: 78px 0 84px;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(500px, 1.12fr);
  align-items: center;
  gap: 68px;
}

.landing-hero-copy {
  min-width: 0;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  font-size: 13px;
  font-weight: 750;
}

.landing-kicker {
  margin-top: 24px;
  color: var(--brand);
  font-weight: 800;
}

.landing-hero h1 {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(46px, 5vw, 66px);
  line-height: 1.04;
  letter-spacing: -.065em;
}

.landing-hero h1 span {
  color: var(--brand);
}

.landing-lead {
  max-width: 520px;
  margin-top: 22px;
  color: #596579;
  font-size: 18px;
  line-height: 1.7;
}

.landing-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.landing-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.landing-app-preview {
  min-width: 0;
}

.landing-preview-window {
  overflow: hidden;
  display: grid;
  grid-template-columns: 52px 1fr;
  min-height: 390px;
  border: 1px solid #ded9d0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 72px rgba(71, 53, 38, .14);
  transform: rotate(.5deg);
}

.landing-preview-rail {
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #fbfaf8;
}

.landing-preview-logo {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
}

.landing-preview-rail i {
  width: 20px;
  height: 4px;
  border-radius: 99px;
  background: #d9d5ce;
}

.landing-preview-rail i.active {
  height: 20px;
  background: var(--brand);
}

.landing-preview-main {
  min-width: 0;
  padding: 18px;
  background: #f8f7f4;
}

.landing-preview-main > header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.landing-preview-main > header strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
}

.landing-preview-main > header i {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: #22a06b;
}

.landing-preview-priority {
  margin-top: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1.15fr auto;
  align-items: center;
  gap: 18px;
  border: 1px solid #ead9cd;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8f2, #fff);
}

.landing-preview-priority div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.landing-preview-priority small,
.landing-preview-columns header span {
  color: var(--muted);
  font-size: 10px;
}

.landing-preview-priority strong {
  color: var(--ink);
  font-size: 16px;
}

.landing-preview-priority em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.landing-preview-priority div > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.landing-preview-priority button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-size: 11px;
}

.landing-preview-columns {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 12px;
  margin-top: 12px;
}

.landing-preview-columns > section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.landing-preview-columns header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.landing-preview-columns p {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #f0ede8;
  font-size: 10px;
}

.landing-preview-columns p i {
  width: 7px;
  height: 22px;
  border-radius: 99px;
  background: var(--secondary);
}

.landing-preview-columns p i.math {
  background: #4c6ef5;
}

.landing-preview-columns p i.english {
  background: #e8590c;
}

.landing-preview-columns p em {
  margin-left: auto;
  color: var(--brand);
  font-size: 9px;
  font-style: normal;
}

.landing-app-preview > p {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.landing-app-preview > p span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.landing-scroll {
  position: absolute;
  bottom: 26px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.landing-section {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 90px 0;
}

.landing-section-head {
  max-width: 680px;
}

.landing-section-head > p {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.landing-section-head h2 {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.landing-section-head > span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
}

.landing-service-tabs {
  width: fit-content;
  margin-top: 34px;
  padding: 4px;
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.landing-service-tabs button {
  min-width: 90px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.landing-service-tabs button.active {
  color: #fff;
  background: var(--ink);
}

.landing-service-panels {
  margin-top: 16px;
}

.landing-service-panel {
  display: none;
  min-height: 270px;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 36px;
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.landing-service-panel.active {
  display: grid;
}

.landing-service-icon {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  color: var(--brand);
  background: var(--brand-soft);
}

.landing-service-icon .ui-icon {
  width: 42px;
  height: 42px;
}

.landing-service-panel p {
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.landing-service-panel h3 {
  margin-top: 5px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -.035em;
}

.landing-service-panel ul {
  margin: 18px 0 24px;
  display: grid;
  gap: 8px;
  color: #536073;
  list-style: none;
}

.landing-service-panel li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--secondary);
  font-weight: 800;
}

.landing-final-cta {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto 80px;
  padding: 68px;
  text-align: center;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(145deg, #273140, #111827);
}

.landing-final-cta p {
  color: #f4b083;
  font-weight: 750;
}

.landing-final-cta h2 {
  margin-top: 10px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.18;
  letter-spacing: -.045em;
}

.landing-final-cta button {
  margin-top: 24px;
}

.landing-final-cta > span {
  display: block;
  margin-top: 12px;
  color: #c8d0dc;
  font-size: 13px;
}

.landing-footer {
  min-height: 90px;
  padding: 20px max(24px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.landing-footer .landing-privacy {
  margin-left: auto;
}

.landing-footer button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.reveal-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}

.reveal-item.revealed {
  opacity: 1;
  transform: none;
}

/* App shell */

.app-shell {
  height: var(--app-viewport-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--canvas);
}

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: #fff;
}

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

.brand > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand strong {
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -.03em;
}

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

#mainNav {
  margin-top: 24px;
  display: grid;
  gap: 5px;
}

.nav-item {
  min-height: 46px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 11px;
  color: #536073;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}

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

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

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

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 6px;
}

.sidebar-save-state {
  min-height: 44px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.sidebar-save-state > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
}

.sidebar-save-state div,
.sidebar-utility > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-save-state strong,
.sidebar-utility strong {
  color: var(--text);
  font-size: 12px;
}

.sidebar-save-state small,
.sidebar-utility small {
  color: var(--muted);
  font-size: 10px;
}

.sidebar-utility {
  min-height: 50px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.sidebar-utility:hover {
  background: #f6f3ef;
}

.sidebar-utility > span:first-child,
.sidebar-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: #f3f1ed;
}

.sidebar-avatar img {
  width: 17px;
  height: 17px;
}

#appMain {
  min-width: 0;
  height: var(--app-viewport-height);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  min-height: var(--topbar-height);
  padding: 0 max(24px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}

.page-heading {
  min-width: 0;
}

.page-heading .eyebrow {
  color: var(--brand);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.page-heading h1 {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.top-actions {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .notification-button,
.topbar .settings-button {
  display: none;
}

.save-state {
  color: var(--muted);
  font-size: 12px;
}

.menu-button,
.mobile-home-button {
  display: none;
}

.section-nav {
  position: sticky;
  z-index: 70;
  top: var(--topbar-height);
  min-height: 54px;
  padding: 5px max(24px, calc((100% - var(--content-width)) / 2));
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 246, 243, .96);
  backdrop-filter: blur(12px);
}

.section-nav button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.section-nav button.active {
  color: var(--brand);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.view {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  padding: 26px 30px 96px;
}

.view:not(.active) {
  display: none;
}

.view-intro,
.ai-hero {
  min-height: 74px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.view-intro > div:first-child,
.ai-hero > div {
  min-width: 0;
}

.eyebrow,
.view-intro > div:first-child > .eyebrow,
.panel-head .eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.view-intro h2,
.ai-hero h2 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.04em;
}

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

.toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Components */

.primary-button,
.soft-button,
.text-button,
.link-button,
.danger-button,
.icon-button,
.close-button,
.round-timer-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s var(--ease), background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.primary-button > span,
.soft-button > span,
.text-button > span,
.link-button > span,
.danger-button > span,
.icon-button > span,
.close-button > span,
.round-timer-button > span {
  color: inherit;
}

.primary-button {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  box-shadow: 0 6px 14px rgba(193, 65, 12, .14);
}

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

.soft-button {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.soft-button:hover {
  border-color: #bbb2a6;
  background: #faf8f5;
}

.text-button,
.link-button {
  padding-inline: 8px;
  color: var(--brand);
}

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

.danger-button {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f2c7c3;
}

.icon-button,
.close-button,
.notification-button,
.settings-button {
  width: 44px;
  padding: 0;
  flex: 0 0 auto;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}

.close-button {
  border-color: transparent;
  background: transparent;
}

.account-button {
  max-width: 190px;
}

.account-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #fff;
}

.account-dot img {
  width: 15px;
  height: 15px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

button:not(:disabled):active {
  transform: translateY(1px);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head > div {
  min-width: 0;
}

.panel-head h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.panel-head small {
  color: var(--muted);
  font-size: 12px;
}

.content-tabs,
.pack-tabs,
.filter-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.content-tabs {
  width: fit-content;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.content-tabs button,
.pack-tabs button,
.filter-tabs button {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.content-tabs button.active,
.pack-tabs button.active,
.filter-tabs button.active {
  color: var(--ink);
  background: #f1efeb;
}

.content-tabs button.active {
  color: #fff;
  background: var(--ink);
}

.helper {
  color: var(--muted);
  font-size: 12px;
}

.empty-state,
.compact-empty,
.task-first-empty {
  min-height: 126px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.empty-state strong,
.compact-empty strong,
.task-first-empty strong {
  color: var(--text);
  font-size: 14px;
}

.empty-state span,
.compact-empty span,
.task-first-empty span {
  color: var(--muted);
  font-size: 12px;
}

.task-first-empty .primary-button {
  margin-top: 10px;
}

label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #d56d35;
  box-shadow: 0 0 0 3px rgba(200, 79, 18, .12);
}

fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

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

.wide-label {
  display: block;
}

.search-box {
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.search-box .ui-icon {
  width: 18px;
  color: var(--muted);
}

.search-box input {
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.search-box input:focus {
  box-shadow: none;
}

details > summary {
  list-style: none;
  cursor: pointer;
}

details > summary::-webkit-details-marker {
  display: none;
}

dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 24, 30, .24);
}

dialog::backdrop {
  background: rgba(18, 24, 33, .48);
  backdrop-filter: blur(2px);
}

.modal-form,
.detail-sheet {
  max-height: min(88dvh, 820px);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-head {
  min-height: 48px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -.035em;
}

.modal-form > label,
.modal-form > fieldset,
.modal-form > details,
.modal-form > .form-grid,
.modal-form > .upload-zone,
.modal-form > .ocr-source-preview,
.modal-form > .ocr-progress {
  margin-top: 14px;
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  margin: 22px -22px -22px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.split-actions .danger-button {
  margin-right: auto;
}

.advanced-form-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.advanced-form-details > summary {
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.advanced-form-details > summary > span:first-child {
  display: flex;
  flex-direction: column;
}

.advanced-form-details summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.advanced-form-body {
  padding: 0 12px 12px;
  display: grid;
  gap: 14px;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-row label,
.onboarding-check {
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.check-row input,
.onboarding-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.custom-reminder {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 8px;
}

.custom-reminder input,
.custom-reminder select {
  margin: 0;
}

.custom-reminder-list,
.reminder-chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.custom-reminder-list > *,
.reminder-chips > * {
  min-height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
}

.upload-zone {
  min-height: 156px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px dashed #d8aa8d;
  border-radius: var(--radius-md);
  color: var(--text);
  background: #fffaf6;
  text-align: center;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-icon {
  width: 30px;
  height: 30px;
  color: var(--brand);
}

.upload-zone strong {
  color: var(--ink);
  font-size: 15px;
}

.upload-zone small {
  color: var(--muted);
  font-size: 12px;
}

.ocr-source-preview {
  padding: 12px;
  display: grid;
  grid-template-columns: 108px 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.ocr-source-preview img {
  width: 108px;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.ocr-source-preview div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ocr-source-preview strong {
  color: var(--ink);
}

.ocr-source-preview span {
  color: var(--muted);
  font-size: 12px;
}

.ocr-progress {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.ocr-progress > div {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8e4de;
}

.ocr-progress > div > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .2s ease;
}

.ocr-progress p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.recognition-source {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.recognition-source > summary {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.recognition-source > label {
  display: block;
  padding: 0 12px 12px;
}

.vision-review-action {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #f0c993;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
}

.vision-review-action > span {
  color: #7b4b12;
  font-size: 12px;
}

.onboarding-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #eeeae4;
}

.onboarding-progress span {
  display: block;
  width: 33%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .2s ease;
}

.onboarding-step {
  display: none;
  margin-top: 20px;
}

.onboarding-step.active {
  display: block;
}

.onboarding-step > strong {
  color: var(--ink);
  font-size: 17px;
}

.onboarding-step > p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.onboarding-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}

/* Today */

.home-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.home-focus-card {
  position: relative;
  overflow: hidden;
  min-height: 242px;
  padding: 28px;
  border: 1px solid #eadfd4;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 12%, rgba(23, 109, 100, .12), transparent 22rem),
    linear-gradient(145deg, #fff 0%, #fff9f4 100%);
  box-shadow: var(--shadow-sm);
}

.today-next-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  max-width: 720px;
}

.today-next-task > span {
  min-width: 92px;
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 28px;
  color: #fff;
  background: var(--ink);
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.04em;
}

.today-next-task small,
.today-progress-copy span,
.today-card-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.today-next-task h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.25;
  letter-spacing: -.045em;
}

.today-next-task em {
  display: block;
  margin-top: 5px;
  color: var(--brand);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
}

.today-primary-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-progress-copy {
  position: absolute;
  top: 28px;
  right: 28px;
  min-width: 154px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow-sm);
}

.today-progress-copy .eyebrow {
  color: var(--brand);
}

.today-progress-copy strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.04em;
}

.today-card-stats {
  margin-top: 24px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid #eee3d9;
}

.today-card-stats > span,
.home-streak-link {
  min-height: 54px;
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #eee3d9;
  text-align: left;
}

.today-card-stats > :first-child {
  padding-left: 0;
  border-left: 0;
}

.today-card-stats strong {
  color: var(--ink);
  font-size: 17px;
  letter-spacing: -.02em;
}

.home-streak-link {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  cursor: pointer;
}

.dashboard-agenda-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
  align-items: start;
}

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

.task-list,
.today-schedule {
  margin-top: 4px;
}

.task-row,
.today-schedule-row {
  min-height: 62px;
  display: grid;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.task-row:first-child,
.today-schedule-row:first-child {
  border-top: 0;
}

.task-row {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.task-row-main,
.today-schedule-row > div {
  min-width: 0;
}

.task-row-main {
  width: 100%;
  min-height: 61px;
  padding: 8px 4px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.subject-dot {
  width: 8px;
  height: 34px;
  border-radius: 99px;
}

.task-row-copy {
  min-width: 0;
}

.due-chip {
  min-height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.due-chip.urgent {
  color: var(--danger);
  background: var(--danger-soft);
}

.task-row strong,
.today-schedule-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row small,
.today-schedule-row small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-complete,
.task-complete-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.task-row.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.today-schedule-row {
  grid-template-columns: 46px minmax(0, 1fr);
}

.schedule-row {
  position: relative;
  min-height: 62px;
  padding: 9px 8px 9px 16px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}

.schedule-row:first-child {
  border-top: 0;
}

.schedule-row::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 2px;
  width: 4px;
  border-radius: 99px;
  background: var(--subject-color, var(--brand));
}

.schedule-row strong,
.schedule-row span {
  display: block;
}

.schedule-row strong {
  color: var(--ink);
  font-size: 13px;
}

.schedule-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.today-schedule-row > time,
.schedule-period {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.home-more-summary {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.home-more-summary > summary {
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.home-more-summary > summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.home-more-summary .stats-grid {
  padding: 0 14px 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-height: 80px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.stat-icon.mint {
  color: var(--secondary);
  background: var(--secondary-soft);
}

.stat-icon.yellow {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat-card strong {
  color: var(--ink);
  font-size: 20px;
}

.empty-state,
.task-empty,
.calendar-agenda-empty,
.today-schedule-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Schedule */

.mobile-schedule-overview,
.mobile-month-close {
  display: none;
}

.schedule-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.calendar-sync-details,
.mobile-google-details {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.calendar-sync-details > summary,
.mobile-google-details > summary {
  min-height: 56px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.calendar-sync-mark,
.sync-center-icon.google {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #d7e2fb;
  border-radius: 10px;
  color: var(--google);
  background: #fff;
  font-weight: 800;
}

.calendar-sync-details strong,
.mobile-google-details strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.calendar-sync-details small,
.mobile-google-details small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.calendar-sync-actions .soft-button,
.mobile-google-details .soft-button {
  min-height: 44px;
  padding-inline: 11px;
  font-size: 12px;
}

.calendar-head {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 5px;
}

.calendar-head h2 {
  color: var(--ink);
  font-size: 18px;
  text-align: center;
  letter-spacing: -.035em;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-top: 12px;
}

.calendar-weekdays span {
  min-width: 0;
  padding: 7px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.calendar-weekdays span:first-child {
  color: #c64747;
}

.calendar-grid {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 62px;
  padding: 7px 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

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

.calendar-day.other-month {
  color: #b2bac5;
  background: #fbfaf8;
}

.calendar-day.today > span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
}

.calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-day > span:first-child {
  font-size: 11px;
  font-weight: 750;
}

.calendar-event-dots,
.calendar-day-events {
  margin-top: 6px;
  display: flex;
  gap: 3px;
}

.calendar-event-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.schedule-kind-legend {
  margin: 8px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 10px;
}

.schedule-kind-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.event-kind {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
}

.event-kind-school {
  color: var(--secondary);
  background: var(--secondary-soft);
}

.event-kind-google {
  color: var(--google);
  background: #eef4ff;
}

.event-kind-class {
  color: #7254b3;
  background: #f2effb;
}

.schedule-agenda-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-agenda-list {
  min-height: 318px;
}

.calendar-agenda-item {
  position: relative;
  min-height: 64px;
  padding: 11px 8px 11px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.calendar-agenda-item::before {
  content: "";
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 4px;
  width: 3px;
  border-radius: 99px;
  background: var(--brand);
}

.calendar-agenda-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.calendar-agenda-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.calendar-agenda-item button {
  min-width: 44px;
  min-height: 44px;
}

.schedule-task-collection {
  margin-top: 16px;
  padding: 0;
  overflow: clip;
}

.schedule-task-collection > summary,
.record-more-summary > summary,
.grade-whatif-panel > summary,
.collapsible-panel > summary {
  min-height: 62px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--ink);
  cursor: pointer;
}

.schedule-task-collection > summary small,
.grade-whatif-panel > summary small,
.collapsible-panel > summary small {
  display: block;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}

.schedule-task-collection > summary strong,
.grade-whatif-panel > summary strong,
.collapsible-panel > summary strong {
  display: block;
  font-size: 15px;
}

.schedule-task-collection > summary > span:last-child,
.record-more-summary > summary > span:last-child,
.grade-whatif-panel > summary > span:last-child,
.collapsible-panel > summary > span:last-child {
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
}

.schedule-task-tools {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.schedule-search {
  width: min(280px, 44%);
}

.task-board {
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.task-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.task-card-top {
  min-height: 52px;
  padding: 7px 7px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subject-badge {
  min-height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}

.task-card-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-status-toggle,
.task-overflow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.task-status-toggle:hover,
.task-overflow:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.task-card-main {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px 14px;
  display: block;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-card-main h3 {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta strong {
  color: var(--brand);
  font-size: 10px;
  white-space: nowrap;
}

.task-card-main:hover {
  background: var(--surface-alt);
}

.task-card-main strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-card-main small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.task-card-actions {
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line);
}

.task-card-actions button {
  min-height: 44px;
}

/* Timetable */

.mobile-timetable {
  display: none;
}

.table-wrap {
  padding: 12px;
  overflow: auto;
}

.timetable-grid {
  min-width: 760px;
  display: grid;
  grid-template-columns: 54px repeat(var(--timetable-days, 5), minmax(126px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.time-cell {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.time-head {
  min-height: 48px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 800;
}

.period-cell {
  min-height: 78px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 750;
}

.time-cell:is(button) {
  position: relative;
  min-height: 78px;
  padding: 7px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.time-cell:is(button):hover,
.time-cell:is(button):focus-visible {
  z-index: 1;
  background: var(--brand-soft);
}

.time-cell.empty-slot::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 20px;
  transition: color .15s ease;
}

.time-cell.empty-slot:hover::after,
.time-cell.empty-slot:focus-visible::after {
  color: var(--brand);
}

.class-block {
  width: 100%;
  min-height: 62px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 10px;
}

.time-cell strong,
.time-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-cell strong {
  color: inherit;
  font-size: 13px;
}

.time-cell small {
  margin-top: 4px;
  color: inherit;
  opacity: .72;
  font-size: 10px;
}

/* Grades */

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

.record-primary-grid > button,
.record-kpi-grid > button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.record-primary-grid > button {
  min-height: 116px;
  padding: 20px;
}

.record-primary-grid > button:hover,
.record-kpi-grid > button:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.record-primary-grid span,
.record-primary-grid small,
.record-kpi-grid span,
.record-kpi-grid small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.record-primary-grid strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.045em;
}

.record-more-summary {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.record-kpi-grid {
  padding: 0 12px 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.record-kpi-grid > button {
  min-height: 82px;
  padding: 12px;
}

.record-kpi-grid strong {
  display: block;
  margin: 2px 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-empty-state {
  margin-top: 14px;
  min-height: 86px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}

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

.records-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

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

.grade-summary-panel,
.grade-whatif-panel,
.collapsible-panel {
  margin-top: 12px;
}

.grade-term-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.grade-term-card {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.grade-term-card small,
.grade-term-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.grade-term-card strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 22px;
}

.grade-whatif-form {
  padding: 0 18px 18px;
  display: grid;
  grid-template-columns: 1.1fr .8fr .8fr 1.5fr;
  gap: 10px;
  align-items: end;
}

.grade-whatif-form label {
  position: relative;
}

.grade-whatif-form label > span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.grade-whatif-form input {
  padding-right: 30px;
}

.grade-whatif-form output {
  min-height: 48px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  color: #7f3510;
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 650;
}

.bar-chart {
  min-height: 210px;
  padding: 0 18px 18px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.bar-chart-item {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  align-items: end;
}

.bar-chart-bar {
  min-height: 8px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #e87530, var(--brand));
}

.bar-chart-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-filter-bar {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}

.record-filter-bar .search-box {
  flex: 1;
}

.grade-list,
.focus-history,
.mistake-list,
.school-event-list,
.exam-plan-list {
  display: grid;
  gap: 8px;
}

.grade-item,
.focus-history-item,
.mistake-item,
.school-event-item,
.exam-plan-item {
  min-height: 64px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* Timer */

.stopwatch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 16px;
  align-items: start;
}

.timer-hero-card {
  min-height: 460px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stopwatch-card-head {
  width: 100%;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.running-badge {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: 11px;
  font-weight: 800;
}

.running-badge.running {
  color: var(--brand);
  background: var(--brand-soft);
}

.focus-room-open {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.current-subject {
  margin-top: 30px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
}

.stopwatch-kind {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.stopwatch-display {
  margin: 8px 0 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: clamp(54px, 7vw, 80px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.055em;
}

.timer-hero-card > p:last-of-type {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
}

.stopwatch-actions {
  margin: 28px 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.timer-round-button {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}

.timer-round-button.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 26px rgba(200, 79, 18, .22);
}

.timer-round-button.secondary {
  color: var(--ink);
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px var(--line);
}

.timer-round-button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.timer-quick-stats {
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.timer-quick-stats > span {
  padding: 0 10px;
  border-left: 1px solid var(--line);
}

.timer-quick-stats > span:first-child {
  border-left: 0;
}

.timer-quick-stats small,
.timer-quick-stats strong {
  display: block;
}

.timer-quick-stats small {
  color: var(--muted);
  font-size: 10px;
}

.timer-quick-stats strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 15px;
}

.subject-timer-panel {
  min-height: 460px;
  padding: 18px;
}

.subject-timers {
  min-height: 460px;
  padding: 18px;
}

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

.subject-timer-row,
.timer-subject-row {
  min-height: 62px;
  padding: 8px 8px 8px 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.timer-subject-row:hover,
.timer-subject-row.active {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.subject-play {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--subject-color, var(--brand));
}

.subject-play .ui-icon {
  width: 18px;
  height: 18px;
}

.timer-subject-row strong,
.timer-subject-row small,
.subject-total,
.subject-action-label {
  display: block;
}

.timer-subject-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-subject-row small {
  color: var(--muted);
  font-size: 10px;
}

.subject-total {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.subject-action-label {
  min-width: 62px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.round-timer-button {
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 26px rgba(200, 79, 18, .22);
}

.round-timer-button:disabled {
  color: var(--muted);
  background: #ebe7e1;
}

.task-link-label {
  width: min(100%, 240px);
  margin-top: 8px;
}

.focus-progress-details {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.focus-progress-details > summary {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.focus-progress-details > summary strong,
.focus-progress-details > summary small {
  display: block;
}

.focus-progress-details > summary strong {
  color: var(--ink);
  font-size: 14px;
}

.focus-progress-details > summary small,
.focus-progress-details > summary > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.study-summary {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr) minmax(140px, .8fr);
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.study-summary strong,
.study-summary span {
  display: block;
}

.study-summary > div:first-child > strong {
  color: var(--ink);
  font-size: 24px;
}

.study-summary > div:first-child > span {
  color: var(--muted);
  font-size: 11px;
}

.goal-ring {
  --goal: 0deg;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) var(--goal), #eeeae4 0);
}

.goal-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
}

.goal-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.level-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-summary > span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--secondary);
  background: var(--secondary-soft);
}

.level-summary strong,
.level-summary small {
  display: block;
}

.level-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.level-summary small {
  color: var(--muted);
  font-size: 10px;
}

.level-info-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.goal-setting {
  position: relative;
}

.goal-setting input {
  padding-right: 44px;
}

.goal-setting > span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--muted);
  font-size: 11px;
}

.achievement-strip {
  padding: 0 18px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.achievement-chip {
  min-width: 164px;
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.achievement-chip > b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
}

.achievement-chip strong,
.achievement-chip small {
  display: block;
}

.achievement-chip strong {
  color: var(--ink);
  font-size: 11px;
}

.achievement-chip small {
  color: var(--muted);
  font-size: 9px;
}

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

.timer-insights,
.focus-records-workspace {
  margin-top: 12px;
}

.weekly-focus-chart {
  min-height: 180px;
}

.hour-heatmap {
  display: grid;
  grid-template-columns: repeat(12, minmax(22px, 1fr));
  gap: 5px;
}

/* AI study */

.ai-study-hero {
  margin-bottom: 16px;
  min-height: 132px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #eadfd4;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0, rgba(23, 109, 100, .13), transparent 20rem),
    linear-gradient(135deg, #fff 0, #fff7f0 100%);
}

.ai-study-hero h2 {
  max-width: 650px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.22;
  letter-spacing: -.045em;
}

.ai-study-hero p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.ai-hero {
  min-height: 112px;
  margin-bottom: 14px;
  padding: 22px 24px;
  align-items: center;
  border: 1px solid #eadfd4;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 0, rgba(23, 109, 100, .13), transparent 20rem),
    linear-gradient(135deg, #fff 0, #fff7f0 100%);
}

.ai-hero > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  color: var(--secondary);
  background: var(--secondary-soft);
}

.ai-layout {
  margin-top: 12px;
}

.ai-maker {
  padding: 18px;
}

.ai-options {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.ai-options > summary {
  min-height: 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.ai-options > summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.ai-options .form-grid {
  padding: 0 12px 12px;
}

.ai-output-summary {
  margin-top: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #d6e8e4;
  border-radius: var(--radius-sm);
  background: var(--secondary-soft);
}

.ai-output-summary span {
  color: var(--secondary);
  font-size: 10px;
  font-weight: 850;
}

.ai-output-summary strong {
  color: #245e57;
  font-size: 12px;
}

.ai-create-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-create-actions > span:first-child {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}

.ai-usage-inline {
  padding: 5px 8px;
  border-radius: 99px;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-maker-grid {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.ai-source-card,
.ai-control-card {
  min-height: 420px;
}

.upload-zone {
  min-height: 174px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--brand-soft);
  text-align: center;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--brand);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-zone .upload-icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.upload-zone strong {
  color: var(--ink);
  font-size: 14px;
}

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

.small-upload {
  min-height: 126px;
}

.ocr-source-preview {
  margin-top: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.ocr-source-preview img {
  width: 82px;
  height: 66px;
  border-radius: 8px;
  object-fit: cover;
}

.ocr-source-preview strong,
.ocr-source-preview span {
  display: block;
}

.ocr-source-preview strong {
  color: var(--ink);
  font-size: 12px;
}

.ocr-source-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.ocr-progress {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.ocr-progress > div {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9e5df;
}

.ocr-progress > div > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .18s ease;
}

.ocr-progress p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.ai-control-card textarea {
  min-height: 230px;
  resize: vertical;
}

.ai-generate-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.study-source-trust {
  margin-top: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  border: 1px solid #d9e9e6;
  border-radius: var(--radius-sm);
  color: #245e57;
  background: var(--secondary-soft);
  font-size: 11px;
}

.study-pack-panel {
  margin-top: 16px;
}

.study-pack-tabs,
.pack-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.study-pack-tabs::-webkit-scrollbar,
.pack-tabs::-webkit-scrollbar {
  display: none;
}

.study-pack-tabs button,
.pack-tabs button {
  min-height: 44px;
  padding: 0 15px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.study-pack-tabs button.active,
.pack-tabs button.active {
  border-color: var(--ink);
  color: #fff;
  background: var(--ink);
}

.study-pack-content,
.pack-content {
  margin-top: 10px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.pack-content:not(.active) {
  display: none;
}

.study-pack-content h3,
.study-pack-content h4,
.pack-content h3,
.pack-content h4 {
  color: var(--ink);
}

.study-pack-content p,
.study-pack-content li,
.pack-content p,
.pack-content li {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
}

.study-pack-content ul,
.study-pack-content ol,
.pack-content ul,
.pack-content ol {
  padding-left: 20px;
}

.generated-flashcard,
.saved-flashcard-face {
  width: 100%;
  min-height: 96px;
  padding: 16px;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.generated-flashcard + .generated-flashcard {
  margin-top: 8px;
}

.generated-flashcard strong,
.generated-flashcard span,
.saved-flashcard-face strong,
.saved-flashcard-face span {
  display: block;
}

.generated-flashcard strong,
.saved-flashcard-face strong {
  color: var(--ink);
  font-size: 14px;
}

.generated-flashcard span,
.saved-flashcard-face span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.saved-flashcards,
.flashcard-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.saved-flashcard,
.flashcard-item {
  min-width: 0;
}

.flashcard-review-actions {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.flashcard-review-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.flashcard-review-actions button:last-child {
  border-color: #c9e3dc;
  color: var(--secondary);
  background: var(--secondary-soft);
}

/* Planner, reports and settings */

.weekly-planner-panel,
.pro-panel {
  margin-top: 12px;
}

.weekly-plan-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.weekly-plan-actions label {
  max-width: 120px;
}

.weekly-plan-actions label > span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
}

.ai-planner-builder {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.ai-planner-copy strong,
.ai-planner-copy span,
.ai-planner-copy small {
  display: block;
}

.ai-planner-copy span {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.ai-planner-copy strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.ai-planner-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ai-planner-inputs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(140px, .6fr) minmax(240px, 1.6fr) auto auto;
  gap: 8px;
  align-items: end;
}

.ai-planner-inputs textarea {
  min-height: 88px;
}

.ai-plan-file {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  cursor: pointer;
}

.ai-plan-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.ai-planner-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.ai-plan-preview,
.weekly-plan-grid {
  margin-top: 12px;
}

.weekly-plan-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.weekly-plan-day {
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

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

.pro-panel.active {
  grid-column: 1 / -1;
}

.wide-pro {
  grid-column: 1 / -1;
}

.study-queue {
  display: grid;
  gap: 8px;
}

.study-queue-item {
  min-height: 60px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.focus-pro-report,
.focus-insight {
  display: grid;
  gap: 10px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-grid > div {
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.report-grid small,
.report-grid strong {
  display: block;
}

.report-grid small {
  color: var(--muted);
  font-size: 10px;
}

.report-grid strong {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-pro-report .helper {
  padding: 10px 12px;
  border: 1px solid #d6e8e4;
  border-radius: var(--radius-sm);
  color: #245e57;
  background: var(--secondary-soft);
  font-size: 10px;
}

.weekly-focus-chart {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.focus-day {
  min-width: 0;
  display: grid;
  grid-template-rows: 136px auto auto;
  gap: 4px;
  text-align: center;
}

.focus-bar-track {
  position: relative;
  overflow: hidden;
  border-radius: 8px 8px 3px 3px;
  background: #f0ede8;
}

.focus-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 4px;
  border-radius: inherit;
  background: linear-gradient(180deg, #e87530, var(--brand));
}

.focus-day strong {
  color: var(--ink);
  font-size: 11px;
}

.focus-day span {
  color: var(--muted);
  font-size: 9px;
}

.focus-insight {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #d6e8e4;
  border-radius: var(--radius-sm);
  color: #245e57;
  background: var(--secondary-soft);
  font-size: 12px;
}

.focus-row {
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.focus-row strong,
.focus-row small {
  display: block;
}

.focus-row strong {
  color: var(--ink);
  font-size: 13px;
}

.focus-row small {
  color: var(--muted);
  font-size: 10px;
}

.focus-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-focus {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  cursor: pointer;
}

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

.more-menu-list,
.more-menu {
  display: grid;
  gap: 8px;
}

.more-menu-list > button,
.more-menu > button {
  width: 100%;
  min-height: 62px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.more-menu-list strong,
.more-menu-list small,
.more-menu strong,
.more-menu small {
  display: block;
}

.more-menu-list strong,
.more-menu strong {
  color: var(--ink);
  font-size: 13px;
}

.more-menu-list small,
.more-menu small {
  color: var(--muted);
  font-size: 10px;
}

.more-menu-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
}

.more-chevron {
  width: 16px;
  color: var(--subtle);
}

.more-profile-card {
  width: 100%;
  min-height: 78px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.more-profile-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--secondary);
  background: var(--secondary-soft);
}

.more-profile-card small,
.more-profile-card strong {
  display: block;
}

.more-profile-card small {
  color: var(--muted);
  font-size: 10px;
}

.more-profile-card strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
}

.more-ai-usage {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.more-ai-usage > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.more-ai-usage strong {
  color: var(--ink);
  font-size: 12px;
}

.more-ai-usage-track {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #eeeae4;
}

.more-ai-usage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #e99057);
  transition: width .2s ease;
}

.more-section {
  margin-top: 18px;
}

.more-section > h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
}

@media (min-width: 901px) {
  .more-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dialog content and feedback */

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

.quick-add-grid > button {
  min-height: 104px;
  padding: 14px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.quick-add-grid > button:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

.quick-add-grid > button > span {
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
}

.quick-add-grid strong,
.quick-add-grid small {
  display: block;
}

.quick-add-grid strong {
  align-self: end;
  color: var(--ink);
  font-size: 13px;
}

.quick-add-grid small {
  align-self: start;
  color: var(--muted);
  font-size: 10px;
}

.auth-profile,
.cloud-sync-card {
  padding: 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.auth-profile strong,
.auth-profile small,
.cloud-sync-card strong,
.cloud-sync-card small {
  display: block;
}

.auth-profile strong,
.cloud-sync-card strong {
  color: var(--ink);
  font-size: 12px;
}

.auth-profile small,
.cloud-sync-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.auth-provider {
  width: 100%;
  min-height: 62px;
  margin: 10px 0;
  padding: 9px 13px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.google-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.google-mark img {
  width: 18px;
  height: 18px;
}

.auth-provider strong,
.auth-provider small {
  display: block;
}

.auth-provider strong {
  color: var(--ink);
  font-size: 13px;
}

.auth-provider small {
  color: var(--muted);
  font-size: 10px;
}

.auth-trust-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.auth-trust-note a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sync-center-list {
  display: grid;
  gap: 8px;
}

.sync-center-list > section {
  min-height: 66px;
  padding: 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.sync-center-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--secondary);
  background: var(--secondary-soft);
}

.sync-center-list strong,
.sync-center-list small {
  display: block;
}

.sync-center-list strong {
  color: var(--ink);
  font-size: 12px;
}

.sync-center-list small {
  color: var(--muted);
  font-size: 10px;
}

.status-badge {
  min-height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 750;
}

.network-banner,
.app-update-banner {
  position: fixed;
  z-index: 500;
  right: 18px;
  bottom: 18px;
  max-width: min(430px, calc(100vw - 36px));
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.network-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.network-banner strong {
  color: var(--warning);
}

.network-banner span,
.app-update-banner span {
  color: var(--muted);
  font-size: 11px;
}

.app-update-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 40px;
  align-items: center;
  gap: 10px;
}

.app-update-banner strong,
.app-update-banner span {
  display: block;
}

.app-update-banner strong {
  color: var(--ink);
  font-size: 13px;
}

.xp-reward-toast,
.toast {
  position: fixed;
  z-index: 900;
  left: 50%;
  bottom: 24px;
  min-height: 48px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
}

.app-fab {
  display: none;
}

/* Responsive */

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 196px;
  }

  .view {
    padding-inline: 22px;
  }

  .page-heading {
    min-width: 150px;
  }

  .save-state {
    display: none;
  }

  .dashboard-agenda-grid,
  .stopwatch-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .timer-hero-card,
  .subject-timer-panel {
    min-height: auto;
  }

  .task-board,
  .grade-term-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grade-whatif-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grade-whatif-form output {
    grid-column: 1 / -1;
  }

  .ai-planner-inputs {
    grid-template-columns: minmax(140px, .55fr) minmax(0, 1.45fr);
  }

  .ai-plan-file,
  .ai-planner-inputs > button {
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 176px;
  }

  .sidebar {
    padding-inline: 10px;
  }

  .brand-copy small,
  .sidebar-foot small {
    display: none;
  }

  .sidebar-nav button {
    padding-inline: 10px;
  }

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

  .account-button,
  #quickAddBtn {
    width: 44px;
    padding: 0;
  }

  .schedule-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .ai-maker-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-source-card,
  .ai-control-card {
    min-height: auto;
  }

  .settings-grid,
  .pro-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wide-pro {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 58px;
  }

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

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 350;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    border-right: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
  }

  .brand,
  .sidebar-foot,
  .sidebar-section-label {
    display: none;
  }

  .sidebar-nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }

  #mainNav {
    height: 100%;
    margin-top: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 2px;
    overflow: visible;
  }

  #mainNav .nav-item {
    width: auto;
    min-width: 0;
    min-height: 56px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
  }

  #mainNav .nav-item .ui-icon {
    width: 21px;
    height: 21px;
  }

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

  .sidebar-nav button {
    min-width: 0;
    min-height: 56px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    border-radius: 12px;
    font-size: 10px;
    white-space: nowrap;
  }

  .sidebar-nav button .ui-icon {
    width: 21px;
    height: 21px;
  }

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

  .main-shell {
    grid-column: 1;
    min-width: 0;
  }

  .topbar {
    top: 0;
    min-height: var(--topbar-height);
    padding: 0 14px;
  }

  .mobile-home-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .menu-button,
  .page-heading,
  .save-state,
  .notification-button,
  .settings-button,
  #quickAddBtn {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .account-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  .section-nav {
    top: var(--topbar-height);
    min-height: 54px;
    padding: 5px 12px;
    gap: 5px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

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

  .section-nav button {
    min-height: 44px;
    padding: 0 13px;
    flex: 0 0 auto;
    border-radius: 10px;
    white-space: nowrap;
  }

  .view {
    height: calc(var(--app-viewport-height) - var(--topbar-height));
    padding: 18px 16px calc(38px + var(--mobile-keyboard-inset));
  }

  .section-nav:not([hidden]) ~ .view {
    height: calc(var(--app-viewport-height) - var(--topbar-height) - 54px);
  }

  .view-intro {
    margin-bottom: 14px;
    align-items: flex-start;
    gap: 10px;
  }

  .view-intro > div:first-child {
    min-width: 0;
  }

  .view-intro h2 {
    font-size: 21px;
  }

  .view-intro > div:first-child > span {
    display: none;
  }

  .toolbar-actions {
    flex: 0 0 auto;
  }

  .toolbar-actions .text-button {
    display: none;
  }

  .toolbar-actions .primary-button,
  .toolbar-actions .soft-button {
    width: auto;
    min-width: 44px;
    padding: 0 10px;
    gap: 5px;
  }

  .toolbar-actions button > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    font-size: 12px;
  }

  #tasksView #addTaskBtn,
  #mobileTodayAddBtn {
    display: none;
  }

  .panel {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .panel-head {
    margin-bottom: 10px;
  }

  .home-focus-card {
    min-height: 0;
    padding: 18px;
  }

  .today-next-task {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .today-next-task > span {
    min-width: 64px;
    min-height: 64px;
    border-radius: 20px;
    font-size: 14px;
  }

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

  .today-progress-copy {
    position: static;
    min-width: 0;
    margin-top: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
  }

  .today-progress-copy strong {
    margin: 0;
    font-size: 19px;
  }

  .today-progress-copy span {
    min-width: 0;
  }

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

  .today-card-stats {
    display: none;
  }

  .today-card-stats > span,
  .home-streak-link {
    min-height: 46px;
    padding-inline: 8px;
  }

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

  .dashboard-agenda-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .dashboard-agenda-panel .task-row:nth-child(n + 4),
  .dashboard-timetable-panel .today-schedule-row:nth-child(n + 5) {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 72px;
  }

  .mobile-schedule-overview {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-schedule-head {
    order: 1;
    min-height: 50px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
  }

  .mobile-schedule-head > div {
    text-align: center;
  }

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

  .mobile-schedule-head small {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-schedule-head strong {
    color: var(--ink);
    font-size: 15px;
  }

  .mobile-schedule-week {
    order: 2;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .mobile-week-day,
  .mobile-schedule-week > div {
    min-width: 0;
  }

  .mobile-week-day button,
  .mobile-schedule-week > div > button {
    width: 100%;
    min-height: 66px;
    padding: 6px 2px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
  }

  .mobile-week-day button.active,
  .mobile-schedule-week > div > button.selected {
    border-color: var(--ink);
    color: #fff;
    background: var(--ink);
  }

  .mobile-week-day small,
  .mobile-week-day strong,
  .mobile-schedule-week > div > button small,
  .mobile-schedule-week > div > button strong {
    font-size: 10px;
  }

  .mobile-week-day strong,
  .mobile-schedule-week > div > button strong {
    font-size: 14px;
  }

  .mobile-date-kinds {
    min-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
  }

  .mobile-date-kinds .event-kind {
    width: auto;
    min-width: 16px;
    height: 16px;
    padding-inline: 2px;
    font-size: 9px;
  }

  .mobile-schedule-overview > .schedule-kind-legend {
    order: 5;
  }

  .mobile-schedule-actions {
    order: 6;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .mobile-schedule-actions button {
    width: 100%;
  }

  .mobile-today-head {
    order: 3;
    margin-top: 4px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

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

  .mobile-today-head small {
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-today-head strong {
    color: var(--ink);
    font-size: 17px;
  }

  .mobile-today-agenda {
    order: 4;
    min-height: 126px;
    overflow: visible;
    border-top: 1px solid var(--line);
  }

  .mobile-google-details {
    display: none;
  }

  .schedule-workspace {
    display: none;
  }

  .schedule-task-collection {
    display: block;
    margin-top: 14px;
  }

  .schedule-task-tools {
    padding: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-search {
    width: 100%;
  }

  .schedule-task-list {
    padding: 0 12px 12px;
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-month-open .schedule-workspace {
    position: fixed;
    z-index: 600;
    inset: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    display: block;
    overflow-y: auto;
    background: rgba(20, 25, 32, .4);
  }

  .mobile-month-open .schedule-calendar-panel {
    min-height: 0;
    padding: 14px;
    display: block;
    background: #fff;
    box-shadow: var(--shadow-md);
  }

  .mobile-month-open .schedule-agenda-panel,
  .mobile-month-open .calendar-sync-details {
    display: none;
  }

  .mobile-month-open .mobile-month-close {
    display: inline-flex;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .calendar-day {
    min-height: 55px;
  }

  .desktop-timetable {
    display: none;
  }

  .mobile-timetable {
    display: block;
  }

  .mobile-timetable-tools {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-timetable-tools strong {
    color: var(--ink);
    font-size: 14px;
  }

  .mobile-timetable-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .mobile-timetable-days button {
    min-width: 0;
    min-height: 44px;
    padding: 0 2px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
    background: var(--surface);
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
  }

  .mobile-timetable-days button.active {
    border-color: var(--ink);
    color: #fff;
    background: var(--ink);
  }

  .mobile-timetable-list {
    margin-top: 10px;
    display: grid;
    gap: 7px;
  }

  .mobile-timetable-item,
  .mobile-period-row {
    width: 100%;
    min-height: 62px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    cursor: pointer;
  }

  .mobile-period-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 12px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 14px;
    font-weight: 850;
  }

  .mobile-period-number small,
  .mobile-period-copy strong,
  .mobile-period-copy small {
    display: block;
  }

  .mobile-period-number small {
    color: inherit;
    font-size: 8px;
    font-weight: 700;
  }

  .mobile-period-copy {
    min-width: 0;
  }

  .mobile-period-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-period-copy small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-period-action {
    width: 18px;
    color: var(--muted);
  }

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

  .record-primary-grid > button {
    min-height: 98px;
    padding: 14px;
  }

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

  .record-kpi-grid,
  .grade-term-summary,
  .grade-whatif-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade-whatif-form output {
    grid-column: auto;
  }

  .bar-chart {
    min-height: 176px;
    padding-inline: 8px;
    gap: 6px;
  }

  .timer-intro {
    display: none;
  }

  .stopwatch-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

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

  .stopwatch-display {
    font-size: clamp(52px, 16vw, 68px);
  }

  .timer-round-button {
    width: 68px;
    height: 68px;
  }

  .subject-timer-panel,
  .subject-timers {
    padding: 14px;
  }

  .timer-subject-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .timer-subject-row .subject-action-label {
    display: none;
  }

  .focus-room-open {
    min-height: 44px;
  }

  .level-info-button {
    flex: 0 0 44px;
  }

  .study-summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .study-summary .level-summary,
  .study-summary .goal-setting {
    grid-column: 1 / -1;
  }

  .content-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .content-tabs::-webkit-scrollbar {
    display: none;
  }

  .content-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ai-study-hero,
  .ai-hero {
    min-height: 0;
    margin-bottom: 12px;
    padding: 16px;
  }

  .ai-study-hero h2,
  .ai-hero h2 {
    font-size: 22px;
  }

  .ai-study-hero p,
  .ai-hero p {
    display: none;
  }

  .ai-create-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .ai-create-actions > span:first-child,
  .ai-create-actions #generateStudyPackBtn {
    grid-column: 1 / -1;
  }

  .ai-create-actions #generateStudyPackBtn {
    width: 100%;
  }

  .ai-maker-grid {
    gap: 12px;
  }

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

  .upload-zone {
    min-height: 132px;
  }

  .ai-control-card textarea {
    min-height: 176px;
  }

  .ai-generate-row {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-generate-row .primary-button {
    width: 100%;
  }

  .saved-flashcards,
  .flashcard-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  .weekly-plan-actions,
  .ai-planner-inputs {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
  }

  .weekly-plan-actions label {
    max-width: none;
  }

  .quick-add-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  dialog::backdrop {
    background: rgba(18, 24, 33, .42);
  }

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

  .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 18px -16px -18px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .app-fab {
    position: fixed;
    z-index: 330;
    right: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    min-height: 48px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 99px;
    color: #fff;
    background: var(--ink);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .network-banner,
  .app-update-banner {
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }

  .app-update-banner {
    padding: 10px 11px;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    gap: 7px;
  }

  .app-update-banner span {
    display: none;
  }

  .app-update-banner .primary-button {
    min-width: 58px;
    min-height: 44px;
    padding-inline: 11px;
    font-size: 12px;
  }

  .xp-reward-toast,
  .toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .landing-header {
    height: 60px;
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }

  .landing-header nav,
  .landing-login {
    display: none;
  }

  .landing-brand strong {
    font-size: 15px;
  }

  .landing-open {
    min-height: 44px;
    padding-inline: 13px;
    font-size: 12px;
  }

  .landing-hero {
    min-height: auto;
    padding: 72px 18px 50px;
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .landing-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .landing-hero-actions > * {
    width: 100%;
  }

  .landing-preview {
    margin-top: 12px;
  }

  .landing-preview-window {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .landing-preview-rail {
    padding: 14px 6px;
    gap: 18px;
  }

  .landing-preview-main {
    padding: 12px;
  }

  .landing-preview-priority {
    padding: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .landing-preview-priority > div:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: center;
    gap: 3px 8px;
  }

  .landing-preview-priority > div:first-child > span {
    grid-column: 1 / -1;
  }

  .landing-preview-priority button {
    white-space: nowrap;
  }

  .landing-preview-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-preview-columns > section:last-child {
    display: none;
  }

  .landing-service-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  body {
    font-size: 15px;
  }

  .view {
    padding-inline: 13px;
  }

  .today-next-task {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .today-next-task > span {
    min-width: 58px;
    min-height: 58px;
    border-radius: 18px;
    font-size: 12px;
  }

  .today-next-task h3 {
    font-size: 18px;
  }

  .today-primary-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .today-primary-actions .primary-button {
    width: 100%;
  }

  .mobile-week-day button,
  .mobile-schedule-week > div > button {
    min-height: 60px;
  }

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

  .stopwatch-display {
    font-size: clamp(48px, 15.5vw, 62px);
  }

  .timer-quick-stats strong {
    font-size: 13px;
  }

  .app-update-banner {
    grid-template-columns: minmax(0, 1fr) auto 44px;
  }

  .app-update-banner .close-button {
    grid-column: 3;
    grid-row: 1;
  }
}

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