/* AICS FONT: Naver Barun Gothic / NanumBarunGothic preferred */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --orange: #f97316;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "NanumBarunGothic", "Nanum Barun Gothic", "Naver Barun Gothic", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 270px;
  background: #101827;
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
}

.brand-sub {
  margin-top: 4px;
  color: #a9b4c7;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav a {
  padding: 12px 13px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.side-box {
  margin-top: 28px;
  padding: 15px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: #dbeafe;
}

.side-box b {
  color: #fff;
  font-size: 13px;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px;
}

.hero {
  background: linear-gradient(135deg, #1d4ed8, #0f172a);
  color: #fff;
  border-radius: 26px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  font-size: 13px;
  color: #bfdbfe;
  font-weight: 900;
}

.hero h1 {
  margin: 9px 0 12px;
  font-size: 32px;
  letter-spacing: -1px;
}

.hero p {
  margin: 0;
  max-width: 820px;
  color: #dbeafe;
  line-height: 1.65;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
}

.btn {
  border: 0;
  background: #fff;
  color: #1d4ed8;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.summary-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--blue);
}

.summary-card.good {
  border-top-color: var(--green);
}

.summary-card.ready {
  border-top-color: var(--purple);
}

.summary-card.wait {
  border-top-color: var(--orange);
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-card b {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  letter-spacing: -1px;
}

.toolbar {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.search-box {
  min-width: 310px;
}

.search-box input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 13px;
  font-size: 14px;
  outline: none;
}

.search-box input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.panel {
  margin-top: 20px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.api-table {
  width: 100%;
  min-width: 1300px;
  border-collapse: collapse;
  font-size: 13px;
}

.api-table th,
.api-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.api-table th {
  background: #f8fafc;
  color: #334155;
  white-space: nowrap;
}

.api-table td {
  line-height: 1.45;
}

.url-cell {
  font-family: Consolas, Monaco, monospace;
  color: #1d4ed8;
  font-size: 12px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.ready {
  background: #dbeafe;
  color: #1e40af;
}

.badge.wait {
  background: #ffedd5;
  color: #9a3412;
}

.badge.hold {
  background: #fee2e2;
  color: #991b1b;
}

.badge.read {
  background: #f1f5f9;
  color: #334155;
}

.badge.write {
  background: #fee2e2;
  color: #991b1b;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px !important;
}

.guide-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.guide-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.guide-card.danger {
  border-top: 5px solid var(--red);
}

.guide-card h3 {
  margin: 0 0 9px;
  font-size: 16px;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.footer {
  color: var(--muted);
  padding: 22px 4px 4px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .summary-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .search-box {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 860px) {
  .page-shell {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }

  .btn {
    flex: 1;
    text-align: center;
  }

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

.explain-panel {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.explain-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.explain-card b {
  display: block;
  font-size: 16px;
  margin-bottom: 9px;
}

.explain-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.summary-card.aics-write {
  border-top-color: #0ea5e9;
}

.summary-card.danger {
  border-top-color: var(--red);
}

.api-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.api-detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 20px;
}

.api-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.api-group {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.api-detail-card h3 {
  margin: 6px 0 7px;
  font-size: 21px;
  letter-spacing: -0.5px;
}

.api-url {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.badge.aics-write {
  background: #e0f2fe;
  color: #075985;
}

.beginner-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 15px;
}

.beginner-box b {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.beginner-box span {
  color: #334155;
  line-height: 1.6;
  font-size: 14px;
}

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

.detail-block {
  background: #fbfdff;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 13px;
}

.detail-block b {
  display: block;
  color: #334155;
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-block span {
  display: block;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.example-box {
  margin-top: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 13px;
}

.example-box b {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #bfdbfe;
}

.example-box code {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

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

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

  .api-detail-head {
    flex-direction: column;
  }

  .badge-row {
    justify-content: flex-start;
  }
}

.panel-help {
  color: var(--muted);
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}

.api-table.compact {
  min-width: 1200px;
}

.api-table.compact th,
.api-table.compact td {
  padding: 10px 10px;
  vertical-align: middle;
}

.api-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.api-row:hover {
  background: #eff6ff;
}

.api-row.selected {
  background: #dbeafe;
}

.api-row.selected td:first-child {
  border-left: 5px solid #2563eb;
}

.api-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: #0f172a;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.api-name-btn:hover {
  color: #1d4ed8;
}

.detail-panel {
  margin-top: 16px;
}

.api-detail-card.single {
  border: 1px solid #d8e4f2;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

@media (max-width: 860px) {
  .panel-help {
    white-space: normal;
    border-radius: 12px;
  }
}

/* AICS dual home links */
.aics-dual-home {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 52px;
  margin: 0 0 22px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
}

.aics-home-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: #ffffff !important;
  line-height: 1.1;
  border-right: 1px solid rgba(255,255,255,0.18);
  background: #1d4ed8;
}

.aics-home-btn:last-child {
  border-right: 0;
}

.aics-home-btn:hover {
  color: #ffffff !important;
  background: #2563eb;
}

.aics-home-new {
  background: #0f766e;
}

.aics-home-new:hover {
  background: #0d9488;
}

.aics-home-main {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.aics-home-sub {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.92;
}


