/* ===== Fonts ===== */
@font-face {
  font-family: 'Josefin Sans';
  src: url('/fonts/JosefinSans-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Josefin Sans';
  src: url('/fonts/JosefinSans-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'NewZen';
  src: url('/fonts/NewZen-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'NewZen';
  src: url('/fonts/NewZen-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'NewZen';
  src: url('/fonts/NewZen-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.link-marker{
  background: var(--success);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  display: inline-block;
}

/* ===== Root & Variables ===== */
:root {
  --primary: #0073c0;
  --primary-dark: #1565c0;
  --primary-light: #42a5f5;
  --navy: #0c2f5d;
  --navy-mid: #1a305e;
  --secondary: #424242;
  --border: #e5e7eb;
  --bg-light: #f5f7fa;
  --bg-card: #fff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --success: #2e7d32;
  --shadow-small: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
  --topbar-h: 3.5rem;
  --radius: 0.5rem;
}

/* ===== Reset & Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-padding-top: 100px; min-height: 100vh;}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; font-family: 'NewZen', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h3 { font-size: 1.1rem; margin-bottom: 0.4rem; margin-top: 1.25rem; }
h4 { font-size: 0.95rem; margin-bottom: 0.4rem; margin-top: 1rem; }
p { margin: 0.5rem 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Topbar ===== */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  padding-top: env(safe-area-inset-top, 0px);
}
#topbar-inner {
  height: var(--topbar-h);
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}
#topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}
#topbar-logo-text {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
}
#topbar-logo-text span:first-child { color: #90CAF9; }
#topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
#topbar-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.18);
  border-radius: 2rem;
  padding: 0.35rem 0.85rem;
  transition: background 0.15s;
}
#topbar-search-wrap:focus-within { background: rgba(255,255,255,0.28); }
#topbar-search-icon { color: rgba(255,255,255,0.7); flex-shrink: 0; }
#search-input {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.875rem;
  outline: none;
  width: 9rem;
  -webkit-appearance: none;
}
#search-input::placeholder { color: rgba(255,255,255,0.55); }
#search-input::-webkit-search-cancel-button { filter: brightness(10); opacity: 0.55; cursor: pointer; }
#sync-status { font-size: 0.7rem; color: rgba(255,255,255,0.65); }
#topbar-menu-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
}
#topbar-menu-btn:hover { background: rgba(255,255,255,0.22); }

/* ===== Page Hero ===== */
#page-hero {
  background: var(--navy);
  padding: 1.25rem 1rem 1.5rem;
}
#page-hero[hidden] { display: none; }
#page-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
#hero-category {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-light);
  display: block;
}
#hero-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

/* ===== Content Wrap ===== */
#content-wrap {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-light);
  flex:1;
  display: flex;
  width: 100%;
}
#app {
  padding: 1.5rem 1.25rem;
  min-width: 0;
  background: var(--bg-card);
}
#app:has(+ #side-panel:not([hidden])) {
  border-right: 1px solid var(--border);
}
#app:has(+ #side-panel[hidden]) {
  width: 100%;
}
#side-panel {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}
#side-panel[hidden] { display: none; }

