.nav-link.active {
    background: #14233a;
    color: #fff;
    box-shadow: inset 3px 0 #3d8bfd;
}

html[data-theme="light"] .nav-link.active {
    background: #e6eef8;
    color: #172235;
}

.current-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    min-width: 185px;
    padding-right: 13px;
    margin-right: 3px;
    border-right: 1px solid var(--line);
    line-height: 1.15;
}

.current-datetime strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.current-datetime span {
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
    white-space: nowrap;
}

.status-dot.blocked {
    background: var(--amber);
    box-shadow: 0 0 9px var(--amber);
}

.alert.warning {
    color: var(--amber);
    border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
    background: color-mix(in srgb, var(--amber) 8%, var(--surface));
}

.readonly-access-banner {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}

.readonly-access-banner > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--amber);
    background: color-mix(in srgb, var(--amber) 13%, var(--surface2));
    font-size: 18px;
}

.readonly-access-banner strong { display: block; font-size: 12px; }
.readonly-access-banner p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.subscription-readonly .project-data-form .field { cursor: not-allowed; opacity: .78; }

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

.auth-switch a { color: var(--blue); font-weight: 800; }

.user-card form {
    flex: 0 0 auto;
    margin: 0;
}

.user-card .logout-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    padding: 5px 7px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    transition: color .15s ease, background .15s ease;
}

.user-card .logout-button:hover,
.user-card .logout-button:focus-visible {
    color: var(--red);
    background: color-mix(in srgb, var(--red) 9%, transparent);
    outline: none;
}

.user-card .logout-button > span:first-child {
    font-size: 13px;
}

@media (max-width: 700px) {
    .readonly-access-banner { grid-template-columns: 38px 1fr; }
    .readonly-access-banner .btn { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .current-datetime {
        min-width: auto;
        padding-right: 10px;
    }

    .current-datetime span {
        display: none;
    }
}

.stat-card-link {
    display: block;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.stat-card-link:hover {
    transform: translateY(-2px);
    border-color: #3d8bfd;
    box-shadow: 0 18px 44px #1d72d326;
}

.stat-card-link:hover .stat-meta {
    color: var(--text);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(.25);
}

.field-action {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.field-action .field {
    min-width: 0;
    flex: 1;
}

.field-action .btn {
    white-space: nowrap;
}

.register-status {
    min-height: 16px;
    color: var(--muted);
    font-size: 10px;
}

.register-status.success { color: var(--green); }
.register-status.error { color: var(--red); }

@media (max-width: 520px) {
    .field-action { flex-direction: column; }
}

.copy-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-button {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface2);
    color: var(--muted);
    cursor: pointer;
    transition: .15s ease;
}

.copy-button:hover {
    color: var(--text);
    border-color: var(--blue);
}

.copy-button.copied {
    color: var(--green);
    border-color: var(--green);
}

.contact-email,
.project-count-link {
    color: var(--blue);
    text-decoration: none;
}

.contact-email:hover,
.project-count-link:hover {
    text-decoration: underline;
}

.project-count-link {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 35%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--blue) 8%, transparent);
    font-weight: 700;
}

.timeline-date.deadline-overdue {
    color: var(--red);
}

.timeline-date.deadline-soon {
    color: var(--amber);
}

.timeline-date.deadline-later {
    color: var(--green);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.report-total {
    color: var(--muted);
    font-size: 11px;
}

.report-breakdown {
    display: flex;
    flex-direction: column;
    gap: 19px;
}

.report-breakdown.compact {
    gap: 15px;
}

.report-row-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 12px;
}

.report-row-heading > span {
    line-height: 1.4;
}

.report-row-heading strong {
    white-space: nowrap;
}

.report-row-heading small {
    color: var(--muted);
    font-weight: 500;
    margin-left: 5px;
}

.report-bar {
    height: 7px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--line);
}

