/* ==== Global Theme & Typography ==== */
:root {
  --accent: #34d399; /* emerald-400 */
  --accent-dark: #059669; /* emerald-600 */
  --warn: #f59e0b; /* amber-500 */
  --bg-main: #020617; /* slate-950 */
  --bg-card: rgba(30, 41, 59, 0.5); /* slate-800 with transparency */
  --border-color: rgba(148, 163, 184, 0.2);
  --text-main: #e2e8f0; /* slate-200 */
  --text-muted: #94a3b8; /* slate-400 */
  --text-heading: #f1f5f9; /* slate-100 */
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 1% 1%, rgba(52, 211, 153, 0.15) 0, transparent 40%),
    radial-gradient(circle at 99% 99%, rgba(59, 130, 246, 0.15) 0, transparent 40%);
  font-family: "Noto Sans KR", system-ui, -apple-system, Segoe UI, Roboto, "Apple SD Gothic Neo", sans-serif;
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
}

main,
section,
article,
div {
  min-width: 0;
}

img,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: white;
  text-decoration: underline;
}

/* ==== Common Header ==== */
.ap-header {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid rgba(100, 116, 139, 0.22);
  backdrop-filter: blur(12px);
  background:
    linear-gradient(100deg, rgba(2, 6, 23, 0.94), rgba(6, 18, 45, 0.9)),
    radial-gradient(circle at 8% 18%, rgba(56, 189, 248, 0.12), transparent 40%);
}
.ap-header * {
  box-sizing: border-box;
}
.ap-header a,
.ap-header a:hover {
  text-decoration: none;
}
.ap-header-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.ap-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  color: #f8fafc;
}
.ap-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.92));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ap-brand-mark img {
  width: 20px;
  height: 20px;
}
.ap-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.ap-brand-text strong {
  font-size: 1.03rem;
  letter-spacing: -0.02em;
}
.ap-brand-text small {
  margin-top: 3px;
  color: #8bb4ce;
  font-size: 0.73rem;
  letter-spacing: 0.01em;
}
.ap-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.ap-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: #c7d2fe;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.ap-nav-link:hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-1px);
}
.ap-nav-link[aria-current="page"] {
  color: #f8fafc;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.ap-dropdown {
  position: relative;
}
.ap-dropdown-trigger {
  gap: 5px;
}
.ap-dropdown-caret {
  font-size: 0.68rem;
  color: #94a3b8;
  transform: translateY(-1px);
}
.ap-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 285px;
  max-width: min(285px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.38);
  background: linear-gradient(180deg, rgba(7, 15, 35, 0.98), rgba(15, 23, 42, 0.98));
  box-shadow: 0 16px 38px rgba(2, 6, 23, 0.65);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 100;
}
.ap-dropdown:hover .ap-dropdown-menu,
.ap-dropdown:focus-within .ap-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.ap-dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 9px;
  color: #e2e8f0;
}
.ap-dropdown-item:hover {
  background: rgba(30, 41, 59, 0.84);
}
.ap-dropdown-item .title {
  display: block;
  font-size: 0.87rem;
  font-weight: 700;
}
.ap-dropdown-item .desc {
  display: block;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.74rem;
  line-height: 1.25;
}
.ap-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ap-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #042f2e;
  background: linear-gradient(180deg, #34d399, #10b981);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.35);
}
.ap-cta:hover {
  color: #022c22;
  filter: saturate(1.05) brightness(1.03);
}
.ap-mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 64px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.7);
  font-size: 0.82rem;
  font-weight: 700;
}
.ap-mobile-menu {
  display: none;
  border-top: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(2, 6, 23, 0.9);
}
.ap-mobile-menu.hidden {
  display: none;
}
.ap-mobile-menu.is-open {
  display: block;
}
.ap-mobile-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ap-mobile-link {
  display: block;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.7);
  background: rgba(15, 23, 42, 0.82);
  color: #dbeafe;
  font-size: 0.83rem;
}
.ap-mobile-link:hover {
  background: rgba(30, 41, 59, 0.9);
}
.ap-mobile-link[aria-current="page"] {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(30, 64, 175, 0.26);
}
@media (max-width: 1110px) {
  .ap-brand {
    min-width: 210px;
  }
  .ap-nav-link {
    padding: 0 10px;
    font-size: 0.86rem;
  }
}
@media (max-width: 980px) {
  .ap-nav {
    display: none;
  }
  .ap-cta {
    display: none;
  }
  .ap-mobile-btn {
    display: inline-flex;
  }
  .ap-brand {
    min-width: 0;
  }
}
@media (max-width: 640px) {
  .ap-header-shell {
    padding: 9px 12px;
  }
  .ap-brand-text small {
    display: none;
  }
  .ap-brand-text strong {
    font-size: 0.95rem;
  }
  .ap-mobile-grid {
    grid-template-columns: 1fr;
    padding: 10px 12px 14px;
  }
}

main h1, main h2, main h3 {
  color: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}
