html {
    /* Reserve scrollbar gutter on ALL pages so the nav never shifts
       when navigating between pages with/without a scrollbar.
       scrollbar-gutter: stable is the modern standard (Chrome 94+, FF 97+);
       overflow-y: scroll is the universal fallback for older browsers. */
    scrollbar-gutter: stable;
    overflow-y: scroll;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    /* Light grey background */
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    /* Ensure body takes full height of viewport */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

nav {
    width: 100%;
    background-color: #333;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Align items to the right */
    padding: 0 20px;
}

.logo img {
    height: 80px;
    /* Adjust the logo size as needed */
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin: 0;
    padding-right: 1.5em;
}

nav ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

nav ul li a:hover {
    background-color: #575757;
}

.container {
    display: flex;
    flex-wrap: wrap;
    /* Allow rectangles to stack on smaller screens */
    justify-content: center;
    /* Center the content */
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
    /* Ensure the container doesn't exceed viewport width */
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

.rectangle {
    position: relative;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    width: calc(50% - 20px);
    /* Adjusted to be slightly less than 50% to account for margins */
    margin: 10px;
    aspect-ratio: 210 / 297;
    /* Aspect ratio for A4 size */
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    /* Ensure colored section stays on the left */
    flex-grow: 1;
    /* Allow rectangles to grow to fill available space */
}

.colored-section {
    background-color: #6b7468;
    width: 30%;
    /* 30% width of the parent rectangle */
    height: 100%;
    /* Full height of the parent */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center items horizontally */
    padding: 10px;
    /* Add padding */
    margin: 0;
}

.colored-section img {
    width: 80%;
    /* Reduce image size */
    max-width: 150px;
    /* Ensure image does not get too large */
    height: auto;
    border-radius: 50%;
    /* Rounded corners */
    object-fit: cover;
    /* Ensure image covers the container */
    display: block;
    margin-top: 1%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.white-text {
    color: white;
    font-size: 2rem;
    /* Change font size */
    margin-top: 1rem;
    text-align: right;
    padding-right: 10px;
    /* Shift text 10px to the left */
    align-self: flex-end;
    /* Align text to the right */
}

.separator {
    width: 95%;
    position: relative;
    height: 1rem;
    margin: 0px 0;
}

.separator::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 1px;
    background-color: white;
}

.separator::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 60%;
    width: 35%;
    height: 3px;
    background-color: white;
}

.content-section {
    padding: 10px;
    width: 70%;
    /* 70% width of the parent rectangle */
    height: 100%;
    /* Full height */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.right-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align content at the top */
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

.right-content p {
    margin: 0 0 20px 0;
    /* Add margin to the bottom of the paragraph */
}

.right-content input[type="file"] {
    margin-top: 10px;
    /* Add some margin to the top of the button */
}

.content {
    padding: 20px;
    margin: auto;
    max-width: 800px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    color: #333;
}

.content p {
    margin-bottom: 20px;
}

.content p,
.content ul,
.content ol {
    font-size: 1rem;
}

.content strong {
    font-weight: bold;
}

.content em {
    font-style: italic;
}

.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

form {
    margin-top: 20px;
}

label {
    font-weight: bold;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="submit"] {
    width: 100%;
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: #45a049;
}

input[type="checkbox"] {
    margin-top: 10px;
}

/* Media query for small screens */
@media (max-width: 800px) {
    .container {
        flex-direction: column;
        /* Stack the rectangles vertically */
        align-items: center;
        /* Center the stacked items */
    }

    .rectangle {
        width: 100%;
        /* Full width for each rectangle */
        margin-bottom: 10px;
        aspect-ratio: 210 / 297;
        /* Maintain A4 aspect ratio */
        flex-direction: column-reverse;
        /* Stack colored and content sections vertically */
    }

    .colored-section,
    .content-section {
        width: 100%;
        padding: 10px;
        height: auto;
        /* Auto height to fit content */
    }

    .colored-section img {
        width: 50%;
        /* Reduce image size further */
        max-width: 120px;
        /* Ensure image does not get too large */
    }
}

/* =========================================
   LEGAL PAGES — CV BUILDER UI LOOK
   ========================================= */

.legal-cvui {
    background: #f4f6f8;
    /* wie .cv-input-panel */
    min-height: calc(100vh - 64px);
    /* grob: nav abziehen */
}

.legal-cvui-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px;
}

/* Header: fühlt sich an wie input-panel-header */
.legal-cvui-header {
    position: relative;
    /* Changed from sticky due to flexbody */
    top: 0;
    z-index: 5;
    background: #f4f6f8;
    /* wie .input-panel-header */
    padding: 16px 0 12px 0;
}

.legal-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    /* wie .inp-section-title */
}

.legal-title {
    margin: 6px 0 12px;
    font-size: 1.6rem;
    color: #212529;
}

/* Reuse segmented control from CV builder */
.legal-tabs {
    margin: 0 0 10px;
    display: flex;
    gap: 8px;
    padding: 4px;
    background: #e9ecef;
    border-radius: 8px;
    max-width: fit-content;
}

.legal-tabs .panel-tab {
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 6px;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.legal-tabs .panel-tab.active {
    background: #fff;
    color: #212529;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legal-tabs .panel-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Layout: TOC + Content */
.legal-cvui-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 14px;
    align-items: start;
}

/* Cards: wie entry-card / switcher */
.legal-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    padding: 24px;
}

.legal-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 10px;
}

/* Sticky TOC card */
.legal-toc {
    position: sticky;
    top: 20px;
    padding: 18px;
}

#toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.92rem;
    transition: background 0.2s;
}

#toc a:hover {
    background: rgba(0, 0, 0, 0.04);
}

#toc a.toc-l3 {
    padding-left: 18px;
    color: #495057;
    font-size: 0.88rem;
}

/* Markdown typography */
.legal-content {
    display: flex;
    flex-direction: column;
}

.legal-md {
    max-width: 78ch;
}

.legal-md h2 {
    margin-top: 0;
    font-size: 1.4rem;
    color: #212529;
    scroll-margin-top: 20px;
}

.legal-md h3 {
    margin-top: 16px;
    font-size: 1.15rem;
    color: #343a40;
    scroll-margin-top: 20px;
}

.legal-md p,
.legal-md li {
    line-height: 1.75;
    color: #333;
    font-size: 0.95rem;
}

.legal-md ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.legal-md a {
    color: #0b57d0;
}

.legal-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-pill {
    font-size: 0.78rem;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 999px;
    background: #fff;
    color: #444;
}

/* Mobile */
@media (max-width: 900px) {
    .legal-cvui-body {
        grid-template-columns: 1fr;
    }

    .legal-toc {
        position: relative;
        top: 0;
    }

    .legal-md {
        max-width: 100%;
    }
}