@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light dark;
  font-family: "Inter", "Pretendard", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: #f4f5f7;
  color: #1e1f24;
  --color-primary: #4658ff;
  --color-primary-dark: #2c3cff;
  --color-secondary: #7b61ff;
  --color-accent: #40c8f4;
  --color-surface: rgba(255, 255, 255, 0.78);
  --color-surface-strong: rgba(255, 255, 255, 0.92);
  --color-outline: rgba(98, 105, 139, 0.18);
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 24px 60px rgba(36, 56, 110, 0.18);
  --shadow-card: 0 18px 36px rgba(40, 54, 94, 0.14);
  --layout-padding-top: clamp(1.1rem, 4vw, 1.75rem);
  --layout-padding-bottom: clamp(1.5rem, 4.5vw, 2.5rem);
  --layout-padding-x: clamp(0.85rem, 4vw, 1.5rem);
  --layout-padding-x-wide: clamp(1rem, 4vw, 1.75rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px at 15% 120%, rgba(71, 88, 255, 0.12), transparent),
    radial-gradient(700px at 85% -10%, rgba(64, 200, 244, 0.18), transparent),
    radial-gradient(800px at 10% -5%, rgba(123, 97, 255, 0.2), transparent),
    #f6f8ff;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  background: linear-gradient(120deg, rgba(70, 88, 255, 0.12), transparent 55%);
}

body::after {
  background: radial-gradient(1400px at 75% 15%, rgba(255, 255, 255, 0.6), transparent 70%);
  opacity: 0.65;
  z-index: -3;
}

header {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) clamp(1.25rem, 4vw, 2rem);
  color: #14213d;
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255, 255, 255, 0.35), transparent),
    linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  opacity: 0.92;
  z-index: -2;
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 70% at 80% -10%, rgba(64, 200, 244, 0.35), transparent 55%);
  z-index: -1;
}

.header-content {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(1rem, 2.5vw, 1.75rem);
  flex-wrap: wrap;
  margin: 0 auto;
  width: min(100%, 1100px);
  background: rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.header-content::after {
  content: "";
  position: absolute;
  width: clamp(160px, 22vw, 260px);
  height: clamp(160px, 22vw, 260px);
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 65%);
  right: clamp(-80px, 8vw, -20px);
  top: clamp(-80px, 6vw, -10px);
  opacity: 0.65;
  z-index: -1;
}

.header-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.4rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.header-logo-link:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.8);
  outline-offset: 4px;
}

.header-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.22);
  padding: 0.6rem;
  box-sizing: border-box;
  object-fit: contain;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.1rem);
  flex: 1;
  min-width: min(100%, 280px);
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  gap: clamp(0.35rem, 2vw, 0.6rem);
  flex: 1 1 auto;
  min-width: 0;
}

.header-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.65rem, 2vw, 1rem);
  position: relative;
  width: 100%;
}

.header-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.32);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.header-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.header-menu-toggle:active {
  transform: translateY(1px);
}

.header-menu-toggle:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.8);
  outline-offset: 4px;
}

.header-menu-icon {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: background 0.2s ease;
}

.header-menu-icon::before,
.header-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-menu-icon::before {
  top: -6px;
}

.header-menu-icon::after {
  top: 6px;
}

body.mobile-menu-open .header-menu-toggle {
  background: rgba(255, 255, 255, 0.38);
}

body.mobile-menu-open .header-menu-icon {
  background: transparent;
}

body.mobile-menu-open .header-menu-icon::before {
  transform: translateY(6px) rotate(45deg);
}

body.mobile-menu-open .header-menu-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.header-menu-backdrop {
  display: none;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  width: auto;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

body:not([data-guide-page="exam-session"]) header,
body[data-guide-page="exam-session"] header {
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.5rem) clamp(0.75rem, 2.5vw, 1.25rem);
}

body:not([data-guide-page="exam-session"]) header::before,
body[data-guide-page="exam-session"] header::before,
body:not([data-guide-page="exam-session"]) header::after,
body[data-guide-page="exam-session"] header::after {
  opacity: 0.8;
}

body[data-guide-page="exam-session"] .exam-session-header .header-content {
  justify-content: flex-start;
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

body:not([data-guide-page="exam-session"]) .header-content,
body[data-guide-page="exam-session"] .header-content {
  gap: clamp(0.75rem, 2vw, 1.25rem);
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  align-items: center;
}

body:not([data-guide-page="exam-session"]) .header-content::after,
body[data-guide-page="exam-session"] .header-content::after {
  display: none;
}

body:not([data-guide-page="exam-session"]) .header-logo,
body[data-guide-page="exam-session"] .header-logo {
  width: 52px;
  height: 52px;
  padding: 0.35rem;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.2);
}

body:not([data-guide-page="exam-session"]) .header-main,
body[data-guide-page="exam-session"] .header-main {
  gap: clamp(0.5rem, 2vw, 0.9rem);
}

body:not([data-guide-page="exam-session"]) .header-top,
body[data-guide-page="exam-session"] .header-top {
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1.1rem);
}

body:not([data-guide-page="exam-session"]) .user-meta,
body[data-guide-page="exam-session"] .user-meta {
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
}

body:not([data-guide-page="exam-session"]) .user-meta .link-button,
body[data-guide-page="exam-session"] .user-meta .link-button,
body:not([data-guide-page="exam-session"]) .user-meta .link-button.secondary,
body[data-guide-page="exam-session"] .user-meta .link-button.secondary,
body:not([data-guide-page="exam-session"]) .user-meta .link-button.danger,
body[data-guide-page="exam-session"] .user-meta .link-button.danger {
  padding-block: 0.4rem;
  padding-inline: 0.85rem;
}

body:not([data-guide-page="exam-session"]) .header-description,
body[data-guide-page="exam-session"] .header-description {
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.4;
  opacity: 0.78;
}

body:not([data-guide-page="exam-session"]) .header-links,
body[data-guide-page="exam-session"] .header-links {
  gap: clamp(0.45rem, 1.6vw, 0.75rem);
  width: auto;
}

body:not([data-guide-page="exam-session"]) .header-links .link-button,
body[data-guide-page="exam-session"] .header-links .link-button {
  width: auto;
  justify-content: center;
  padding-block: 0.65rem;
  padding-inline: clamp(1.15rem, 2.6vw, 1.5rem);
  font-size: clamp(0.95rem, 1.9vw, 1.08rem);
  min-height: 3.25rem;
}

body:not([data-guide-page="exam-session"]) .header-links .link-button.secondary,
body[data-guide-page="exam-session"] .header-links .link-button.secondary {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-greeting {
  font-weight: 600;
}

header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: #0f172a;
}

.header-description {
  margin: 0;
  opacity: 0.88;
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  line-height: 1.6;
  color: rgba(15, 23, 42, 0.82);
}

body[data-guide-page="manage"] .header-description {
  max-width: min(100%, 540px);
}

body[data-guide-page="memorize"] {
  font-size: clamp(1rem, 0.98rem + 0.25vw, 1.12rem);
}

.hero-pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.35rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #1b2554;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.link-button.primary-action {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1));
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.22);
}

.link-button.primary-action:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.25));
}

.link-button.tertiary-action {
  background: rgba(15, 23, 42, 0.25);
  border-color: rgba(255, 255, 255, 0.28);
}

.link-button.tertiary-action:hover {
  background: rgba(15, 23, 42, 0.35);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-stat-value {
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  font-weight: 700;
}

.hero-stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
}

header .link-button {
  color: #14213d;
}

@media (max-width: 900px) {
  .header-content {
    align-items: stretch;
  }

  .header-main {
    width: 100%;
  }

  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .header-menu {
    justify-content: center;
    gap: clamp(0.55rem, 2.4vw, 0.9rem);
  }

  .user-meta {
    justify-content: center;
    width: auto;
  }

  .user-meta .link-button,
  .user-meta .link-button.secondary,
  .user-meta .link-button.danger {
    flex: 0 1 auto;
  }

  body:not([data-guide-page="exam-session"]) .header-links,
  body[data-guide-page="exam-session"] .header-links {
    justify-content: center;
    gap: 0.45rem;
    padding: 0;
  }

  body:not([data-guide-page="exam-session"]) .header-links .link-button,
  body[data-guide-page="exam-session"] .header-links .link-button {
    justify-content: center;
    white-space: normal;
    line-height: 1.35;
    padding-inline: 0.85rem;
  }
}