main h1 { font-size: clamp(1.9rem, 4.5vw, 2.55rem); line-height: 1.2; }
main h2 { font-size: clamp(1.25rem, 3.1vw, 1.6rem); margin-top: 2.1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
main h3 { font-size: clamp(1.08rem, 2.2vw, 1.25rem); margin-top: 1.7rem; }

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.82rem;
}

/* ==== Main Layout & Components ==== */
.wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.sitemap-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.7);
}
.sitemap-card {
  width: min(980px, 92vw);
  max-height: 85vh;
  overflow: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.sitemap-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px;
}
.sitemap-item a {
  color: #f8fafc;
  font-weight: 600;
  text-decoration: none;
}
.sitemap-item a:hover {
  text-decoration: underline;
}
.sitemap-item .desc {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.3;
}

.hero {
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  background: none;
  border: none;
  text-align: center;
}
.hero h1 {
  color: transparent;
  background: linear-gradient(90deg, white, #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 1rem auto 0;
}

.chips {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.ctaRow {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 800;
  color: #042f2e;
  background: linear-gradient(180deg, #34d399, #10b981);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  color: #022c22;
  text-decoration: none;
  filter: saturate(1.05) brightness(1.03);
  transform: translateY(-1px);
}

.btn.secondary {
  color: #dbeafe;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: none;
}

.btn.secondary:hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.85);
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
  border-color: rgba(52, 211, 153, 0.3);
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  background: rgba(255, 255, 255, .05);
  font-weight: 500;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

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

.kpiItem {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.45);
}

.kpiItem b {
  display: block;
  margin-bottom: 4px;
}

.kpiItem span {
  display: block;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.notice {
  padding: 1rem;
  border-radius: 0.75rem;
  margin: 1rem 0;
  border-left-width: 4px;
  background-color: rgba(30, 41, 59, 0.8);
}
.notice.ok {
  border-color: var(--accent);
  background-color: rgba(52, 211, 153, 0.1);
}
.notice.warn {
  border-color: var(--warn);
  background-color: rgba(245, 159, 11, 0.1);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
}

.table-wrap > .table {
  margin-top: 0;
}
.table th, .table td {
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
}
.table th {
  background: rgba(255, 255, 255, .05);
  font-weight: 600;
  color: var(--text-main);
}
.table tr:last-child td {
  border-bottom: none;
}

details.details-box {
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  margin-top: 1rem;
  transition: background-color 0.2s ease;
}
details.details-box[open] {
  background-color: rgba(255, 255, 255, 0.03);
}
details.details-box summary {
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.details-content {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid var(--border-color);
}
.details-content p { margin-top: 0.5rem; }

/* Flowchart Styles */
.flowchart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
@media (min-width: 768px) {
    .flowchart-container {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 0;
    }
}
.flow-step {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (min-width: 768px) {
    .flow-step { width: auto; flex: 1; }
}
.flow-step span { font-weight: 700; }
.flow-step small { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.flow-arrow {
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.flow-step.warn {
    background-color: rgba(245, 159, 11, 0.1);
    border-color: rgba(245, 159, 11, 0.4);
}
.flow-step.ok {
    background-color: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.4);
}

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

  .kpi {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .wrap {
    padding: 1rem 0.78rem 1.5rem;
  }

  main h1 {
    font-size: clamp(1.65rem, 8.4vw, 2.15rem);
    line-height: 1.18;
  }

  main h2 {
    margin-top: 1.45rem;
    font-size: clamp(1.13rem, 5.5vw, 1.36rem);
  }

  main h3 {
    margin-top: 1.15rem;
    font-size: 1.02rem;
  }

  .hero {
    text-align: left;
    padding: 0.8rem 0.15rem;
  }

  .hero p {
    margin-top: 0.72rem;
    max-width: none;
    font-size: 1rem;
  }

  .chips {
    justify-content: flex-start;
    gap: 7px;
  }

  .ctaRow {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .btn,
  .btn.secondary {
    width: 100%;
    min-height: 46px;
  }

  .card {
    margin-top: 0.95rem;
    padding: 0.95rem;
    border-radius: 14px;
  }

  .card:hover {
    transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    border-color: var(--border-color);
  }

  .table {
    min-width: 620px;
    font-size: 0.82rem;
  }

  .table th,
  .table td {
    padding: 0.6rem 0.68rem;
  }

  .notice {
    margin: 0.8rem 0;
    padding: 0.8rem;
  }

  .sitemap-panel {
    padding: 12px;
  }

  .sitemap-card {
    width: min(980px, 96vw);
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .ap-header-shell {
    padding: 8px 10px;
    gap: 10px;
  }

  .ap-brand {
    gap: 8px;
  }

  .ap-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .ap-brand-mark img {
    width: 18px;
    height: 18px;
  }

  .ap-brand-text strong {
    font-size: 0.9rem;
  }

  .ap-mobile-btn {
    min-height: 40px;
    min-width: 66px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .pill {
    font-size: 0.72rem;
    padding: 0.22rem 0.56rem;
  }
}
