:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --border: #e5e5e5;
  --accent: #1a56db;
  --accent-soft: #e8f0fe;
  --tag-bg: #f0f4ff;
  --tag-text: #1a56db;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --sidebar-w: 280px;
  --header-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
}
.menu-toggle:hover { background: var(--accent-soft); }
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.brand {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.brand a { color: var(--text); }
.brand a:hover { text-decoration: none; color: var(--accent); }

.search-wrap {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}
#search {
  width: 100%;
  max-width: 320px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
#search:focus {
  border-color: var(--accent);
  background: var(--surface);
}

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 8px;
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

.section { margin-bottom: 6px; }
.section > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.section > summary::-webkit-details-marker { display: none; }
.section > summary:hover { background: var(--bg); }
.section > summary::after {
  content: "▸";
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s;
}
.section[open] > summary::after { transform: rotate(90deg); }

.section ul {
  list-style: none;
  padding: 4px 0 8px 8px;
  margin: 0;
}
.section li { margin: 2px 0; }
.session-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.session-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}
.session-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  border-color: var(--accent);
}
.session-link .org {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.session-link.active .org { color: var(--accent); opacity: 0.8; }
.session-link.disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.session-link.disabled:hover { background: var(--bg); }
.badge-soon {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  background: #eee;
  color: #888;
  border-radius: 999px;
  vertical-align: middle;
}

.backdrop {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 19;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  padding: 32px 24px 80px;
  outline: none;
}
.welcome {
  max-width: 760px;
  margin: 80px auto;
  text-align: center;
  color: var(--muted);
}

/* Session article */
.session {
  max-width: 760px;
  margin: 0 auto;
}
.session-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 28px;
}
.track-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 999px;
  margin: 0 0 12px;
}
.session-header h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 8px;
  word-break: keep-all;
}
.presenter {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px;
}
.download-btn {
  display: inline-block;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
}
.download-btn:hover {
  background: #1546b8;
  color: #fff;
  text-decoration: none;
}
.download-btn.disabled {
  background: #c8c8c8;
  color: #fff;
  cursor: not-allowed;
}
.download-btn.disabled:hover {
  background: #c8c8c8;
}

.session-summary {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
}
.session-summary h2 {
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
}
.session-summary p { margin: 0; font-size: 15px; }
.session-summary ul { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.session-summary li { margin: 4px 0; }

.session-body h2 {
  font-size: 20px;
  margin: 36px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.session-body h3 {
  font-size: 17px;
  margin: 24px 0 10px;
}
.session-body p {
  margin: 12px 0;
  word-break: keep-all;
}
.session-body ul, .session-body ol {
  padding-left: 22px;
  margin: 12px 0;
}
.session-body li { margin: 6px 0; word-break: keep-all; }

.session-body figure {
  margin: 18px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.session-body figure img {
  display: block;
  width: 100%;
  height: auto;
}
.session-body figcaption {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.callout {
  border-left: 4px solid var(--accent);
  background: #f5f8ff;
  padding: 12px 16px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}
.callout p { margin: 0; }

/* Notice (coming soon) */
.notice {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  padding: 32px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.notice h2 { color: var(--text); margin: 0 0 8px; }

/* Mobile */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .brand { font-size: 14px; }
  #search { max-width: none; height: 34px; font-size: 13px; }
  .topbar { gap: 8px; padding: 0 10px; }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 84vw;
    max-width: 320px;
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 25;
    border-right: 1px solid var(--border);
    box-shadow: 6px 0 18px rgba(0,0,0,0.08);
  }
  .sidebar.open { transform: translateX(0); }
  .backdrop.show { display: block; }

  .content { padding: 20px 16px 60px; }
  .session-header h1 { font-size: 22px; }
  .session-body h2 { font-size: 18px; }
  .session-body h3 { font-size: 16px; }
  body { font-size: 15.5px; }
}

@media (max-width: 480px) {
  .search-wrap { display: none; }
}