@media (max-width: 600px) {
  .user-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .user-meta .link-button,
  .user-meta .link-button.secondary,
  .user-meta .link-button.danger {
    width: 100%;
  }

  body:not([data-guide-page="exam-session"]) .header-links .link-button,
  body[data-guide-page="exam-session"] .header-links .link-button {
    padding-block: 0.65rem;
    font-size: clamp(0.95rem, 3.6vw, 1.08rem);
    min-height: 3.25rem;
  }
}

@media (max-width: 420px) {
  body:not([data-guide-page="exam-session"]) .header-links,
  body[data-guide-page="exam-session"] .header-links {
    gap: 0.35rem;
  }

  body:not([data-guide-page="exam-session"]) .header-links .link-button,
  body[data-guide-page="exam-session"] .header-links .link-button {
    font-size: clamp(0.92rem, 4.8vw, 1.02rem);
    min-height: 3.25rem;
  }
}

@media (max-width: 720px) {
  .header-top {
    flex-direction: row;
    align-items: center;
  }

  .header-title-group {
    gap: 0.4rem;
  }

  .header-menu-toggle {
    display: inline-flex;
  }

  .header-menu {
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw);
    padding: clamp(1.5rem, 6vw, 2.25rem) clamp(0.75rem, 5vw, 1.25rem);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(22px);
    box-shadow: -26px 0 60px rgba(15, 23, 42, 0.3);
    align-items: stretch;
    justify-content: flex-start;
    gap: clamp(1.2rem, 5vw, 1.8rem);
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
    z-index: 999;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .header-menu::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0 0 0 var(--radius-lg);
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.08);
    z-index: -1;
  }

  body.mobile-menu-open .header-menu {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header-menu .user-meta {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: clamp(0.8rem, 4vw, 1.1rem);
  }

  .header-menu .user-meta .link-button,
  .header-menu .user-meta .link-button.secondary,
  .header-menu .user-meta .link-button.danger {
    width: 100%;
    justify-content: center;
    padding-block: clamp(0.95rem, 3.4vw, 1.2rem);
    padding-inline: clamp(1.2rem, 4.2vw, 1.55rem);
    font-size: clamp(1.08rem, 3.8vw, 1.22rem);
    min-height: clamp(3.4rem, 16vw, 4rem);
    border-radius: 20px;
  }

  .header-menu .header-links {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(0.8rem, 4vw, 1.1rem);
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .header-menu .header-links .link-button {
    display: flex;
    width: 100%;
    justify-content: center;
    padding-block: clamp(0.95rem, 3.4vw, 1.2rem);
    padding-inline: clamp(1.2rem, 4.2vw, 1.55rem);
    font-size: clamp(1.08rem, 3.9vw, 1.24rem);
    min-height: clamp(3.4rem, 16vw, 4rem);
    border-radius: 20px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: none;
    backdrop-filter: none;
    transform: none;
  }

  .header-menu .header-links .link-button:hover,
  .header-menu .header-links .link-button:focus-visible {
    background: #f8fafc;
    transform: none;
    box-shadow: none;
    outline: 3px solid rgba(148, 163, 184, 0.35);
    outline-offset: 3px;
  }

  .header-menu .header-links .link-button.secondary {
    background: linear-gradient(140deg, #fbcfe8 0%, #f472b6 100%);
    border-color: rgba(244, 114, 182, 0.55);
    color: #831843;
    box-shadow: none;
  }

  .header-menu .header-links .link-button.secondary:hover,
  .header-menu .header-links .link-button.secondary:focus-visible {
    background: linear-gradient(140deg, #f9a8d4 0%, #f472b6 100%);
    color: #701a3c;
    box-shadow: none;
  }

  .header-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 998;
  }

  body.mobile-menu-open .header-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.3rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #0f172a;
}

.link-button.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(70, 88, 255, 0.22);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.link-button.primary:focus-visible {
  outline: 3px solid rgba(70, 88, 255, 0.45);
  outline-offset: 3px;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.link-button.primary:disabled,
.link-button.primary[aria-disabled='true'] {
  background: rgba(148, 163, 255, 0.35);
  border-color: transparent;
  box-shadow: none;
  color: rgba(15, 23, 42, 0.65);
  -webkit-text-fill-color: rgba(15, 23, 42, 0.65);
}

.link-button.exam-method-passed {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
  border-color: rgba(21, 128, 61, 0.5);
  -webkit-text-fill-color: #fff;
}

.link-button.exam-method-passed:disabled,
.link-button.exam-method-passed[aria-disabled='true'] {
  background: rgba(22, 163, 74, 0.55);
  color: #e8f7ed;
  -webkit-text-fill-color: #e8f7ed;
  box-shadow: none;
}

header .link-button.primary-action {
  color: #0f172a;
}

header .link-button.tertiary-action {
  color: #f8fbff;
}

header .hero-stat-value {
  color: #0f172a;
}

header .hero-stat-label {
  color: rgba(15, 23, 42, 0.68);
}

.link-button.guide-button {
  background: rgba(96, 165, 250, 0.25);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.link-button.guide-button:hover {
  background: rgba(59, 130, 246, 0.35);
}

.link-button.guide-button:focus-visible {
  outline: 3px solid rgba(191, 219, 254, 0.95);
  outline-offset: 3px;
}

.link-button:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.link-button.primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-secondary));
  box-shadow: 0 16px 32px rgba(70, 88, 255, 0.28);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.link-button.danger {
  background: rgba(255, 82, 82, 0.25);
  color: #0f172a;
  border-color: rgba(255, 82, 82, 0.35);
}

.link-button.danger:hover {
  background: rgba(255, 82, 82, 0.35);
}

body[data-guide-page="manage"] main {
  display: grid;
  gap: clamp(1rem, 3vw, 1.5rem);
  padding: clamp(1.1rem, 3.5vw, 1.75rem);
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.05fr);
  grid-template-areas:
    "folders words"
    "groups words";
  grid-template-rows: auto 1fr;
  align-items: start;
  min-height: calc(100vh - 6rem);
  max-width: 1060px;
  width: min(100%, 1060px);
  margin: clamp(1.1rem, 3vw, 2rem) auto 0;
  position: relative;
  z-index: 1;
}

@media (min-width: 1200px) {
  body[data-guide-page="manage"] main {
    grid-template-columns:
      minmax(280px, 0.8fr)
      minmax(280px, 0.85fr)
      minmax(520px, 1.35fr);
    grid-template-areas: "folders groups words";
    grid-template-rows: auto;
    max-width: 1440px;
    width: min(100%, 1440px);
  }
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(70, 88, 255, 0.18);
  color: var(--color-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

main.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  align-items: flex-start;
  gap: 1.5rem;
  padding: var(--layout-padding-top) var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.35rem);
  max-width: 1180px;
  margin: 0 auto;
  width: min(100%, 1180px);
}

main.today-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: var(--layout-padding-top) var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.35rem);
  max-width: 960px;
  margin: 0 auto;
  width: min(100%, 960px);
}

main.study-plan-layout {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  padding: calc(var(--layout-padding-top) + 0.15rem)
    clamp(1rem, 4vw, 2rem)
    calc(var(--layout-padding-bottom) + 0.9rem);
  max-width: 1280px;
  margin: 0 auto;
  width: min(100%, 1280px);
}

main.exam-layout .panel {
  width: 100%;
}

main.market-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  padding: var(--layout-padding-top) var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.35rem);
  max-width: 1200px;
  margin: 0 auto;
  width: min(100%, 1200px);
}

main.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
  padding: var(--layout-padding-top) var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.35rem);
  max-width: 1100px;
  margin: 0 auto;
  width: min(100%, 1100px);
}

