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

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

/* Stále farebné skupiny hlavného menu. */
.nav-link.nav-tone-overview,
.nav-link.nav-tone-projects,
.nav-link.nav-tone-contacts,
.nav-link.nav-tone-library,
.nav-link.nav-tone-work {
    margin-block: 3px;
    border: 1px solid color-mix(in srgb, var(--nav-tone) 24%, transparent);
    background: color-mix(in srgb, var(--nav-tone) 10%, transparent);
}

.nav-link.nav-tone-overview { --nav-tone: #d0648e; }
.nav-link.nav-tone-projects { --nav-tone: #3d8bfd; }
.nav-link.nav-tone-contacts { --nav-tone: #20a89a; }
.nav-link.nav-tone-library { --nav-tone: #8b6edb; }
.nav-link.nav-tone-work { --nav-tone: #d99528; }

.nav-link.nav-tone-overview > span:first-child,
.nav-link.nav-tone-projects > span:first-child,
.nav-link.nav-tone-contacts > span:first-child,
.nav-link.nav-tone-library > span:first-child,
.nav-link.nav-tone-work > span:first-child {
    color: var(--nav-tone);
}

.nav-link.nav-tone-overview:hover,
.nav-link.nav-tone-projects:hover,
.nav-link.nav-tone-contacts:hover,
.nav-link.nav-tone-library:hover,
.nav-link.nav-tone-work:hover {
    border-color: color-mix(in srgb, var(--nav-tone) 42%, transparent);
    background: color-mix(in srgb, var(--nav-tone) 16%, transparent);
}

.nav-link.nav-tone-overview.active,
.nav-link.nav-tone-projects.active,
.nav-link.nav-tone-contacts.active,
.nav-link.nav-tone-library.active,
.nav-link.nav-tone-work.active {
    transform: translateX(2px);
    border-color: color-mix(in srgb, var(--nav-tone) 55%, transparent);
    background: color-mix(in srgb, var(--nav-tone) 22%, #14233a);
    box-shadow: inset 3px 0 var(--nav-tone), 0 7px 18px color-mix(in srgb, var(--nav-tone) 17%, transparent);
    font-weight: 800;
}

.nav-link.nav-tone-overview.active > span:first-child,
.nav-link.nav-tone-projects.active > span:first-child,
.nav-link.nav-tone-contacts.active > span:first-child,
.nav-link.nav-tone-library.active > span:first-child,
.nav-link.nav-tone-work.active > span:first-child {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: var(--nav-tone);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--nav-tone) 28%, transparent);
}

/* Neutrálne položky ostávajú bez pozadia a farbu dostanú až po otvorení. */
.nav-link.nav-active-only.active {
    --nav-tone: #3d8bfd;
    transform: translateX(2px);
    border: 1px solid color-mix(in srgb, var(--nav-tone) 45%, transparent);
    background: color-mix(in srgb, var(--nav-tone) 18%, #14233a);
    box-shadow: inset 3px 0 var(--nav-tone), 0 7px 18px color-mix(in srgb, var(--nav-tone) 17%, transparent);
    font-weight: 800;
}

.nav-link.nav-active-only.active > span:first-child {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: var(--nav-tone);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--nav-tone) 28%, transparent);
}

html[data-theme="light"] .nav-link.nav-active-only.active {
    color: #172235;
    border-color: color-mix(in srgb, var(--nav-tone) 34%, #d2dce8);
    background: color-mix(in srgb, var(--nav-tone) 19%, #fff);
}

html[data-theme="light"] .nav-link.nav-tone-overview,
html[data-theme="light"] .nav-link.nav-tone-projects,
html[data-theme="light"] .nav-link.nav-tone-contacts,
html[data-theme="light"] .nav-link.nav-tone-library,
html[data-theme="light"] .nav-link.nav-tone-work {
    color: #30455e;
    border-color: color-mix(in srgb, var(--nav-tone) 22%, #dce5ef);
    background: color-mix(in srgb, var(--nav-tone) 11%, #fff);
}

html[data-theme="light"] .nav-link.nav-tone-overview:hover,
html[data-theme="light"] .nav-link.nav-tone-projects:hover,
html[data-theme="light"] .nav-link.nav-tone-contacts:hover,
html[data-theme="light"] .nav-link.nav-tone-library:hover,
html[data-theme="light"] .nav-link.nav-tone-work:hover {
    background: color-mix(in srgb, var(--nav-tone) 17%, #fff);
}

html[data-theme="light"] .nav-link.nav-tone-overview.active,
html[data-theme="light"] .nav-link.nav-tone-projects.active,
html[data-theme="light"] .nav-link.nav-tone-contacts.active,
html[data-theme="light"] .nav-link.nav-tone-library.active,
html[data-theme="light"] .nav-link.nav-tone-work.active {
    color: #172235;
    border-color: color-mix(in srgb, var(--nav-tone) 38%, #d2dce8);
    background: color-mix(in srgb, var(--nav-tone) 22%, #fff);
}

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

.news-toggle {
    position: relative;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.news-toggle:hover,
.news-toggle:focus-visible,
.news-toggle.has-unread { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); outline: none; }
.news-toggle svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.news-count { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 99px; color: #fff; background: var(--red); font-size: 8px; font-weight: 800; line-height: 1; }

.news-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start end; padding: 76px 24px 24px; background: rgba(3, 8, 15, .44); backdrop-filter: blur(3px); }
.news-modal[hidden] { display: none; }
.news-dialog { width: min(430px, calc(100vw - 32px)); max-height: calc(100vh - 100px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 24px 70px rgba(0, 0, 0, .34); }
.news-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 20px 16px; border-bottom: 1px solid var(--line); }
.news-header .eyebrow { margin-bottom: 4px; }
.news-header h2 { margin: 0; font-size: 17px; }
.news-close { width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 24px; line-height: 1; cursor: pointer; }
.news-close:hover { color: var(--text); background: var(--surface2); }
.news-list { padding: 8px; overflow-y: auto; }
.news-item { position: relative; padding: 15px 16px; border-radius: 11px; }
.news-item + .news-item { border-top: 1px solid var(--line); border-radius: 0; }
.news-item.is-unread { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.news-item.is-unread::before { content: ""; position: absolute; left: 5px; top: 20px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.news-item-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.news-item-meta span { padding: 2px 6px; border-radius: 99px; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.news-item h3 { margin: 7px 0 5px; font-size: 13px; }
.news-item p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.65; white-space: pre-line; }
.news-empty { padding: 35px 20px; text-align: center; color: var(--muted); }
.news-empty > span { width: 38px; height: 38px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.news-empty strong { display: block; color: var(--text); font-size: 12px; }
.news-empty p { margin: 6px auto 0; max-width: 280px; font-size: 10px; line-height: 1.5; }
#newsReadForm { display: none; }
body.modal-open { overflow: hidden; }

html[data-theme="light"] .news-modal { background: rgba(28, 45, 65, .2); }

@media (max-width: 720px) {
    .news-modal { place-items: start center; padding: 70px 12px 12px; }
    .news-dialog { width: 100%; max-height: calc(100vh - 82px); }
}

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

/* Restrained dashboard accents: colour communicates meaning without tinting whole cards. */
.stat-card-active,
.stat-card-overdue,
.stat-card-upcoming {
    box-shadow: inset 0 3px 0 var(--stat-accent), 0 16px 42px #00000018;
}

.stat-card-active { --stat-accent: #4f92e8; }
.stat-card-overdue { --stat-accent: #ef7180; }
.stat-card-upcoming { --stat-accent: #d99a32; }

.stat-card-active .stat-value { color: #6eafff; }
.stat-card-overdue .stat-value { color: #ff8795; }
.stat-card-upcoming .stat-value { color: #efb653; }

.stat-card-active .stat-icon { background: rgba(79, 146, 232, .15); color: #6eafff; }
.stat-card-overdue .stat-icon { background: rgba(239, 113, 128, .14); color: #ff8795; }
.stat-card-upcoming .stat-icon { background: rgba(217, 154, 50, .15); color: #efb653; }

.dashboard-attention { margin-bottom: 22px; overflow: hidden; }
.attention-header { align-items: center; }
.attention-header > div { display: grid; gap: 5px; }
.attention-header p { margin: 0; color: var(--muted); font-size: 11px; }
.attention-heading-row { display: flex; align-items: center; gap: 9px; }
.attention-heading-row h2 { margin: 0; }
.attention-count { min-width: 24px; height: 24px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: rgba(255, 104, 123, .15); color: #ff8795; font-size: 11px; font-weight: 800; }
.attention-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 16px 16px; }
.attention-item { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 18px; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; background: rgba(255, 255, 255, .02); transition: border-color .16s ease, transform .16s ease, background .16s ease; }
.attention-item:hover { border-color: rgba(90, 156, 255, .55); background: rgba(90, 156, 255, .07); transform: translateY(-1px); }
.attention-symbol { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 15px; font-weight: 800; background: rgba(255, 104, 123, .13); color: #ff8795; }
.attention-deadline .attention-symbol { background: rgba(246, 183, 77, .14); color: #f6b74d; }
.attention-task-upcoming .attention-symbol { background: rgba(246, 183, 77, .14); color: #f6b74d; }
.attention-content { min-width: 0; display: grid; gap: 2px; }
.attention-content strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.attention-label { color: #ff8795; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.attention-deadline .attention-label { color: #f6b74d; }
.attention-task-upcoming .attention-label { color: #f6b74d; }
.attention-project { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.attention-date { min-width: 88px; display: grid; justify-items: end; gap: 2px; color: var(--muted); white-space: nowrap; }
.attention-date strong { font-size: 10px; }
.attention-date small { font-size: 9px; }
.attention-date.is-overdue { color: #ff8795; }
.attention-date.is-urgent { color: #f6b74d; }
.attention-arrow { color: var(--muted); font-size: 15px; }
.attention-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 26px; color: var(--muted); border-radius: 12px; background: rgba(91, 214, 160, .035); }
.attention-empty > span { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(91, 214, 160, .12); color: #5bd6a0; font-weight: 800; }
.attention-empty strong { display: block; color: var(--text); font-size: 12px; }
.attention-empty p { margin: 3px 0 0; font-size: 10px; }
.attention-more { padding: 0 16px 14px; color: var(--muted); font-size: 9px; text-align: right; }
.attention-more a { color: var(--accent); font-weight: 700; }

html[data-theme="light"] .stat-card-active,
html[data-theme="light"] .stat-card-overdue,
html[data-theme="light"] .stat-card-upcoming {
    box-shadow: inset 0 3px 0 var(--stat-accent), 0 14px 34px #253b5514;
}

html[data-theme="light"] .stat-card-active .stat-value { color: #2878d4; }
html[data-theme="light"] .stat-card-overdue .stat-value { color: #db5365; }
html[data-theme="light"] .stat-card-upcoming .stat-value { color: #b97814; }
html[data-theme="light"] .stat-card-active .stat-icon { background: #edf5ff; color: #2878d4; }
html[data-theme="light"] .stat-card-overdue .stat-icon { background: #fff0f2; color: #db5365; }
html[data-theme="light"] .stat-card-upcoming .stat-icon { background: #fff7e8; color: #b97814; }
html[data-theme="light"] .attention-empty { background: #f2fbf7; }

@media (max-width: 1400px) {
    .attention-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
    .attention-list { grid-template-columns: 1fr; }
}

.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: 2600;
    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-editor-form { grid-template-columns: minmax(0, 1fr); }
.project-editor-form [data-project-editor-panel][hidden] { display: none; }
.project-editor-form .project-form-panel { min-height: 0; }
.project-editor-form .project-form-main .form-grid { grid-template-rows: none; }
.project-editor-toolbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 16px; grid-column: 1 / -1; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); }
.project-editor-tabs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; }
.project-editor-tabs button { min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.project-editor-tabs button.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.project-autosave-status { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.project-autosave-status.is-saved { color: var(--green); }
.project-autosave-status.is-saving, .project-autosave-status.is-pending { color: var(--blue); }
.project-autosave-status.is-error { color: var(--red); }
.project-editor-form[data-active-tab="details"] .project-protected-interests { display: none; }
.project-editor-form[data-active-tab="protected"] .project-form-extra-grid > .form-group { display: none; }
.project-editor-form[data-active-tab="protected"] .project-form-secondary-header { display: none; }
.project-editor-form[data-active-tab="protected"] .project-protected-interests { margin-top: 0; padding-top: 0; border-top: 0; }
.project-editor-footer { position: sticky; bottom: 0; z-index: 24; display: flex; align-items: center; justify-content: space-between; gap: 12px; grid-column: 1 / -1; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px); }
.project-editor-footer > div { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.project-editor-footer > div[hidden] { display: none; }
.project-storage-picker { padding: 18px 20px; }
.project-editor-form:not([data-active-tab="main"]) .project-storage-picker { display: none; }
.project-storage-picker-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.project-storage-picker-heading h2 { margin: 4px 0 0; font-size: 18px; }
.project-storage-picker-heading > small { max-width: 470px; color: var(--muted); text-align: right; }
.project-storage-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.project-storage-option { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) 28px; align-items: center; gap: 12px; min-height: 92px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.project-storage-option:hover { border-color: var(--blue); }
.project-storage-option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 24%, transparent); outline-offset: 2px; }
.project-storage-option:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--blue); }
.project-storage-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.project-storage-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: color-mix(in srgb, #32c692 13%, var(--surface)); color: #18a774; font-size: 25px; font-weight: 800; }
.project-storage-icon-cloud { background: color-mix(in srgb, var(--blue) 13%, var(--surface)); color: var(--blue); }
.project-storage-copy { display: grid; gap: 4px; min-width: 0; }
.project-storage-copy strong { font-size: 16px; }
.project-storage-copy small { color: var(--muted); line-height: 1.4; }
.project-storage-check { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: transparent; font-weight: 900; }
.project-storage-option:has(input:checked) .project-storage-check { border-color: var(--blue); background: var(--blue); color: #fff; }
.project-primary-client-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.project-client-manager[data-project-client-modal] { position: fixed; inset: 0; z-index: 1400; display: grid; align-content: start; gap: 0; width: auto; margin: 0; padding: min(5vh, 42px) max(24px, calc((100vw - 760px) / 2)); overflow-y: auto; border: 0; border-radius: 0; background: rgba(3, 8, 15, .7); backdrop-filter: blur(6px); }
.project-client-manager[data-project-client-modal][hidden] { display: none; }
.project-client-manager[data-project-client-modal] > * { padding: 14px 18px; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.project-client-manager[data-project-client-modal] > :first-child { border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; }
.project-client-manager[data-project-client-modal] > :last-child { padding-bottom: 20px; border-bottom: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.project-client-manager-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.project-client-modal-close { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface2); color: var(--text); font-size: 20px; cursor: pointer; }
html[data-theme="light"] .project-client-manager[data-project-client-modal] { background: rgba(28, 43, 61, .42); }

@media(max-width:700px){.project-editor-toolbar{align-items:stretch;flex-direction:column}.project-autosave-status{padding-inline:6px}.project-primary-client-row{grid-template-columns:1fr}.project-client-manager[data-project-client-modal]{padding:10px}.project-editor-tabs{width:100%}.project-storage-picker-heading{align-items:flex-start;flex-direction:column}.project-storage-picker-heading>small{text-align:left}.project-storage-options{grid-template-columns:1fr}}

.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-client-manager {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
    gap: 13px;
    margin-top: 3px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: color-mix(in srgb, var(--blue) 3%, var(--surface2));
}

.project-client-manager-heading > div {
    display: grid;
    gap: 4px;
}

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

.project-client-manager-heading small,
.project-client-entry-actions small,
.project-client-empty {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.project-client-entry {
    display: grid;
    gap: 10px;
}

.project-client-entry-row {
    display: grid;
    gap: 10px;
}

.project-client-entry-name { grid-template-columns: 120px minmax(0, 1fr); }
.project-client-entry-address { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 120px; }

.project-client-entry-row label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

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

.project-client-entry-actions small { color: var(--red); }
.project-client-list { display: grid; gap: 7px; }

.project-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.project-client-row > div:first-child { min-width: 0; }
.project-client-row strong,
.project-client-row small { display: block; }
.project-client-row strong { font-size: 11px; overflow-wrap: anywhere; }
.project-client-row small { margin-top: 3px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.project-client-empty { margin: 0; }
.table-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

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

.admin-customer-actions { display: flex; align-items: center; gap: 7px; }
.admin-customer-actions form { margin: 0; }
.registration-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.calendar-status-card .card-body { display: grid; gap: 18px; }
.calendar-integrations-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.calendar-integrations-grid .calendar-status-card { height: 100%; }
.calendar-integrations-grid .calendar-status-card .card-body { align-content: start; }
.calendar-primary-action { width: 100%; justify-content: center; }
.calendar-account-info { grid-template-columns: 1fr; }
.calendar-actions { margin-top: auto; }
.calendar-link-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; align-items: center; }
.calendar-link-row .form-control { min-width: 0; font-size: 11px; }
.calendar-copy-button { width: 42px; height: 42px; }
.calendar-private-note { color: var(--muted); font-size: 10px; line-height: 1.45; }
.calendar-guide-card { margin-top: 16px; }
.calendar-guide-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.calendar-guide-columns h3 { margin: 0 0 6px; font-size: 13px; }
.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; }

@media (max-width: 1050px) {
    .calendar-integrations-grid,
    .calendar-guide-columns { grid-template-columns: 1fr; }
}

.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 strong.subscription-plan-name.is-active { color: var(--green); }
.settings-info-list strong.subscription-plan-name.is-inactive { color: var(--red); }
.settings-info-list strong.subscription-expiry-date { color: var(--red); }
.settings-info-list > p { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.subscription-user-types { margin-top: 18px; }
.subscription-user-types-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.subscription-user-types-grid.users-page-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.users-overview-card { width: 100%; max-width: none; }
.users-explainer-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 24px; background: rgba(3, 8, 15, .72); backdrop-filter: blur(7px); }
.users-explainer-modal[hidden] { display: none; }
.users-explainer-dialog { display: flex; width: min(1380px, 100%); max-height: calc(100vh - 48px); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 28px 80px rgba(0, 0, 0, .38); }
.users-explainer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.users-explainer-header h2 { margin: 0; font-size: 20px; }
.users-explainer-close { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 28px; line-height: 1; }
.users-explainer-image { display: grid; min-height: 0; flex: 1; place-items: center; padding: 12px; background: #f8fbff; }
.users-explainer-image img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 190px); object-fit: contain; }
.users-explainer-footer { display: flex; justify-content: flex-end; padding: 14px 24px; border-top: 1px solid var(--line); }
html[data-theme="light"] .users-explainer-modal { background: rgba(28, 43, 61, .42); }
.users-page-grid h3 { font-size: 20px; }
.users-page-grid .subscription-user-type-description { font-size: 15px; line-height: 1.65; }
.users-page-grid .subscription-user-row { padding: 16px 0; }
.users-page-grid .subscription-user-row strong { font-size: 16px; }
.users-page-grid .subscription-user-row small { font-size: 13px; }
.users-page-grid .subscription-user-status { font-size: 14px; }
.users-page-grid .subscription-shared-projects { font-size: 13px; }
.subscription-user-types-grid section { min-height: 90px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.subscription-user-types-grid h3 { margin: 0; font-size: 13px; line-height: 1.45; }
.subscription-user-type-description { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; user-select: none; }
.toast-stack { position: fixed; z-index: 2200; top: 22px; left: 50%; display: grid; gap: 10px; width: min(480px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.app-toast { --toast-accent: var(--blue); position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 28px; align-items: center; gap: 11px; min-height: 58px; overflow: hidden; padding: 13px 13px 15px 15px; border: 1px solid color-mix(in srgb, var(--toast-accent) 55%, var(--line)); border-left: 5px solid var(--toast-accent); border-radius: 13px; background: color-mix(in srgb, var(--toast-accent) 12%, var(--surface)); box-shadow: 0 18px 55px rgba(0,0,0,.32),0 0 0 1px color-mix(in srgb,var(--toast-accent) 16%,transparent); backdrop-filter: blur(14px); color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.45; pointer-events: auto; animation: app-toast-in .32s cubic-bezier(.2,.9,.25,1.15); }
.app-toast::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--toast-accent); transform-origin: left; animation: app-toast-progress var(--toast-duration, 5000ms) linear forwards; }
.app-toast.success { --toast-accent: var(--green); }.app-toast.warning { --toast-accent: var(--amber); }.app-toast.error { --toast-accent: var(--red); }
.app-toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); font-weight: 800; }
.app-toast.success .app-toast-icon { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }.app-toast.warning .app-toast-icon { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }.app-toast.error .app-toast-icon { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.app-toast > span:nth-child(2) { display: grid; gap: 2px; }.app-toast > span:nth-child(2) strong { font-size: 12px; }.app-toast button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 19px; cursor: pointer; }.app-toast button:hover { background: var(--surface2); color: var(--text); }
.app-toast.is-leaving { opacity: 0; transform: translateY(-14px) scale(.97); transition: opacity .2s, transform .2s; }
@keyframes app-toast-in { from { opacity: 0; transform: translateY(-24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes app-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 700px) { .toast-stack { top: 12px; width: calc(100vw - 24px); } }
.eyebrow, .page-title, .page-subtitle, .card-header, .data-table th, label, .btn, button, nav, .empty,
.settings-workspace { user-select: none; -webkit-user-select: none; }
input, textarea, [contenteditable="true"], .user-copy, .copy-value, .data-table td,
.settings-workspace input, .settings-workspace textarea, .settings-workspace [contenteditable="true"],
.settings-workspace .user-copy, .settings-workspace .copy-value { user-select: text; -webkit-user-select: text; }
.subscription-user-list { display: grid; gap: 0; margin-top: 14px; }
.subscription-user-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.subscription-user-row > div { min-width: 0; }
.subscription-user-row strong, .subscription-user-row small { display: block; overflow: hidden; text-overflow: ellipsis; }
.subscription-user-row strong { font-size: 11px; white-space: nowrap; }
.subscription-user-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.subscription-user-status { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; font-size: 9px; font-weight: 800; }
.subscription-user-status i { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; }
.subscription-user-status.is-active { color: var(--green); }
.subscription-user-status.is-active i { background: var(--green); }
.subscription-user-status.is-inactive { color: var(--red); }
.subscription-user-status.is-inactive i { background: var(--red); }
.subscription-user-empty { margin: 14px 0 0; color: var(--muted); font-size: 10px; }
.subscription-restricted-user-row { align-items: flex-start; }
.subscription-shared-projects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.subscription-shared-projects span { padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); color: var(--blue); font: 700 8px "Space Mono", monospace; }
.subscription-shared-projects em { color: var(--muted); font-size: 9px; font-style: normal; }

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

.overview-export-action { width: 100%; justify-content: space-between; }
.project-last-editor {
    width: min(520px, 55%);
    min-width: 360px;
    display: grid;
    gap: 2px;
    margin-right: auto;
    padding: 8px 12px;
    border-left: 3px solid var(--blue);
    border-radius: 7px;
    background: color-mix(in srgb, var(--blue) 6%, var(--surface));
}
.project-last-editor span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.project-last-editor strong { font-size: 11px; }
.project-last-editor small { color: var(--muted); font-size: 9px; }
.project-last-editor-details { display: grid; grid-template-columns: repeat(3, max-content); align-items: center; justify-content: start; gap: 10px; }
.project-last-editor-details strong,
.project-last-editor-details time { color: var(--text); font-size: 11px; font-weight: 700; white-space: nowrap; }
.project-last-editor-details .project-last-editor-email { color: var(--text); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.project-last-editor-details time { justify-self: start; }

@media (max-width: 700px) {
    .overview-export-action { align-items: stretch; flex-direction: column; }
    .project-last-editor { width: 100%; min-width: 0; margin-right: 0; }
    .project-last-editor-details { grid-template-columns: 1fr; gap: 3px; }
    .project-last-editor-details time { justify-self: start; }
}

.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, .subscription-user-types-grid { grid-template-columns: 1fr; }
    .subscription-user-types-grid.users-page-grid { 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; }
    .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-client-entry-name,
    .project-client-entry-address { grid-template-columns: 1fr; }
    .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;
}

.registration-form-layout {
    display: grid;
    gap: 14px;
}

.registration-row {
    display: grid;
    gap: 14px;
    align-items: start;
}

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

.registration-row-company-ids {
    grid-template-columns: minmax(115px, .8fr) auto minmax(145px, 1fr) minmax(145px, 1fr);
}

.registration-row-address {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.registration-lookup-action {
    padding-top: 22px;
}

.registration-lookup-action .btn {
    min-height: 44px;
    margin-top: 0;
    white-space: nowrap;
}

.registration-consent {
    margin-top: 18px;
}

.organization-settings-form { max-width: none; }
.organization-cloud-panel { overflow: hidden; }
.organization-cloud-heading { padding: 20px 22px; }
.organization-cloud-heading h2 { margin: 5px 0 0; font-size: 18px; }
.organization-cloud-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.organization-cloud-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); border-top: 1px solid var(--line); }
.cloud-plan-list { display: grid; gap: 12px; padding: 20px; border-right: 1px solid var(--line); }
.cloud-plan-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.cloud-plan-card.is-active { border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, var(--surface)); }
.cloud-plan-card > div { display: grid; min-width: 0; gap: 4px; }
.cloud-plan-card strong { font-size: 20px; }
.cloud-plan-card span { font-size: 13px; font-weight: 750; }
.cloud-plan-card small { color: var(--muted); font-size: 11px; }
.cloud-plan-card form { margin: 0; }
.cloud-plan-card .btn { min-width: 100px; }
.cloud-usage-panel { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 280px; padding: 24px; }
.cloud-usage-chart { display: grid; place-items: center; width: 166px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--blue) var(--cloud-used), var(--surface2) 0); }
.cloud-usage-chart::before { content: ""; grid-area: 1 / 1; width: 122px; aspect-ratio: 1; border-radius: 50%; background: var(--surface); }
.cloud-usage-chart > div { z-index: 1; grid-area: 1 / 1; display: grid; gap: 2px; text-align: center; }
.cloud-usage-chart strong { font-size: 25px; }
.cloud-usage-chart span, .cloud-usage-copy span { color: var(--muted); font-size: 11px; }
.cloud-usage-copy { display: grid; gap: 4px; text-align: center; }
.admin-cloud-workspace { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-cloud-organizations { display: grid; gap: 5px; padding: 10px; max-height: 720px; overflow-y: auto; }
.admin-cloud-organizations a { display: grid; gap: 4px; padding: 12px; border-radius: 9px; color: var(--text); text-decoration: none; }
.admin-cloud-organizations a:hover, .admin-cloud-organizations a.active { background: var(--surface2); color: var(--blue); }
.admin-cloud-organizations span { color: var(--muted); font-size: 10px; }
.organization-registration-email { display: grid; gap: 4px; margin-bottom: 20px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface2); }
.organization-registration-email span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.organization-registration-email strong { font-size: 14px; }
.organization-registration-email small { color: var(--muted); font-size: 10px; }
.organization-form-layout { display: grid; gap: 17px; }
.organization-form-row { display: grid; gap: 17px; align-items: start; }
.organization-form-row-one { grid-template-columns: minmax(0, 1fr); }
.organization-form-row-company { grid-template-columns: minmax(130px, .8fr) auto minmax(150px, 1fr) minmax(170px, 1fr); }
.organization-form-row-company .register-status { grid-column: 1 / -1; margin-top: -9px; }
.organization-form-row-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.organization-lookup-action { padding-top: 18px; }
.organization-lookup-action .btn { min-height: 43px; margin-top: 0; white-space: nowrap; }
.organization-settings-form .responsible-person-section { display: grid; gap: 8px; }
.organization-settings-form .readonly-field { color: var(--muted); background: color-mix(in srgb, var(--surface2) 84%, transparent); cursor: default; }

@media (max-width: 760px) {
    .organization-cloud-grid { grid-template-columns: 1fr; }
    .cloud-plan-list { border-right: 0; border-bottom: 1px solid var(--line); }
    .cloud-plan-card { align-items: stretch; flex-direction: column; }
    .cloud-plan-card .btn { width: 100%; }
    .admin-cloud-workspace { grid-template-columns: 1fr; }
    .admin-cloud-organizations { max-height: 260px; }
    .organization-form-row-company,
    .organization-form-row-three { grid-template-columns: 1fr; }
    .organization-lookup-action { padding-top: 0; }
    .organization-lookup-action .btn { width: 100%; }
}

.registration-consent label {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.registration-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--blue);
}

.registration-consent a {
    color: var(--blue);
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.registration-consent > span {
    display: block;
    margin: 6px 0 0 29px;
}

@media (max-width: 800px) {
    .auth-content:has(.register-card-compact) { padding: 22px 17px; }
    .registration-row-company-ids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .registration-row-address { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.alert.warning {
    color: #ffd185;
    border-color: #5e4727;
    background: #2b2114;
}

/* Registration - ICO + ORSR */
.register-form-grid .field-action .field {
    flex: 1 1 auto;
    min-width: 140px;
}

.register-form-grid .field-action .btn {
    flex: 0 0 auto;
    width: auto !important;
}

@media (max-width: 520px) {
    .registration-row,
    .registration-row-company-ids,
    .registration-row-address { grid-template-columns: 1fr; }
    .registration-row-two > [aria-hidden="true"] { display: none; }
    .registration-lookup-action { padding-top: 0; }
    .registration-lookup-action .btn { width: 100% !important; }
    .register-form-grid .field-action .field,
    .register-form-grid .field-action .btn {
        width: 100% !important;
    }
}

.required-marker {
    color: var(--red);
    font-weight: 900;
}
