:root {
  color-scheme: light;
  --bg: #fbf6e8;
  --bg-soft: #fffaf0;
  --surface: #fffdf8;
  --surface-strong: #f3ead8;
  --ink: #1f2933;
  --muted: #6b665d;
  --line: #e4d8c3;
  --accent: #1f5f8b;
  --accent-dark: #174b70;
  --gold: #d39a2d;
  --green: #16805d;
  --amber: #a86f17;
  --red: #b8403a;
  --shadow: 0 18px 44px rgba(77, 59, 28, 0.1);
}

:root.dark {
  color-scheme: dark;
  --bg: #171613;
  --bg-soft: #201d18;
  --surface: #24211c;
  --surface-strong: #302a21;
  --ink: #f5f0e8;
  --muted: #c7bbab;
  --line: #463d31;
  --accent: #7fc5f0;
  --accent-dark: #9bd5f4;
  --gold: #e0ad4a;
  --green: #64c89e;
  --amber: #e0ad4a;
  --red: #ff8179;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(211, 154, 45, 0.18), transparent 34rem),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  color: var(--ink);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0) scale(0.98);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid rgba(228, 216, 195, 0.86);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
}

:root.dark .site-header {
  background: rgba(36, 33, 28, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 1.35rem;
  font-weight: 900;
}

.brand strong,
.brand small,
.stat-card span,
.stat-card strong,
.stat-card small {
  display: block;
}

.brand small,
.muted,
.session-card small {
  color: var(--muted);
}

.public-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.header-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.account-button {
  min-height: 42px;
  max-width: 180px;
  padding: 0 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(31, 95, 139, 0.18);
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 52px;
  z-index: 20;
  display: grid;
  width: 180px;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 180ms ease;
}

.account-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.account-menu button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.account-menu button:hover {
  background: var(--surface-strong);
}

.nav-link,
.nav-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-link {
  min-height: 40px;
  padding: 0 14px;
}

.nav-item {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
}

.nav-link:hover,
.nav-link.active,
.nav-item:hover,
.nav-item.active {
  background: var(--surface-strong);
  color: var(--ink);
}

main {
  min-height: calc(100vh - 81px);
}

.view,
.teacher-panel {
  display: none;
}

.view {
  scroll-margin-top: 90px;
}

.view.active,
.teacher-panel.active {
  display: block;
  animation: softReveal 220ms ease both;
}

@keyframes softReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 81px);
  padding: clamp(34px, 7vw, 84px) clamp(18px, 5vw, 56px);
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1,
.page-shell h1,
.security-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(2.45rem, 6vw, 5.5rem);
  line-height: 1.03;
}

.hero-copy p,
.security-hero p {
  max-width: 660px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(31, 95, 139, 0.18);
}

.ghost-button {
  padding: 0 16px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
}

.ghost-button:hover,
.icon-button:hover {
  background: var(--surface-strong);
}

.icon-button {
  display: grid;
  width: 42px;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
}

.hero-visual {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 430px;
  align-content: center;
}

