:root {
  --page: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #18221f;
  --muted: #63706c;
  --line: #dce5e1;
  --line-strong: #cbd7d2;
  --accent: #17725f;
  --accent-dark: #0e594b;
  --accent-soft: #e5f3ef;
  --accent-pale: #f0f8f5;
  --hero: #163f37;
  --shadow: 0 18px 48px rgba(31, 50, 44, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family:
    Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(203, 215, 210, 0.85);
  background: rgba(244, 247, 245, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar__inner {
  width: min(1360px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 6px 18px rgba(23, 114, 95, 0.22);
}

.brand__name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.overall {
  width: min(330px, 43vw);
}

.overall__copy {
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.overall__copy strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4e0;
}

.progress--small {
  height: 5px;
}

.progress__bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.layout {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 128px);
  padding: 24px 18px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar__heading {
  padding: 2px 8px 20px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.sidebar h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.sidebar__heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.topic-list {
  min-height: 0;
  padding-right: 3px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.topic-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name count"
    "bar bar";
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: 150ms ease;
}

.topic-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.topic-button:focus-visible,
.action-button:focus-visible,
.section-toggle:focus-visible,
.item-checkbox:focus-visible,
.mobile-picker select:focus-visible {
  outline: 3px solid rgba(23, 114, 95, 0.23);
  outline-offset: 2px;
}

.topic-button.is-active {
  border-color: #cce2db;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.topic-name {
  grid-area: name;
  overflow: hidden;
  font-size: 14px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-count {
  grid-area: count;
  color: #7c8884;
  font-size: 11px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.topic-mini {
  grid-area: bar;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 158, 152, 0.22);
}

.topic-mini__bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.storage-note {
  margin: 16px 5px 1px;
  padding-top: 15px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: #7a8582;
  font-size: 11px;
  line-height: 1.5;
}

.storage-note__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: #4b9d84;
  box-shadow: 0 0 0 3px rgba(75, 157, 132, 0.12);
}

.workspace {
  min-width: 0;
}

.mobile-picker {
  display: none;
}

.topic-summary {
  min-height: 232px;
  padding: 34px 36px;
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  background: var(--hero);
  color: #fff;
  box-shadow: 0 20px 50px rgba(20, 57, 50, 0.15);
}

.topic-summary::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -110px;
  width: 270px;
  height: 270px;
  border: 44px solid rgba(255, 255, 255, 0.045);
  border-radius: 50%;
  pointer-events: none;
}

.summary-head,
.summary-progress,
.summary-actions {
  position: relative;
  z-index: 1;
}

.summary-kicker {
  margin: 0 0 10px;
  color: #9bd0c1;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.summary-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.summary-meta {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.summary-progress {
  margin-top: 27px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px 18px;
}

.summary-progress__label {
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 680;
}

.summary-progress__count {
  font-size: 14px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.summary-progress .progress {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.13);
}

.summary-progress .progress__bar {
  background: #7ed0b9;
}

.summary-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.action-button,
.section-toggle {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 740;
  transition: 140ms ease;
}

.action-button:hover,
.section-toggle:hover {
  transform: translateY(-1px);
}

.action-button--primary {
  background: #fff;
  color: var(--accent-dark);
}

.action-button--quiet {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
}

.action-button:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.loading,
.error {
  min-height: 164px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
}

.loading__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.section-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.check-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 50, 44, 0.045);
}

.section-head {
  min-height: 74px;
  padding: 16px 19px 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.section-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.section-number {
  min-width: 35px;
  height: 35px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 820;
}

.section-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -0.018em;
}

.section-count {
  display: block;
  margin-top: 5px;
  color: #798481;
  font-size: 11px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.section-toggle {
  min-width: max-content;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.section-toggle:hover {
  border-color: #bad6cd;
  background: var(--accent-pale);
  color: var(--accent-dark);
}

.item-list {
  display: flex;
  flex-direction: column;
}

.check-item {
  min-height: 68px;
  padding: 16px 22px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 15px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 140ms ease;
}

.check-item + .check-item {
  border-top: 1px solid #edf0ee;
}

.check-item:hover {
  background: #fafcfb;
}

.check-item.is-checked {
  background: var(--accent-pale);
}

.item-checkbox {
  width: 23px;
  height: 23px;
  margin: 2px 0 0;
  display: grid;
  place-content: center;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid #aebbb6;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: 140ms ease;
}

.item-checkbox::before {
  content: "";
  width: 11px;
  height: 6px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  opacity: 0;
  transform: rotate(-45deg) scale(0.6);
  transition: 120ms ease;
}

.item-checkbox:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(23, 114, 95, 0.2);
}

.item-checkbox:checked::before {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.item-body {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.item-id {
  min-height: 24px;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eef1ef;
  color: #66716e;
  font-size: 11px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  transition: 140ms ease;
}

.check-item.is-checked .item-id {
  background: #d8ede7;
  color: var(--accent-dark);
}

.item-text {
  color: #2f3936;
  font-size: 14px;
  line-height: 1.72;
  white-space: pre-line;
}

.check-item.is-checked .item-text {
  color: #46645c;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 50;
  padding: 14px 16px;
  border-radius: 12px;
  background: #9c3838;
  color: #fff;
  text-align: center;
  font-size: 13px;
}

.sr-only {
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .topbar__inner,
  .layout {
    width: min(100% - 28px, 760px);
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 14px;
  }

  .sidebar {
    display: none;
  }

  .mobile-picker {
    position: sticky;
    top: 72px;
    z-index: 20;
    padding: 10px 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    background: rgba(244, 247, 245, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-picker label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 740;
  }

  .mobile-picker select {
    width: 100%;
    height: 44px;
    padding: 0 38px 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 720;
  }
}

@media (max-width: 620px) {
  .topbar__inner {
    height: 64px;
  }

  .brand__mark {
    width: 29px;
    height: 29px;
    border-radius: 9px;
    font-size: 17px;
  }

  .brand__name {
    display: none;
  }

  .overall {
    width: min(260px, calc(100vw - 78px));
  }

  .layout {
    width: min(100% - 20px, 760px);
    padding-bottom: 32px;
  }

  .mobile-picker {
    top: 64px;
  }

  .topic-summary {
    min-height: 0;
    padding: 25px 21px 23px;
    border-radius: 19px;
  }

  .summary-head h2 {
    font-size: 32px;
  }

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

  .action-button {
    width: 100%;
    min-height: 43px;
    padding: 0 10px;
  }

  .check-section {
    border-radius: 15px;
  }

  .section-head {
    min-height: 70px;
    padding: 14px 13px 14px 16px;
    gap: 10px;
  }

  .section-title {
    gap: 10px;
  }

  .section-number {
    min-width: 32px;
    height: 32px;
  }

  .section-title h3 {
    font-size: 14px;
  }

  .section-toggle {
    min-height: 40px;
    padding: 0 10px;
    font-size: 11px;
  }

  .check-item {
    min-height: 66px;
    padding: 15px 16px;
    grid-template-columns: 23px minmax(0, 1fr);
    gap: 12px;
  }

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

  .item-id {
    padding-inline: 5px;
    font-size: 10px;
  }

  .item-text {
    font-size: 13px;
  }
}

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