* {
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
    margin: 0;
    padding: 0;
}

.absence-edit-btn {
    flex: 0 0 116px;
    width: 116px;
    min-height: 34px;
    padding: 6px 10px;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}

.absence-edit-btn:hover,
.absence-edit-btn:focus-visible {
    color: var(--accent-hover);
    background: var(--accent-soft);
}

body {
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.calendar-day.is-selected {
    color: #173d36;
    background: #a5d5c9;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 24px;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    border: none;
}

#profileImage[hidden] {
    display: none;
}

.header-login-btn {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}

.header-login-btn:hover {
    background-color: #2980b9;
}

.header-login-btn[hidden] {
    display: none;
}

/* Profil-Menü */
.profile-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-width: 150px;
    z-index: 1000;
}

.profile-menu[hidden] {
    display: none;
}

.profile-menu button {
    padding: 10px 15px;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.profile-menu button:last-child {
    border-bottom: none;
}

.profile-menu button:hover {
    background: #f4f4f9;
}
.container {
    display: flex;
    flex: 1;
    padding: 20px;
    gap: 20px;
}

.container[hidden],
[hidden] {
    display: none !important;
}

.storage-notice {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: min(560px, calc(100vw - 40px));
    padding: 16px 18px;
    background: #fff;
    color: #263238;
    border: 1px solid #d6dce1;
    border-left: 4px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(31, 45, 61, 0.18);
}

.storage-notice-text {
    display: grid;
    gap: 5px;
}

.storage-notice-text p {
    font-size: 13px;
    line-height: 1.45;
}

.inline-legal-link {
    padding: 0;
    color: var(--accent);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.inline-legal-link:hover {
    color: var(--accent-hover);
}

.storage-notice-dismiss {
    flex: 0 0 auto;
    padding: 9px 14px;
    background: #2c3e50;
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.storage-notice-dismiss:hover {
    background: #1f2d3a;
}

body.dark-mode .storage-notice {
    background: #24313d;
    color: #f4f7f9;
    border-color: #40515f;
}

@media (max-width: 600px) {
    .storage-notice {
        right: 12px;
        bottom: 12px;
        max-width: calc(100vw - 24px);
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .storage-notice-dismiss {
        width: 100%;
    }
}

/* Spalten */
.left-panel, .right-panel {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.middle-panel {
    flex: 2;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* Linke Spalte: Kreisdiagramm */
.progress-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#3498db 60%, #eee 0);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.progress-text {
    background: white;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Mittlere Spalte: Liste */
.today-time {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.entries-list {
    flex: 1;
    overflow-y: auto;
}

.entry-item {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    border-radius: 4px;
}

/* Rechte Spalte: Buttons */
.right-panel {
    justify-content: center;
    gap: 20px;
}

.action-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:hover {
    background-color: #2980b9;
}

/* Modals (Pop-ups) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

#messageModal {
    z-index: 1100;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    min-width: 320px;
    max-width: 90vw;
}

.absence-editor-content {
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

/* Neuer Auth Screen: Weisser Hintergrund, kein GUI im Hintergrund */
body.not-authenticated {
    height: auto;
    min-height: 100vh;
    background-color: #ffffff;
}

body.not-authenticated header {
    justify-content: center;
}


.auth-form {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.auth-form label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-top: 12px;
    margin-bottom: 4px;
}

.auth-form input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
    color: var(--ink);
    cursor: pointer;
    line-height: 1.45;
}

.auth-form .checkbox-field input {
    width: auto;
    margin-top: 3px;
    accent-color: var(--accent);
}

.auth-form .toggle-field {
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
}

.auth-form .toggle-field input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 44px;
    width: 44px;
    height: 24px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #5a636b;
    background: #3a4046;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-form .toggle-field input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.auth-form .toggle-field input[type="checkbox"]:checked {
    background: var(--accent, #45ad99);
    border-color: var(--accent, #45ad99);
}

.auth-form .toggle-field input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.auth-form input:focus {
    border-color: #3498db;
}

.submit-btn {
    margin-top: 18px;
    padding: 12px;
    background-color: #3498db;
    color: white;
    font-size: 15px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background-color: #2980b9;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #888;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e0e0;
}

.divider span {
    padding: 0 10px;
    font-size: 13px;
    color: #999;
}

.github-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    background-color: #24292e;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.github-btn:hover {
    background-color: #040d21;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding: 11px;
    background-color: #ffffff;
    color: #333;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.google-btn:hover {
    background-color: #f7f7f7;
}

.google-logo {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.github-icon {
    display: inline-block;
    vertical-align: middle;
}

.auth-toggle-text {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.auth-toggle-text a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.auth-toggle-text a:hover {
    text-decoration: underline;
}

#messageText {
    overflow-wrap: anywhere;
    white-space: pre-line;
    line-height: 1.4;
}

.modal-content input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    font-size: 16px;
}

.modal-content button {
    padding: 10px 20px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.cancel-btn {
    background: #e74c3c !important;
    margin-left: 10px;
}

/* Responsive Anpassung für Mobilgeräte */
@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
    }

    .container {
        flex-direction: column;
    }

    .left-panel, .middle-panel, .right-panel {
        width: 100%;
    }
}

:root {
    --ink: #292d30;
    --muted: #687078;
    --canvas: #e7e9eb;
    --surface: #f7f7f6;
    --line: #d3d6d8;
    --accent: #197c70;
    --accent-hover: #12685e;
    --accent-soft: #e3eeee;
    --warm: #c36a4d;
    --shadow: 0 12px 32px rgba(35, 40, 44, 0.1);
}

* {
    font-family: "Open Sans", sans-serif;
}

body {
    min-height: 100vh;
    height: 100vh;
    color: var(--ink);
    background: var(--canvas);
}

header {
    min-height: 76px;
    padding: 16px clamp(20px, 4vw, 56px);
    background: #243b36;
    position: relative;
    z-index: 1400;
}

header h1 {
    font-size: 21px;
    font-weight: 650;
}

.brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.brand-link {
    display: block;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.brand-logo {
    display: block;
    width: auto;
    height: clamp(29px, 4vw, 44px);
    max-width: min(38vw, 240px);
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) invert(1);
}

body.dark-mode .brand-logo {
    filter: invert(1);
}

body.not-authenticated header {
    justify-content: center;
    background: transparent;
    color: var(--ink);
    padding-top: 28px;
}

.container {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.6fr) minmax(190px, 1fr);
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 36px);
    gap: 18px;
}

.left-panel,
.middle-panel,
.right-panel {
    min-width: 0;
    padding: clamp(20px, 2.5vw, 30px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.calendar-panel {
    grid-column: 1 / -1;
}

.left-panel h2,
.today-time h2 {
    color: var(--ink);
    font-size: 18px;
    font-weight: 650;
}

.progress-circle {
    background: conic-gradient(var(--accent) 0%, #e5ece8 0);
}

.progress-text {
    color: var(--ink);
}

.entry-item {
    padding: 15px 16px;
    color: var(--ink);
    background: #f7f9f8;
    border: 1px solid #e8eeeb;
    border-left: 3px solid var(--accent);
    border-radius: 5px;
    line-height: 1.55;
}

.entry-item strong {
    display: block;
    margin-bottom: 4px;
}

.entry-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.action-btn,
.submit-btn,
.header-login-btn {
    color: white;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 5px;
    font-weight: 650;
    transition: background-color 160ms ease, transform 160ms ease;
}

.action-btn:hover,
.submit-btn:hover,
.header-login-btn:hover {
    background: var(--accent-hover);
}

.action-btn:active,
.submit-btn:active {
    transform: translateY(1px);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(25, 124, 112, 0.35);
    outline-offset: 3px;
}

.profile-icon {
    background: #d77e5e;
}

.profile-menu {
    top: 48px;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.profile-menu button:hover {
    background: var(--accent-soft);
}

.auth-screen {
    display: flex;
    flex: 1;
    background: linear-gradient(145deg, #e7e9eb 0%, #f1f1f0 100%);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
    padding: clamp(24px, 4vw, 44px) 16px;
}

.auth-card,
.seo-intro {
    width: min(450px, 100%);
    background: #ffffff;
    border: 1px solid #dbe5e0;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(32, 53, 47, 0.10);
    padding: clamp(28px, 5vw, 40px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.auth-card {
    justify-content: flex-start;
}

.seo-intro {
    justify-content: space-between;
    text-align: left;
}

.seo-intro-header {
    margin-bottom: 18px;
}

.seo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    margin-bottom: 14px;
}

.seo-badge-dot {
    font-size: 11px;
}

.seo-intro h1 {
    margin: 0 0 10px;
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
}

.seo-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.seo-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.seo-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    background: #f8faf9;
    border: 1px solid #e3eae7;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ink);
    font-weight: 500;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 22px;
}

.seo-footer-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e3eae7;
    margin-top: auto;
}

.seo-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.seo-pill .pill-dot {
    color: var(--accent);
    font-size: 9px;
}

@media (min-width: 900px) {
    .auth-screen {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: 32px;
        padding: 50px 24px;
    }

    .auth-card,
    .seo-intro {
        flex: 1 1 420px;
        max-width: 450px;
    }
}

.auth-card h2 {
    margin-bottom: 24px;
    text-align: center;
    color: var(--ink);
    font-size: 26px;
    font-weight: 700;
}

.auth-form label {
    margin-top: 15px;
    color: #3c4b47;
    font-size: 13px;
}

.auth-form input,
.auth-form textarea,
.modal-content input {
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fcfdfc;
    border: 1px solid #cbd8d2;
    border-radius: 5px;
}

.auth-form textarea {
    min-height: 150px;
    resize: vertical;
}

.auth-form input:focus,
.auth-form textarea:focus {
    border-color: var(--accent);
}

.submit-btn {
    min-height: 46px;
    margin-top: 22px;
}

.github-btn {
    min-height: 44px;
    border-radius: 5px;
    transition: background-color 160ms ease;
}

.github-btn:hover {
    background: #35443f;
}

.auth-toggle-text {
    color: var(--muted);
    line-height: 1.6;
}

.auth-toggle-text a {
    color: var(--accent-hover);
}

.modal {
    padding: 16px;
    background: rgba(26, 39, 35, 0.48);
    backdrop-filter: blur(3px);
}

.modal-content {
    width: min(460px, 100%);
    min-width: 0;
    max-height: min(90vh, 760px);
    overflow-y: auto;
    padding: clamp(22px, 5vw, 34px);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(19, 35, 30, 0.2);
}

.modal-content h2 {
    margin-bottom: 14px;
    font-size: 20px;
}

.modal-content button {
    min-height: 42px;
    margin-top: 14px;
    background: var(--accent);
    border-radius: 5px;
}

.modal-content button:hover {
    background: var(--accent-hover);
}

.modal-content .cancel-btn {
    background: var(--warm) !important;
}

.modal-content .text-btn {
    align-self: flex-start;
    min-height: 0;
    width: auto;
    margin-top: 8px;
    padding: 0;
    background: transparent;
    color: var(--accent);
    border: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 650;
}

.modal-content .text-btn:hover {
    background: transparent;
    color: var(--accent-hover);
    text-decoration: underline;
}

.legal-footer {
    display: flex;
    flex: 0 0 auto;
    justify-content: center;
    gap: 18px;
    padding: 12px 16px 18px;
    color: var(--muted);
    background: var(--surface);
    border-top: 1px solid var(--line);
    position: relative;
    align-items: center;
    font-size: 12px;
}

.footer-logo {
    position: absolute;
    left: 16px;
    top: 50%;
    height: 22px;
    width: auto;
    transform: translateY(-50%);
}

.app-version {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--muted);
    font-size: 10px;
    transform: translateY(-50%);
}

.legal-footer button {
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: underline;
}

.legal-footer button:hover {
    color: var(--accent-hover);
}

.legal-modal-content {
    width: min(680px, 92vw);
    max-height: min(780px, 88vh);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-align: left;
}

.legal-modal-content h2 {
    margin: 0;
    padding: 24px 28px 18px;
    color: var(--ink);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface));
    border-bottom: 1px solid var(--line);
    font-size: clamp(20px, 3vw, 26px);
    line-height: 1.25;
}

.legal-modal-content #legalModalBody {
    max-height: min(570px, 62vh);
    padding: 24px 28px;
    overflow-y: auto;
    white-space: pre-line;
    color: var(--ink);
    line-height: 1.7;
    font-size: 14px;
}

.legal-modal-content > button {
    margin: 0 28px 24px;
    padding: 10px 18px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 160ms ease, transform 160ms ease;
}

.legal-modal-content > button:hover {
    background: var(--accent-hover);
}

.legal-modal-content > button:active {
    transform: translateY(1px);
}

.legal-text {
    text-align: left;
    line-height: 1.6;
    white-space: pre-line;
}

.legal-text p,
.legal-text ul,
.legal-text ol {
    margin-bottom: 1em;
}

#messageText {
    font-size: 17px;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .middle-panel {
        grid-column: 1 / -1;
        grid-row: 1;
        min-height: 280px;
    }

    .left-panel,
    .right-panel {
        min-height: 230px;
    }

    .calendar-panel {
        grid-column: 1 / -1;
    }
}

/* App views and the global navigation drawer */
.menu-trigger {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center;
    color: inherit;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    font-size: 0;
}

.menu-trigger span {
    display: block;
    font-size: 22px;
    line-height: 1;
    pointer-events: none;
    transform: rotate(0deg);
    transition: transform 220ms ease;
}

.menu-trigger[aria-expanded="true"] span {
    transform: rotate(90deg);
}

.menu-trigger:hover,
.menu-trigger:focus-visible {
    background: transparent !important;
}

.navigation-drawer {
    position: fixed;
    z-index: 1300;
    top: 0;
    right: 0;
    width: 25vw;
    min-width: 0;
    height: 100vh;
    padding: 96px 24px 24px;
    color: var(--ink);
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: -20px 0 45px rgba(27, 43, 38, 0.18);
    transform: translateX(105%);
    transition: transform 220ms ease;
}

.navigation-drawer[aria-hidden="false"] {
    transform: translateX(0);
}

.navigation-drawer[hidden] {
    display: none !important;
}

.navigation-backdrop {
    position: fixed;
    z-index: 1250;
    inset: 0;
    background: rgba(24, 35, 32, 0.32);
}

.page-heading,
.calendar-toolbar,
.month-toolbar,
.button-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-heading {
    justify-content: space-between;
}

.help-heading-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 14px;
}

.help-heading-group.guest-help {
    flex-direction: row-reverse;
    justify-content: space-between;
}

.guest-help-back {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.guest-help-back svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.guest-help-back:hover {
    background: var(--surface);
}

.guest-help-back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.guest-help-back[hidden] {
    display: none;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 5px;
    cursor: pointer;
    font-size: 24px;
}

.drawer-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-links button {
    width: 100%;
    padding: 13px 12px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-weight: 650;
}

.drawer-links button:hover,
.drawer-links button[aria-current="page"] {
    color: var(--accent-hover);
    background: var(--accent-soft);
}

.app-views {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.app-view[hidden] {
    display: none;
}

.page-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 44px);
}

.absence-page-shell,
.entries-page-shell {
    width: min(760px, 100%);
    max-width: 760px;
}

.narrow-shell {
    width: min(760px, 100%);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(280px, 1.6fr) minmax(190px, 1fr);
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 44px);
    gap: 18px;
}

