@charset "UTF-8";

/* Farben und Grundlayout; Logo-Regeln am Dateiende stammen aus der Benutzeranpassung. */
:root {
    --navy: #12263e;
    --navy-dark: #0c1c2e;
    --teal: #087f83;
    --mint: #72e3d1;
    --ink: #172b42;
    --muted: #5e6e80;
    --line: #e0e6ec;
    --canvas: #f3f6f9;
    --white: #fff;
    --red: #a42e3f;
    --shadow: 0 3px 14px #12263e05;
    --radius: 12px;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--canvas);
}
a {
    color: var(--teal);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}
button {
    cursor: pointer;
}
button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1 {
    font-size: 2rem;
    letter-spacing: -0.035em;
    line-height: 1.2;
    margin-bottom: 10px;
    font-weight: 680;
}
h2 {
    font-size: 1.125rem;
    line-height: 1.35;
    letter-spacing: -0.015em;
    font-weight: 650;
    margin-bottom: 18px;
}
h3 {
    font-size: 1rem;
}
p {
    margin-bottom: 16px;
}
small,
.hint {
    font-size: 0.875rem;
    color: var(--muted);
}
strong {
    font-weight: 650;
}
code,
pre,
.code-input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--canvas);
    padding: 16px;
    font-size: 0.875rem;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid #27a6ae;
    outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #199aa32a;
    border-color: var(--teal);
}
.muted {
    color: var(--muted);
}
.block {
    display: block;
}
.spaced {
    margin-top: 18px;
}
.wide {
    width: 100%;
}
.narrow {
    max-width: 640px;
}
.numeric {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: fixed;
    left: 20px;
    top: -60px;
    z-index: 100;
    background: white;
    padding: 12px;
}
.skip-link:focus {
    top: 10px;
}
/* Seitennavigation und Kopfbereich */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 254px;
    background: var(--navy);
    color: #e3edf6;
    padding: 30px 18px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 20;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.03rem;
    font-weight: 650;
    line-height: 1.22;
    padding: 0 8px;
    letter-spacing: -0.02em;
}
.brand:hover {
    text-decoration: none;
}
.brand-light {
    display: block;
    color: #adc0d3;
    font-weight: 400;
}
.brand-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--mint);
    color: var(--navy-dark);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.08em;
    border-radius: 11px;
}
.workspace-/* Formulare und Eingabefelder */
label {
    margin: 22px 10px 6px;
    color: #9aafc3;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}
.nav-group {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 650;
    color: #8ba0b6;
    margin: 23px 12px 7px;
}
.nav-link {
    color: #cfdae6;
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 0.9rem;
    margin-bottom: 3px;
}
.nav-link:hover {
    background: #ffffff0d;
    text-decoration: none;
    color: white;
}
.nav-link.active {
    background: #294056;
    color: white;
    box-shadow: inset 3px 0 var(--mint);
}
.nav-icon {
    font-size: 1.12rem;
    width: 22px;
    text-align: center;
    color: #afc3d6;
}
.active .nav-icon {
    color: var(--mint);
}
.sidebar-bottom {
    margin-top: auto;
    padding: 30px 8px 0;
}
.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f1f5fa;
    font-size: 0.9rem;
}
.user-link small {
    display: block;
    color: #9aafc3;
    font-size: 0.75rem;
}
.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #324c66;
    color: #dceafa;
    font-size: 0.85rem;
    font-weight: 650;
}
.logout {
    border: 0;
    background: none;
    color: #a7bbcf;
    font-size: 0.875rem;
    padding: 13px 0 0;
}
.app-shell {
    margin-left: 254px;
    min-height: 100vh;
}
.topbar {
    height: 69px;
    background: #ffffffc7;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    font-size: 0.875rem;
    color: var(--muted);
}
.slash {
    color: #b0bbc6;
    margin: 0 12px;
}
.top-date {
    font-variant-numeric: tabular-nums;
}
main#main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 36px 40px 24px;
    min-width: 0;
}
/* Seitenüberschriften und Aktionen */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 27px;
}
.page-heading p:last-child {
    margin-bottom: 0;
}
.eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--teal);
    font-weight: 750;
    margin-bottom: 12px;
}
.heading-actions,
.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.heading-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid #cdd7e1;
    background: white;
    border-radius: 7px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
    transition: background 0.12s;
}
.button:hover {
    background: #f1f6f8;
    text-decoration: none;
    border-color: #abbeca;
}
.button.primary {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
    box-shadow: 0 2px 4px #086c7610;
}
.button.primary:hover {
    background: #076e72;
}
.button.small {
    padding: 6px 10px;
    min-height: 34px;
    font-size: 0.875rem;
}
.button.danger {
    color: var(--red);
    border-color: #e2b9c0;
}
.button.danger:hover {
    background: #fff1f3;
}
/* Kennzahlen und Inhaltsraster */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stats-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 23px;
    min-width: 0;
    box-shadow: var(--shadow);
}
.stat > span {
    color: var(--muted);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 12px;
}
.stat > strong {
    display: block;
    font-size: 1.85rem;
    letter-spacing: -0.04em;
    font-weight: 650;
    line-height: 1.2;
    margin-bottom: 9px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.stat small {
    font-size: 0.8rem;
}
.stat.accent {
    background: #e7f3f3;
    border-color: #cbe4e5;
}
.stat.accent > strong {
    color: #076f76;
}
.two-columns {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 24px;
    align-items: start;
}
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow-wrap: anywhere;
}
.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.panel-heading h2 {
    margin-bottom: 0;
}
.panel-heading > div > p {
    margin: 8px 0 0;
}
.panel-heading > a,
.panel-heading > .muted {
    font-size: 0.875rem;
}
.panel .stats-grid {
    margin-top: 20px;
}
.panel .stat {
    box-shadow: none;
    background: var(--canvas);
}
.workflow {
    display: flex;
    flex-direction: column;
}
.workflow-step {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 17px 0;
    border-bottom: 1px solid #edf0f4;
    color: var(--ink);
}
.workflow-step:last-child {
    border: 0;
    padding-bottom: 0;
}
.workflow-step:first-child {
    padding-top: 0;
}
.workflow-step:hover {
    text-decoration: none;
}
.workflow-step:hover strong {
    color: var(--teal);
}
.workflow-step strong {
    font-size: 0.9375rem;
    display: block;
}
.workflow-step small {
    font-size: 0.875rem;
    display: block;
    margin-top: 5px;
    line-height: 1.5;
}
.step-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #dce5ed;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.step-arrow {
    color: #8b9caf;
    margin-left: auto;
}
.review-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
    color: var(--ink);
}
.review-row strong {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
}
.info-note {
    background: #f3f7fa;
    padding: 20px;
    margin-top: 24px;
    border-radius: 8px;
    font-size: 0.875rem;
}
.info-note p {
    color: var(--muted);
    margin: 7px 0 0;
    line-height: 1.7;
}
.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 0 40px;
    padding: 20px 0 26px;
    color: #768697;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
}
label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.875rem;
    font-weight: 550;
    margin-bottom: 18px;
    min-width: 0;
}
.field-label {
    font-size: 0.875rem;
    font-weight: 550;
    margin-bottom: 7px;
}
input,
select,
textarea {
    background: white;
    border: 1px solid #cdd7e1;
    border-radius: 7px;
    padding: 10px 12px;
    color: var(--ink);
    width: 100%;
    min-width: 0;
    font-size: 1rem;
}
input::placeholder,
textarea::placeholder {
    color: #8492a2;
}
textarea {
    resize: vertical;
    line-height: 1.65;
}
select {
    padding-right: 30px;
}
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--teal);
    margin: 2px 0 0;
}
.check {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    font-weight: 450;
    line-height: 1.6;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
}
.compact-form {
    min-width: 230px;
    padding-top: 12px;
}
.filterbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.filterbar label {
    margin: 0;
    min-width: 250px;
    flex: 1;
    max-width: 600px;
}
.filterbar .button {
    height: 46px;
}
.searchbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 660px;
}
.hint {
    line-height: 1.6;
}
.help-list {
    margin: 0;
}
.help-list dt {
    font-size: 0.9375rem;
    font-weight: 650;
    margin-top: 20px;
}
.help-list dt:first-child {
    margin-top: 0;
}
.help-list dd {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 6px 0 0;
    line-height: 1.7;
}
.file-drop {
    align-items: center;
    text-align: center;
    border: 1.5px dashed #b7cbd6;
    border-radius: 10px;
    padding: 28px 18px;
    margin: 20px 0 24px;
    background: #f7fafc;
    gap: 8px;
}
.file-drop > span {
    color: var(--muted);
    font-size: 0.875rem;
}
.file-drop .upload-symbol {
    color: var(--teal);
    font-size: 2rem;
    line-height: 1;
}
.file-drop input {
    width: auto;
    max-width: 100%;
    padding: 8px;
    font-size: 0.875rem;
    border: 0;
    background: transparent;
}
.tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: #e8edf3;
    border-radius: 9px;
    margin-bottom: 24px;
    width: max-content;
    max-width: 100%;
    flex-wrap: wrap;
}
.tabs a {
    padding: 10px 17px;
    color: var(--muted);
    font-size: 0.875rem;
    border-radius: 6px;
    font-weight: 550;
}
.tabs a.selected {
    background: white;
    color: var(--ink);
    box-shadow: 0 1px 4px #10253d10;
}
.tabs a:hover {
    text-decoration: none;
    color: var(--teal);
}
.stepper {
    display: flex;
    gap: 30px;
    margin: 0 0 24px;
    padding: 0 0 17px;
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
    color: #758699;
    flex-wrap: wrap;
}
.stepper .current {
    color: var(--teal);
    font-weight: 650;
}
.stepper .done {
    color: var(--ink);
}
.mapping-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 12px 20px;
    align-items: center;
    margin: 25px 0;
}
.mapping-grid > strong {
    font-size: 0.875rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
.mapping-grid label {
    margin-bottom: 0;
    font-size: 0;
    gap: 0;
}
.mapping-grid select {
    font-size: 0.875rem;
}
.mapping-label {
    font-size: 0.875rem;
}
.mapping-dash {
    text-align: center;
}
/* Tabellen: auf kleinen Bildschirmen innerhalb des Containers scrollbar */
.table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
    max-width: 100%;
}
table {
    border-collapse: collapse;
    width: 100%;
    min-width: 640px;
    overflow-wrap: normal;
    font-size: 0.875rem;
    text-align: left;
}
thead {
    background: #f5f7fa;
}
th {
    font-weight: 600;
    color: #56687b;
    font-size: 0.8rem;
    white-space: nowrap;
    padding: 12px 14px;
}
td {
    padding: 16px 14px;
    border-bottom: 1px solid #edf0f4;
    vertical-align: top;
}
tbody th {
    border-bottom: 1px solid #edf0f4;
}
tbody tr:last-child td {
    border-bottom: none;
}
td a {
    font-weight: 600;
}
td small {
    font-size: 0.8rem;
    line-height: 1.55;
    margin-top: 4px;
}
td .button {
    margin-bottom: 4px;
}
td .button:last-child {
    margin-bottom: 0;
}
.preview-cell {
    min-width: 140px;
    max-width: 330px;
    word-break: break-word;
}
.badge {
    display: inline-block;
    border-radius: 5px;
    padding: 3px 8px;
    background: #edf1f6;
    color: #53677b;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.badge.success {
    background: #e4f3ed;
    color: #246852;
}
.badge.warning {
    background: #fff1d7;
    color: #8a6010;
}
.notice {
    border: 1px solid #cce5e3;
    background: #eff8f5;
    color: #245f52;
    padding: 16px 19px;
    border-radius: 9px;
    font-size: 0.9375rem;
    margin-bottom: 22px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.notice p:last-child,
.notice ul:last-child {
    margin-bottom: 0;
}
.notice.error {
    background: #fff1f3;
    color: #963042;
    border-color: #f1d0d5;
}
.notice.warning {
    background: #fff8e9;
    color: #775718;
    border-color: #f0dfb4;
}
.notice a {
    font-weight: 600;
}
.notice .check {
    margin: 16px 0 0;
}
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--muted);
}
.empty h2 {
    margin: 16px 0 9px;
    color: var(--ink);
}
.empty p {
    font-size: 0.9375rem;
    max-width: 500px;
    margin: 0 auto 20px;
}
.empty-icon {
    margin: auto;
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    border: 1px solid #d8e4ed;
    border-radius: 12px;
    background: #f2f7fa;
    color: #527893;
    font-size: 1.75rem;
}
.record {
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
}
.record:last-child {
    border-bottom: 0;
}
.record summary {
    cursor: pointer;
    font-size: 0.9375rem;
    line-height: 1.9;
}
.record summary .badge {
    margin-left: 8px;
}
summary {
    cursor: pointer;
    color: var(--teal);
    font-size: 0.875rem;
}
.calculation-detail {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}
.calculation-detail > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 19px 20px;
    color: var(--ink);
}
.calculation-detail > summary:before {
    content: "＋";
    color: var(--teal);
    font-size: 1.2rem;
}
.calculation-detail[open] > summary:before {
    content: "−";
}
.calculation-detail > summary > span {
    flex: 1;
}
.calculation-detail summary small {
    display: block;
    margin-top: 4px;
}
.calculation-detail[open] > summary {
    background: #f4f8fa;
    border-bottom: 1px solid var(--line);
}
.calculation-content {
    padding: 22px;
}
.formula-box {
    font-size: 0.9375rem;
    padding: 15px;
    border-radius: 7px;
    background: #eaf4f4;
    color: #12656b;
    margin-bottom: 16px;
}
.calculation-content > p {
    font-size: 0.875rem;
    margin: 17px 0;
}
.calculation-content h3 {
    margin-top: 25px;
}
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 17px;
}
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.editor-preview,
.letter-preview {
    background: #fff;
    border: 1px solid #dfe5eb;
    padding: 36px;
    box-shadow: 0 4px 22px #1d304b09;
    color: #273345;
    font-size: 0.9375rem;
    line-height: 1.75;
}
.editor-preview {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    min-height: 590px;
    max-height: 760px;
    overflow-y: auto;
}
.letter-preview {
    max-width: 850px;
    margin: 20px auto;
}
.letter-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.letter-preview h2 {
    margin-bottom: 28px;
}
.document-editor textarea {
    min-height: 590px;
    font-size: 0.9375rem;
}
/* Anmeldung und Erstinstallation */
.setup-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 24px;
    background: linear-gradient(145deg, #e9f0f5, #f5f8fb);
}
.setup-card,
.login-card {
    background: white;
    border: 1px solid #dde6ee;
    border-radius: 17px;
    padding: 45px;
    box-shadow: 0 12px 55px #10253d0b;
    width: 100%;
    max-width: 810px;
}
.login-card {
    max-width: 465px;
}
.setup-card > .brand-mark,
.login-card > .brand-mark {
    margin-bottom: 25px;
}
.setup-card h1 {
    font-size: 2.15rem;
}
.setup-card h2 {
    border-top: 1px solid var(--line);
    padding-top: 27px;
    margin-top: 28px;
}
.login-card h1 {
    font-size: 1.8rem;
}
.login-card form {
    margin-top: 26px;
}
.login-card .button {
    margin-top: 8px;
}
@media (min-width: 1600px) {
    main#main {
        padding-top: 42px;
    }
    .page-heading {
        margin-bottom: 32px;
    }
    .stat {
        padding: 26px;
    }
}
@media (max-width: 1200px) {
    .sidebar {
        width: 224px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .app-shell {
        margin-left: 224px;
    }
    main#main {
        padding: 28px 24px;
    }
    .topbar {
        padding: 0 24px;
    }
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .heading-actions {
        justify-content: flex-start;
    }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .two-columns {
        grid-template-columns: 1fr;
    }
    .stat > strong {
        font-size: 1.7rem;
    }
    .panel {
        padding: 23px;
    }
    .app-footer {
        margin: 0 24px;
    }
    .editor-grid {
        grid-template-columns: 1fr;
    }
    .editor-preview {
        min-height: 300px;
    }
    .mapping-grid {
        gap: 12px;
    }
}
/* Mobile Ansicht */
@media (max-width: 760px) {
    .sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        padding: 18px 16px;
        overflow: visible;
        display: block;
    }
    .brand {
        font-size: 0.9375rem;
    }
    .brand-light {
        display: inline;
        margin-left: 2px;
    }
    .brand-mark {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    .workspace-label {
        display: none;
    }
    .sidebar nav {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding: 15px 0 0;
        scrollbar-width: thin;
    }
    .nav-group {
        display: none;
    }
    .nav-link {
        flex-shrink: 0;
        margin: 0;
        font-size: 0.875rem;
        padding: 9px 12px;
    }
    .nav-icon {
        display: none;
    }
    .sidebar-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 7px 0;
    }
    .sidebar-bottom .logout {
        padding: 0;
    }
    .sidebar-bottom .avatar {
        width: 29px;
        height: 29px;
    }
    .sidebar-bottom .user-link small {
        display: none;
    }
    .app-shell {
        margin-left: 0;
    }
    .topbar {
        height: 50px;
        padding: 0 18px;
        font-size: 0.75rem;
    }
    .top-date {
        display: none;
    }
    main#main {
        padding: 24px 16px;
    }
    .page-heading {
        gap: 17px;
    }
    .page-heading h1 {
        font-size: 1.65rem;
    }
    .page-heading .muted {
        font-size: 0.9375rem;
    }
    .heading-actions {
        width: 100%;
    }
    .stats-grid,
    .stats-grid.three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }
    .stat {
        padding: 16px;
    }
    .stat > strong {
        font-size: 1.5rem;
    }
    .stat > span {
        font-size: 0.8rem;
    }
    .stat small {
        font-size: 0.75rem;
    }
    .stats-grid.three .stat:last-child {
        grid-column: 1/-1;
    }
    .panel {
        padding: 20px 16px;
        margin-bottom: 18px;
    }
    .panel-heading {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .filterbar label {
        min-width: 0;
        width: 100%;
    }
    .filterbar {
        align-items: stretch;
    }
    .filterbar .button {
        align-self: flex-end;
    }
    .tabs {
        width: 100%;
    }
    .tabs a {
        padding: 8px 10px;
    }
    .mapping-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .mapping-grid > strong,
    .mapping-dash {
        display: none;
    }
    .mapping-label {
        margin-top: 14px;
        font-weight: 650;
    }
    .mapping-grid label {
        font-size: 0.75rem;
        gap: 5px;
    }
    .mapping-grid label select {
        font-size: 0.9375rem;
    }
    .mapping-grid > label {
        margin-bottom: 5px;
    }
    .app-footer {
        margin: 0 16px;
        flex-direction: column;
        gap: 5px;
    }
    .setup-body {
        padding: 20px 12px;
        align-items: flex-start;
    }
    .setup-card,
    .login-card {
        padding: 27px 22px;
        border-radius: 12px;
    }
    .setup-card h1 {
        font-size: 1.75rem;
    }
    .letter-preview,
    .editor-preview {
        padding: 23px;
    }
    .stepper {
        gap: 15px;
        font-size: 0.8rem;
    }
    .workflow-step {
        gap: 12px;
    }
    .review-row {
        align-items: flex-start;
    }
    .calculation-content {
        padding: 15px;
    }
    .calculation-detail > summary {
        padding: 15px;
    }
    .editor-grid {
        gap: 10px;
    }
    .code-input {
        font-size: 0.875rem;
    }
}
/* Druckansicht */
@media print {
    .sidebar,
    .topbar,
    .app-footer,
    .heading-actions,
    .editor-toolbar,
    form,
    .button {
        display: none !important;
    }
    .app-shell {
        margin: 0;
    }
    .panel {
        box-shadow: none;
        border: none;
    }
    .letter-preview {
        box-shadow: none;
        border: none;
        max-width: none;
    }
    main#main {
        padding: 0;
    }
    .page-heading {
        display: none;
    }
}
/* Eigene Logo-Anpassungen aus dem hochgeladenen Stand */
.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.login-logo {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 28px;
}