.report-bar span {
    display: block;
    min-width: 3px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.report-summary-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.report-summary-list > div {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 11px;
    min-height: 47px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.report-summary-list > div:last-child {
    border-bottom: 0;
}

.report-summary-list strong {
    font-size: 18px;
}

.report-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.report-dot-blue { background: var(--blue); }
.report-dot-green { background: var(--green); }
.report-dot-amber { background: var(--amber); }
.report-dot-red { background: var(--red); }

@media (max-width: 900px) {
    .reports-grid { grid-template-columns: 1fr; }
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(3, 8, 15, .72);
    backdrop-filter: blur(7px);
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(460px, 100%);
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 17px;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, var(--surface2), var(--surface));
    box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

.confirm-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--blue) 12%, var(--surface2));
    color: var(--blue);
    font-size: 21px;
    font-weight: 800;
}

.confirm-content .eyebrow {
    margin: 1px 0 7px;
}

.confirm-content h2 {
    margin: 0;
    color: var(--text);
    font-size: 19px;
}

.confirm-content p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.confirm-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.confirm-actions .btn {
    min-width: 105px;
}

html[data-theme="light"] .confirm-modal {
    background: rgba(28, 43, 61, .42);
}

html[data-theme="light"] .confirm-dialog {
    box-shadow: 0 28px 80px rgba(35, 54, 76, .24);
}

@media (max-width: 520px) {
    .confirm-dialog {
        grid-template-columns: 38px 1fr;
        gap: 13px;
        padding: 20px;
    }

    .confirm-icon {
        width: 38px;
        height: 38px;
    }

    .confirm-actions .btn {
        flex: 1;
    }
}

.settings-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 1050px;
}

.sortable-column {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    white-space: nowrap;
    transition: color .16s ease;
}

.sortable-column span {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    font-size: 11px;
    line-height: 1;
}

.sortable-column:hover,
.sortable-column.active {
    color: var(--blue);
}

.sortable-column.active span {
    color: var(--blue);
}

.projects-table td:first-child,
.projects-table td:last-child .btn {
    white-space: nowrap;
}

.project-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

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

.project-open-btn {
    border-color: color-mix(in srgb, var(--green) 52%, var(--line));
    color: color-mix(in srgb, var(--green) 82%, var(--text));
    background: color-mix(in srgb, var(--green) 10%, var(--surface2));
}

.project-open-btn:hover {
    border-color: var(--green);
    color: color-mix(in srgb, var(--green) 74%, white);
    background: color-mix(in srgb, var(--green) 18%, var(--surface2));
}

.project-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface2);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.project-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-icon-btn:hover {
    transform: translateY(-1px);
}

.project-icon-btn.duplicate:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
}

.project-icon-btn.delete {
    border-color: color-mix(in srgb, var(--red) 30%, var(--line));
    color: color-mix(in srgb, var(--red) 72%, var(--muted));
}

.project-icon-btn.delete:hover {
    border-color: var(--red);
    color: var(--red);
    background: color-mix(in srgb, var(--red) 10%, var(--surface2));
}

.project-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.project-form-panel {
    min-width: 0;
    min-height: 630px;
}

.project-form-main .card-body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-form-main .form-group {
    min-width: 0;
}

.project-form-main .form-grid {
    flex: 1;
    grid-template-rows: auto auto auto auto minmax(180px, 1fr);
}

.project-form-main .project-note-field textarea {
    height: 100%;
    min-height: 180px;
}

.project-form-main .form-group label {
    overflow-wrap: anywhere;
}

.project-form-main .field {
    width: 100%;
    min-width: 0;
}

.project-form-main .form-actions {
    margin-top: auto;
}

.project-form-secondary {
    display: flex;
    flex-direction: column;
}

.project-form-secondary-header {
    min-height: 82px;
}

.project-form-secondary-header .eyebrow {
    margin-bottom: 5px;
}

.project-form-secondary-header h2 {
    margin: 0;
    font-size: 15px;
}

