:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17212f;
  --muted: #64748b;
  --line: #d7dee8;
  --line-strong: #9aa8ba;
  --green: #047857;
  --blue: #0369a1;
  --amber: #a15c07;
  --rose: #be123c;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1560px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 28px;
}

.topbar,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px;
}

.topbar-copy {
  min-width: 0;
}

.kicker {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.kicker.blue {
  color: var(--blue);
}

.kicker.amber {
  color: var(--amber);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.25;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.muted.strong {
  font-weight: 800;
}

.topbar-actions,
.panel-head,
.detail-title,
.item-group-head,
.week-card-top,
.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  flex-wrap: wrap;
  flex-shrink: 0;
}

.button,
.small-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 900;
}

.button-ghost,
.small-button {
  border: 1px solid #cbd5e1;
  background: #fff;
}

.button-ghost:hover,
.small-button:hover {
  border-color: var(--line-strong);
}

.button-dark {
  border: 1px solid #0f172a;
  background: #0f172a;
  color: #fff;
}

.workspace-grid,
.detail-grid {
  display: grid;
  gap: 14px;
}

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

.detail-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: start;
  margin-top: 14px;
}

.side-rail {
  display: grid;
  gap: 14px;
}

.panel {
  padding: 16px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.timeline-head {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.count-pill,
.status-pill,
.alert-pill,
.status-soft {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.count-pill {
  background: #ecfdf5;
  padding: 5px 8px;
  color: #065f46;
}

.course-list,
.category-list,
.week-grid,
.item-groups,
.check-list,
.alert-list {
  display: grid;
  gap: 8px;
}

.course-button,
.category-button,
.week-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.course-button {
  min-height: 44px;
  padding: 0 11px;
  text-align: left;
  font-size: 14px;
  font-weight: 900;
}

.course-button.active {
  border-color: rgba(4, 120, 87, 0.48);
  background: #ecfdf5;
  color: #064e3b;
  box-shadow: inset 0 0 0 2px rgba(4, 120, 87, 0.12);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 900;
}

.search-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.13);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
}

.category-button {
  min-height: 32px;
  padding: 0 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.category-button.active {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

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

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
}

.metric-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.metric-grid dd {
  margin: 5px 0 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.week-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.week-card {
  display: grid;
  min-height: 164px;
  align-content: start;
  padding: 12px;
  text-align: left;
}

.week-card:hover {
  border-color: var(--line-strong);
}

.week-card.active {
  border-color: rgba(3, 105, 161, 0.48);
  background: #f0f9ff;
  box-shadow: inset 0 0 0 2px rgba(3, 105, 161, 0.13);
}

.week-card-top {
  justify-content: space-between;
  align-items: flex-start;
}

.status-soft {
  background: #f1f5f9;
  padding: 5px 8px;
  color: #334155;
}

.phase {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.week-card strong {
  margin-top: 12px;
  font-size: 19px;
}

.week-card em {
  margin-top: 4px;
  color: #475569;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.45;
}

.course-name {
  margin-top: 11px;
  font-size: 13px;
  font-weight: 900;
}

.tag-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  padding: 4px 7px;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}

.tag.notice,
.tag.alert {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}

.tag.lesson {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.tag.assignment {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.tag.mock {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #5b21b6;
}

.tag.extra {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.detail-title {
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.detail-title h2 {
  margin-top: 4px;
  font-size: 26px;
}

.status-pill {
  flex-shrink: 0;
  background: #0f172a;
  padding: 9px 11px;
  color: #fff;
}

.item-groups {
  margin-top: 14px;
}

.item-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.item-group-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.item-group h3 {
  margin-bottom: 0;
  font-size: 17px;
}

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

.item-card,
.check-item,
.alert-card,
.empty-note,
.empty-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.item-card {
  padding: 11px;
}

.item-card p,
.alert-card p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.item-card strong,
.alert-card strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.item-card small,
.check-item small {
  display: block;
  margin-top: 7px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.small-button {
  min-height: 32px;
  color: #475569;
  font-size: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

#progressBar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #059669;
  transition: width 0.2s ease;
}

.check-list {
  max-height: 520px;
  margin-top: 12px;
  overflow: auto;
  padding-right: 2px;
}

.check-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: #fff;
  padding: 11px;
}

.check-item input {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: #047857;
}

.check-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.alert-pill {
  background: #fff1f2;
  padding: 5px 8px;
  color: var(--rose);
}

.alert-card {
  border-color: #fecdd3;
  background: #fff1f2;
  padding: 11px;
}

.alert-card p,
.alert-card strong {
  color: #9f1239;
}

.empty-note,
.empty-box {
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.empty-box {
  grid-column: 1 / -1;
  text-align: center;
}

@media (max-width: 1280px) {
  .workspace-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 900px) {
  .side-rail,
  .week-grid,
  .item-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .timeline-head,
  .detail-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100vw - 16px, 1560px);
    padding-top: 8px;
  }

  .panel,
  .topbar {
    padding: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .week-card {
    min-height: 148px;
  }
}