.page-heading {
    margin-bottom: 22px;
}

.page-heading h2 {
    color: var(--ink);
    font-size: clamp(22px, 3vw, 32px);
}

.eyebrow {
    margin-bottom: 5px;
    color: var(--accent-hover);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-columns {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.4fr);
    gap: 18px;
}

.absence-page-columns {
    grid-template-columns: minmax(0, 1fr);
}

.absence-page-columns .calendar-surface {
    width: 100%;
}

.surface-panel {
    padding: clamp(20px, 3vw, 30px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.surface-panel h3 {
    margin-bottom: 14px;
    font-size: 18px;
}

.button-row > *,
.page-heading > button,
.profile-page-panel > button {
    flex: 1;
}

.button-row .cancel-btn {
    min-height: 46px;
    margin-top: 22px;
    padding: 12px;
    color: var(--ink);
    background: transparent !important;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#absenceForm .button-row > button {
    height: auto;
    min-height: 46px;
    margin-top: 0;
    padding: 10px 8px;
    line-height: 1.25;
    white-space: nowrap;
}

.button-row .cancel-btn:hover {
    background: var(--accent-soft) !important;
    border-color: var(--accent);
}

.button-row .cancel-btn:active {
    transform: translateY(1px);
}

.cancel-btn {
    margin-left: 0;
}

.absence-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-top: 18px;
}

.calendar-day,
.calendar-weekday {
    min-height: 42px;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
}

.calendar-weekday {
    min-height: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.calendar-day {
    color: var(--ink);
    background: #eef3f1;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.calendar-day.is-outside {
    color: #a9b2af;
    background: transparent;
}

.calendar-day.has-absence {
    color: #173d36;
    background: #b9ded4;
    border-color: #6eafa1;
    font-weight: 700;
}

.calendar-day:hover,
.calendar-day:focus-visible {
    border-color: var(--accent);
}

body.dark-mode .calendar-day {
    color: var(--ink);
    background: #29343a;
}

body.dark-mode .calendar-day.is-outside {
    color: #6d7a80;
    background: transparent;
}

body.dark-mode .calendar-day.has-absence,
body.dark-mode .calendar-day.is-selected {
    color: #173d36;
}

body.dark-mode .calendar-day.has-absence {
    background: #b9ded4;
}

body.dark-mode .calendar-day.is-selected {
    background: #a5d5c9;
}

.calendar-toolbar,
.month-toolbar {
    justify-content: space-between;
}

.entries-toolbar .export-pdf-btn {
    width: auto;
    height: 42px;
    min-height: 42px;
    margin-top: 0;
    padding: 0 clamp(8px, 2vw, 16px);
    font-size: clamp(9px, 2.6cqi, 13px);
    white-space: nowrap;
    overflow: hidden;
}

.calendar-toolbar,
.entries-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 9.5rem 42px;
    container-type: inline-size;
    gap: 8px;
}

.entries-toolbar strong,
.calendar-toolbar h3 {
    white-space: nowrap;
}

.entries-toolbar .export-pdf-btn {
    justify-self: start;
    max-width: 100%;
}

.calendar-toolbar .add-absence-btn {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0 clamp(8px, 2vw, 16px);
    font-size: clamp(9px, 2.6cqi, 13px);
    white-space: nowrap;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
}

.calendar-toolbar .icon-btn {
    height: 42px;
    line-height: 1;
    place-items: center;
}

.calendar-toolbar h3,
.month-toolbar strong {
    margin: 0;
    text-align: center;
}

.calendar-toolbar h3 {
    grid-column: 3;
    grid-row: 1;
}

.calendar-toolbar .icon-btn:nth-of-type(2) {
    grid-column: 2;
    grid-row: 1;
}

.calendar-toolbar .icon-btn:nth-of-type(3) {
    grid-column: 4;
    grid-row: 1;
}

.absence-list,
.monthly-entries-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.absence-item {
    padding: 12px;
    color: var(--ink);
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
}

.profile-page-panel {
    display: grid;
    gap: 12px;
}

.profile-details {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
    margin: 0 0 8px;
}

.profile-details dt,
.profile-details dd {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.profile-details dt {
    color: var(--muted);
    font-weight: 650;
}

.profile-details dd {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.break-rule-link {
    color: var(--accent);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.break-rule-link:hover {
    color: var(--accent-hover);
}

.break-rule-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-provider-notice {
    margin: 0;
    color: var(--muted);
}

.profile-details dt:last-of-type,
.profile-details dd:last-of-type {
    border-bottom: 0;
}

.text-action {
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 14px;
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.text-action:hover {
    color: var(--accent-hover);
    background: var(--accent-soft);
}

.text-action:active {
    transform: translateY(1px);
}

.text-action:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.text-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.support-email a,
.support-link {
    color: var(--accent-hover);
    font-weight: 650;
}

.support-link:hover {
    color: var(--accent);
}

.support-email {
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.account-deletion-link {
    width: 100%;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.account-deletion-link:hover {
    color: var(--ink);
    text-decoration: underline;
}

.account-deletion-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.support-feedback {
    min-height: 1.5em;
    color: var(--accent-hover);
    font-weight: 650;
}

.support-feedback-error,
.field-error {
    color: var(--danger, #b42318);
}

.field-error {
    min-height: 1.25em;
    font-size: 13px;
}

@media (max-width: 900px) {
    .navigation-drawer {
        width: 25vw;
        min-width: 0;
    }

    .dashboard-grid,
    .page-columns {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navigation-drawer,
    .menu-trigger span {
        transition: none;
    }
}

@media (max-width: 600px) {
    header {
        min-height: 64px;
        padding: 12px 18px;
    }

    body.not-authenticated header {
        padding-top: 20px;
    }

    .container {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
        gap: 12px;
    }

    .left-panel,
    .middle-panel,
    .right-panel {
        min-height: 0;
        padding: 20px;
    }

    .right-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .action-btn {
        min-height: 52px;
        padding: 12px;
        font-size: 14px;
    }

    .action-btn:last-child {
        grid-column: 1 / -1;
    }

    .modal-content {
        padding: 22px 18px;
    }
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.language-switch button {
    min-width: 36px;
    min-height: 32px;
    padding: 0 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.language-switch button[aria-pressed="true"] {
    color: white;
    background: var(--accent);
}

.language-switch,
.theme-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.language-switch button,
.theme-switch button {
    display: inline-grid;
    min-width: 36px;
    min-height: 32px;
    padding: 0 8px;
    place-items: center;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.language-switch button[aria-pressed="true"],
.theme-switch button[aria-pressed="true"] {
    color: #ffffff;
    background: var(--accent);
}

.theme-switch button {
    padding: 0;
}

.language-switch button:focus-visible,
.theme-switch button:focus-visible {
    outline-offset: 1px;
}

body.not-authenticated .language-switch,
body.not-authenticated .theme-switch {
    background: rgba(255, 255, 255, 0.72);
}

body.dark-mode {
    --ink: #e8eaec;
    --muted: #a9afb4;
    --canvas: #17191b;
    --surface: #232629;
    --line: #3b4044;
    --accent: #46ae98;
    --accent-hover: #35927e;
    --accent-soft: #2b3738;
    --warm: #c8755b;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
}

body.dark-mode header {
    background: #19251f;
}

body.not-authenticated.dark-mode header {
    color: var(--ink);
    background: transparent;
}

body.dark-mode .auth-screen {
    background: linear-gradient(145deg, #17191b 0%, #25282b 100%);
}

body.dark-mode .auth-card,
body.dark-mode .seo-intro {
    background-color: var(--surface);
    border-color: var(--line);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
    color: var(--ink);
}

body.dark-mode .seo-feature-list li {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line);
    color: var(--ink);
}

body.dark-mode .feature-icon {
    background: var(--accent);
    color: #17191b;
}

body.dark-mode .seo-footer-pills {
    border-top-color: var(--line);
}

body.dark-mode .left-panel,
body.dark-mode .middle-panel,
body.dark-mode .right-panel,
body.dark-mode .modal-content,
body.dark-mode .profile-menu,
body.dark-mode .progress-text {
    color: var(--ink);
    background-color: var(--surface);
    border-color: var(--line);
}

body.dark-mode .google-btn {
    color: var(--ink);
    background-color: #24292e;
    border: none;
}

body.dark-mode .google-btn:hover {
    background-color: #040d21;
}

body.dark-mode .auth-form label {
    color: #d1ddd6;
}

body.dark-mode .auth-form input,
body.dark-mode .auth-form textarea,
body.dark-mode .modal-content input,
body.dark-mode .auth-form select,
body.dark-mode .modal-content select {
    color: var(--ink);
    background: #1b1e21;
    border-color: #464b50;
    color-scheme: dark;
}

body.dark-mode .auth-form select option,
body.dark-mode .modal-content select option {
    color: var(--ink);
    background: #1b1e21;
}

body.dark-mode .entry-item {
    color: var(--ink);
    background: #292d30;
    border-color: #3b4044;
    border-left-color: var(--accent);
}

body.dark-mode .profile-menu button {
    color: var(--ink);
    border-bottom-color: #35453c;
}

body.dark-mode .profile-menu button:hover {
    background: var(--accent-soft);
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
    border-bottom-color: var(--line);
}

body.dark-mode .divider span {
    color: var(--muted);
}

body.dark-mode #profileCompleteModal p {
    color: var(--muted) !important;
}

body.dark-mode .language-switch {
    background: #1d2823;
    border-color: #46574e;
}

body.dark-mode .theme-switch {
    background: #1d2823;
    border-color: #46574e;
}

body.dark-mode .language-switch button {
    color: var(--muted);
}

body.dark-mode .language-switch button[aria-pressed="true"] {
    color: #10221c;
    background: var(--accent);
}

body.dark-mode .modal {
    background: rgba(0, 0, 0, 0.68);
}

@media (max-width: 600px) {
    header {
        gap: 8px;
        padding-right: 12px;
        padding-left: 12px;
    }

    header h1 {
        font-size: 18px;
    }

    .brand-logo {
        height: 34px;
        max-width: min(44vw, 200px);
    }

    .header-tools {
        gap: 5px;
    }

    .language-switch button,
    .theme-switch button {
        min-width: 32px;
        padding: 0 6px;
    }

    .theme-switch button {
        padding: 0;
    }
}

@media (max-width: 360px) {
    header {
        flex-wrap: wrap;
        justify-content: center;
    }

    header h1 {
        flex: 1 0 100%;
        text-align: center;
    }

    .header-tools {
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    header,
    body.not-authenticated header {
        flex-wrap: nowrap;
        align-items: flex-start;
        justify-content: space-between;
    }

    header h1 {
        flex: 0 1 auto;
        max-width: calc(100% - 90px);
        padding-top: 7px;
        text-align: left;
    }

    .brand-logo {
        max-width: calc(100vw - 110px);
    }

    .header-tools {
        flex-direction: column;
        align-items: stretch;
        flex: 0 0 auto;
        gap: 6px;
        margin: 0;
    }

    .language-switch,
    .theme-switch {
        width: 71px;
    }

    .language-switch button,
    .theme-switch button {
        flex: 1 1 0;
    }

    .profile-container {
        align-self: flex-end;
    }
}

body.not-authenticated header {
    min-height: 76px;
    justify-content: space-between;
    padding: 16px clamp(20px, 4vw, 56px);
    color: #ffffff;
    background: #243b36;
}

body.not-authenticated.dark-mode header {
    color: var(--ink);
    background: #19251f;
}

body.dark-mode .legal-footer {
    color: var(--ink);
    background: var(--surface);
    border-top-color: var(--line);
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.theme-icon {
    display: grid;
    width: 36px;
    height: 32px;
    place-items: center;
    font-size: 19px;
    line-height: 1;
}

.theme-switch button[aria-pressed="true"] .theme-icon {
    color: #10221c;
}

.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;
}

@media (max-width: 600px) {
    body.not-authenticated header {
        min-height: 64px;
        padding: 12px;
    }

    .theme-icon {
        width: 32px;
    }
}

.auth-form select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: var(--ink);
}

.auth-hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.text-btn {
    align-self: flex-start;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
}

.text-btn:hover {
    text-decoration: underline;
}

.activity-label {
    align-self: flex-start;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.activity-select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
}

.dashboard-stats {
    display: grid;
    gap: 5px;
    width: 100%;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.dashboard-stats strong {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-stats span {
    margin-bottom: 8px;
    font-size: 21px;
    font-weight: 700;
}

.monthly-chart {
    width: 100%;
    height: 144px;
    margin-top: 12px;
}

.secondary-btn {
    width: 100%;
    margin-top: 14px;
    padding: 11px 14px;
    border: 1px solid var(--accent);
    border-radius: 5px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 650;
}

.secondary-btn:hover {
    background: var(--accent-soft);
}

.profile-modal-content {
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}

.calendar-panel {
    min-width: 0;
    padding: clamp(20px, 2.5vw, 30px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.calendar-panel h2 {
    margin-bottom: 16px;
    color: var(--ink);
    font-size: 18px;
}

@media (max-width: 600px) {
    header,
    body.not-authenticated header {
        min-height: 64px;
        padding: 10px 12px;
    }

    header h1 {
        max-width: none;
        padding-top: 0;
    }

    .brand-logo {
        height: 32px;
        max-width: 34vw;
    }

    .header-tools {
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }

    .language-switch,
    .theme-switch {
        width: 82px;
        flex: 0 0 82px;
    }

    .language-switch button,
    .theme-switch button {
        flex: 1 1 0;
        min-width: 27px;
        height: 30px;
        width: 0;
        padding: 0 5px;
    }

    .theme-icon {
        width: 27px;
        height: 28px;
        font-size: 17px;
    }

    .menu-trigger {
        width: 36px;
        height: 36px;
    }

    .app-views {
        min-height: 0;
    }

    .navigation-drawer {
        width: min(88vw, 360px);
        padding: 82px 16px 20px;
    }

    .drawer-links {
        gap: 4px;
    }

    .drawer-links button {
        min-height: 46px;
        padding: 11px 12px;
    }

    .dashboard-grid,
    .page-shell {
        padding: 16px 12px 28px;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .left-panel,
    .middle-panel,
    .right-panel,
    .surface-panel,
    .calendar-panel {
        border-radius: 12px;
    }

    .left-panel,
    .middle-panel,
    .right-panel {
        padding: 18px 16px;
    }

    .left-panel h2,
    .today-time h2 {
        font-size: 20px;
    }

    .progress-circle {
        width: 132px;
        height: 132px;
        margin-top: 16px;
    }

    .progress-text {
        width: 98px;
        height: 98px;
    }

    .dashboard-stats {
        margin-top: 18px;
        padding-top: 14px;
    }

    .dashboard-stats span {
        font-size: 19px;
    }

    .monthly-chart {
        height: 136px;
    }

    .entries-list {
        max-height: 36vh;
    }

    .entry-item {
        padding: 12px;
    }

    .right-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .right-panel .activity-label,
    .right-panel .activity-select {
        grid-column: 1;
    }

    .action-btn,
    .action-btn:last-child {
        grid-column: 1;
        min-height: 48px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 16px;
    }

    .page-heading > button {
        width: 100%;
    }

    .page-heading > .add-absence-btn {
        width: 100%;
    }

    .page-heading h2 {
        font-size: 25px;
        line-height: 1.2;
    }

    .page-columns {
        gap: 12px;
    }

    .surface-panel,
    .calendar-panel {
        padding: 18px 16px;
    }

    .button-row {
        flex-direction: column;
        gap: 8px;
    }

    .button-row > * {
        width: 100%;
    }

    .button-row .cancel-btn {
        margin-top: 0;
    }

    .calendar-toolbar h3,
    .month-toolbar strong {
        font-size: 15px;
    }

    .calendar-toolbar {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        row-gap: 10px;
    }

    .calendar-toolbar .add-absence-btn {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        justify-self: stretch;
        overflow: visible;
    }

    .calendar-toolbar .icon-btn:nth-of-type(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .calendar-toolbar h3 {
        grid-column: 2;
        grid-row: 2;
    }

    .calendar-toolbar .icon-btn:nth-of-type(3) {
        grid-column: 3;
        grid-row: 2;
    }

    .absence-calendar-grid {
        gap: 3px;
        margin-top: 14px;
    }

    .calendar-day,
    .calendar-weekday {
        min-height: 38px;
        padding: 6px 2px;
        font-size: 12px;
        text-align: center;
    }

    .calendar-weekday {
        font-size: 10px;
    }

    .profile-details {
        display: block;
    }

    .profile-details dt,
    .profile-details dd {
        display: block;
        padding: 8px 0 3px;
        border-bottom: 0;
    }

    .profile-details dd {
        padding: 0 0 10px;
        border-bottom: 1px solid var(--line);
    }

    .modal {
        align-items: flex-end;
        padding: 12px;
    }

    .modal-content {
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        border-radius: 14px;
        padding: 20px 16px;
    }

    .legal-modal-content {
        padding: 0;
    }

    .legal-modal-content h2 {
        padding: 20px 18px 15px;
    }

    .legal-modal-content #legalModalBody {
        max-height: calc(100vh - 210px);
        padding: 18px;
    }

    .legal-modal-content > button {
        margin: 0 18px 18px;
    }
}

.absence-list {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.absence-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: var(--ink);
    border-left: 3px solid var(--warm);
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 6px;
}

body.dark-mode .absence-item {
    color: var(--ink);
    background: #29343a;
    border-color: #40515a;
    border-left-color: var(--warm);
}

.entry-edit-btn {
    float: right;
    padding: 4px 7px;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 16px;
}

.entry-edit-icon {
    display: inline-block;
    transform: scaleX(-1);
}

.password-requirements {
    list-style: none;
    margin-top: 8px;
    padding: 0;
    color: #777;
    font-size: 12px;
}

.password-requirements li::before {
    content: "○";
    display: inline-block;
    width: 18px;
}

.password-requirements li.fulfilled {
    color: #18804b;
}

.password-requirements li.fulfilled::before {
    content: "✓";
    font-weight: 700;
}

.onboarding-progress {
    margin-bottom: 12px;
    color: #687773;
    font-size: 13px;
    text-align: center;
}

.onboarding-actions {
    display: flex;
    gap: 10px;
}

.onboarding-actions .submit-btn,
.onboarding-actions .cancel-btn {
    flex: 1;
    height: 46px;
    min-height: 46px;
    margin-top: 22px;
}
.field-invalid,
.auth-form input.field-invalid,
.auth-form select.field-invalid,
.auth-form textarea.field-invalid,
body.dark-mode .auth-form input.field-invalid,
body.dark-mode .auth-form select.field-invalid {
    border-color: #d93025 !important;
    box-shadow: 0 0 0 1px #d93025;
    background-color: rgba(217, 48, 37, 0.12);
}

/* Modals dürfen nicht unter den fixierten Header ragen */
.modal {
    box-sizing: border-box;
    padding: 108px 16px 16px;
}

.modal-content {
    max-height: min(760px, calc(100vh - 124px));
}

.legal-modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(780px, calc(100vh - 124px));
}

.legal-modal-content #legalModalBody,
.legal-modal-content #breakInfoBody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.legal-modal-content h2,
.legal-modal-content > button,
.break-toggle,
.break-toggle-question {
    flex: 0 0 auto;
}

/* Swiss break regulation (ArG Art. 15) */
.modal-content .break-hint {
    align-self: flex-start;
    min-height: 0;
    width: auto;
    margin: 6px 0 0;
    padding: 0;
    color: var(--accent-hover);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.modal-content .break-hint[hidden] {
    display: none;
}

.modal-content .break-hint:hover {
    background: transparent;
    text-decoration: underline;
}

.modal-content .break-hint.break-hint-error {
    color: #b3261e;
}

.auth-form input.break-invalid,
.modal-content input.break-invalid {
    border-color: #d93025;
    box-shadow: 0 0 0 1px #d93025;
    background-color: #fff0ef;
}

.modal-content .submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.entry-item .auto-break-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 3px 10px;
    color: #7a4f00;
    background: #fff4d6;
    border: 1px solid #e0b84a;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.entry-item .auto-break-badge:hover {
    background: #ffecb8;
}

.entry-item .auto-break-badge {
    position: relative;
}

.entry-item .auto-break-badge::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: 240px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(40, 40, 40, 0.82);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    white-space: pre-line;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 20;
}

.entry-item .auto-break-badge::before {
    content: "";
    position: absolute;
    left: 18px;
    bottom: calc(100% + 4px);
    border: 6px solid transparent;
    border-top-color: rgba(40, 40, 40, 0.82);
    border-bottom: 0;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 20;
}

.entry-item .auto-break-badge:hover::after,
.entry-item .auto-break-badge:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.entry-item .auto-break-badge:hover::before,
.entry-item .auto-break-badge:focus-visible::before {
    opacity: 1;
}

body.dark-mode .entry-item .auto-break-badge::after {
    background: rgba(240, 240, 240, 0.88);
    color: #111;
}

body.dark-mode .entry-item .auto-break-badge::before {
    border-top-color: rgba(240, 240, 240, 0.88);
}

.modal-content .break-hint {
    white-space: pre-line;
}

.break-disable-text {
    line-height: 1.6;
}

.legal-modal-content #breakInfoBody {
    max-height: min(470px, 52vh);
    padding: 24px 28px;
    overflow-y: auto;
    color: var(--ink);
    line-height: 1.7;
    font-size: 14px;
}

.break-toggle-question {
    flex: 0 0 auto;
    margin: 0 28px 14px;
    padding-top: 14px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.5;
}

.break-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 28px 4px;
    padding: 0;
    color: var(--ink);
    font-weight: 650;
    cursor: pointer;
}

.break-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 44px;
    width: 44px;
    height: 24px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #5a636b;
    background: #8a939b;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.break-toggle input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}

.break-toggle input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.break-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.break-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.break-toggle input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: wait;
}

body.dark-mode .modal-content .break-hint {
    color: var(--accent);
}

body.dark-mode .modal-content .break-hint.break-hint-error {
    color: #ff8a80;
}

body.dark-mode .auth-form input.break-invalid,
body.dark-mode .modal-content input.break-invalid {
    border-color: #ff6b60;
    box-shadow: 0 0 0 1px #ff6b60;
    background-color: rgba(217, 48, 37, 0.18);
}

body.dark-mode .entry-item .auto-break-badge {
    color: #ffd37a;
    background: #3a3118;
    border-color: #8a7330;
}

body.dark-mode .entry-item .auto-break-badge:hover {
    background: #4a3d1c;
}