.import-panel .form {
  border-top: none;
  padding: 1.5rem 1.75rem 2rem;
}

.import-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.import-form-actions button {
  min-width: 160px;
}

.import-hint-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.import-guide-body {
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.import-guide-figure {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.import-guide-image-button {
  border: none;
  padding: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 8px;
  display: block;
  line-height: 0;
}

.import-guide-image-button:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.65);
  outline-offset: 4px;
}

.import-guide-image {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  object-fit: contain;
}

.import-image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.7);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.import-image-modal[hidden] {
  display: none;
}

.import-image-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.import-image-modal-dialog {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: min(960px, 95vw);
  width: 100%;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.import-image-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.import-image-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.import-image-modal-close {
  border: none;
  background: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #0f172a;
  padding: 0.25rem;
  border-radius: 999px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.import-image-modal-close:hover,
.import-image-modal-close:focus-visible {
  background: rgba(15, 23, 42, 0.08);
}

.import-image-modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-image-modal-image {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
}

.import-guide-figure figcaption {
  font-size: 0.85rem;
  color: #475569;
}

.import-feedback {
  padding: 0 1.75rem 1.5rem;
}

.panel.market-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.market-language-block {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.market-language-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  color: #1f2937;
}

.market-language-label select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: white;
  font-size: 0.95rem;
  color: #1e293b;
}

.market-group-list {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 0 1 auto;
  max-height: clamp(280px, 45vh, 520px);
  overflow-y: auto;
}

.market-group-list:empty {
  padding: 0;
  max-height: none;
}

.market-group-list .empty {
  margin: 0;
  padding: 1rem 0;
  color: #64748b;
  text-align: center;
}

.market-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.market-group-item:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.market-group-item input[type='checkbox'] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #2563eb;
}

.market-group-name {
  flex: 1;
  font-weight: 600;
  color: #1f2937;
}

.market-group-count {
  color: #475569;
  font-size: 0.9rem;
}

.market-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.market-bulk-actions button {
  min-width: 110px;
}

.market-group-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.85) 0%, rgba(248, 250, 252, 0.5) 100%);
}

.market-group-toolbar .form-description {
  margin: 0 0 0 auto;
  text-align: right;
  flex: 1 1 220px;
}

.market-actions {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.2) 0%, rgba(248, 250, 252, 0.8) 100%);
}

.market-actions > button {
  min-width: 200px;
}

@media (max-width: 1024px) {
  main.market-layout {
    grid-template-columns: 1fr;
  }

  .market-group-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .market-group-toolbar .form-description {
    margin: 0;
    text-align: left;
    flex: 0 0 auto;
  }

  .market-bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .market-bulk-actions button {
    width: 100%;
  }

  .market-actions > button {
    width: 100%;
  }

  .market-group-list {
    max-height: 320px;
  }
}

@media (max-width: 600px) {
  .panel.market-panel {
    min-height: 0;
  }

  .market-group-toolbar {
    padding: 0.55rem 1.1rem;
    gap: 0.6rem;
  }

  .market-group-list {
    padding: 0.85rem 1.1rem 1.1rem;
    gap: 0.7rem;
  }
}

main.exam-session-layout {
  display: flex;
  justify-content: center;
  padding: var(--layout-padding-top) var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.25rem);
  max-width: 880px;
  margin: 0 auto;
  width: min(100%, 880px);
}

main.exam-session-layout .panel {
  width: 100%;
}

.exam-panel {
  display: flex;
  flex-direction: column;
}

.exam-session-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.75);
  color: #334155;
  font-size: 1rem;
  text-align: center;
}

.exam-session-placeholder .link-button {
  background: #2563eb;
  color: white;
}

.exam-session-placeholder .link-button:hover {
  background: #1d4ed8;
}

.exam-session-note {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-size: 0.95rem;
  line-height: 1.6;
}

.exam-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.exam-summary-score {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.badge-pass {
  background: rgba(22, 163, 74, 0.18);
  color: #15803d;
}

.badge-fail {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.exam-history-panel {
  display: flex;
  flex-direction: column;
}

.exam-range-block {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exam-actions {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.exam-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 16px;
  font-size: 1rem;
}

.exam-actions button.primary {
  box-shadow: 0 10px 20px rgba(70, 88, 255, 0.2);
}

.exam-actions button.secondary {
  box-shadow: inset 0 0 0 1px rgba(70, 88, 255, 0.2);
}

.worksheet-progress {
  margin-top: 1rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: rgba(59, 130, 246, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: opacity 0.2s ease;
}

.worksheet-progress.hidden {
  display: none;
}

.worksheet-progress-meter {
  position: relative;
  width: 100%;
  height: 0.6rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  overflow: hidden;
}

.worksheet-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #6366f1 100%);
  transition: width 0.25s ease;
}

.worksheet-progress[data-indeterminate='true'] .worksheet-progress-bar {
  width: 35%;
  animation: worksheet-progress-indeterminate 1.2s ease-in-out infinite;
}

.worksheet-progress-text {
  margin: 0;
  font-size: 0.92rem;
  color: #1e3a8a;
  line-height: 1.45;
}

@keyframes worksheet-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(15%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (max-width: 560px) {
  .exam-actions {
    flex-direction: column;
  }
}

.exam-range-block .range-label {
  font-size: 0.95rem;
  color: #1d4ed8;
}

.exam-range-block .range-inputs input[type='number'] {
  width: 5rem;
}

.exam-history-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exam-history-body {
  padding: 1.1rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.exam-history-empty {
  margin: 0;
  padding: 1.25rem 0.5rem;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.65);
  color: #64748b;
  font-size: 0.95rem;
  text-align: center;
}

.exam-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: 420px;
}

.exam-history-list:empty {
  display: none;
}

.exam-history-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.exam-history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.exam-history-item-score {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1f2937;
}

.exam-history-item-meta,
.exam-history-item-groups,
.exam-history-item-stats {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #475569;
}

.exam-history-item-groups {
  color: #334155;
}

.exam-history-item-stats {
  color: #1f2937;
  font-weight: 500;
}

.exam-history-item-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.exam-history-item-actions button {
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1100;
}

.modal-card {
  background: white;
  border-radius: 18px;
  padding: 2rem 2.25rem;
  width: min(90%, 380px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.18);
}

.modal[data-status='pass'] .modal-card {
  border-top: 4px solid rgba(34, 197, 94, 0.6);
}

.modal[data-status='fail'] .modal-card {
  border-top: 4px solid rgba(239, 68, 68, 0.6);
}

.modal-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
}

.modal-title.pass {
  color: #16a34a;
}

.modal-title.fail {
  color: #dc2626;
}

.modal-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.modal-actions .secondary {
  background: rgba(148, 163, 184, 0.18);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.modal-actions .secondary:hover {
  background: rgba(148, 163, 184, 0.28);
}

.modal-close {
  align-self: center;
  padding: 0.6rem 1.5rem;
  min-width: 140px;
}

.modal-open {
  overflow: hidden;
}

body.guide-modal-open {
  overflow: hidden;
}

.guide-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1200;
}

body.today-history-modal-open {
  overflow: hidden;
}

.today-history-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.today-all-exam-modal-open {
  overflow: hidden;
}

.today-all-exam-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.today-all-exam-modal[hidden] {
  display: none;
}

.today-all-exam-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.today-all-exam-dialog {
  position: relative;
  width: min(420px, 92%);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.today-all-exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.today-all-exam-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.today-all-exam-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #475569;
  cursor: pointer;
}

.today-all-exam-message {
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.5;
}

.exam-group-selection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.exam-group-selection__help {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.exam-group-folders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.25rem;
}

.exam-group-folder {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #f8fafc;
}

.exam-group-folder.active {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.exam-group-folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.exam-group-folder-name {
  font-weight: 700;
  color: #0f172a;
}

.exam-group-folder-switch {
  border: none;
  background: transparent;
  color: #6366f1;
  font-weight: 600;
  cursor: pointer;
}

.exam-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.exam-group-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
}

.exam-group-item label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #1e293b;
}

.exam-group-item input[type='checkbox'][disabled] + span {
  color: #94a3b8;
}

.today-all-exam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.today-all-exam-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.today-all-exam-label {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #1e293b;
}

#today-all-exam-custom-input,
#plan-all-exam-custom-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5f5;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: rgba(248, 250, 252, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#today-all-exam-custom-input:focus,
#plan-all-exam-custom-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.today-history-modal[hidden] {
  display: none;
}

