
:root {
    --bg: #f5f7fb;
    --bg-strong: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --text: #17202d;
    --muted: #5f6d7c;
    --border: #d9e1ea;
    --accent: #1f5eff;
    --accent-soft: #eaf1ff;
    --shadow: 0 14px 34px rgba(18,31,53,0.08);
    --radius: 18px;
    --max-width: 1180px;
    --article-width: 760px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.01em;
}
.brand img {
    width: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(18,31,53,0.12);
}
.page-shell {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px 56px;
}
.hero-card, .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: 32px;
    margin-bottom: 20px;
}
.eyebrow {
    margin: 0 0 10px;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--accent);
    text-transform: uppercase;
}
.hero-card h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.1;
}
.lead {
    font-size: 1.14rem;
    color: var(--text);
    max-width: 70ch;
}
.muted { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}
.button:hover { text-decoration: none; opacity: 0.96; }
.button.secondary {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: #cfe0ff;
}
.language-grid, .chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.language-card, .chapter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow);
}
.language-card h2, .chapter-card h2, .chapter-card h3 { margin-top: 0; }
.page-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--article-width)) minmax(240px, 1fr);
    gap: 22px;
    align-items: start;
}
.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.94rem;
}
.sidebar {
    position: sticky;
    top: 82px;
}
.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.sidebar h2, .sidebar h3 { margin-top: 0; }
.side-nav {
    display: grid;
    gap: 8px;
}
.side-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
}
.side-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}
.side-nav a:hover {
    background: #f3f7ff;
    text-decoration: none;
}
article h1 { margin-top: 0; margin-bottom: 10px; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; }
article h2 { margin-top: 34px; margin-bottom: 12px; font-size: 1.5rem; line-height: 1.25; }
article h3 { margin-top: 24px; margin-bottom: 8px; font-size: 1.1rem; }
article p { margin: 0 0 14px; }
article ul, article ol { margin: 0 0 18px 0; padding-left: 22px; }
article li { margin: 0 0 8px; }
article strong { color: #111a27; }
article blockquote {
    margin: 18px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 14px 14px 0;
}
.note-callout {
    margin: 18px 0;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 14px 14px 0;
}
.note-callout strong { display: block; margin-bottom: 6px; }
article hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}
.placeholder {
    margin: 18px 0;
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed #bfd1ef;
    background: linear-gradient(180deg, #fbfdff 0%, #f1f6ff 100%);
}
.placeholder .label {
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}
.placeholder .alt {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}
.inline-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.inline-nav a {
    display: inline-flex;
    padding: 10px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}
.inline-nav a:hover { text-decoration: none; }
.footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 36px;
}
.footer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px 22px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; }
.small-note { font-size: 0.94rem; color: var(--muted); }
.chapter-list {
    display: grid;
    gap: 12px;
}
.chapter-list a {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text);
}
.chapter-list a strong {
    display: block;
    margin-bottom: 4px;
}
@media (max-width: 980px) {
    .page-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
}
@media (max-width: 680px) {
    .page-shell { padding-left: 16px; padding-right: 16px; }
    .hero-card, .article-card, .sidebar-card { padding: 22px; }
    .hero-actions, .inline-nav { flex-direction: column; }
    .button, .inline-nav a { width: 100%; justify-content: center; }
    .footer { padding-left: 16px; padding-right: 16px; }
}

/* HDC handbook graphic integration – WS v1.2, bestandswahrend */
.compact-list {
    margin: 0 0 18px 0;
    padding-left: 22px;
}
.handbook-figure,
.infopad-card {
    margin: 18px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    box-shadow: 0 10px 22px rgba(18,31,53,0.055);
}
.handbook-figure img,
.infopad-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(217,225,234,0.85);
    background: #fff;
}
.handbook-figure figcaption,
.infopad-card figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}
.ui-graphic-grid,
.infopad-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.infopad-card {
    margin: 0;
}
.infopad-card figcaption strong,
.infopad-card figcaption span {
    display: block;
}
.infopad-card figcaption strong {
    color: var(--text);
    margin-bottom: 4px;
}
.menu-tree {
    overflow-x: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #111a27;
    color: #f7f9fc;
    line-height: 1.45;
}
.menu-tree code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.95rem;
}
.piece-section {
    margin-top: 34px;
    padding-top: 2px;
}
.piece-facts {
    display: grid;
    grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
    gap: 0;
    margin: 16px 0 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
}
.piece-facts dt,
.piece-facts dd {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.piece-facts dt {
    font-weight: 800;
    color: var(--text);
    background: var(--surface-soft);
}
.piece-facts dd {
    color: var(--muted);
}
.piece-facts dt:last-of-type,
.piece-facts dd:last-of-type {
    border-bottom: 0;
}
.piece-slice-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 10px;
    margin: 16px 0 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.piece-slice {
    min-width: 112px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}
.piece-slice img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #fff;
}
.piece-slice-label {
    margin-top: 8px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text);
}
@media (max-width: 680px) {
    .ui-graphic-grid,
    .infopad-grid {
        grid-template-columns: 1fr;
    }
    .handbook-figure,
    .infopad-card {
        padding: 10px;
    }
    .piece-facts {
        grid-template-columns: 1fr;
    }
    .piece-facts dt {
        border-bottom: 0;
    }
    .piece-facts dd {
        border-bottom: 1px solid var(--border);
    }
    .piece-slice-grid {
        display: flex;
        max-width: 100%;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .piece-slice {
        flex: 0 0 136px;
        min-width: 0;
    }
}

/* HDC v4 – mobile header polish and public handbook refinements */
.label-short { display: none; }
.menu-section-list {
    display: grid;
    gap: 12px;
    margin: 16px 0 20px;
}
.menu-section-list div {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}
.menu-section-list strong {
    display: block;
    color: var(--text);
    margin-bottom: 2px;
}


/* HDC v4.1 overflow guard for mobile handbook cards */
.page-layout,
.page-layout > *,
.article-card,
.sidebar,
.sidebar-card,
.handbook-figure,
.infopad-card,
.piece-slice-grid,
.menu-tree,
.menu-section-list {
    min-width: 0;
    max-width: 100%;
}
.article-card {
    overflow-wrap: break-word;
}



/* HDC v5 – additional handbook diagrams and selection-preview legend */
.figure-sequence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.figure-sequence-grid .handbook-figure {
    margin: 0;
}
.preview-marker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}
.preview-marker-card {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    box-shadow: 0 10px 22px rgba(18,31,53,0.045);
}
.preview-marker-card img {
    display: block;
    width: min(128px, 100%);
    height: auto;
    margin: 0 auto 10px;
    border-radius: 10px;
    border: 1px solid rgba(217,225,234,0.85);
    background: #fff;
}
.preview-marker-card figcaption strong,
.preview-marker-card figcaption span {
    display: block;
}
.preview-marker-card figcaption strong {
    color: var(--text);
    margin-bottom: 3px;
}
.preview-marker-card figcaption span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
}
@media (max-width: 680px) {
    .figure-sequence-grid,
    .preview-marker-grid {
        grid-template-columns: 1fr;
    }
}