.project-form-extra-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 17px;
}

.project-form-extra-grid .form-group {
    min-width: 0;
}

.project-form-extra-grid .field {
    width: 100%;
    min-width: 0;
}

.project-form-extra-grid .field-label {
    font: 700 11px Space Mono;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #8293aa;
}

.project-binary-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.project-binary-choice label {
    margin: 0;
    cursor: pointer;
}

.project-binary-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.project-binary-choice span {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface2);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.project-binary-choice label:hover span {
    border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
}

.project-binary-choice input:focus-visible + span {
    outline: 3px solid color-mix(in srgb, var(--blue) 22%, transparent);
    outline-offset: 1px;
}

.project-binary-choice input:checked + span {
    border-color: var(--blue);
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
}

.project-protected-interests {
    min-width: 0;
    margin-top: 7px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.project-protected-interests h3 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

.project-protected-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
    align-items: end;
}

.project-protected-grid .form-group {
    align-self: stretch;
    justify-content: end;
}

.project-form-empty {
    grid-column: 1 / -1;
    min-height: 475px;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 30px;
    border: 1px dashed color-mix(in srgb, var(--blue) 30%, var(--line));
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
    background: color-mix(in srgb, var(--blue) 3%, var(--surface2));
}

.project-form-empty > span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--line));
    border-radius: 10px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 8%, var(--surface2));
    font-size: 19px;
}

.project-form-empty strong {
    color: var(--text);
    font-size: 12px;
}

.project-form-empty p {
    margin: 6px 0 0;
    font-size: 10px;
}

.project-overview-sections {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.project-overview-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 30px;
}

.project-overview-protected-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-overview-item {
    position: relative;
    min-width: 0;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    padding: 12px 38px 12px 0;
    border-bottom: 1px solid var(--line);
}

.project-overview-wide {
    grid-column: span 2;
}

.project-overview-item small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: .45px;
}

.project-overview-item strong {
    max-width: 100%;
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.project-option-value {
    min-width: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface2);
}

.project-option-value.is-yes {
    border-color: color-mix(in srgb, var(--blue) 52%, var(--line));
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
}

.project-option-value.is-no,
.project-option-value.is-empty {
    color: var(--muted);
}

.project-item-edit {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--surface2);
    font-size: 14px;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.project-item-edit:hover {
    border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 9%, var(--surface2));
}

.project-overview-note {
    min-height: 94px;
}

.project-overview-note strong {
    white-space: pre-wrap;
}

.project-note-field,
.project-form-extra-grid .form-group,
.project-protected-grid .form-group {
    scroll-margin-top: 110px;
}

.project-note-field:target,
.project-form-extra-grid .form-group:target,
.project-protected-grid .form-group:target {
    border-radius: 8px;
    outline: 2px solid var(--blue);
    outline-offset: 7px;
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--blue) 9%, transparent);
}

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

.trial-operation-badge {
    margin-left: 18px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--red) 68%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--red) 13%, transparent);
    color: var(--red);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .trial-operation-badge {
        margin-left: auto;
        margin-right: 4px;
        padding: 5px 7px;
        font-size: 8px;
        letter-spacing: .45px;
    }
}

