:root {
  --sidebar-w: 260px;
  --accent: #1565C0;
  --accent-light: #E3F0FF;
  --accent-mid: #1976D2;
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --border: #DDE4EE;
  --text: #1A2332;
  --muted: #5A6A7E;
  --success-bg: #E8F5E9;
  --success-border: #81C784;
  --success-text: #2E7D32;
  --warn-bg: #FFF8E1;
  --warn-border: #FFD54F;
  --warn-text: #7B5800;
  --info-bg: #E3F0FF;
  --info-border: #90CAF9;
  --info-text: #1565C0;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}

/* ── SIDEBAR ── */
#sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.sidebar-logo .brand span {
  color: #37474F;
}

.sidebar-logo .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  padding: 6px 16px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 0;
  font-size: 13.5px;
  color: var(--muted);
  border-left: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
  border-left-color: var(--accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

/* ── APP-WRAPPER (Sidebar + Main nebeneinander) ── */
.handbook-app-wrapper {
  display: flex;
  align-items: flex-start;
}

/* ── MAIN ── */
#main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 14px;
  color: var(--muted);
}

.topbar-title strong {
  color: var(--text);
  font-weight: 500;
}

.version-badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* ── PAGES ── */
.page {
  display: none;
  padding: 40px;
  max-width: 860px;
}

.page.active {
  display: block;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.section-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.section-header p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── SCREENSHOT BLOCK ── */
.screenshot-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.screenshot-header {
  background: #F0F3F7;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r {
  background: #FF5F57;
}

.dot-y {
  background: #FEBC2E;
}

.dot-g {
  background: #28C840;
}

.screenshot-label {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.screenshot-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #FAFBFC;
}

.screenshot-img img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.screenshot-caption {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-style: italic;
}

/* ── FIELD TABLE ── */
.field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.field-table th {
  text-align: left;
  padding: 9px 14px;
  background: var(--bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
}

.field-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.field-table tr:last-child td {
  border-bottom: none;
}

.field-table tr:hover td {
  background: var(--bg);
}

.field-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
}

.required-badge {
  display: inline-block;
  background: #FFEBEE;
  color: #C62828;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

.optional-badge {
  display: inline-block;
  background: #F3F4F6;
  color: var(--muted);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── CALLOUT BOXES ── */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
}

.callout-icon {
  font-size: 18px;
  line-height: 1.4;
  flex-shrink: 0;
}

.callout.tip {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.callout.warning {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
}

.callout.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
}

/* ── BUTTONS REFERENCE ── */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.btn-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
}

.btn-ref.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-ref.danger {
  background: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2;
}

/* ── STEPS ── */
.steps {
  list-style: none;
  margin: 16px 0;
}

.steps li {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.steps li p {
  font-size: 14px;
  padding-top: 3px;
}

/* ── HEADINGS ── */
h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--text);
}

h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

p {
  margin-bottom: 12px;
  color: var(--text);
}

code {
  background: #EEF2F7;
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Consolas', monospace;
  font-size: 13px;
}

/* ── WELCOME CARDS ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  border-color: var(--accent-mid);
  box-shadow: 0 2px 12px rgba(21, 101, 192, 0.1);
}

.feature-card .fc-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.feature-card .fc-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* annotation list */
.annot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.annot-list li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: flex-start;
}

.annot-list li:last-child {
  border-bottom: none;
}

.annot-num {
  min-width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}