/* ===== Breadcrumbs ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-size: 0.8rem; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }

/* ===== Context Strip – Tab-Komponente ===== */
.ctx-strip {
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.ctx-tab-strip {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}
.ctx-tab-btn {
  padding: 0.35rem 0.875rem;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.ctx-tab-btn:last-child { border-right: none; }
.ctx-tab-btn:hover { color: var(--primary); background: rgba(0,115,192,0.05); }
.ctx-tab-btn.active {
  color: var(--primary);
  background: var(--bg-card);
  border-bottom: 2px solid var(--primary);
  margin-bottom: -1px;
}
.ctx-tab-body { padding: 0.5rem 0.875rem; }
.ctx-tab-content { display: none; font-size: 0.82rem; color: var(--text-primary); line-height: 1.4; }
.ctx-tab-content.active { display: block; }

/* ===== Page Title ===== */
.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
.page-id { color: var(--primary); }
.page-title-desc { color: var(--primary); font-weight: 800; }
.page-hoechstwert {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: -0.75rem 0 1.25rem 0;
}

/* ===== Entry Rows (Navigation) ===== */
.entry-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.entry-list li { display: block; }
a.entry-row, button.entry-row, div.entry-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.875rem 0.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  font-size: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: rgba(25, 118, 210, 0.08);
}
.entry-list > li:first-child > a.entry-row,
.entry-list > li:first-child > button.entry-row,
.entry-list > li:first-child > div.entry-row,
.item-list > li:first-child > a.entry-row,
.item-list > li:first-child > button.entry-row,
.item-list > li:first-child > div.entry-row {
  border-top: 1px solid var(--border);
}
a.entry-row:hover, button.entry-row:hover, div.entry-row:hover {
  background: rgba(25, 118, 210, 0.04);
  text-decoration: none;
}
a.entry-row.selected, button.entry-row.selected, div.entry-row.selected {
  background: rgba(25, 118, 210, 0.08);
}
.entry-text a {
  color: var(--primary);
  text-decoration: none;
}
.entry-text a:hover { text-decoration: underline; }
a.entry-arrow {
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}
.entry-id {
  font-weight: 700;
  color: var(--primary);
  min-width: 2.75rem;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.entry-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.entry-arrow {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ===== Info Button ===== */
.info-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 2rem;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1.25rem;
}
.info-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
@media (min-width: 900px) {
  /* On desktop allgemein is auto-shown in the side panel — hide the trigger button */
  .info-btn { display: none; }
}

/* ===== Side Panel ===== */
.side-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 0.75rem 0;
}
.side-header-row .side-label { margin: 0; }
.side-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem 0;
  display: block;
}
.side-entry-bez { font-weight: 400; }
.side-parent-note { font-size: 0.75rem; color: var(--text-secondary, #888); margin: -0.25rem 0 0.5rem; }
.panel-fav-btn { padding: 0.15rem; }
.side-placeholder {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  padding: 2.5rem 0.5rem;
  line-height: 1.5;
}
.side-placeholder svg { margin-bottom: 0.75rem; display: block; margin-left: auto; margin-right: auto; opacity: 0.35; }
.side-entry-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}
.side-allgemein { font-size: 0.875rem; line-height: 1.6; color: var(--text-primary); }
.side-allgemein h1, .side-allgemein h2, .side-allgemein h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.75rem 0 0.4rem;
}
/* Side panel: Allgemeine Informationen Header */
.side-allgemein-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.side-allgemein-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  flex-shrink: 0;
}
.side-allgemein-body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-primary);
}
.side-allgemein-body h1, .side-allgemein-body h2, .side-allgemein-body h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.75rem 0 0.4rem;
}

/* ===== Fee Widget (dark navy design) ===== */
.fee-widget {
  background: var(--navy);
  border-radius: var(--radius);
  margin: 0.75rem 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding: 20px;
  gap: 1.5rem;
  max-width: 500px;
}
.fee-display{
  background: var(--primary-dark);
  background-image: url('./../../images/pvs_pfeile.svg');
  background-repeat: no-repeat;
  background-size: 60% 60%;
  background-position: center;

  flex: 1;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  border-radius: var(--radius);
}
.fee-tab-strip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.fee-tab {
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 2rem;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.3;
}
.fee-tab:hover { border-color: rgba(255,255,255,0.5); color: rgba(255,255,255,0.9); }
.fee-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.fee-panel {
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
}
.fee-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: 'NewZen', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
}
.fee-value small { font-size: 1.1rem; font-weight: 500; opacity: 0.65; margin-left: 0.15rem; }
.fee-label { font-size: 0.78rem; color: rgba(255,255,255,0.5); margin-top: 0.15rem; }

/* ===== Field Display ===== */
.feld {
  background: var(--bg-light);
  border-left: 3px solid var(--primary);
  padding: 0.875rem 1rem;
  margin: 0.875rem 0;
  border-radius: 0.25rem;
}
.feld .lbl {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.3rem;
}
.feld .val { word-break: break-word; font-size: 0.9rem; }

/* ===== Allgemein Block ===== */
.allgemein {
  /*background: #fffde7;
  border-left: 3px solid #fbc02d;
  padding: 0.75rem 1rem;
  margin: 0.875rem 0;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.6;*/
}

/* ===== Back Link (in-content) ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.back-link::before { content: "‹"; font-size: 1.1rem; font-weight: 700; margin-right: 0.1rem; }

/* ===== Legacy .back-btn (kept for compatibility) ===== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1rem;
  text-decoration: none;
}
.back-btn:hover { background: var(--bg-light); }
.back-btn::before { content: "←"; font-weight: bold; margin-right: 0.2rem; }

/* ===== Loading Spinner ===== */
.loader-wrap { text-align: center; padding: 4rem 1rem; color: var(--text-secondary); }
.spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Footer ===== */
#app-footer {
  width: 100%;
}