.today-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.today-history-dialog {
  position: relative;
  width: min(480px, 92%);
  max-height: min(80vh, 560px);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.today-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.today-history-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.today-history-close {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 999px;
  padding: 0.25rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.today-history-close:hover,
.today-history-close:focus-visible {
  background: rgba(148, 163, 184, 0.24);
  color: #0f172a;
  outline: none;
}

.today-history-body {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.25rem;
}

.today-history-empty {
  margin: 1.5rem 0;
  text-align: center;
  color: #475569;
  font-size: 0.95rem;
}

.today-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.today-history-item {
  background: rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.today-history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.today-history-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e3a8a;
}

.today-history-badge {
  font-size: 0.8rem;
}

.today-history-item-bottom {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.today-history-score {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.today-history-detail {
  font-size: 0.92rem;
  color: #475569;
  font-weight: 500;
}

.today-history-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .today-history-dialog {
    width: min(96%, 420px);
    padding: 1.35rem;
    max-height: min(84vh, 520px);
  }

  .today-history-title {
    font-size: 1.1rem;
  }

  .today-history-item {
    padding: 0.8rem 0.85rem;
  }

  .today-history-score {
    font-size: 0.98rem;
  }
}

.guide-modal[hidden] {
  display: none;
}

.guide-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.guide-modal-dialog {
  position: relative;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 20px;
  width: min(640px, 90%);
  max-height: min(90vh, 640px);
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
}

.guide-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.75rem 1rem;
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.18));
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.guide-modal-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.guide-modal-close {
  border: none;
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.guide-modal-close:hover,
.guide-modal-close:focus-visible {
  background: rgba(59, 130, 246, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.guide-modal-body {
  padding: 1.25rem 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.guide-description {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #1f2937;
}

.guide-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(191, 219, 254, 0.18);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.guide-section h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #1d4ed8;
}

.guide-section p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1f2937;
}

.guide-section ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.4rem;
}

.guide-section li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1f2937;
}

.guide-note {
  font-size: 0.9rem;
  color: #2563eb;
  font-weight: 500;
}

.guide-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.75rem 1.35rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  background: linear-gradient(120deg, rgba(191, 219, 254, 0.25), rgba(219, 234, 254, 0.2));
}

.guide-modal-footer .link-button {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.guide-modal-footer .link-button:hover {
  background: rgba(59, 130, 246, 0.28);
}

.guide-modal-footer .link-button:focus-visible {
  outline: 3px solid rgba(147, 197, 253, 0.85);
  outline-offset: 3px;
}

main.memorize-layout {
  display: flex;
  justify-content: center;
  padding: calc(var(--layout-padding-top) + 0.2rem)
    var(--layout-padding-x-wide)
    calc(var(--layout-padding-bottom) + 0.6rem);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

main.memorize-layout .panel {
  width: 100%;
}

.memorize-panel-header {
  align-items: flex-start;
}

.memorize-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.memorize-controls {
  padding: 0.25rem 0;
}

.memorize-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.memorize-range-form {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
}

.memorize-range-form .range-label {
  margin: 0;
  font-size: 0.85rem;
  color: #0f172a;
}

.memorize-range-form .range-inputs input[type='number'] {
  width: 4rem;
  padding: 0.35rem 0.45rem;
}

.memorize-range-form button {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.memorize-range-form[aria-disabled='true'] {
  opacity: 0.5;
}

.audio-language-control {
  margin: 0;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  min-height: 2.25rem;
  flex-wrap: wrap;
}

.audio-language-control legend {
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
}

.audio-language-control label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #1e293b;
  white-space: nowrap;
}

.audio-language-control input[type='radio'] {
  accent-color: #1d4ed8;
}

.memorize-selectors {
  gap: 1rem;
}

.memorize-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.memorize-table {
  flex: 1;
  margin-top: 0.35rem;
}

.memorize-word-board {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), #f6f8ff);
  border: 1px solid #e5e9f5;
  border-radius: 18px;
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.08), 0 2px 10px rgba(0, 0, 0, 0.04);
}

.memorize-word-board__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.memorize-word-board__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.9rem;
}

.memorize-word-board__pill::before {
  content: '★';
  color: #f59e0b;
}

.memorize-word-board__hint {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.memorize-table table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  min-width: 0;
}

.memorize-table thead tr,
.memorize-table tbody tr {
  display: grid;
  grid-template-columns: 82px 140px 1fr 1.15fr;
  align-items: center;
}

.memorize-table thead tr {
  background: #eef2ff;
  border-radius: 12px;
  border: 1px solid #e0e7ff;
  padding: 0.65rem 0.9rem;
  color: #0f172a;
}

.memorize-table thead th {
  border: none;
  font-weight: 700;
  text-align: left;
  font-size: 0.95rem;
  color: #1f2937;
}

.memorize-table thead th.number-column,
.memorize-table tbody .word-number {
  text-align: center;
}

.memorize-table tbody tr {
  position: relative;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e5e9f5;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.memorize-table tbody tr:nth-child(odd) {
  background: #f9fafc;
}

.memorize-table tbody tr:nth-child(even) {
  background: #f1f5f9;
}

.memorize-table tbody tr:hover {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12), 0 6px 12px rgba(15, 23, 42, 0.08);
}

.memorize-table .empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #475569;
  padding: 1.4rem 0.25rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

.number-column {
  color: #475569;
  font-weight: 700;
  font-size: 0.95rem;
}

.word-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

.star-column {
  min-width: 6.5rem;
}

.star-cell {
  font-weight: 600;
  font-size: 1rem;
  color: #0f172a;
  white-space: nowrap;
}

.star-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}