/* Gruppierte Felder der manuellen Patent- und Erfinderverwaltung. */
fieldset {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    min-width: 0;
}

legend {
    padding: 0 8px;
    font-weight: 650;
}

[hidden] {
    display: none !important;
}

/* Dreispaltiger Vorlagen-Arbeitsplatz im bestehenden Türkis-/Navy-Design. */
.letter-controls .actions {
    flex-wrap: wrap;
    margin-top: 18px;
}
.letter-workspace {
    display: grid;
    grid-template-columns: minmax(180px, 0.65fr) minmax(360px, 1.5fr) minmax(320px, 1.35fr);
    gap: 16px;
    align-items: start;
}
.letter-workspace > .panel {
    min-width: 0;
    padding: 18px;
}
.placeholder-panel {
    max-height: 1000px;
    overflow-y: auto;
}
.placeholder-group h3 {
    font-size: 13px;
    margin: 20px 0 8px;
}
.placeholder-button {
    display: block;
    width: 100%;
    margin: 0 0 7px;
    padding: 9px;
    text-align: left;
    background: #f2f8f8;
    border: 1px solid #d9e8e9;
    border-radius: 6px;
    color: #153547;
    cursor: pointer;
}
.placeholder-button code {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #007f84;
}
.pdf-panel iframe {
    width: 100%;
    height: 820px;
    border: 1px solid #d7e1e8;
    border-radius: 6px;
    background: #edf2f6;
}
#rich-letter-body {
    width: 100%;
    min-height: 600px;
    font-family: monospace;
}
.sr-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
@media (max-width: 1350px) {
    .letter-workspace {
        grid-template-columns: 190px minmax(0, 1fr);
    }
    .letter-workspace .pdf-panel {
        grid-column: 2;
    }
}
@media (max-width: 800px) {
    .letter-workspace {
        display: block;
    }
    .placeholder-panel {
        max-height: 320px;
    }
    .pdf-panel iframe {
        height: 650px;
    }
}
.pdf-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: #eaf1f5;
    padding: 10px;
    border: 1px solid #d7e1e8;
}
.pdf-controls select {
    width: auto;
    max-width: 135px;
    padding: 6px;
}
.pdf-canvas-wrap {
    height: 760px;
    overflow: auto;
    background: #dce5ec;
    padding: 12px;
    border: 1px solid #d7e1e8;
    border-top: 0;
}
.pdf-canvas-wrap canvas {
    display: block;
    background: white;
    box-shadow: 0 2px 8px #19304422;
    margin: 0 auto;
}
/* Kompakte Kopfleiste lässt mehr Platz für Editor und Vorschau. */
@media (min-width: 1100px) {
    .letter-controls {
        display: grid;
        grid-template-columns: 1fr 1.6fr;
        gap: 12px 20px;
        align-items: end;
        padding: 20px;
    }
    .letter-controls > .actions,
    .letter-controls > .hint {
        grid-column: 1 / -1;
        margin: 0;
    }
}