.settings-workspace {
    display: grid;
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.settings-side-nav {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.settings-side-card {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 13px;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.settings-side-card:hover {
    transform: translateX(2px);
    border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
}

.settings-side-card.active {
    border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
    background: color-mix(in srgb, var(--blue) 9%, var(--surface));
    box-shadow: inset 3px 0 var(--blue);
}

.settings-side-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
    border-radius: 11px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 8%, var(--surface2));
    font-size: 17px;
}

.settings-side-card strong,
.settings-side-card small {
    display: block;
}

.settings-side-card strong {
    color: var(--text);
    font-size: 13px;
    margin-bottom: 4px;
}

.settings-side-card small {
    color: var(--muted);
    font-size: 10px;
}

.settings-detail {
    min-width: 0;
}

.settings-detail-header {
    min-height: 76px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 14px;
    padding: 0 2px;
}

.settings-detail-header .eyebrow {
    margin-bottom: 6px;
}

.settings-detail-header h2 {
    margin: 0;
    font-size: 21px;
}

.settings-detail-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.settings-detail .form-card {
    max-width: none;
}

.calendar-status-card .card-body { display: grid; gap: 18px; }
.calendar-server-warning { line-height: 1.65; }
.calendar-server-warning code { color: var(--amber); overflow-wrap: anywhere; }
.calendar-connect-body { display: grid; grid-template-columns: 70px 1fr; gap: 20px; align-items: start; }
.calendar-connect-body h3 { margin: 0 0 8px; font-size: 14px; }
.calendar-connect-body p { max-width: 790px; margin: 0 0 17px; color: var(--muted); line-height: 1.65; }
.calendar-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 55%, var(--line));
    border-radius: 15px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 9%, var(--surface2));
    font-size: 22px;
    font-weight: 800;
}
.calendar-sync-error { margin: 0; }
.calendar-actions { padding-top: 2px; }
.calendar-feed-owner small,
.calendar-feed-owner strong { display: block; }
.calendar-feed-owner small,
.calendar-feed-field label { color: var(--muted); font-size: 10px; }
.calendar-feed-owner strong { margin-top: 4px; font-size: 13px; }
.calendar-feed-field { display: grid; gap: 8px; }
.calendar-feed-field .field-action { align-items: stretch; }
.calendar-feed-field input { min-width: 0; flex: 1; font-size: 11px; }
.calendar-secret-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.calendar-guide-card,
.calendar-download-card { margin-top: 16px; }
.calendar-guide-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.calendar-guide-steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.calendar-guide-steps li:last-child { border-bottom: 0; }
.calendar-guide-steps li > span {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
    border-radius: 50%;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 8%, var(--surface2));
    font-weight: 800;
    font-size: 11px;
}
.calendar-guide-steps strong { display: block; font-size: 12px; }
.calendar-guide-steps p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.calendar-download-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; }
.calendar-download-card strong { display: block; font-size: 13px; }
.calendar-download-card p { max-width: 760px; margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.organization-logo-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px;
    margin-bottom: 16px;
}

.organization-logo-copy {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.organization-logo-preview {
    flex: 0 0 auto;
    width: 112px;
    height: 82px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed color-mix(in srgb, var(--blue) 44%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--blue) 5%, var(--surface2));
}

.organization-logo-preview img {
    width: 100%;
    height: 100%;
    padding: 9px;
    object-fit: contain;
}

.organization-logo-preview span {
    color: var(--blue);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .08em;
}

.organization-logo-copy h3 {
    margin: 0;
    font-size: 16px;
}

.organization-logo-copy p {
    max-width: 460px;
    margin: 6px 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.organization-logo-copy small,
.logo-file-name {
    color: var(--muted);
    font-size: 9px;
}

.organization-logo-actions,
.logo-upload-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.logo-file-picker {
    position: relative;
    overflow: hidden;
}

.logo-file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.logo-file-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.template-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.template-choice {
    position: relative;
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 236px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.template-choice:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
}

.template-choice.is-selected {
    border-color: var(--blue);
    box-shadow: 0 14px 38px color-mix(in srgb, var(--blue) 13%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--blue) 34%, transparent);
}

.template-choice:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.template-choice > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.template-selected-mark {
    position: absolute;
    z-index: 3;
    top: 13px;
    right: 13px;
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: transparent;
    background: var(--surface2);
    font-size: 13px;
    font-weight: 800;
}

.template-choice.is-selected .template-selected-mark {
    border-color: var(--blue);
    color: white;
    background: var(--blue);
}

.template-choice-copy strong,
.template-choice-copy small {
    display: block;
}