.star-bar {
  --star-size: 1.05rem;
  --star-fill: 0%;
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: var(--star-size);
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: linear-gradient(90deg, #f59e0b var(--star-fill), #e2e8f0 var(--star-fill));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #f59e0b;
  min-width: calc(var(--star-size) * 4.5);
}

.star-bar::before {
  content: '★★★★★';
}

.star-label {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.term-cell,
.meaning-cell {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
  touch-action: manipulation;
  width: 100%;
}

.term-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.term-audio {
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.45rem;
  min-width: 2.6rem;
  min-height: 2.6rem;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease,
    transform 0.2s ease;
}

.term-audio svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.term-audio:hover,
.term-audio:focus-visible {
  background-color: rgba(37, 99, 235, 0.16);
  outline: none;
}

.term-audio:focus-visible {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.term-audio[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.memorize-table .value-text {
  display: block;
  width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.term-cell .value-text {
  font-weight: 800;
  color: #0f172a;
  font-size: 1.85rem;
}

.memorize-table .term-cell,
.memorize-table .meaning-cell {
  text-align: left;
}

.memorize-table .term-content {
  width: 100%;
  justify-content: flex-start;
}

.memorize-table .meaning-cell .value-text {
  font-size: 1.7rem;
  width: 100%;
  color: #0f172a;
}

.value-text {
  display: inline;
  width: 100%;
}

.value-hidden {
  display: none;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  text-align: center;
  width: 100%;
  font-size: 0.95rem;
}

.memorize-table.hide-term .term-cell .term-content {
  display: none;
}

.memorize-table.hide-term .term-cell {
  cursor: pointer;
}

.memorize-table.hide-term .term-cell .value-hidden {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.memorize-table.hide-term tr.peek-term .term-cell .term-content {
  display: inline-flex;
}

.memorize-table.hide-term tr.peek-term .term-cell .value-hidden {
  display: none;
}

.memorize-table.hide-meaning .meaning-cell .value-text {
  display: none;
}

.memorize-table.hide-meaning .meaning-cell {
  cursor: pointer;
}

.memorize-table.hide-meaning .meaning-cell .value-hidden {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.memorize-table.hide-meaning tr.peek-meaning .meaning-cell .value-text {
  display: inline;
}

.memorize-table.hide-meaning tr.peek-meaning .meaning-cell .value-hidden {
  display: none;
}

#folders {
  grid-area: folders;
}

#groups {
  grid-area: groups;
}

#folders,
#groups {
  max-height: calc(100vh - 12rem);
}

#words {
  grid-area: words;
  min-height: 100%;
  align-self: stretch;
}

.panel {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid var(--color-outline);
  backdrop-filter: blur(18px);
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 65%);
  opacity: 0.7;
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel > .list {
  padding: 0.5rem 0;
}

.panel > .list,
.panel > .table-wrapper {
  flex: 1;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  flex-wrap: wrap;
  row-gap: 0.75rem;
  backdrop-filter: blur(12px);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.panel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-subtitle {
  font-size: 0.9rem;
  color: #475569;
}

.list {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  border-left: 4px solid transparent;
  border-radius: 12px;
  margin: 0.25rem 0.65rem;
}

.item-actions {
  display: flex;
  gap: 0.35rem;
}

.item-actions button {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 8px;
  background: rgba(70, 88, 255, 0.12);
  color: #1f2937;
  border: 1px solid rgba(70, 88, 255, 0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}

.item-actions button:hover {
  background: rgba(70, 88, 255, 0.18);
  transform: translateY(-1px);
}

.list li:hover {
  background: rgba(70, 88, 255, 0.1);
  transform: translateX(4px);
}

.list li.active {
  background: rgba(70, 88, 255, 0.16);
  border-left-color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(70, 88, 255, 0.22);
}

.list li span.name {
  font-weight: 600;
}

.list li .item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list li span.meta {
  font-size: 0.85rem;
  color: #64748b;
}

.form {
  padding: 1.1rem 1.5rem 1.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  background: rgba(255, 255, 255, 0.45);
}

.form h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #1f2937;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
  gap: 0.4rem;
  color: #2f3850;
}

.range-label {
  font-weight: 600;
  color: #1e293b;
}

.range-inputs {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.range-inputs input[type='number'] {
  width: 4.5rem;
  padding: 0.45rem 0.5rem;
  text-align: center;
}

.range-separator {
  color: #64748b;
  font-weight: 600;
}

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

input,
select,
textarea {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: var(--color-surface-strong);
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  color: #0f172a;
  color-scheme: light;
}

.auth-page {
  color-scheme: light;
}

.auth-page input,
.auth-page select,
.auth-page textarea {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.98);
}

.auth-page input {
  -webkit-text-fill-color: #0f172a;
}

.auth-page input::placeholder {
  color: rgba(100, 116, 139, 0.9);
  opacity: 1;
}

.auth-page input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.98) inset;
  -webkit-text-fill-color: #0f172a;
}

@keyframes authAutofillStart {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

@keyframes authAutofillCancel {
  from {
    opacity: 1;
  }
  to {
    opacity: 1;
  }
}

.auth-form input[data-autofill-detect] {
  animation-duration: 0.01s;
  animation-fill-mode: both;
  animation-iteration-count: 1;
  animation-name: authAutofillCancel;
}

.auth-form input[data-autofill-detect]:-webkit-autofill,
.auth-form input[data-autofill-detect]:-webkit-autofill:hover,
.auth-form input[data-autofill-detect]:-webkit-autofill:focus,
.auth-form input[data-autofill-detect]:-webkit-autofill:active,
.auth-form input[data-autofill-detect]:-moz-autofill {
  animation-name: authAutofillStart;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(70, 88, 255, 0.18);
  outline: none;
  transform: translateY(-1px);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: 0 12px 24px rgba(70, 88, 255, 0.22);
}

button.secondary {
  background: rgba(70, 88, 255, 0.14);
  color: #1f2937;
  box-shadow: inset 0 0 0 1px rgba(70, 88, 255, 0.2);
}

button.secondary[data-active="true"] {
  background: rgba(70, 88, 255, 0.2);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 2px rgba(70, 88, 255, 0.24);
}

button.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
}

button.danger {
  background: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.22);
}

.word-actions button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  background: rgba(70, 88, 255, 0.12);
  color: #1f2937;
  border-radius: 8px;
  border: 1px solid rgba(70, 88, 255, 0.16);
}

.star-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.star-cell .star-value {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 600;
  color: #1f2937;
}

.star-cell button {
  padding: 0.25rem 0.55rem;
  min-width: 2rem;
  border-radius: 999px;
  background: white;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.star-cell button:hover:not(:disabled) {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: none;
  transform: none;
}

.form-description {
  font-size: 0.85rem;
  color: #475569;
  margin: 0;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(70, 88, 255, 0.28);
}

.table-wrapper {
  overflow: auto;
  padding: 0 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead tr {
  background: rgba(37, 99, 235, 0.08);
}

thead th {
  padding: 0.6rem;
  text-align: left;
  color: #1f2937;
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.number-column {
  width: 6%;
  min-width: 3.6rem;
  text-align: center;
}

td.word-number {
  font-weight: 600;
  color: #1e293b;
  text-align: center;
}

tbody td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.9);
  vertical-align: top;
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background: rgba(148, 163, 184, 0.12);
}

.memorize-table tbody tr + tr td {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.settings-grid .full-span {
  grid-column: 1 / -1;
}

.word-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.group-select-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.5rem;
}

.group-select-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.group-select-header #exam-groups-label {
  font-weight: 600;
  color: #1f2937;
}

.group-select-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.group-checkbox-list {
  min-height: 9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  overflow-y: auto;
}

.group-checkbox-list:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.group-checkbox-list.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

.group-checkbox-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-items: start;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: #1f2937;
  width: 100%;
}

.group-checkbox-item input[type='checkbox'] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.group-checkbox-item span {
  text-align: left;
  width: 100%;
}

.group-placeholder {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

.group-select-block .form-description {
  margin: 0;
  color: #475569;
}

.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.inline input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  z-index: 1;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.modal-content h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #0f172a;
}