.visual-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: end;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.visual-card.large {
  grid-row: span 2;
  min-height: 314px;
  background: linear-gradient(145deg, #fff8df, #f1fbff);
}

:root.dark .visual-card.large {
  background: linear-gradient(145deg, #302a21, #1e3140);
}

.motto-card {
  align-content: center;
  gap: 12px;
}

.visual-card span {
  color: var(--gold);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 0.9;
}

.motto-card span {
  color: var(--accent);
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.visual-card strong {
  font-size: 1.18rem;
}

.motto-card strong {
  color: var(--ink);
  font-size: clamp(2.4rem, 5.4vw, 4.8rem);
  line-height: 0.98;
}

.motto-card small {
  color: var(--gold);
  font-weight: 900;
}

.visual-card small,
.feature-card p,
.program-item span,
.stat-card small {
  color: var(--muted);
}

.intro-band,
.page-shell {
  padding: clamp(42px, 6vw, 78px) clamp(18px, 5vw, 56px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2,
.section-heading h3,
.feature-card h3,
.panel h1,
.panel h2,
.panel h3 {
  margin: 0;
}

.feature-grid,
.student-detail,
.student-summary-grid,
.audience-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.audience-panel,
.panel,
.session-card,
.member-card,
.study-column,
.progress-item,
.stat-card,
.notice-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card,
.audience-panel,
.stat-card,
.notice-panel {
  padding: 20px;
}

.audience-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.audience-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.audience-panel h2,
.audience-panel p {
  margin: 0;
}

.audience-panel p,
.audience-panel li {
  color: var(--muted);
}

.audience-panel ul {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
  padding-left: 20px;
}

.parent-layout {
  display: grid;
  gap: 18px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.program-list {
  display: grid;
  gap: 12px;
  max-width: 900px;
}

.program-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.security-hero {
  max-width: 900px;
  margin-bottom: 28px;
}

.login-layout {
  display: grid;
  min-height: calc(100vh - 81px);
  place-items: center;
  padding: 32px 18px;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.login-panel {
  width: min(520px, 100%);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(77, 59, 28, 0.08);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
  animation: softReveal 180ms ease both;
}

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

.role-card {
  display: grid;
  gap: 6px;
  min-height: 128px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.role-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 24px rgba(77, 59, 28, 0.12);
}

.role-card.active {
  border-color: var(--accent);
  background: linear-gradient(145deg, rgba(31, 95, 139, 0.1), rgba(211, 154, 45, 0.12));
  box-shadow: inset 0 0 0 1px rgba(31, 95, 139, 0.25);
}

.role-card span {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.role-card strong {
  font-size: 1.05rem;
}

.role-card small {
  color: var(--muted);
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.auth-status {
  display: none;
  min-height: 40px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 800;
}

.auth-status:not(:empty) {
  display: flex;
}

.auth-status[data-type="success"] {
  background: rgba(22, 128, 93, 0.12);
  color: var(--green);
}

.auth-status[data-type="error"] {
  background: rgba(184, 64, 58, 0.12);
  color: var(--red);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 81px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
}

:root.dark .sidebar {
  background: rgba(36, 33, 28, 0.72);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.session-card {
  padding: 16px;
}

.session-card strong {
  display: block;
  margin: 4px 0;
}

.workspace {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.teacher-panel {
  gap: 18px;
}

.teacher-panel.active {
  display: grid;
}

.student-summary-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.student-summary-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-block {
  display: grid;
  gap: 8px;
}

.summary-checklist {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.summary-checklist li {
  color: var(--ink);
}

.summary-checklist li.done {
  color: var(--muted);
  text-decoration: line-through;
}

.member-grid,
.kanban {
  display: grid;
  gap: 16px;
}

.student-tools {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.category-groups {
  display: grid;
  gap: 18px;
}

.category-group {
  display: grid;
  gap: 12px;
}

.category-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.category-heading h3 {
  margin: 0;
}

.category-heading span {
  color: var(--muted);
  font-weight: 800;
}

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

.student-list {
  display: grid;
  gap: 16px;
}

.member-card {
  padding: 18px;
}

.member-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.member-profile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
}

.member-profile h3 {
  margin: 3px 0 0;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 900;
}

.member-card dl {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
}

.member-card div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.member-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.password-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.password-panel[hidden] {
  display: none;
}

.password-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
}

.password-message {
  min-height: 20px;
  font-size: 0.9rem;
  font-weight: 800;
}

.password-message[data-type="success"] {
  color: var(--green);
}

.password-message[data-type="error"] {
  color: var(--red);
}

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

.study-column {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.study-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.study-card small {
  color: var(--muted);
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  gap: 10px;
}

.progress-actions label {
  min-width: 170px;
}

.spreadsheet-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-sheet {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.progress-sheet th,
.progress-sheet td {
  min-width: 140px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.progress-sheet th:first-child,
.progress-sheet td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 150px;
  background: var(--surface);
}

.progress-sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.84rem;
}

.progress-sheet th:first-child {
  z-index: 3;
}

.progress-sheet small {
  display: block;
  color: var(--muted);
}

.progress-sheet textarea,
.progress-sheet select {
  min-height: 70px;
  resize: vertical;
  border: 1px solid transparent;
  background: transparent;
}

.progress-sheet select {
  min-height: 42px;
  background: var(--surface);
}

.progress-sheet textarea:focus,
.progress-sheet select:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.checklist-block {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.checklist-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--ink);
}

.checklist-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.checklist-row input[type="text"] {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
}

.checklist-row input[type="checkbox"]:checked + input[type="text"] {
  color: var(--muted);
  text-decoration: line-through;
}

.checklist-row input[type="text"]:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.guideline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-left: 26px;
  padding: 6px 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.guideline-row.hidden {
  display: none;
}

.guideline-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.guideline-row .ghost-button {
  min-height: 30px;
  padding: 0 10px;
}

.add-checklist-item {
  width: fit-content;
  min-height: 34px;
}

.progress-item {
  display: grid;
  grid-template-columns: 1fr 150px 1.2fr 1.2fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.student-name strong,
.student-name span {
  display: block;
}

.student-name span {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.badge.green {
  background: rgba(22, 128, 93, 0.12);
  color: var(--green);
}

.badge.amber {
  background: rgba(168, 111, 23, 0.14);
  color: var(--amber);
}

.badge.red {
  background: rgba(184, 64, 58, 0.12);
  color: var(--red);
}

.stat-card strong {
  margin: 6px 0 2px;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.modal {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(31, 41, 51, 0.56);
}

.modal form {
  display: grid;
  gap: 14px;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .public-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .header-actions {
    justify-self: end;
  }

  .hero-panel,
  .feature-grid,
  .audience-grid,
  .student-detail,
  .student-summary-grid,
  .kanban {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .student-tools {
    grid-template-columns: 1fr;
  }

  .progress-item {
    grid-template-columns: 1fr 1fr;
  }

  .progress-actions {
    justify-content: stretch;
  }

  .progress-actions label,
  .progress-actions button {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 14px;
  }

  .hero-copy h1,
  .page-shell h1,
  .security-hero h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .hero-visual {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .visual-card.large {
    min-height: 220px;
  }

  .section-heading,
  .topbar,
  .program-item {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 18px;
  }

  .side-nav,
  .progress-item {
    grid-template-columns: 1fr;
  }

  .hero-actions .primary-button,
  .hero-actions .ghost-button,
  .login-panel .primary-button,
  .login-panel .ghost-button {
    width: 100%;
  }

  .role-choice {
    grid-template-columns: 1fr;
  }
}
