:root {
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: #222641;
  background: #f4f5fa;
  font-synthesis: none;
  --sidebar: #191d32;
  --accent: #5145be;
  --accent-wash: #eeeafd;
  --muted: #555c76;
  --line: #e1e4ef;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
p, h1, h2, h3, dl, dd { margin: 0; }
:focus-visible { outline: 3px solid #7564ee; outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  transform: translateY(-150%);
  padding: .6rem 1rem;
  border-radius: .5rem;
  color: #fff;
  background: var(--accent);
}
.skip-link:focus { transform: none; }

.dashboard {
  --sidebar-width: 14rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(90deg, var(--sidebar) var(--sidebar-width), transparent var(--sidebar-width));
}
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 2.1rem 1rem 1.5rem;
  background: var(--sidebar);
  color: #f6f5ff;
  overflow-y: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: .8rem;
  margin: 0 .62rem 2.85rem;
  text-decoration: none;
}
.brand strong { font-size: 1.37rem; letter-spacing: -.065em; }
.brand-mark {
  position: relative;
  width: 2.38rem;
  height: 2.38rem;
  border-radius: .8rem;
  background: #a89bff;
  box-shadow: inset 0 0 0 1px #cdc4ff;
}
.brand-mark::before,
.brand-mark::after {
  position: absolute;
  width: .92rem;
  height: .92rem;
  border: 2px solid #2a2262;
  border-radius: .21rem;
  content: "";
}
.brand-mark::before { top: .59rem; left: .59rem; }
.brand-mark::after { right: .57rem; bottom: .55rem; background: #e5e0ff; }
.sidebar h2 {
  margin: 0 .75rem .65rem;
  color: #b6bedb;
  font-size: .82rem;
  font-weight: 650;
}
.category-list { display: grid; gap: .25rem; }
.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 2.68rem;
  padding: .55rem .75rem;
  border: 1px solid transparent;
  border-radius: .62rem;
  background: transparent;
  color: #dce0f1;
  text-align: left;
  font-size: .925rem;
  font-weight: 640;
  white-space: nowrap;
}
.category-button:hover { background: #252a47; }
.category-button[aria-pressed="true"] {
  border-color: #4e4679;
  background: #342b59;
  color: #f6f3ff;
}
.category-count {
  min-width: 1.55rem;
  padding: .13rem .34rem;
  border-radius: .34rem;
  background: #292f4c;
  color: #bec6ed;
  text-align: center;
  font-size: .77rem;
  font-variant-numeric: tabular-nums;
}
.category-button[aria-pressed="true"] .category-count { background: #4b3f77; color: #f3eaff; }
.recent {
  margin-top: 1.55rem;
  padding-top: 1.15rem;
  border-top: 1px solid #343956;
}
.recent a {
  display: block;
  padding: .55rem .75rem;
  border-radius: .5rem;
  color: #f1edff;
  font-size: .92rem;
  text-underline-offset: .25rem;
}
.recent a:hover { background: #252a47; }

.main {
  width: min(100%, 92rem);
  justify-self: center;
  padding: 2rem clamp(1.4rem, 3vw, 3.1rem) 3rem;
}
.overview {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.35rem 2rem;
  min-height: 12.2rem;
  padding: 2rem clamp(1.4rem, 3.2vw, 3rem);
  overflow: hidden;
  border: 1px solid #575092;
  border-radius: 1.32rem;
  background: linear-gradient(125deg, #22284e 4%, #312c67 58%, #514294 100%);
  color: #fcfbff;
  box-shadow: 0 .85rem 2.05rem #25254f1c;
}
.overview::before {
  position: absolute;
  z-index: -1;
  right: -11rem;
  bottom: -13rem;
  width: 38rem;
  height: 31rem;
  border: 100px solid transparent;
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, #c9baff24 0 1px, transparent 2px 19px);
  transform: rotate(-19deg);
  content: "";
}
.overview-copy { min-width: 0; }
.overview h1 {
  font-size: clamp(1.85rem, 3.35vw, 3rem);
  font-weight: 770;
  line-height: 1.16;
  letter-spacing: -.071em;
  word-break: keep-all;
}
.overview p {
  margin-top: .75rem;
  color: #e9e6fa;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.6;
  word-break: keep-all;
}
.overview-stats {
  display: flex;
  flex-shrink: 0;
  padding: .9rem .15rem;
  border: 1px solid #e5dcff43;
  border-radius: .9rem;
  background: #1f1b4775;
}
.overview-stats div { padding: 0 clamp(.75rem, 1.65vw, 1.45rem); }
.overview-stats div + div { border-left: 1px solid #e5dcff43; }
.overview-stats dt { color: #f0eaff; font-size: .86rem; font-weight: 600; }
.overview-stats dd {
  margin-top: .14rem;
  font-size: clamp(1.4rem, 2.2vw, 2.05rem);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
}

.library { margin-top: 2rem; scroll-margin-top: 1rem; }
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1.35rem;
  margin-bottom: 1.05rem;
}
.library-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .38rem .75rem; }
.library-heading h2 { font-size: 1.55rem; line-height: 1.3; letter-spacing: -.055em; }
.library-heading p { color: var(--muted); font-size: .9rem; font-weight: 650; }
.search-box {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: min(100%, 19rem);
  padding: 0 .82rem;
  border: 1px solid #d7dbea;
  border-radius: .68rem;
  background: #fff;
  color: #58617d;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #b6adf4; }
.search-icon {
  position: relative;
  width: .75rem;
  height: .75rem;
  flex: none;
  margin-right: .17rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.search-icon::after {
  position: absolute;
  width: .38rem;
  height: 1.5px;
  right: -.29rem;
  bottom: -.16rem;
  transform: rotate(45deg);
  background: currentColor;
  content: "";
}
.search-box input {
  min-width: 0;
  width: 100%;
  height: 2.62rem;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #222641;
  font-size: 1rem;
}
.search-box input::placeholder { color: #58617d; opacity: 1; }

.exam-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.12rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.exam-item { min-width: 0; }
.exam-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: .99rem;
  background: #fff;
  box-shadow: 0 .24rem .8rem #2d2d5d0a;
  text-decoration: none;
  transition: border-color .17s ease, transform .17s ease, box-shadow .17s ease;
}
.exam-card:hover {
  transform: translateY(-2px);
  border-color: #aea4e7;
  box-shadow: 0 .72rem 1.6rem #2d2d5d17;
}
.card-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.4;
  background: #e8eaf2;
  object-fit: cover;
  object-position: center 54%;
}
.card-content { display: flex; flex: 1; flex-direction: column; padding: .86rem 1rem .9rem; }
.card-category {
  align-self: flex-start;
  margin-bottom: .27rem;
  color: var(--accent);
  font-size: .84rem;
  font-weight: 750;
}
.card-title { font-size: 1.18rem; font-weight: 780; line-height: 1.38; letter-spacing: -.045em; word-break: keep-all; }
.card-description { margin: .23rem 0 .8rem; color: var(--muted); font-size: .91rem; line-height: 1.45; word-break: keep-all; }
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem .7rem;
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px solid #e9eaf3;
}
.card-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .125rem .68rem;
  color: var(--muted);
  font-size: .82rem;
}
.card-counts strong { color: #222641; font-size: .89rem; font-weight: 760; }
.card-action {
  flex: none;
  padding: .37rem .58rem;
  border-radius: .48rem;
  background: var(--accent-wash);
  color: #3d328e;
  font-size: .86rem;
  font-weight: 750;
  white-space: nowrap;
}
.exam-card:hover .card-action { background: #e4dcff; }

.empty {
  display: grid;
  justify-items: center;
  gap: .8rem;
  padding: 2rem 1rem;
  border: 1px dashed #cdd0e8;
  border-radius: 1rem;
  color: #414863;
  text-align: center;
}
.empty button {
  padding: .52rem .9rem;
  border: 1px solid #c5baf5;
  border-radius: .5rem;
  background: #fff;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .dashboard { --sidebar-width: 12.3rem; }
  .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard { display: block; background: none; }
  .sidebar { position: static; height: auto; padding: .88rem 1rem .75rem; }
  .brand { margin: 0 0 .65rem; }
  .brand strong { font-size: 1.22rem; }
  .brand-mark { width: 2.14rem; height: 2.14rem; }
  .brand-mark::before { top: .46rem; left: .46rem; }
  .brand-mark::after { right: .45rem; bottom: .45rem; }
  .category-nav h2 { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .category-list { display: flex; gap: .3rem; margin: 0 -.3rem; padding: .23rem .3rem; overflow-x: auto; }
  .category-button { flex: none; justify-content: center; min-height: 2.45rem; padding: .45rem .63rem; font-size: .89rem; }
  .category-button:hover { background: #2b3150; }
  .category-count { display: none; }
  .recent { display: flex; align-items: baseline; gap: .25rem .6rem; margin-top: .58rem; padding-top: .5rem; }
  .recent h2 { flex: none; margin: 0; }
  .recent a { padding: .25rem .28rem; }
  .main { padding: 1.23rem 1rem 2rem; }
  .overview { min-height: auto; align-items: flex-start; flex-wrap: wrap; padding: 1.35rem 1.25rem; }
  .overview-stats { padding: .65rem .1rem; }
  .overview-stats div { padding-inline: .78rem; }
  .overview p { margin-top: .47rem; }
  .library { margin-top: 1.5rem; }
}

@media (max-width: 520px) {
  .exam-grid { grid-template-columns: minmax(0, 1fr); gap: .9rem; }
  .library-toolbar { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .card-photo { aspect-ratio: 2.47; }
}

@media (prefers-reduced-motion: reduce) {
  .exam-card { transition: none; }
  .exam-card:hover { transform: none; }
}