.modal-caption {
  margin: -0.25rem 0 0;
  color: #475569;
  font-weight: 600;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-field select {
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  font-size: 1rem;
}

.modal-field select:disabled {
  color: #94a3b8;
  background: #e2e8f0;
  cursor: not-allowed;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.modal-actions > button {
  min-width: 110px;
}

body.modal-open {
  overflow: hidden;
}


.form-details {
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(12px);
}

.form-details + .form-details {
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.form-details summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: #111827;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.form-details summary::-webkit-details-marker {
  display: none;
}

.form-details summary::after {
  content: '열기';
  font-size: 0.8rem;
  color: rgba(15, 23, 42, 0.65);
}

.form-details[open] summary {
  background: rgba(70, 88, 255, 0.12);
  color: var(--color-primary);
  box-shadow: inset 0 0 0 1px rgba(70, 88, 255, 0.15);
}

.form-details[open] summary::after {
  content: '닫기';
  color: var(--color-primary-dark);
}

.form-details .form {
  border-top: 1px solid rgba(70, 88, 255, 0.18);
  padding-top: 1.35rem;
}

.form-details[open] + .form-details {
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

.quiz-content {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-progress {
  font-weight: 600;
  color: #1f2937;
}

.quiz-question {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.7);
}

.quiz-question-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quiz-question--writing .quiz-question-header {
  align-items: center;
  gap: 0.5rem;
}

.quiz-question--writing #exam-session-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.quiz-question .quiz-audio {
  display: flex;
  align-items: center;
}

.quiz-question h3 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.35;
  color: #111827;
}

.quiz-question--multiple-choice h3 {
  font-size: 1.82rem;
}

.quiz-reading {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #475569;
}

.quiz-star {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #0f172a;
  font-weight: 600;
}

.quiz-image {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-image img {
  max-width: min(720px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  object-fit: cover;
  background: #e2e8f0;
}

.quiz-image-caption {
  margin: 0;
  color: #475569;
  font-size: 0.95rem;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.quiz-fill {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem 0.25rem 0;
}

.quiz-fill-instruction {
  margin: 0;
  color: #475569;
  font-weight: 600;
}

.quiz-fill-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #eef2ff;
  font-size: 1.4rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.quiz-fill-text .quiz-fill-char {
  min-width: 0.85rem;
  text-align: center;
  color: #0f172a;
}

.quiz-fill-text .quiz-fill-blank {
  min-width: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0;
}

.quiz-fill-blank--full .quiz-fill-blank-input::placeholder {
  color: #94a3b8;
  opacity: 1;
  letter-spacing: 0.08em;
}

.quiz-fill-blank-input {
  width: 1.8ch;
  min-width: 0;
  max-width: 2rem;
  padding: 0.15rem 0.2rem;
  text-align: center;
  font-size: 1.4rem;
  border: none;
  border-bottom: 2px solid #4f46e5;
  background: transparent;
  color: #0f172a;
  font-weight: 700;
  text-transform: none;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.quiz-fill-blank-input:focus {
  border-color: #312e81;
  box-shadow: 0 2px 0 0 rgba(49, 46, 129, 0.45);
}

.quiz-fill-actions {
  display: flex;
  justify-content: flex-start;
}

.quiz-choice-button {
  width: 100%;
  text-align: left;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.quiz-choice-button:hover {
  border-color: var(--color-primary-dark);
  box-shadow: 0 8px 18px rgba(70, 88, 255, 0.15);
  transform: translateY(-1px);
}

.quiz-choice-button:disabled {
  opacity: 0.68;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.danger-outline {
  background: transparent;
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.55);
}

.danger-outline:hover {
  background: rgba(239, 68, 68, 0.08);
}

.quiz-feedback {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  padding: 0.9rem 1.25rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.quiz-feedback[data-status='correct'] {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.28);
}

.quiz-feedback[data-status='incorrect'] {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.quiz-feedback[data-status='notice'] {
  top: 50%;
  transform: translate(-50%, -60%);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.32);
}

.quiz-feedback.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.quiz-feedback[data-status='notice'].show {
  transform: translate(-50%, -50%);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 4vw, 3rem);
  background: transparent;
}

.auth-page--with-header {
  justify-content: flex-start;
  padding-top: clamp(2rem, 6vw, 4.25rem);
  padding-bottom: clamp(2rem, 6vw, 4.25rem);
}

.auth-page--with-header > header {
  align-self: stretch;
}

.auth-main {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-page--with-header .auth-main {
  margin-top: clamp(0.5rem, 3vw, 1.75rem);
}

.auth-container {
  width: min(960px, 100%);
  display: grid;
  gap: 1.5rem;
}

.auth-page--with-header .auth-container {
  width: min(720px, 100%);
}

.auth-card {
  background: var(--color-surface-strong);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
  padding: clamp(1.5rem, 4vw, 2rem);
  color: #0f172a;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.auth-card h1,
.auth-card h2 {
  margin: 0 0 1rem;
}

.auth-card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.auth-card-header--with-actions {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
}

.auth-card-header--with-actions .auth-card-header-content {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.auth-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-guide-button:hover {
  background: rgba(37, 99, 235, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.auth-guide-button:focus-visible {
  outline: 3px solid rgba(191, 219, 254, 0.95);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .auth-card-header--with-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-card-header--with-actions .auth-guide-button {
    width: 100%;
  }
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.5rem;
  object-fit: contain;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form button.primary {
  align-self: flex-start;
}

.auth-feedback {
  margin-top: 0.75rem;
  min-height: 1.5rem;
  font-weight: 600;
  color: #2563eb;
}

.auth-feedback[data-type="error"] {
  color: #dc2626;
}

.auth-feedback[data-type="success"] {
  color: #15803d;
}

.social-login {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.social-title {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #1e293b;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.social-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: #ffffff;
  color: #1f2937;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.social-button span {
  font-size: 1.15rem;
}

.social-button:hover,
.social-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px -14px rgba(15, 23, 42, 0.55);
}

.social-button.google {
  border-color: rgba(66, 133, 244, 0.45);
}

.social-button.kakao {
  border-color: rgba(244, 229, 76, 0.6);
}

.social-button.naver {
  border-color: rgba(3, 199, 90, 0.5);
}

.social-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.auth-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.auth-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.auth-link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.auth-link-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-card.info-card {
  background: #f8fafc;
}

.auth-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-feedback {
  margin-top: 0.75rem;
  min-height: 1.5rem;
  font-weight: 600;
  color: #2563eb;
}

.form-feedback-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-feedback-actions .link-button {
  align-self: flex-start;
}

.form-feedback-actions .link-button[aria-busy='true'] {
  pointer-events: none;
  opacity: 0.7;
}

.form-feedback[data-type='error'] {
  color: #dc2626;
}

.form-feedback[data-type='success'] {
  color: #15803d;
}

.admin-container {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 5vw, 2.5rem) clamp(3rem, 6vw, 4.5rem);
  width: min(100%, 1280px);
  margin: 0 auto;
}

@media (min-width: 1440px) {
  .admin-container {
    width: min(100%, 1400px);
  }
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

.admin-table td {
  font-size: 0.95rem;
  color: #1f2937;
}

.admin-controls {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.stacked-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  color: #334155;
}

.muted-text {
  color: #475569;
  font-size: 0.95rem;
}

.admin-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

.admin-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.compact-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.compact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  color: #1f2937;
}

.compact-form input[type='text'],
.compact-form input[type='email'],
.compact-form input[type='password'],
.compact-form input[type='number'] {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 8px;
  font-size: 1rem;
}

.compact-form .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.form-actions button {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.form-actions button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.form-actions button.danger {
  background: #ef4444;
  color: #fff;
}

.form-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.admin-data-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

.admin-column {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.column-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.85rem;
}

.inline-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  color: #1f2937;
}

.inline-form input,
.inline-form select {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  min-width: 170px;
}

.inline-form .form-actions {
  margin: 0;
  flex: 1;
  justify-content: flex-start;
}

.action-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.action-buttons button {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-weight: 700;
}

.action-buttons button.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecdd3;
}

.account-container {
  width: min(960px, 100%);
  margin: clamp(1.5rem, 5vw, 3rem) auto;
  display: grid;
  gap: clamp(2rem, 4vw, 2.75rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: stretch;
}

.account-panel {
  width: 100%;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.5rem, 4vw, 2.25rem)
    clamp(1.75rem, 4vw, 2.5rem);
}

.account-summary div {
  background: rgba(248, 250, 252, 0.85);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.account-summary dt {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

.account-summary dd {
  margin: 0;
  font-weight: 600;
  color: #1e293b;
}

.account-password-form {
  display: grid;
  gap: 1rem;
  max-width: 420px;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.25rem)
    clamp(2rem, 5vw, 2.75rem);
}

.admin-table tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.quiz-actions button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.quiz-feedback {
  min-height: 1.2rem;
  font-weight: 600;
}

.quiz-feedback.success {
  color: #2563eb;
}

.quiz-feedback.error {
  color: #dc2626;
}

.quiz-correct {
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
  font-weight: 600;
}

.quiz-summary {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-summary h3 {
  margin: 0;
}

.quiz-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #1f2937;
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 0.95;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  body {
    font-size: 16px;
  }

  header {
    padding: 1.25rem 1.5rem;
  }

  body[data-guide-page="manage"] main {
    padding: clamp(1rem, 4vw, 1.5rem);
    gap: clamp(0.9rem, 3vw, 1.3rem);
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
    grid-template-areas:
      "folders groups"
      "words words";
    max-width: 940px;
  }

  #words {
    min-height: 420px;
  }

  table {
    font-size: 1rem;
  }

  .word-controls {
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .word-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .word-controls select {
    min-width: 120px;
  }

  main.exam-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    padding: calc(var(--layout-padding-top) + 0.2rem)
      var(--layout-padding-x-wide)
      calc(var(--layout-padding-bottom) + 0.45rem);
    max-width: 1080px;
  }

  .exam-summary-score {
    font-size: 1.8rem;
  }

  .exam-history-list {
    max-height: 360px;
  }
}

@media (max-width: 1024px) {
  #folders,
  #groups {
    max-height: calc(100vh - 14rem);
  }

  .memorize-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .memorize-toggle-group {
    width: 100%;
    justify-content: flex-start;
  }

  .memorize-toggle-group button {
    flex: 1 1 200px;
    min-width: min(220px, 100%);
  }

  .memorize-table thead tr,
  .memorize-table tbody tr {
    grid-template-columns: 72px 128px 1fr 1.05fr;
  }

  main.exam-layout {
    grid-template-columns: 1fr;
    max-width: 760px;
    padding: var(--layout-padding-top) var(--layout-padding-x)
      calc(var(--layout-padding-bottom) + 0.35rem);
  }

  .exam-history-list {
    max-height: none;
  }
}

@media (max-width: 900px) {
  body[data-guide-page="manage"] main {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    grid-auto-rows: auto;
    min-height: auto;
    max-width: none;
  }

  #folders,
  #groups,
  #words {
    grid-area: auto;
  }

  #folders,
  #groups {
    max-height: none;
  }

  main.exam-layout {
    padding: var(--layout-padding-top) var(--layout-padding-x)
      calc(var(--layout-padding-bottom) + 0.35rem);
    max-width: none;
  }

  main.exam-layout .panel {
    width: 100%;
  }

  .exam-summary-score {
    font-size: 1.6rem;
  }

  main.memorize-layout {
    padding: calc(var(--layout-padding-top) + 0.1rem) var(--layout-padding-x)
      calc(var(--layout-padding-bottom) + 0.45rem);
  }

  main.memorize-layout .panel {
    width: 100%;
  }

  main.import-layout {
    grid-template-columns: 1fr;
    max-width: none;
    padding: var(--layout-padding-top) var(--layout-padding-x)
      calc(var(--layout-padding-bottom) + 0.35rem);
  }

  main.import-layout .panel {
    width: 100%;
  }

  .group-select-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    align-items: flex-start;
  }

  .header-links {
    justify-content: flex-start;
    width: 100%;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-stats {
    width: 100%;
  }

  .link-button {
    align-self: flex-start;
  }

  .panel {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .memorize-word-board__label {
    flex-direction: column;
    align-items: flex-start;
  }

  .memorize-table table {
    border-spacing: 0 10px;
  }

  .memorize-table thead {
    display: none;
  }

  .memorize-table thead tr,
  .memorize-table tbody tr {
    grid-template-columns: 64px 1fr;
    row-gap: 0.5rem;
  }

  .memorize-table tbody tr {
    padding: 0.9rem 0.95rem;
  }

  .memorize-table tbody .star-cell,
  .memorize-table tbody .term-cell,
  .memorize-table tbody .meaning-cell {
    grid-column: 1 / -1;
  }

  .memorize-table tbody .word-number {
    justify-self: center;
  }

  .guide-modal {
    padding: 1rem;
    align-items: flex-end;
  }

  .guide-modal-dialog {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
    border-radius: 16px 16px 0 0;
  }

  .guide-modal-header,
  .guide-modal-body,
  .guide-modal-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .guide-modal-title {
    font-size: 1.4rem;
  }

  .guide-section {
    padding: 0.9rem 1rem;
  }

  #toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
    max-width: calc(100% - 2rem);
  }

  .memorize-table .term-cell .value-text {
    font-size: 1.65rem;
    letter-spacing: 0.01em;
  }

  .memorize-table .meaning-cell .value-text {
    font-size: 1.5rem;
  }

  main.exam-layout {
    padding: calc(var(--layout-padding-top) - 0.05rem)
      var(--layout-padding-x)
      calc(var(--layout-padding-bottom) + 0.2rem);
  }

  .exam-summary-score {
    font-size: 1.4rem;
  }

  .exam-history-body {
    padding: 0.9rem 1rem 1.4rem;
  }

  .exam-history-item {
    padding: 0.9rem 1rem;
  }

  .modal-card {
    padding: 1.6rem 1.4rem;
  }

  .modal-title {
    font-size: 1.55rem;
  }
}


.today-panel {
  padding: clamp(1.35rem, 3vw, 1.75rem);
}

.today-panel-header {
  align-items: flex-start;
}

.today-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.today-heading-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 12rem;
  text-align: center;
}

.today-date-button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--color-outline);
  background: rgba(255, 255, 255, 0.86);
  color: #1f2937;
  font-size: 1rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.today-date-button:hover,
.today-date-button:focus-visible {
  background: rgba(70, 88, 255, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(64, 80, 170, 0.14);
  outline: none;
}

.today-date-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(30, 41, 59, 0.16);
}

.today-date-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.today-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.today-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.today-main {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.today-pending {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--color-outline);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.today-pending[hidden] {
  display: none;
}

.today-pending-title {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
  font-size: 1rem;
}

.today-pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.today-pending-button {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: white;
  color: #0f172a;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.today-pending-button:hover,
.today-pending-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(70, 88, 255, 0.16);
  border-color: rgba(70, 88, 255, 0.35);
  outline: none;
}

.today-pending-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

.today-pending-button.is-selected {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(70, 88, 255, 0.28);
}

.today-memo {
  padding: 1.15rem 1.3rem;
  border-radius: 16px;
  border: 1px solid var(--color-outline);
  background: var(--color-surface-strong);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-card);
}

.today-memo[hidden] {
  display: none;
}

.today-memo-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

.today-memo-content {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #0f172a;
  white-space: pre-wrap;
}

.today-empty {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0;
  padding: 1.35rem 1.5rem;
  border-radius: 16px;
  border: 1px dashed var(--color-outline);
  background: var(--color-surface-strong);
  box-shadow: var(--shadow-card);
  color: #475569;
}

.today-empty-message {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #475569;
}

@media (min-width: 960px) {
  .today-body {
    gap: 1.75rem;
  }

  .today-main {
    gap: 1.35rem;
  }
}

.today-empty .link-button:not(.primary) {
  background: white;
  color: #1f2937;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.today-empty .link-button:not(.primary):hover {
  background: #f1f5f9;
  color: #111827;
}

.today-empty .link-button:not(.primary):focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 3px;
}

.today-empty .link-button.primary:disabled,
.today-empty .link-button.primary[aria-disabled='true'] {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(70, 88, 255, 0.18);
  color: rgba(255, 255, 255, 0.78);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.78);
  cursor: not-allowed;
  opacity: 0.85;
}

.today-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}


.today-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.today-plan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.3rem;
  border-radius: 16px;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-outline);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.today-plan-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
}