.template-choice-copy strong {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.template-choice-copy small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.template-paper {
    position: relative;
    width: 142px;
    height: 200px;
    display: block;
    overflow: hidden;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 11px 28px #0003;
    color: #14243a;
}

.template-paper-real {
    overflow: hidden;
    border: 1px solid #d6dde6;
    background: #fff;
}

.template-paper-real img,
.template-paper-real iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.template-paper-real img {
    object-fit: cover;
    object-position: top center;
}

.template-paper-real iframe {
    pointer-events: none;
}

.template-paper-brand,
.template-paper-kicker,
.template-paper-title,
.template-paper-subtitle,
.template-paper-section,
.template-paper-lines,
.template-paper-footer {
    position: absolute;
    display: block;
}

.template-paper-brand {
    top: 14px;
    left: 13px;
    font-size: 6px;
    font-weight: 800;
    letter-spacing: .09em;
}

.template-paper-kicker {
    top: 16px;
    right: 12px;
    font-size: 3.5px;
    font-weight: 800;
    letter-spacing: .16em;
}

.template-paper-title {
    top: 43px;
    left: 13px;
    width: 82px;
    height: 7px;
    background: currentColor;
}

.template-paper-subtitle {
    top: 54px;
    left: 13px;
    width: 55px;
    height: 2px;
    background: #8c9aab;
}

.template-paper-section {
    top: 78px;
    left: 13px;
    right: 13px;
    height: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.template-paper-section b {
    font-size: 6px;
}

.template-paper-section i {
    width: 53px;
    height: 4px;
    background: currentColor;
}

.template-paper-section.second { top: 132px; }

.template-paper-lines {
    top: 95px;
    left: 30px;
    right: 13px;
    display: grid;
    gap: 4px;
}

.template-paper-lines i {
    height: 1px;
    background: #cbd2da;
}

.template-paper-lines i:nth-child(2) { width: 88%; }
.template-paper-lines i:nth-child(4) { width: 94%; }
.template-paper-lines.short { top: 149px; }
.template-paper-lines.short i:last-child { width: 70%; }

.template-paper-footer {
    left: 13px;
    right: 13px;
    bottom: 10px;
    height: 1px;
    background: #d5dae0;
}

.template-preview-classic-blue {
    border-top: 13px solid #276dcc;
}

.template-preview-classic-blue .template-paper-title,
.template-preview-classic-blue .template-paper-section i { color: #153a70; }

.template-preview-classic-blue .template-paper-section b { color: #2f7bd6; }

.template-preview-classic-blue::after {
    content: "";
    position: absolute;
    left: 0;
    top: 57px;
    bottom: 0;
    width: 4px;
    background: #4b91e7;
}

.template-preview-minimal { color: #171717; }

.template-preview-minimal .template-paper-brand {
    top: 18px;
    left: auto;
    right: 13px;
}

.template-preview-minimal .template-paper-kicker { display: none; }
.template-preview-minimal .template-paper-title { top: 53px; height: 5px; width: 68px; }
.template-preview-minimal .template-paper-subtitle { top: 64px; width: 40px; background: #aaa; }
.template-preview-minimal .template-paper-section { top: 90px; border-top: 1px solid #222; padding-top: 7px; }
.template-preview-minimal .template-paper-section.second { top: 143px; }
.template-preview-minimal .template-paper-lines { top: 108px; left: 13px; }
.template-preview-minimal .template-paper-lines.short { top: 161px; }
.template-preview-minimal .template-paper-section b { font-weight: 400; }

.template-preview-technical {
    color: #183b51;
    background-color: #f8fcfd;
    background-image: linear-gradient(#38a8cd12 1px, transparent 1px), linear-gradient(90deg, #38a8cd12 1px, transparent 1px);
    background-size: 9px 9px;
    border: 1px solid #3a9fbe;
}

.template-preview-technical .template-paper-kicker,
.template-preview-technical .template-paper-section b { color: #008eb8; }
.template-preview-technical .template-paper-title { width: 93px; background: #183b51; }
.template-preview-technical .template-paper-section { left: 7px; right: 7px; border-left: 4px solid #00a1ce; padding-left: 6px; background: #e8f6f9; }
.template-preview-technical .template-paper-lines { left: 25px; }
.template-preview-technical .template-paper-footer { background: #3a9fbe; }

.template-preview-elegant {
    color: #4a4742;
    background: #f5f3ef;
    border-top: 8px solid #5b5a58;
}

.template-preview-elegant .template-paper-brand { color: #9a7739; }
.template-preview-elegant .template-paper-kicker { color: #81796c; }
.template-preview-elegant .template-paper-title { top: 47px; width: 74px; height: 5px; }
.template-preview-elegant .template-paper-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 23px;
    height: 2px;
    background: #b48c45;
}
.template-preview-elegant .template-paper-subtitle { top: 64px; }
.template-preview-elegant .template-paper-section b { color: #aa8240; }
.template-preview-elegant .template-paper-lines i { background: #d2cdc3; }

.template-preview-architectural {
    color: #10273a;
    background: linear-gradient(90deg, #10273a 0 34px, #fff 34px);
}

.template-preview-architectural .template-paper-brand {
    left: 7px;
    width: 20px;
    color: white;
    text-align: center;
}
.template-preview-architectural .template-paper-kicker { color: #e55f4a; }
.template-preview-architectural .template-paper-title { left: 46px; top: 48px; width: 77px; height: 9px; }
.template-preview-architectural .template-paper-subtitle { left: 46px; top: 64px; background: #e55f4a; }
.template-preview-architectural .template-paper-section { left: 46px; }
.template-preview-architectural .template-paper-lines { left: 55px; }
.template-preview-architectural .template-paper-section b { color: #e55f4a; }
.template-preview-architectural .template-paper-footer { left: 46px; }

.template-selection-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
}

.template-selection-note strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
}

.template-selection-note p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
}

.settings-menu-card {
    min-height: 128px;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 17px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.settings-menu-card:hover {
    transform: translateY(-2px);
    border-color: var(--blue);
    box-shadow: 0 18px 44px color-mix(in srgb, var(--blue) 12%, transparent);
}

.settings-menu-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
    border-radius: 13px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
    font-size: 20px;
}

.settings-menu-card strong,
.settings-menu-card small {
    display: block;
}

.settings-menu-card strong {
    font-size: 15px;
    margin-bottom: 7px;
}

.settings-menu-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.settings-menu-card > b {
    color: var(--blue);
    font-size: 19px;
}

.settings-info-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.settings-info-list > div {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface2);
}

.settings-info-list small,
.settings-info-list strong {
    display: block;
}

.settings-info-list small {
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.settings-info-list strong { font-size: 13px; }
.settings-info-list > p { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }

.backup-guide {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.backup-guide > div:not(.alert) {
    display: grid;
    grid-template-columns: 35px 1fr;
    align-items: center;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.backup-guide > div:not(.alert) > span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
    font-weight: 800;
}

.backup-guide p { margin: 0; }
.backup-guide strong,
.backup-guide small { display: block; }
.backup-guide strong { font-size: 13px; margin-bottom: 4px; }
.backup-guide small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.backup-guide .alert { margin: 15px 0 0; }

.backup-panel {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    align-items: start;
}

.backup-panel-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
    border-radius: 15px;
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, var(--surface2));
    font-size: 25px;
}

.backup-panel h3 { margin: 2px 0 8px; font-size: 15px; }
.backup-panel p { max-width: 650px; margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.backup-panel form { display: none; }
.backup-status { margin-top: 12px; font-size: 12px; }

.backup-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.restore-backup-form { display: none !important; }

.backup-note {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface2);
}

.backup-note strong { font-size: 12px; }
.backup-note span { color: var(--muted); font-size: 11px; line-height: 1.55; }

.automatic-backup-card { margin-top: 18px; }
.automatic-backup-settings-form { display: grid; gap: 17px; }
.backup-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface2);
}
.backup-toggle-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue); }
.backup-toggle-row span,
.backup-toggle-row strong,
.backup-toggle-row small { display: block; }
.backup-toggle-row strong { font-size: 13px; }
.backup-toggle-row small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.backup-folder-status {
    margin-top: 15px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 12px;
}
.backup-folder-status.success { border-color: color-mix(in srgb, #16a46f 40%, var(--line)); color: #16865f; }
.backup-folder-status.warning { border-color: color-mix(in srgb, #e89a20 42%, var(--line)); color: #b36d06; }
.backup-folder-status.error { border-color: color-mix(in srgb, #df5161 42%, var(--line)); color: #c94352; }

.password-field {
    position: relative;
    display: flex;
}

.password-field .field {
    width: 100%;
    padding-right: 48px;
}

.password-field button {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-field button:hover,
.password-field button.visible {
    color: var(--blue);
    background: color-mix(in srgb, var(--blue) 10%, transparent);
}

.password-field button span {
    position: relative;
    width: 18px;
    height: 11px;
    display: block;
    overflow: hidden;
    border: 2px solid currentColor;
    border-radius: 50% / 65%;
    font-size: 0;
}

.password-field button span::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: currentColor;
}

.subscription-actions {
    grid-column: 1 / -1;
    padding-top: 4px;
}

.settings-info-list > .subscription-actions {
    padding: 4px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

@media (max-width: 800px) {
    .settings-menu-grid,
    .settings-info-list { grid-template-columns: 1fr; }
    .settings-info-list > p { grid-column: auto; }
    .backup-panel { grid-template-columns: 1fr; }
    .backup-note { grid-column: auto; }
    .settings-workspace { grid-template-columns: 1fr; }
    .settings-side-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .settings-detail-header { min-height: auto; margin-top: 8px; }
    .calendar-connect-body { grid-template-columns: 1fr; }
    .calendar-feed-field .field-action,
    .calendar-download-card { align-items: stretch; flex-direction: column; }
    .organization-logo-panel,
    .template-selection-note { align-items: stretch; flex-direction: column; }
    .organization-logo-actions,
    .logo-upload-form { justify-content: flex-start; }
    .template-choice-grid { grid-template-columns: 1fr; }
    .template-choice:last-child:nth-child(odd) { grid-column: auto; }
    .project-form-layout { grid-template-columns: 1fr; }
    .project-form-panel { min-height: auto; }
    .project-form-empty { min-height: 260px; }
    .project-protected-grid { grid-template-columns: 1fr; }
    .project-form-main .form-grid { grid-template-rows: none; }
    .project-form-main .project-note-field textarea { min-height: 240px; }
    .project-overview-info-grid,
    .project-overview-protected-grid { grid-template-columns: 1fr; }
    .project-overview-wide { grid-column: auto; }
}

@media (max-width: 520px) {
    .settings-side-nav { grid-template-columns: 1fr; }
    .organization-logo-copy { align-items: flex-start; flex-direction: column; }
    .template-choice { grid-template-columns: 116px minmax(0, 1fr); gap: 13px; padding: 14px; }
    .template-paper { width: 106px; height: 150px; transform-origin: top left; }
}

/* Kompaktnejšia verejná registrácia. */
.auth-content:has(.register-card-compact) {
    align-items: start;
    padding: 42px 24px;
}

.auth-content .page-shell:has(.register-card-compact) {
    width: min(860px, 100%);
}

.auth-content .register-card-compact {
    width: 100%;
    padding: 32px;
}

.register-form-grid {
    gap: 14px;
}

@media (max-width: 800px) {
    .auth-content:has(.register-card-compact) { padding: 22px 17px; }
}
.alert.warning {
    color: #ffd185;
    border-color: #5e4727;
    background: #2b2114;
}
