/* AICS FONT: Naver Barun Gothic / NanumBarunGothic preferred */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --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, #22c55e);
  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); }
.docs-layout { margin-top: 22px; display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 18px; }
.doc-list-panel, .doc-view-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.doc-list-panel { padding: 18px; height: fit-content; }
.doc-view-panel { padding: 22px; min-width: 0; }
.panel-head h2, .doc-toolbar h2 { margin: 0; font-size: 20px; }
.panel-head p, .doc-toolbar p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.doc-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.doc-btn {
  width: 100%; border: 1px solid var(--line); background: #f8fafc;
  border-radius: 14px; padding: 13px; text-align: left; cursor: pointer;
}
.doc-btn:hover, .doc-btn.active { background: #dbeafe; border-color: #93c5fd; }
.doc-btn b { display: block; font-size: 14px; margin-bottom: 5px; }
.doc-btn span { display: block; color: var(--muted); font-size: 12px; }
.doc-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px;
}
.small-link {
  display: inline-flex; background: #eff6ff; color: #1d4ed8; padding: 9px 12px;
  border-radius: 11px; font-weight: 900; font-size: 13px; white-space: nowrap;
}
.markdown-body { line-height: 1.72; font-size: 15px; color: #1f2937; }
.markdown-body h1 { font-size: 30px; margin: 0 0 18px; letter-spacing: -1px; }
.markdown-body h2 { margin: 28px 0 12px; font-size: 22px; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; }
.markdown-body h3 { margin: 22px 0 10px; font-size: 18px; }
.markdown-body p { margin: 10px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li { margin: 6px 0; }
.markdown-body code {
  background: #f1f5f9; color: #1d4ed8; padding: 2px 5px; border-radius: 5px;
  font-family: Consolas, Monaco, monospace; font-size: 13px;
}
.markdown-body pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 14px; overflow-x: auto; }
.markdown-body pre code { background: transparent; color: inherit; padding: 0; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: #f8fafc; border-radius: 14px; }
.footer { color: var(--muted); padding: 22px 4px 4px; display: flex; justify-content: space-between; gap: 15px; font-size: 12px; }
@media (max-width: 1000px) {
  .docs-layout { grid-template-columns: 1fr; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .page-shell { display: block; }
}
@media (max-width: 760px) {
  .main { padding: 18px; }
  .hero, .doc-toolbar { flex-direction: column; }
  .hero-actions { width: 100%; }
  .btn { flex: 1; }
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-btn {
  border: 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.small-btn.edit {
  background: #2563eb;
  color: #ffffff;
}

.small-btn.save {
  background: #16a34a;
  color: #ffffff;
}

.small-btn.cancel {
  background: #fee2e2;
  color: #991b1b;
}

.small-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-help {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  padding: 13px 14px;
}

.edit-help b {
  display: block;
  margin-bottom: 5px;
  color: #1e40af;
}

.edit-help span {
  display: block;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.md-editor {
  width: 100%;
  min-height: 620px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  outline: none;
  font-family: Consolas, Monaco, "NanumBarunGothic", "Malgun Gothic", monospace;
  font-size: 14px;
  line-height: 1.65;
  color: #0f172a;
  background: #ffffff;
}

.md-editor:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

@media (max-width: 760px) {
  .doc-actions {
    justify-content: flex-start;
  }

  .small-btn,
  .small-link {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .md-editor {
    min-height: 420px;
  }
}

/* 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;
}