.today-plan-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.today-plan-folder {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
}

.today-plan-group {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.today-plan-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.today-plan-actions button {
  min-width: 112px;
}

.today-plan-item-passed {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(236, 253, 245, 0.7);
  box-shadow: 0 16px 32px rgba(22, 163, 74, 0.12);
}

.today-plan-item-completed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(236, 253, 245, 0.85);
  box-shadow: 0 16px 32px rgba(16, 185, 129, 0.12);
}

.today-plan-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #047857;
  background: rgba(52, 211, 153, 0.25);
  border-radius: 999px;
}

.today-plan-status-pass {
  color: #166534;
  background: rgba(22, 163, 74, 0.18);
}

.today-plan-history-button {
  min-width: auto;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.today-plan-history-button:hover,
.today-plan-history-button:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.25);
  color: #0f172a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.calendar-panel {
  padding: clamp(1.75rem, 3vw, 2.35rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2vw, 1.75rem);
}

.calendar-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.calendar-panel-heading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.calendar-month-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.calendar-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin: 0 -0.25rem;
}

.calendar-scroll::-webkit-scrollbar {
  height: 8px;
}

.calendar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.5rem, 1vw + 0.2rem, 1rem);
  margin-top: 1.1rem;
  width: 100%;
  min-width: 0;
}