/* Produkt-Bereich (navy) */
#footer-products {
  background: var(--navy);
}
#footer-products-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 2rem;
}
.footer-product {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-product-logo {
  width: 100%;
  max-width: 150px;
  overflow: hidden;
  background: #0c2f5d
}
.footer-product-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.footer-product-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
}
.footer-product-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1.5rem;
  border-radius: 2rem;
  text-decoration: none;
  cursor: pointer;
}
.footer-product-btn-disabled {
  background: rgba(255,255,255,0.15);
  cursor: default;
}

/* Info-Bereich (weiß) */
#footer-info {
  background: #fff;
  border-top: 1px solid var(--border);
}
#footer-info-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
#footer-legal {
  max-width: 1200px;
  margin: 0 auto;
}
#footer-logo {
  display: flex;
  align-items: flex-start;
}
#footer-logo svg {
  max-width: 200px;
  height: auto;
}
#footer-address {
  font-style: normal;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
#footer-social {
  display: flex;
  align-items: center;
}
#footer-social a {
  color: var(--text-secondary);
  display: flex;
  transition: color 0.15s;
}
#footer-social a:hover { color: var(--primary); }
#footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 1rem 2rem;
}
#footer-legal a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}
#footer-legal a:hover { text-decoration: underline; }

@media (max-width: 599px) {
  #footer-products-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2rem 1.25rem;
  }
  #footer-info-inner { padding: 1.5rem 1.25rem 1.25rem; }
  #footer-legal { padding: 0.75rem 1.25rem; }
}

/* ===== Home Page ===== */
body.is-home #content-wrap {
  max-width: none;
  background: transparent;
  box-shadow: none;
}
body.is-home #app {
  padding: 0 !important;
  min-width: 0;
}
.home-hero {
  background: var(--primary);
  padding: 4.5rem 2rem 5.5rem;
}
.home-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.home-hero h1 {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  color: #fff;
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.home-hero-sub {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  font-family: 'Nunito', sans-serif;
  margin: 0;
}
.home-products {
  background: var(--navy);
  padding: 4rem 2rem 5rem;
}
.home-products-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}
.home-intro {
  text-align: center;
  max-width: 680px;
}
.home-intro h2 {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.home-intro p {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 0;
}
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}
@media (max-width: 599px) {
  .home-hero { padding: 3rem 1.25rem 4rem; }
  .home-products { padding: 3rem 1.25rem 4rem; }
  .home-cards { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  background: var(--secondary);
  color: #fff;
  padding: 0.875rem 1.15rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  z-index: 9999;
  transition: transform 0.3s ease;
  width: min(420px, calc(100vw - 1.5rem));
  box-sizing: border-box;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  pointer-events: none;
}
.toast.visible { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-green { background: var(--success); }
.toast-msg { flex: 1 1 60%; min-width: 0; }
.toast-action {
  background: #fff; color: var(--secondary); border: none; border-radius: 0.4rem;
  padding: 0.6rem 1rem; cursor: pointer; font-size: 0.9rem; font-weight: 600;
  white-space: nowrap; min-height: 40px;
}
.toast-action:hover { background: #f0f0f0; }
.toast-close {
  background: transparent; border: none; color: #ddd;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  padding: 0.25rem 0.5rem; min-width: 32px; min-height: 32px;
}
.toast-close:hover { color: #fff; }
@media (max-width: 420px) {
  .toast { gap: 0.5rem 0.6rem; padding: 0.75rem 0.85rem; }
  .toast-msg { flex-basis: 100%; order: 1; }
  .toast-action { order: 2; flex: 1 1 auto; }
  .toast-close { order: 3; }
}

/* ===== Message ===== */
.msg {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; color: var(--text-secondary);
}
.msg h2 { color: var(--text-primary); margin-top: 0; }

/* ===== Nav Overlay ===== */
#nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--navy);
  display: flex;
  flex-direction: column;
}
#nav-overlay[hidden] { display: none; }
#nav-overlay-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.75rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
#nav-close {
  align-self: flex-end;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  margin-bottom: 2.5rem;
  transition: background 0.15s;
}
#nav-close:hover { background: rgba(255,255,255,0.2); }
#nav-menu { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.nav-item {
  font-size: 1.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  padding: 0.45rem 0;
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}
a.nav-item:hover { color: #fff; text-decoration: none; }
.nav-item-soon { color: rgba(255,255,255,0.3); cursor: default; }
.nav-item-soon small { font-size: 0.65rem; font-weight: 400; margin-left: 0.6rem; opacity: 0.8; vertical-align: middle; }
#nav-footer { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
#nav-footer-meta { font-size: 0.75rem; color: rgba(255,255,255,0.3); margin-bottom: 0.75rem; }
#nav-footer-links { display: flex; gap: 1rem; }
#nav-footer-links a { font-size: 0.8rem; color: rgba(255,255,255,0.35); }
#nav-footer-links a:hover { color: rgba(255,255,255,0.65); }

/* ===== Modal ===== */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000; display: flex; align-items: flex-start; justify-content: center;
  padding: 2rem 1rem; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); cursor: pointer; z-index: -1;
}
.modal-content {
  background: var(--bg-card); border-radius: var(--radius); max-width: 600px; width: 100%;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); padding: 1.1rem 1.25rem;
  background: var(--bg-light); border-radius: var(--radius) var(--radius) 0 0;
}
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close {
  background: transparent; border: none; font-size: 1.4rem; color: var(--text-secondary);
  cursor: pointer; padding: 0; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 1.25rem; color: var(--text-primary); line-height: 1.6; font-size: 0.9rem; }

