:root {
  --ink: #17202a;
  --muted: #657383;
  --line: #dce3ea;
  --line-strong: #c7d2dc;
  --paper: #f5f7f9;
  --surface: #ffffff;
  --blue: #2468b2;
  --green: #3f8f5b;
  --amber: #d97821;
  --shadow: 0 18px 44px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
a,
iframe {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px clamp(16px, 3vw, 36px);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(36, 104, 178, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 104, 178, 0.95), rgba(63, 143, 91, 0.92)),
    #fff;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.18);
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  font-weight: 900;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.header-actions,
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.icon-button svg,
.tool-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button.is-active,
.tool-button:hover,
.tool-button:focus-visible {
  border-color: rgba(36, 104, 178, 0.45);
  background: #eef5fb;
  color: var(--blue);
}

.icon-button:focus-visible,
.exam-card:focus-visible,
.tool-button:focus-visible {
  outline: 3px solid rgba(36, 104, 178, 0.22);
  outline-offset: 2px;
}

main {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 36px) 40px;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.overview-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: clamp(22px, 4vw, 36px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
}

.overview-copy p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
  color: #3d4b5a;
  font-size: 16px;
  line-height: 1.7;
}

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

.summary-grid article {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.summary-grid span,
.summary-grid small,
.exam-card small,
.exam-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.summary-grid strong {
  margin: 5px 0;
  color: var(--blue);
  font-size: 28px;
  font-weight: 950;
}

.exam-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.exam-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.exam-card:hover,
.exam-card.is-active {
  border-color: rgba(36, 104, 178, 0.5);
  box-shadow: var(--shadow);
}

.exam-card img {
  width: 94px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f6;
  object-fit: cover;
}

.exam-card span {
  min-width: 0;
}

.exam-card strong {
  display: block;
  margin: 5px 0;
  font-size: 22px;
  font-weight: 950;
}

.exam-card.is-active strong {
  color: var(--blue);
}

.viewer-section {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(23, 32, 42, 0.1);
  overflow: hidden;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 16px;
}

.viewer-toolbar h2 {
  margin-bottom: 0;
  font-size: 21px;
  font-weight: 950;
}

#examFrame {
  display: block;
  width: 100%;
  height: min(880px, calc(100vh - 250px));
  min-height: 680px;
  border: 0;
  background: #fff;
}

@media (max-width: 1020px) {
  .overview {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .icon-button {
    width: 100%;
  }

  .overview-copy {
    min-height: auto;
  }

  .summary-grid,
  .exam-picker {
    grid-template-columns: 1fr;
  }

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

  .viewer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #examFrame {
    height: 72vh;
    min-height: 560px;
  }
}

@media (max-width: 460px) {
  main {
    padding-inline: 12px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small,
  .icon-button span {
    font-size: 11px;
  }

  h1 {
    font-size: 26px;
  }

  .exam-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .exam-card img {
    width: 78px;
  }

  .exam-card strong {
    font-size: 19px;
  }
}