.calendar-weekday {
  font-weight: 600;
  text-align: center;
  color: rgba(15, 23, 42, 0.6);
  padding-bottom: 0.25rem;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(0.45rem, 1.2vw, 0.6rem);
  padding: clamp(0.7rem, 2.4vw, 1rem) clamp(0.6rem, 2vw, 0.9rem);
  border-radius: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  text-align: left;
  min-height: clamp(95px, 18vw, 160px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #1f2937;
}

.calendar-day.is-weekend {
  background: rgba(148, 163, 184, 0.16);
}

.calendar-day.is-completed {
  background: rgba(22, 163, 74, 0.18);
  box-shadow: 0 16px 32px rgba(22, 163, 74, 0.22);
}

.calendar-day.is-pending {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 16px 32px rgba(239, 68, 68, 0.22);
}

.calendar-day:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.calendar-day:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.55);
  outline-offset: 3px;
}

.calendar-day.is-outside {
  opacity: 0.55;
}

.calendar-day.is-selected {
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.24);
}

.calendar-day.is-selected:not(.is-completed):not(.is-pending) {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.1));
}

.calendar-day.is-selected.is-completed {
  box-shadow: 0 20px 40px rgba(22, 163, 74, 0.28);
}

.calendar-day.is-selected.is-pending {
  box-shadow: 0 20px 40px rgba(239, 68, 68, 0.3);
}

.calendar-day.is-drop-target {
  outline: 3px solid rgba(16, 185, 129, 0.55);
  outline-offset: 3px;
}

.calendar-date {
  font-weight: 700;
  font-size: clamp(0.9rem, 2.4vw, 1.2rem);
}

.calendar-plans {
  margin-top: auto;
  width: 100%;
}

.calendar-plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.32rem, 1.6vw, 0.45rem) clamp(0.45rem, 2vw, 0.6rem);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
  font-size: clamp(0.65rem, 2vw, 0.85rem);
  font-weight: 600;
  cursor: grab;
  max-width: 100%;
}

.calendar-plan-chip.is-summary {
  background: rgba(30, 64, 175, 0.15);
  color: #1e3a8a;
}

.calendar-plan-chip.is-dragging,
.plan-detail-item.is-dragging {
  opacity: 0.55;
}

.calendar-footer {
  margin-top: 0.5rem;
}

.calendar-help {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.65);
}

.calendar-help strong {
  color: #1d4ed8;
}

.plan-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.plan-detail-toolbar {
  display: flex;
  justify-content: flex-end;
}

.plan-detail-toolbar .link-button {
  min-width: 140px;
}

.plan-detail-toolbar .link-button.exam-method-passed {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35);
  border-color: rgba(21, 128, 61, 0.5);
}

.plan-detail-toolbar .link-button.exam-method-passed:disabled {
  background: rgba(22, 163, 74, 0.55);
  color: #e8f7ed;
  box-shadow: none;
}

.plan-detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.plan-memo-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.plan-memo-section.is-disabled {
  opacity: 0.65;
}

.plan-memo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.plan-memo-clear-button {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(226, 232, 240, 0.55);
  color: #1f2937;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.plan-memo-clear-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.plan-memo-clear-button:not(:disabled):hover,
.plan-memo-clear-button:not(:disabled):focus-visible {
  background: rgba(203, 213, 225, 0.85);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
}

.plan-memo-clear-button:focus-visible {
  outline: 3px solid rgba(191, 219, 254, 0.85);
  outline-offset: 2px;
}

.plan-memo-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.plan-memo-heading h3 {
  margin: 0;
}

.plan-memo-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.plan-memo-label {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
}

#plan-memo-text {
  resize: vertical;
  min-height: 140px;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.5;
}

#plan-memo-text:focus {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

#plan-memo-text:disabled {
  background: rgba(241, 245, 249, 0.8);
  color: rgba(15, 23, 42, 0.55);
}

.plan-memo-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.plan-memo-feedback {
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.68);
}

.plan-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.plan-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.plan-detail-folder {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e40af;
}

.plan-detail-group {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.plan-detail-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f766e;
  background: rgba(45, 212, 191, 0.16);
  border-radius: 999px;
}

.plan-detail-status-pass {
  color: #166534;
  background: rgba(22, 163, 74, 0.18);
}

.plan-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plan-detail-actions button {
  min-width: 96px;
}

.plan-detail-item-passed {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(240, 253, 244, 0.85);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.1);
}

.plan-form {
  margin-top: 0.5rem;
}

body.plan-modal-open {
  overflow: hidden;
}

.plan-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: rgba(15, 23, 42, 0.58);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.plan-modal[hidden] {
  display: none;
}

.plan-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.plan-modal-backdrop {
  position: absolute;
  inset: 0;
}

.plan-modal-dialog {
  position: relative;
  background: rgba(248, 250, 252, 0.95);
  border-radius: 22px;
  box-shadow: 0 32px 60px rgba(15, 23, 42, 0.32);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  width: min(620px, 92vw);
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.plan-modal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.plan-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.plan-modal-heading h2 {
  margin: 0;
}

.plan-modal-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.plan-modal-close {
  border: none;
  background: rgba(15, 23, 42, 0.08);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.plan-modal-close:hover,
.plan-modal-close:focus-visible {
  background: rgba(15, 23, 42, 0.16);
  transform: scale(1.05);
}

.plan-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.plan-modal-body::-webkit-scrollbar {
  width: 8px;
}

.plan-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.6);
  border-radius: 999px;
}

.exam-method-fieldset {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exam-method-fieldset legend {
  font-weight: 700;
  padding: 0 0.35rem;
}

.exam-method-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.exam-method-options .checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.exam-method-options input[type='checkbox'] {
  width: 1rem;
  height: 1rem;
}

.plan-form-grid {
  gap: 1rem;
}

.plan-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.plan-form select {
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  font-size: 0.95rem;
}

.plan-form select.is-disabled {
  opacity: 0.5;
}

.plan-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

@media (min-width: 880px) {
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(110px, 1fr));
  }
}

@media (min-width: 1100px) {
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(140px, 1fr));
  }
}

@media (max-width: 820px) {
  .calendar-day {
    min-height: clamp(90px, 20vw, 140px);
  }

  .plan-modal-dialog {
    width: min(94vw, 560px);
    max-height: min(92vh, 700px);
  }
}

@media (max-width: 680px) {
  main.study-plan-layout {
    padding: calc(var(--layout-padding-top) + 0.05rem)
      clamp(0.75rem, 5vw, 1.5rem)
      calc(var(--layout-padding-bottom) + 0.5rem);
  }

  .calendar-scroll {
    margin: 0;
    padding-bottom: 0.35rem;
  }

  .calendar-grid {
    gap: clamp(0.35rem, 1.4vw, 0.55rem);
  }

  .calendar-day {
    padding: clamp(0.55rem, 3vw, 0.75rem) clamp(0.5rem, 2.6vw, 0.7rem);
    min-height: clamp(85px, 24vw, 120px);
  }

  .calendar-date {
    font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  }

  .calendar-plan-chip {
    padding: clamp(0.28rem, 1.8vw, 0.4rem) clamp(0.4rem, 2.4vw, 0.55rem);
    font-size: clamp(0.58rem, 2.6vw, 0.75rem);
  }

  .plan-modal-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .calendar-grid {
    gap: clamp(0.25rem, 2.2vw, 0.45rem);
  }

  .calendar-day {
    padding: clamp(0.5rem, 3.6vw, 0.65rem) clamp(0.4rem, 3vw, 0.6rem);
  }

  .calendar-date {
    font-size: clamp(0.82rem, 3.8vw, 1rem);
  }

  .calendar-plan-chip {
    font-size: clamp(0.55rem, 3vw, 0.7rem);
  }

  .plan-modal-dialog {
    width: 96vw;
    border-radius: 18px;
  }

  .plan-modal-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .plan-modal-close {
    order: -1;
  }

  .plan-memo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-memo-feedback {
    width: 100%;
  }

  #plan-memo-save,
  #plan-memo-clear {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .today-plan-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .today-plan-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