/* ===== Search highlight ===== */
mark.search-hl {
  background: var(--primary-light);
  color: var(--bg-light);
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* ===== Utility ===== */
.muted { color: var(--text-secondary); font-size: 0.9em; margin-left: 0.35rem; }
.tag {
  font-size: 0.75em; padding: 0.2rem 0.45rem; background: var(--bg-light);
  border: 1px solid var(--border); border-radius: 0.3rem; margin-left: 0.35rem; color: var(--text-secondary);
}
/* Legacy section-header (search results, etc.) */
.section-header { margin-bottom: 1.5rem; }
.section-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.3rem; line-height: 1.4; }
/* Legacy item cards (search results fallback) */
.item-list { list-style: none; padding: 0; margin: 0.75rem 0; }
.item-list li { display: block; }
.item-list-sub { list-style: none; padding: 0; margin: 0; }
.item-list-sub .entry-row {
  padding-left: 2rem;
  font-size: 0.875rem;
  background: var(--bg-secondary, #f5f7fa);
  border-top: none;
}
.item-list-sub .entry-row:hover { background: rgba(25, 118, 210, 0.05); }
.item-list-sub .entry-id { font-size: 0.82rem; min-width: 2.25rem; }
.item-list-sub .entry-text { font-size: 0.82rem; }

/* ── Tree: Nummernbereich hierarchisch ──────────────────────────────────── */
.tree-kapitel {
  margin: 0.75rem 0 1.25rem;
  border-left: 3px solid var(--primary, #1976d2);
  padding-left: 0;
}
.tree-kapitel-header {
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: rgba(25, 118, 210, 0.07);
  font-weight: 600;
}
.tree-abschnitt {
  margin-left: 1rem;
  border-left: 2px solid var(--border, #dde1e7);
}
.tree-abschnitt-header {
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.35rem 0.75rem;
  background: var(--bg-secondary, #f5f7fa);
  font-weight: 500;
}
.tree-entries { margin-left: 1rem; }
.tree-link { font-weight: 700; color: var(--primary, #1976d2); text-decoration: none; }
.tree-link:hover { text-decoration: underline; }
.tree-bez { color: var(--text-secondary, #555); font-size: 0.875rem; font-weight: 400; }
.parent-range-note { font-size: 0.8rem; color: var(--text-secondary, #666); margin: 0.25rem 0 0.5rem; }
.parent-range-note a { color: var(--primary, #1976d2); }

/* ── Favoriten-Stern ──────────────────────────────────────────────────────── */
.section-header-row { display: flex; align-items: center; gap: 0.5rem; }
.section-header-row h2 { margin: 0; }
.fav-btn {
  background: none; border: none; cursor: pointer; padding: 0.2rem;
  color: var(--text-secondary, #aaa); line-height: 0; border-radius: 4px;
  transition: color 0.15s, transform 0.1s; flex-shrink: 0;
}
.fav-btn svg { fill: none; stroke: currentColor; display: block; }
.fav-btn:hover { color: var(--primary-light); transform: scale(1.15); }
.fav-btn.active { color: var(--primary-light); }
.fav-btn.active svg { fill: var(--primary-light); }

/* ── Nav: Favoriten-Link + Badge ──────────────────────────────────────────── */
.nav-divider { border: none; border-top: 1px solid var(--border, #e0e0e0); margin: 0.5rem 0; }
.nav-item-fav { display: flex; align-items: center; gap: 0.4rem; }
.nav-item-fav svg { fill: none; stroke: currentColor; flex-shrink: 0; }

/* Install-Button im Nav-Menü (als <button>, sieht aus wie die anderen Einträge) */
#nav-install-btn {
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit;
  display: flex; align-items: center; gap: 0.4rem;
}
#nav-install-btn svg { flex-shrink: 0; }
#nav-install-btn:hover { color: #fff; }
.nav-badge {
  display: inline-block; min-width: 1.2rem; height: 1.2rem; line-height: 1.2rem;
  padding: 0 0.3rem; border-radius: 0.6rem; font-size: 0.72rem; font-weight: 700;
  background: var(--primary, #1976d2); color: #fff; text-align: center;
}
.nav-badge:empty { display: none; }

/* ── Nav: Sync-Code ───────────────────────────────────────────────────────── */
#nav-sync-info {
  font-size: 0.75rem; color: var(--text-secondary, #777);
  padding: 0.4rem 0; display: flex; align-items: center; gap: 0.4rem;
}
#nav-sync-code { font-family: monospace; letter-spacing: 0.05em; }
#nav-sync-claim,
#nav-sync-decouple {
  background: none; border: 1px solid var(--border, #ccc); border-radius: 4px;
  padding: 0.25rem; font-size: 0.72rem; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 0;
}
#nav-sync-claim svg,
#nav-sync-decouple svg { display: block; }
#nav-sync-claim:hover,
#nav-sync-decouple:hover { background: var(--bg-secondary, #f5f5f5); }

/* ── Modal-Overlay (generisch, für Sync-Code & Decouple) ─────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.modal-overlay .modal-box {
  background: var(--bg-card, #fff); border-radius: var(--radius, 8px);
  padding: 1.5rem;
  width: min(380px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  color: var(--text, #222);
}
.modal-overlay h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.modal-overlay p  { margin: 0.4rem 0; font-size: 0.9rem; line-height: 1.45; }
#sync-code-input {
  width: 100%; margin: 0.75rem 0; padding: 0.5rem 0.75rem;
  font-size: 1rem; font-family: monospace; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid var(--border, #ccc); border-radius: 6px; box-sizing: border-box;
}
.modal-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem;
}
.modal-actions button {
  flex: 1 1 120px; min-height: 44px; padding: 0.65rem 0.85rem;
  border-radius: 6px; border: 1px solid var(--border, #ccc);
  cursor: pointer; font-size: 0.95rem; font-family: inherit;
  background: var(--bg-card, #fff); color: var(--text, #222);
}
.modal-actions button:first-child {
  background: var(--primary, #1976d2); color: #fff; border-color: var(--primary, #1976d2);
  font-weight: 600;
}
@media (max-width: 380px) {
  .modal-overlay .modal-box { padding: 1.1rem; }
  .modal-actions button { flex-basis: 100%; }
}

/* ── Favoriten-Seite ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--text-secondary, #888); padding: 2rem 1rem; line-height: 1.6; }

.item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  margin: 0.5rem 0; padding: 0.875rem 1rem; transition: border-color 0.15s;
}
.item:hover { border-color: var(--primary); }
.item a.link { display: block; font-weight: 600; color: var(--primary); text-decoration: none; font-size: 0.95rem; }
.item a.link:hover { text-decoration: underline; }
.list-title { font-weight: 700; color: var(--primary); margin-right: 0.5rem; }
.list-desc { color: var(--text-secondary); font-size: 0.875rem; }
.nolink { text-decoration: none; color: inherit; cursor: default; }

/* ===== Desktop Split View ===== */
@media (min-width: 900px) {
  #content-wrap { display: flex; width: 100%; align-items: stretch; }
  #app { flex: 2; min-width: 0; padding: 2rem 2.5rem; }
  #side-panel:not([hidden]) {
    display: block;
    width: 340px;
    flex-shrink: 0;
    flex: 1;
    position: sticky;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    max-height: calc(100vh - var(--topbar-h) - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    padding: 2rem 1.5rem;
    border-top: none;
    /*border-left: 1px solid var(--border);*/
  }
  #topbar-inner { padding: 0 2rem; }
  #page-hero-inner { padding: 0 1.5rem; }
  #hero-title { font-size: 1.6rem; }
  #search-input { width: 13rem; }
  .page-title { font-size: 2.1rem; }
  .entry-id { min-width: 3.25rem; font-size: 0.95rem; }
  .entry-text { font-size: 0.9rem; }
}

/* ===== Mobile ===== */
@media (max-width: 899px) {
  #side-panel { display: none !important; }
  #search-input { width: 7.5rem; }
}

/* ===== Landscape sperren ===== */
@media (orientation: landscape) and (max-width: 899px) {
  body::before {
    content: 'Bitte drehe dein Gerät in den Hochformatmodus.';
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: var(--navy);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
  }
  body > * { visibility: hidden; }
}

/* ===== Print ===== */
@media print {
  #topbar, #page-hero, #nav-overlay, .toast, .back-btn, .back-link, #sync-status { display: none !important; }
  body { background: #fff; }
}
