:root {
    --red: #b51f29;
    --red-dark: #7f1219;
    --text: #1f2328;
    --muted: #667085;
    --border: #e5e7eb;
    --bg: #f7f7f8;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(181, 31, 41, 0.05), transparent 280px),
        linear-gradient(180deg, #ffffff 0%, #f7f7f8 42%, #f1f2f4 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.page {
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 72px;
    min-height: 100vh;
    position: relative;
}

.hero-card {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 22px 24px;
    margin-bottom: 24px;
    color: var(--text);
    background: white;
    border: 1px solid var(--border);
    border-top: 4px solid var(--red);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.brand {
    display: flex;
    gap: 20px;
    align-items: center;
}

.brand img {
    width: 120px;
    max-height: 80px;
    object-fit: contain;
    padding: 10px;
    background: white;
    border-radius: 14px;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 18px;
    position: relative;
    z-index: 30;
}

.contact-strip {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    align-items: center;
    padding: 6px 16px;
    background: linear-gradient(90deg, var(--red), #d43a43);
    color: white;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.contact-strip span {
    white-space: nowrap;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-width: 0;
    padding: 12px 16px;
    min-height: 76px;
    background: white;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    flex-wrap: wrap;
}

.app-header-compact .main-header {
    border-top: 1px solid var(--border);
    border-radius: 18px;
}

.header-left-group {
    display: flex;
    align-items: center;
    flex: 1 1 520px;
    min-width: 0;
    gap: 14px;
    flex-wrap: wrap;
}

.brand-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.brand-link img {
    width: 112px;
    max-height: 54px;
    object-fit: contain;
    padding: 8px 10px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.desktop-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.desktop-nav-left {
    justify-content: flex-start;
}

.desktop-account-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 360px;
    min-width: 0;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.user-badge {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0 4px;
    max-width: 100%;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #eef0f3;
    border-radius: 999px;
    background: #f9fafb;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.35;
}

.user-badge-prefix {
    white-space: nowrap;
}

.user-badge-main {
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-dropdown {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.admin-dropdown > summary {
    list-style: none;
}

.admin-dropdown > summary::-webkit-details-marker {
    display: none;
}

.admin-dropdown-toggle {
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.dropdown-caret {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.admin-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 50;
    display: none;
    min-width: 240px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.admin-nav-group-label,
.mobile-nav-group-label {
    display: block;
    padding: 8px 10px 3px;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-nav-group-label:not(:first-child) {
    margin-top: 5px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
}

.admin-dropdown:hover .admin-dropdown-menu,
.admin-dropdown:focus-within .admin-dropdown-menu,
.admin-dropdown[open] .admin-dropdown-menu {
    display: grid;
    gap: 4px;
}

.admin-dropdown-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #374151;
    background: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-dropdown-link:hover,
.admin-dropdown-link:focus {
    background: #f9fafb;
    outline: none;
}

.admin-dropdown-link.is-active {
    color: var(--red-dark);
    background: #fff5f5;
}

.mobile-nav {
    position: relative;
    display: none;
    margin-left: auto;
}

.mobile-nav > summary {
    list-style: none;
}

.mobile-nav > summary::-webkit-details-marker {
    display: none;
}

.mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    color: var(--text);
}

.site-menu-icon {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.site-menu-icon span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mobile-nav-panel {
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.mobile-nav[open] .mobile-nav-panel {
    display: flex;
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 800;
    white-space: nowrap;
}

.site-nav-link:hover {
    background: #f9fafb;
}

.site-nav-link.is-active {
    color: white;
    background: var(--red);
    border-color: transparent;
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

.logout-form .logout-link {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
    cursor: pointer;
    font: inherit;
}

.logout-form .logout-link:hover {
    background: #fecaca;
}

.page-version {
    position: static;
    align-self: flex-end;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-top: auto;
}

.page-version-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-version-links a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.feedback-entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.feedback-entry-card h2,
.feedback-entry-card p {
    margin: 0;
}

.feedback-entry-card p {
    color: var(--muted);
    margin-top: 4px;
}

.feedback-form {
    display: grid;
    gap: 16px;
    max-width: 760px;
}

.feedback-form small,
.feedback-privacy {
    color: var(--muted);
    font-size: 0.86rem;
}

.feedback-message {
    display: grid;
    gap: 10px;
}

.feedback-context {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.feedback-context h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.feedback-context dl {
    display: grid;
    gap: 6px;
    margin: 0;
}

.feedback-context dl div {
    display: flex;
    gap: 10px;
}

.feedback-context dt {
    min-width: 120px;
    color: var(--muted);
}

.feedback-context dd {
    margin: 0;
    overflow-wrap: anywhere;
}

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

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.subline {
    margin: 10px 0 0;
    font-size: 1.05rem;
    opacity: 0.92;
}


.card {
    margin-top: 20px;
    padding: 24px;
    background: var(--card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.card h2 {
    margin-top: 0;
}

.card p {
    color: var(--muted);
    line-height: 1.5;
}

.upload-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
    margin-top: 22px;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input, select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: white;
}

button {
    padding: 12px 18px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--red);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: var(--red-dark);
}

.error {
    border-color: rgba(181,31,41,0.35);
    background: #fff5f5;
}

.error p {
    color: var(--red-dark);
}

.empty {
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: #374151;
    background: #f9fafb;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
}

.summary-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafafa;
}

.summary-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-grid strong {
    font-size: 1.1rem;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.health-item {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f9fafb;
}

.health-item-wide {
    grid-column: 1 / -1;
}

.health-item span:first-child {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.health-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.status-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.status-section-heading h2 {
    margin-bottom: 0;
}

.readiness-item strong {
    font-size: 0.95rem;
    line-height: 1.35;
}

.status-links {
    margin: 16px 0 0;
}

.status-links a {
    color: var(--accent);
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-ok {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

.status-warning {
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.status-missing {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.status-note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.warning {
    border-color: #e0b84c;
    background: #fffaf0;
}

.warning ul {
    margin: 0;
    padding-left: 20px;
}

.warning li {
    margin: 8px 0;
}

.day-block {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.day-block:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.day-block h3 {
    margin: 0;
}

.day-block header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    min-height: 26px;
}

.pill.ok {
    color: #166534;
    background: #dcfce7;
}

.pill.danger {
    color: #991b1b;
    background: #fee2e2;
}

.pill.muted {
    color: #374151;
    background: #e5e7eb;
}

.alias-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alias-list span {
    display: inline-flex;
    padding: 4px 8px;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.table-link {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.table-link:hover {
    text-decoration: underline;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 800;
}

.back-link:hover {
    background: #f9fafb;
}

.source-action-link {
    display: inline-flex;
    max-width: 100%;
    margin-top: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.success-card {
    border-color: rgba(22, 101, 52, 0.22);
    background: #f0fdf4;
}

.success-card p {
    color: #166534;
}

.settings-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
    max-width: 640px;
}

.calendar-fetch-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: 100%;
    min-height: 48px;
}

.calendar-fetch-button [data-calendar-fetch-label] {
    overflow-wrap: anywhere;
}

.calendar-fetch-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: white;
    border-radius: 50%;
    animation: calendar-fetch-spin 0.8s linear infinite;
}

.calendar-fetch-status {
    margin: -6px 0 0;
}

@keyframes calendar-fetch-spin {
    to { transform: rotate(360deg); }
}

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafafa;
}

.checkbox-field input {
    width: auto;
    margin-top: 4px;
    accent-color: var(--red);
    flex: 0 0 auto;
}

.checkbox-field span {
    display: grid;
    gap: 4px;
}

.checkbox-field small {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.4;
}

.settings-form label:not(.checkbox-field) {
    max-width: 480px;
}

.settings-form input[type="email"],
.settings-form input[type="text"] {
    max-width: 100%;
}
.settings-form input[type="email"],
.settings-form input[type="text"],
.settings-form select,
.user-form input[type="password"] {
    max-width: 100%;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.inline-form button {
    padding: 8px 12px;
    border-radius: 999px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.row-actions .back-link {
    padding: 8px 12px;
    font-size: 0.86rem;
}

.secondary-button {
    background: #f3f4f6;
    border-color: #cbd5e1;
    color: #1f2937;
}

.secondary-button:hover {
    background: #e5e7eb;
}

.danger-button {
    background: #b91c1c;
    border-color: #b91c1c;
    color: white;
}

.danger-button:hover {
    background: #991b1b;
    border-color: #991b1b;
}

.warning-card {
    border-color: #f3c35f;
    background: #fffaf0;
}

.detail-list {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: minmax(90px, 120px) 1fr;
    gap: 12px;
}

.detail-list dt {
    color: #6b7280;
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--red);
    border-radius: 10px;
    background: var(--red);
    color: white;
    font-weight: 800;
    text-decoration: none;
}

.primary-button:hover,
.primary-button:focus {
    background: var(--red-dark);
    color: white;
}

.unsigned-email-actions form {
    margin: 0;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    min-width: 220px;
}

.users-table th:last-child,
.users-table td:last-child {
    min-width: 340px;
}

.admin-calendar-sources-table {
    table-layout: fixed;
}

.admin-calendar-sources-table th,
.admin-calendar-sources-table td {
    overflow-wrap: anywhere;
    word-break: normal;
}

.admin-calendar-sources-table th:nth-child(1),
.admin-calendar-sources-table td:nth-child(1) {
    width: 16%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(2),
.admin-calendar-sources-table td:nth-child(2) {
    width: 20%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(3),
.admin-calendar-sources-table td:nth-child(3) {
    width: 12%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(4),
.admin-calendar-sources-table td:nth-child(4) {
    width: 16%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(5),
.admin-calendar-sources-table td:nth-child(5) {
    width: 16%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(6),
.admin-calendar-sources-table td:nth-child(6) {
    width: 14%;
    min-width: 0;
}

.admin-calendar-sources-table th:nth-child(7),
.admin-calendar-sources-table td:nth-child(7) {
    width: 6%;
    min-width: 0;
}

.admin-calendar-sources-table th:last-child,
.admin-calendar-sources-table td:last-child {
    min-width: 0;
}

.admin-calendar-sources-table .status-note {
    margin-top: 6px;
    font-size: 0.84rem;
    line-height: 1.35;
}

.admin-calendar-sources-table .status-note:first-of-type {
    margin-top: 8px;
}

.admin-calendar-sources-table .muted-text {
    margin-top: 6px;
    font-size: 0.84rem;
    line-height: 1.35;
}

.admin-calendar-sources-table .row-actions {
    justify-content: flex-start;
}

.event-details summary {
    cursor: pointer;
    font-weight: 700;
}

.event-details div {
    margin-top: 8px;
    white-space: pre-wrap;
}

.muted-text {
    color: var(--muted);
}

.projects-table th:nth-child(4),
.projects-table td:nth-child(4) {
    min-width: 260px;
}

.detail-table th:nth-child(9),
.detail-table td:nth-child(9) {
    min-width: 220px;
}

.week-table th:nth-child(3),
.week-table td:nth-child(3),
.week-table th:nth-child(4),
.week-table td:nth-child(4),
.week-table th:nth-child(5),
.week-table td:nth-child(5) {
    min-width: 210px;
}

.week-edit-form {
    display: grid;
    gap: 20px;
}

.week-edit-actions {
    margin: 0;
    margin-top: 18px;
}

.week-edit-toolbar {
    align-items: center;
}

.week-email-hint {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.week-email-panel {
    display: grid;
    gap: 14px;
}

.week-email-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.week-email-summary div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fafafa;
}

.week-email-summary span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.week-email-summary strong {
    overflow-wrap: anywhere;
}

.week-email-form {
    margin: 0;
}

.week-email-form .back-link {
    width: fit-content;
}

.week-delete-zone {
    display: grid;
    gap: 12px;
    border-color: rgba(181, 31, 41, 0.22);
    background: #fff5f5;
}

.week-delete-form {
    display: grid;
    gap: 12px;
    max-width: 520px;
}

.week-edit-table th:nth-child(1),
.week-edit-table td:nth-child(1) {
    min-width: 250px;
}

.week-edit-table th:nth-child(2),
.week-edit-table td:nth-child(2) {
    min-width: 220px;
}

.week-edit-table th:nth-child(3),
.week-edit-table td:nth-child(3) {
    min-width: 140px;
}

.week-edit-table th:nth-child(4),
.week-edit-table td:nth-child(4) {
    min-width: 240px;
}

.week-edit-table th:nth-child(5),
.week-edit-table td:nth-child(5) {
    min-width: 100px;
}

.week-edit-table th:nth-child(6),
.week-edit-table td:nth-child(6) {
    min-width: 110px;
}

.week-edit-table input[type="text"] {
    width: 100%;
    min-width: 0;
}

.week-entry-field {
    display: grid;
    gap: 6px;
}

.week-entry-raw {
    display: grid;
    gap: 4px;
}

.week-entry-note {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.week-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.week-entry-actions .back-link,
.week-entry-actions .danger-button {
    padding: 8px 12px;
    font-size: 0.86rem;
}

.week-entry-card--removed {
    background: #fafafa;
    border-color: rgba(148, 163, 184, 0.35);
    opacity: 0.86;
}

.week-entry-card--manual {
    background: #f8fafc;
}

.week-entry-card--removed input[readonly] {
    background: #f3f4f6;
    color: #4b5563;
}

.week-day-overflow {
    border-color: rgba(181, 31, 41, 0.20);
}

.week-project-leader-field {
    display: grid;
    gap: 8px;
    max-width: 520px;
}

.week-project-leader-field span {
    font-weight: 700;
}

.week-project-leader-field select {
    min-width: 0;
}


.week-day-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.week-day-title-group {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.week-day-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.week-day-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.week-day-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.week-entry-warning {
    background: #fffaf5;
}

.stack-list {
    display: grid;
    gap: 4px;
}

.week-day-warning {
    background: #fffaf0;
}

.docs-category-card {
    display: grid;
    gap: 18px;
}

.docs-category-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.docs-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.docs-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fafafa;
}

.docs-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.docs-card-head h3 {
    margin: 4px 0 0;
}

.docs-category-badge {
    margin: 0;
    color: var(--red-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-card-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.docs-meta {
    display: grid;
    gap: 10px;
}

.docs-meta div {
    display: grid;
    gap: 3px;
}

.docs-meta span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.docs-meta strong {
    overflow-wrap: anywhere;
}

.docs-card-actions {
    margin: 0;
}

.docs-content {
    display: grid;
    gap: 14px;
    color: var(--text);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4,
.docs-content h5,
.docs-content h6 {
    margin: 1.2em 0 0.5em;
    line-height: 1.25;
}

.docs-content h1:first-child,
.docs-content h2:first-child,
.docs-content h3:first-child {
    margin-top: 0;
}

.docs-content p,
.docs-content ul,
.docs-content ol,
.docs-content blockquote {
    margin: 0;
}

.docs-content ul,
.docs-content ol {
    padding-left: 22px;
}

.docs-content li + li {
    margin-top: 4px;
}

.docs-content blockquote {
    padding: 10px 14px;
    border-left: 4px solid var(--border);
    background: #fafafa;
    color: var(--muted);
}

.docs-content code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #f3f4f6;
    font-size: 0.95em;
    word-break: break-word;
}

.docs-content pre {
    margin: 0;
    padding: 14px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f172a;
    color: #e5e7eb;
}

.docs-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    white-space: pre;
}

.docs-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.docs-content th,
.docs-content td {
    padding: 10px 12px;
    border: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}

.docs-content th {
    background: #f9fafb;
}

.docs-markdown-fallback {
    white-space: pre-wrap;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }

    .mobile-nav {
        display: none;
    }
}

@media (max-width: 980px) {
    .main-header {
        gap: 12px;
        padding-inline: 12px;
    }

    .header-left-group {
        gap: 10px;
    }

    .brand-link img {
        width: 96px;
    }

    .desktop-account-group {
        flex: 1 1 100%;
        justify-content: flex-start;
    }

    .user-badge {
        max-width: 100%;
    }

    .user-badge-prefix {
        width: 100%;
    }

    .logout-link {
        align-self: flex-start;
    }

    .site-nav-link {
        padding-inline: 11px;
    }
}

@media (max-width: 767px) {
    .feedback-entry-card,
    .feedback-context dl div {
        align-items: stretch;
        flex-direction: column;
    }

.feedback-entry-card .feedback-entry-link {
        width: 100%;
    }

    .feedback-context dt {
        min-width: 0;
    }

    .page {
        width: min(100% - 24px, 1180px);
        padding-top: 18px;
        padding-bottom: 88px;
    }

    .hero-card {
        padding: 18px;
        border-radius: 16px;
    }

    .brand {
        gap: 14px;
    }

    .brand img {
        width: 88px;
        padding: 8px;
    }

    .eyebrow {
        font-size: 0.72rem;
    }

    h1 {
        font-size: 1.55rem;
    }

    .subline {
        font-size: 0.9rem;
    }

    .contact-strip {
        display: none;
    }

    .main-header {
        padding: 10px 12px;
        min-height: 68px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .brand-link img {
        width: 96px;
        max-height: 46px;
        padding: 6px 8px;
    }

    .desktop-nav,
    .desktop-account-group {
        display: none;
    }

    .header-left-group {
        flex: 0 1 auto;
    }

    .user-badge {
        font-size: 0.78rem;
        white-space: normal;
        text-align: left;
        justify-content: flex-start;
        max-width: 100%;
    }

    .mobile-nav {
        display: block;
    }

    .mobile-nav-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: min(320px, calc(100vw - 24px));
        max-height: min(70vh, 620px);
        overflow-y: auto;
        margin-top: 0;
        z-index: 40;
    }

    .mobile-nav-group-label {
        margin-top: 4px;
        padding-left: 4px;
    }

    .mobile-nav-group-label:not(:first-of-type) {
        border-top: 1px solid #e5e7eb;
        padding-top: 10px;
    }

    .page-version {
        display: inline-flex;
        flex-wrap: wrap;
        max-width: calc(100vw - 20px);
        align-self: flex-end;
        margin-top: auto;
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }

    .card {
        padding: 18px;
        border-radius: 16px;
    }

    .upload-form {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    table {
        font-size: 0.82rem;
        min-width: 760px;
    }

    .users-table {
        display: block;
        min-width: 0;
    }

    .users-table thead {
        display: none;
    }

    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
    }

    .users-table tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: white;
    }

    .users-table td {
        min-width: 0 !important;
        padding: 5px 0 5px 7.5rem;
        overflow-wrap: anywhere;
        position: relative;
    }

    .users-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 5px;
        width: 7rem;
        color: #6b7280;
        font-size: 0.74rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .users-table td:last-child {
        padding-left: 0;
        padding-top: 10px;
    }

    .users-table td:last-child::before {
        position: static;
        display: block;
        width: auto;
        margin-bottom: 6px;
    }

    .users-table .row-actions {
        align-items: stretch;
    }

    .users-table .row-actions > * {
        max-width: 100%;
    }

    th,
    td {
        padding: 9px 10px;
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(460px, 100%);
    padding: 28px;
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.10);
}

.login-brand {
    margin-bottom: 24px;
}

.login-brand img {
    width: 130px;
    padding: 10px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: #f8f8f8;
}

.login-brand h1 {
    color: var(--text);
    font-size: 2rem;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form button {
    width: 100%;
    margin-top: 6px;
}

.login-error {
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-weight: 700;
}

.login-success {
    margin-bottom: 18px;
    padding: 12px 14px;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    font-weight: 700;
}

.set-password-summary {
    margin: 0 0 18px;
    padding: 14px 16px;
}

.auth-page {
    max-width: 960px;
}

.auth-hero {
    margin-top: 0;
}

.set-password-form {
    max-width: 560px;
}

.set-password-form small {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.45;
}

.set-password-summary-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.login-footer {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.topbar-title {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    color: #374151;
    background: white;
    border: 1px solid var(--border);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
}

.topbar-link:hover {
    background: #f9fafb;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
}

.logout-button:hover {
    background: #fecaca;
}


.source-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
    align-items: stretch;
}

.source-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    height: 100%;
    align-content: start;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafafa;
}

.source-panel h3 {
    margin: 0;
}

.source-form {
    display: grid;
    gap: 14px;
    align-content: start;
}

.source-form-saved {
    grid-template-columns: minmax(120px, 140px) minmax(140px, 170px) minmax(220px, 1fr) auto;
    align-items: end;
}

.source-success {
    display: grid;
    gap: 6px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 14px;
    background: #f0fdf4;
}

.source-success h3,
.source-success p {
    margin: 0;
}

.source-success p {
    color: #166534;
    font-weight: 700;
}

.source-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.signature-card {
  display: grid;
  gap: 0.75rem;
}

.signature-preview-wrap {
  display: flex;
  align-items: center;
  min-height: 5rem;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #d5d7da);
  background: #fff;
  overflow: hidden;
}

.signature-preview {
  display: block;
  max-width: min(100%, 28rem);
  max-height: 8rem;
  object-fit: contain;
}

.signature-canvas {
  display: block;
  width: 100%;
  max-width: 56rem;
  height: auto;
  aspect-ratio: 3 / 1;
  touch-action: none;
  border: 2px dashed var(--border-color, #b9bdc3);
  border-radius: 0.35rem;
  background: #fff;
  cursor: crosshair;
}

.signature-form,
.signature-upload-form,
.signature-delete-form {
  display: grid;
  gap: 0.55rem;
}

.signature-delete-form {
  margin-top: 0.25rem;
}

.help-details {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f9fafb;
}

.help-details > summary {
    cursor: pointer;
    color: var(--red-dark);
    font-weight: 800;
}

.help-details[open] {
    background: #fffaf5;
}

.help-details ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text);
    line-height: 1.5;
}

.help-details li + li {
    margin-top: 8px;
}

.week-entry-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.week-entry-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.week-entry-card--warning {
    background: #fffaf5;
    border-color: rgba(181, 31, 41, 0.18);
}

.week-entry-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.week-entry-card-head h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
}

.week-entry-origin {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.week-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.week-entry-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-weight: 700;
}

.week-entry-field span {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.25;
}

.week-entry-field input {
    min-width: 0;
}

.week-entry-field--project-choice,
.week-entry-field--raw-summary {
    grid-column: span 2;
}

.week-entry-field--hours {
    grid-column: span 1;
}

.week-entry-free-details {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    padding: 12px 14px 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fafafa;
}

.week-entry-free-details > summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
    line-height: 1.35;
}

.week-entry-free-details > summary::marker,
.week-entry-free-details > summary::-webkit-details-marker {
    color: var(--accent);
}

.week-entry-free-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.week-entry-free-grid .week-entry-field--project-name,
.week-entry-free-grid .week-entry-field--project-number {
    grid-column: auto;
}

.week-entry-free-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.week-entry-raw-empty {
    margin: 0;
    padding: 10px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.week-entry-field--hours input {
    max-width: 150px;
}

.week-entry-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.week-day-badges {
    align-items: center;
}

.week-day-badges .pill,
.week-entry-status .pill {
    margin-left: 0;
}

.week-entry-issue {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.week-entry-raw-details {
    margin-top: 2px;
    padding-top: 2px;
}

.week-entry-raw-details > summary {
    cursor: pointer;
    color: var(--red-dark);
    font-weight: 700;
}

.week-entry-raw-content {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
}

.week-entry-raw-row {
    display: grid;
    gap: 4px;
}

.week-entry-raw-row span {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.week-entry-raw-row strong {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}

.week-edit-form .week-day-header p,
.week-edit-form .week-entry-note {
    word-break: break-word;
}

.week-edit-actions,
.week-edit-actions-bottom {
    flex-wrap: wrap;
}

.week-edit-day {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 3px solid rgba(148, 163, 184, 0.5);
}

.week-edit-day:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top-width: 0;
}

@media (max-width: 980px) {
    .source-picker-grid {
        grid-template-columns: 1fr;
    }

    .source-form-saved {
        grid-template-columns: 1fr;
    }

    .week-entry-grid {
        grid-template-columns: 1fr;
    }

    .week-email-summary {
        grid-template-columns: 1fr;
    }

    .week-entry-field--project-choice,
    .week-entry-field--raw-summary,
    .week-entry-field--hours {
        grid-column: auto;
    }

    .week-entry-free-details {
        grid-column: auto;
    }

    .week-entry-free-grid {
        grid-template-columns: 1fr;
    }

    .week-entry-card-head {
        flex-direction: column;
    }

    .week-entry-actions {
        align-items: flex-start;
    }

    .week-day-header {
        flex-direction: column;
    }

    .week-day-badges {
        justify-content: flex-start;
    }

    .week-edit-toolbar {
        align-items: flex-start;
    }
}


.week-picker-card {
    display: grid;
    gap: 16px;
}

.week-picker-overview {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.week-picker-selected {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 900;
    line-height: 1.15;
}

.week-picker-range,
.week-picker-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.week-picker-body {
    display: grid;
    gap: 14px;
}

.week-picker-nav-link {
    white-space: nowrap;
}

.week-picker-advanced {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
}

.week-picker-advanced summary {
    cursor: pointer;
    font-weight: 800;
    color: #374151;
}

.week-picker-advanced[open] summary {
    margin-bottom: 14px;
}

.week-picker-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.week-picker-header h2 {
    margin: 0;
}

.week-picker-header p {
    margin: 0;
}

.week-picker-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.week-picker-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    align-items: end;
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.week-day-chip {
    display: grid;
    gap: 3px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f9fafb;
    text-align: center;
    min-width: 0;
}

.week-day-chip span,
.week-day-chip small {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.2;
}

.week-day-chip strong {
    font-size: 0.98rem;
    line-height: 1.2;
}

.week-day-chip.is-today {
    border-color: rgba(181, 31, 41, 0.35);
    background: #fff5f5;
    box-shadow: inset 0 0 0 1px rgba(181, 31, 41, 0.18);
}

.week-day-chip.is-weekend {
    background: #f3f4f6;
}

.start-actions-card {
    display: grid;
    gap: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.section-header h2 {
    margin: 0;
}

.section-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.start-actions-grid,
.source-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.source-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    height: 100%;
    align-content: start;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafafa;
}

.source-panel.is-primary {
    border-color: rgba(181, 31, 41, 0.35);
    background: #fff7f7;
}

.source-panel h2 {
    margin: 0;
}

.source-panel p {
    margin: 0;
}

.source-form {
    display: grid;
    gap: 14px;
    align-content: start;
}

.source-form-saved {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.source-form button,
.week-picker-form button {
    justify-self: start;
    max-width: 100%;
}

.source-select-field {
    min-width: 0;
}

.source-select-field select {
    min-width: 0;
    max-width: 100%;
}

input[type="file"] {
    max-width: 100%;
}

.source-success {
    display: grid;
    gap: 6px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 14px;
    background: #f0fdf4;
}

.source-success h2,
.source-success p {
    margin: 0;
}

.source-success p {
    color: #166534;
    font-weight: 700;
}

.source-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.source-card-list {
    display: grid;
    gap: 16px;
}

.source-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
}

.source-card--inactive {
    background: #fafafa;
}

.source-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.source-card-head h3 {
    margin: 0;
    font-size: 1.02rem;
}

.admin-source-card-list {
    gap: 18px;
}

.admin-source-card-head {
    align-items: stretch;
}

.admin-source-card-main {
    display: grid;
    gap: 12px;
    min-width: 0;
    flex: 1 1 420px;
}

.admin-source-card-side {
    display: grid;
    gap: 12px;
    align-content: start;
    justify-items: end;
    min-width: 0;
    flex: 0 1 320px;
}

.admin-source-card-group {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.admin-source-card-kicker {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-source-card-group .muted-text {
    font-size: 0.84rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-source-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-source-card-details {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.admin-source-card-details .status-note {
    margin-top: 0;
}

.source-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-source-form,
.user-source-edit-form {
    display: grid;
    gap: 14px;
}

.user-source-edit-form {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.user-source-edit-form .row-actions {
    grid-column: 1 / -1;
}

.user-source-edit-form .checkbox-field {
    grid-column: 1 / -1;
}

.user-source-form button,
.user-source-edit-form button {
    width: auto;
}

@media (max-width: 980px) {
    .week-picker-header,
    .source-card-head,
    .week-entry-card-head {
        flex-direction: column;
    }

    .week-picker-form,
    .source-form-saved,
    .user-source-edit-form,
    .upload-form {
        grid-template-columns: 1fr;
    }

    .week-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .start-actions-grid,
    .source-picker-grid,
    .week-entry-grid {
        grid-template-columns: 1fr;
    }

    .week-entry-field--project-name,
    .week-entry-field--raw-summary,
    .week-entry-field--hours,
    .week-entry-field--project-number {
        grid-column: auto;
    }

    .week-entry-card-head {
        flex-direction: column;
    }
}

@media (max-width: 767px) {
    .week-picker-nav {
        justify-content: flex-start;
    }

    .week-picker-nav-link {
        flex: 1 1 auto;
    }

    .week-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .start-actions-grid,
    .source-picker-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
    }

    .week-day-chip small {
        font-size: 0.72rem;
    }
}

@media (max-width: 600px) {
    .week-strip {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 6px;
    }

    .week-day-chip {
        grid-column: span 3;
        min-height: 56px;
        padding: 8px 4px;
        border-radius: 10px;
        align-content: center;
    }

    .week-day-chip span {
        font-size: 0.72rem;
        font-weight: 800;
    }

    .week-day-chip strong {
        font-size: 0.9rem;
    }

    .week-day-chip small {
        display: none;
    }

    .week-day-chip.is-today::after {
        content: "Heute";
        color: var(--accent);
        font-size: 0.66rem;
        font-weight: 800;
        line-height: 1;
    }

    .week-day-chip:nth-child(5) {
        grid-column: 2 / span 3;
    }

    .week-day-chip:nth-child(6) {
        grid-column: 5 / span 3;
    }

    .week-day-chip:nth-child(7) {
        grid-column: 8 / span 3;
    }
}


.archive-filter,
.project-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    align-items: end;
}

.archive-grid,
.project-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 18px;
}

.archive-item,
.project-admin-card {
    min-width: 0;
}

.archive-item header,
.project-admin-card > header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.archive-item h2,
.project-admin-card h2 {
    margin: 4px 0 0;
    font-size: 1.15rem;
}

.archive-item dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.archive-item dl div {
    min-width: 0;
}

.archive-item dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.archive-item dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.archive-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
}

.archive-delivery-note {
    margin: -2px 0 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.week-email-delivery-summary {
    display: inline-flex;
    align-items: center;
}

.project-description,
.project-tags,
.project-form > button {
    grid-column: 1 / -1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
}

.project-tags input {
    flex: 1 1 180px;
    min-width: 0;
}

.project-complete-form,
.danger-zone {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dc2626;
    background: #fef2f2;
}

.week-entry-field--project-choice {
    grid-column: 1 / -1;
}

@media (max-width: 680px) {
    .archive-item header,
    .project-admin-card > header {
        flex-direction: column;
    }

    .archive-item dl {
        grid-template-columns: 1fr;
    }
}


.status-neutral {
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.status-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.smtp-status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}


.project-toolbar {
    display: grid;
    gap: 14px;
}

.project-filter-form,
.project-compact-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.project-filter-form .back-link {
    align-self: end;
}

.project-filter-form > button,
.project-compact-form > button {
    align-self: end;
}

.project-create-details,
.project-edit-details,
.project-complete-details {
    min-width: 0;
}

.project-create-details > summary,
.project-edit-details > summary,
.project-complete-details > summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.project-create-details[open] > summary,
.project-edit-details[open] > summary,
.project-complete-details[open] > summary {
    margin-bottom: 12px;
}

.project-table-card {
    padding: 0;
    overflow: hidden;
}

.project-table {
    min-width: 860px;
    margin: 0;
}

.project-table th,
.project-table td {
    vertical-align: top;
    white-space: normal;
}

.project-row-completed {
    color: var(--muted);
    background: #f8fafc;
}

.project-actions-cell {
    display: grid;
    gap: 8px;
    min-width: 210px;
}

.project-actions-cell form {
    margin: 0;
}

.project-edit-details .project-compact-form,
.project-complete-details .project-complete-form {
    min-width: min(680px, 70vw);
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

@media (max-width: 680px) {
    .project-filter-form,
    .project-compact-form {
        grid-template-columns: 1fr;
    }

    .project-edit-details .project-compact-form,
    .project-complete-details .project-complete-form {
        min-width: 0;
    }
}

.status-info { background: #eef2f7; color: #475569; }
.security-result { padding: 1rem 0; border-top: 1px solid #e5e7eb; }
.security-result:first-of-type { border-top: 0; }
.security-result-head { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.security-result-head h3 { margin: 0; }
.security-details { max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