/* HDC v6 – full-size graphic links and download list */
.figure-fullsize {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
}
.figure-fullsize:hover,
.figure-fullsize:focus-visible {
    text-decoration: none;
}
.figure-fullsize img {
    cursor: zoom-in;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.figure-fullsize:hover img,
.figure-fullsize:focus-visible img {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(18,31,53,0.12);
}
.figure-fullsize:focus-visible {
    outline: 3px solid rgba(31,94,255,0.35);
    outline-offset: 3px;
}
.download-list {
    margin: 16px 0 18px;
    padding-left: 22px;
}
.download-list a[download] {
    font-weight: 800;
}

/* HDC Website Chrome v2 – global header/footer */
.site-header-v2 {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 249, 252, 0.94);
    border-bottom: 1px solid rgba(217, 225, 234, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.site-header-v2-inner {
    max-width: var(--max-width, 1180px);
    min-height: 62px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}
.site-brand-v2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}
.site-brand-v2:hover { text-decoration: none; }
.site-brand-v2-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(18,31,53,0.13);
    flex: 0 0 auto;
}
.site-brand-v2-text {
    display: inline-block;
    white-space: nowrap;
    font-size: clamp(0.84rem, 3.1vw, 1.06rem);
    line-height: 1.1;
}
.language-switch-v2 {
    position: relative;
    flex: 0 0 auto;
    color: var(--text);
    font-weight: 700;
}
.language-switch-v2 summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 8px 18px rgba(18,31,53,0.07);
}
.language-switch-v2 summary::-webkit-details-marker { display: none; }
.language-switch-v2 summary::marker { content: ""; font-size: 0; }
.language-switch-v2 summary:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.language-current { letter-spacing: 0.02em; }
.language-menu-v2 {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 154px;
    padding: 8px;
    display: grid;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.language-menu-v2 a {
    display: block;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.language-menu-v2 a:hover,
.language-menu-v2 a[aria-current="page"] {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}
.site-footer-v2 {
    max-width: var(--max-width, 1180px);
    margin: 0 auto;
    padding: 0 20px 32px;
    color: var(--muted);
}
.site-footer-v2-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
    padding: 16px 0 0;
    border-top: 1px solid rgba(217,225,234,0.72);
}
.site-footer-v2-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}
.site-footer-v2-links a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}
.site-footer-v2-links a:hover { text-decoration: underline; }
.site-footer-v2-copy {
    margin: 0;
    white-space: nowrap;
    color: var(--text);
}
@media (max-width: 640px) {
    .site-header-v2-inner {
        min-height: 56px;
        padding: 8px 14px;
        gap: 8px;
    }
    .site-brand-v2 { gap: 8px; }
    .site-brand-v2-icon { width: 34px; height: 34px; border-radius: 8px; }
    .language-switch-v2 summary { min-height: 34px; padding: 7px 9px; }
    .language-menu-v2 { min-width: 142px; }
    .site-footer-v2 { padding-left: 14px; padding-right: 14px; }
    .site-footer-v2-inner { justify-content: center; text-align: center; }
    .site-footer-v2-links { justify-content: center; }
    .site-footer-v2-copy { width: 100%; white-space: normal; }
}
@media (max-width: 340px) {
    .site-header-v2-inner { padding-left: 10px; padding-right: 10px; }
    .site-brand-v2-icon { width: 31px; height: 31px; }
    .site-brand-v2-text { font-size: 0.78rem; }
    .language-switch-v2 summary { padding-left: 7px; padding-right: 7px; gap: 4px; }
}

