:root {
    --cw-primary: #3d5c99;
    --cw-primary-dark: #2f4778;
    --cw-dark: #010f21;
    --cw-dark-2: #000611;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --text: #111111;
    --text-body: #666666;
    --muted: #888888;
    --danger: #c0392b;
    --weekend: #fff5f5;
    --night: #eef3fa;
    --border: #e2e6ec;
    --radius: 4px;
    --shadow: 0 2px 8px rgba(1, 15, 33, 0.08);
    --font: 'Open Sans', Arial, sans-serif;
    --hover-bg: #eef3fa;
    --table-head: #f0f3f8;
    --zebra: #f8fafc;
    --accent-surface: #f4f7fb;
    --warn-surface: #fffaf2;
    --warn-border: #e6a23c;
    --header-bg: linear-gradient(90deg, var(--cw-dark-2) 0%, var(--cw-dark) 47%);
    --header-text: #ffffff;
    --header-muted: rgba(255, 255, 255, .65);
    --header-border: rgba(255, 255, 255, .2);
    --header-control-bg: rgba(255, 255, 255, .08);
    --header-control-border: rgba(255, 255, 255, .25);
    --input-bg: #ffffff;
    --focus-ring: rgba(61, 92, 153, .15);
    --mobile-tabbar-h: 0px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #151b24;
    --text: #e8edf4;
    --text-body: #a8b4c4;
    --muted: #7d8a9c;
    --weekend: #241a1a;
    --night: #141e2e;
    --border: #2a3444;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --hover-bg: #1c2430;
    --table-head: #1a2230;
    --zebra: #121820;
    --accent-surface: #1a2433;
    --warn-surface: #2a2218;
    --warn-border: #c98a2e;
    --header-bg: linear-gradient(90deg, #00040c 0%, #010a18 47%);
    --header-text: #f3f6fa;
    --header-muted: rgba(255, 255, 255, .62);
    --header-border: rgba(255, 255, 255, .18);
    --header-control-bg: rgba(255, 255, 255, .07);
    --header-control-border: rgba(255, 255, 255, .22);
    --input-bg: #10161f;
    --focus-ring: rgba(93, 130, 196, .28);
}

[data-theme="light"] {
    color-scheme: light;
    --header-bg: var(--surface);
    --header-text: var(--text);
    --header-muted: var(--muted);
    --header-border: var(--border);
    --header-control-bg: var(--hover-bg);
    --header-control-border: var(--border);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 15px;
}
h1, h2, h3 { color: var(--text); font-weight: 700; }
h1 { font-size: 1.75rem; margin: 0 0 .5rem; }
a { color: var(--cw-primary); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

.header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: .9rem 0;
    box-shadow: var(--shadow);
}
.site-top {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}
.header__inner { display: flex; align-items: center; gap: 1rem; flex-wrap: nowrap; }
.site-top .header { box-shadow: none; }
.site-top .nav { margin-bottom: 0; }
.logo { text-decoration: none; display: flex; align-items: center; gap: .4rem; }
.logo__img { height: 32px; width: auto; display: block; }
.logo__img--on-dark { display: none; }
[data-theme="dark"] .logo__img--default { display: none; }
[data-theme="dark"] .logo__img--on-dark { display: block; }
[data-theme="dark"] .logo__img--pad-on-dark {
    display: block;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    box-sizing: content-box;
}
.logo__mark { font-weight: 700; font-size: 1.25rem; color: var(--header-text); letter-spacing: .02em; }
.logo__sub { font-size: .85rem; color: var(--header-muted); font-weight: 400; }
.header__client-logo { height: 28px; width: auto; border-radius: 3px; background: #fff; padding: 2px 4px; }
.header__project {
    color: var(--header-text);
    opacity: .9;
    padding-left: 1rem;
    border-left: 1px solid var(--header-border);
    font-weight: 600;
}
.client-switcher {
    position: relative;
    margin-left: .85rem;
    padding-left: .85rem;
    border-left: 1px solid var(--header-border);
    min-width: 0;
}
.client-switcher--open {
    z-index: 250;
}
.client-switcher__sheet-head {
    display: none;
}
.client-switcher__trigger {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: min(280px, 36vw);
    padding: .25rem .45rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--header-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.client-switcher__trigger:hover,
.client-switcher--open .client-switcher__trigger {
    background: color-mix(in srgb, #fff 12%, transparent);
    border-color: var(--header-border);
}
.client-switcher__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.client-switcher__caret {
    width: .4rem;
    height: .4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .75;
    flex-shrink: 0;
    margin-top: -.15rem;
}
.client-switcher--open .client-switcher__caret {
    transform: rotate(-135deg);
    margin-top: .15rem;
}
.client-switcher__dropdown {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    z-index: 230;
    min-width: min(320px, 88vw);
    max-width: min(380px, 92vw);
}
.client-switcher__dropdown-inner {
    background: var(--surface, #fff);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.client-switcher__dashboard {
    display: block;
    padding: .7rem .9rem;
    text-decoration: none;
    color: var(--cw-primary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--cw-primary) 6%, var(--surface, #fff));
}
.client-switcher__dashboard:hover { background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface, #fff)); }
.client-switcher__filter {
    padding: .55rem .65rem;
    border-bottom: 1px solid var(--border);
}
.client-switcher__filter-input {
    width: 100%;
    box-sizing: border-box;
    padding: .4rem .55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg, var(--surface, #fff));
    color: var(--text);
    font: inherit;
}
.client-switcher__list {
    max-height: min(360px, 55vh);
    overflow: auto;
    background: var(--surface, #fff);
}
.client-switcher__item {
    display: block;
    padding: .55rem .9rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    background: var(--surface, #fff);
}
.client-switcher__item:last-child { border-bottom: none; }
.client-switcher__item:hover { background: var(--hover-bg); color: var(--cw-primary); }
.client-switcher__item--current {
    background: color-mix(in srgb, var(--cw-primary) 10%, var(--surface, #fff));
    color: var(--cw-primary);
}
.client-switcher__item--current::after {
    content: ' ✓';
    font-weight: 700;
}
.header__links { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.header__ext { color: rgba(255,255,255,.7); font-size: .85rem; text-decoration: none; }
.header__ext:hover { color: #fff; }

.nav {
    display: flex;
    gap: .3rem;
    flex-wrap: nowrap;
    align-items: center;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: relative;
}
.nav a,
.nav a.nav__link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .65rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav a:hover { background: var(--hover-bg); color: var(--cw-primary); border-color: var(--border); }
.nav a.nav__link.is-active {
    color: var(--cw-primary);
    border-color: color-mix(in srgb, var(--cw-primary) 30%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 9%, transparent);
}
.nav__sep {
    flex-shrink: 0;
    width: 1px;
    align-self: stretch;
    margin: .15rem .35rem;
    background: var(--border);
}
.nav__group-label {
    display: none;
}
.nav__icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    opacity: .9;
}
.nav a.nav__dashboard {
    padding: .35rem .5rem;
    color: var(--cw-primary);
    border-color: color-mix(in srgb, var(--cw-primary) 25%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 7%, transparent);
}
.nav a.nav__dashboard .nav__icon { opacity: 1; }
.nav__more {
    position: relative;
    flex-shrink: 0;
    margin-left: auto;
}
.nav__more-trigger {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .65rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface, #fff);
    color: var(--text);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}
.nav__more-trigger:hover,
.nav__more--open .nav__more-trigger {
    color: var(--cw-primary);
    border-color: color-mix(in srgb, var(--cw-primary) 30%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 7%, var(--surface, #fff));
}
.nav__more--has-current .nav__more-trigger {
    color: var(--cw-primary);
    border-color: color-mix(in srgb, var(--cw-primary) 35%, var(--border));
}
.nav__more-caret {
    opacity: .75;
    transition: transform .15s ease;
}
.nav__more--open .nav__more-caret {
    transform: rotate(180deg);
}
.nav__more-menu {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 220;
    min-width: 12rem;
}
.nav__more-menu-inner {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .35rem;
    background: var(--surface, #fff);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
}
.nav__more-menu .nav__link {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}

.main { padding: 1.75rem 1.25rem 3rem; }
.header__user { color: rgba(255,255,255,.75); font-size: .85rem; }
.header__logout-form { display: inline; margin: 0; }
.header__logout { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.header__logout:hover { color: #fff; }

.user-menu { position: relative; }

.notification-bell { position: relative; }
.notification-bell__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--header-control-border);
    border-radius: var(--radius);
    background: var(--header-control-bg);
    color: var(--header-text);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.notification-bell__trigger:hover,
.notification-bell--open .notification-bell__trigger {
    background: var(--hover-bg);
    border-color: var(--cw-primary);
}
[data-theme="dark"] .notification-bell__trigger:hover,
[data-theme="dark"] .notification-bell--open .notification-bell__trigger {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.35);
}
.notification-bell__badge {
    position: absolute;
    top: -.15rem;
    right: -.15rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 .2rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
    border: 2px solid var(--surface);
}
.notification-bell--live .notification-bell__trigger {
    color: #c2410c;
    border-color: #fb923c;
    background: #fff7ed;
}
.notification-bell--accepted .notification-bell__trigger {
    color: #047857;
    border-color: #34d399;
    background: #ecfdf5;
    animation: bell-accept-glow 1.6s ease-out 3;
}
@keyframes bell-accept-glow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55); }
    100% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}
[data-theme="dark"] .notification-bell--live .notification-bell__trigger {
    color: #fdba74;
    border-color: #fb923c;
    background: #3b2412;
}
[data-theme="dark"] .notification-bell--accepted .notification-bell__trigger {
    color: #6ee7b7;
    border-color: #34d399;
    background: #14352a;
}
@media (prefers-reduced-motion: reduce) {
    .notification-bell--accepted .notification-bell__trigger { animation: none; }
}

.ops-alert {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex-shrink: 0;
    padding: .55rem 1.25rem;
    background: #ecfdf5;
    border-bottom: 1px solid #6ee7b7;
    color: #065f46;
}
.ops-alert[hidden] { display: none; }
.ops-alert__row {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}
.ops-alert__mark {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #059669;
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ops-alert__link {
    flex: 1;
    min-width: 0;
    color: #065f46;
    font-weight: 600;
    font-size: .92rem;
    text-decoration: none;
}
.ops-alert__link:hover { text-decoration: underline; }
.ops-alert__dismiss {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: #047857;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}
.ops-alert__dismiss:hover { background: rgba(5, 150, 105, .12); }
[data-theme="dark"] .ops-alert {
    background: #14352a;
    border-bottom-color: #2d6a4f;
    color: #bbf7d0;
}
[data-theme="dark"] .ops-alert__link,
[data-theme="dark"] .ops-alert__dismiss { color: #bbf7d0; }
[data-theme="dark"] .ops-alert__dismiss:hover { background: rgba(52, 211, 153, .16); }
.notification-bell__panel {
    position: absolute;
    right: 0;
    top: 100%;
    width: min(22rem, calc(100vw - 1.5rem));
    padding-top: 6px;
    z-index: 60;
}
.notification-bell__panel[hidden] { display: none; }
.notification-bell--open .notification-bell__panel { display: block; }
.notification-bell__panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 6px;
}
.notification-bell__head,
.notification-bell__tabs,
.notification-bell__foot,
.notification-bell__list {
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}
.notification-bell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .7rem .9rem;
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
    box-shadow: var(--shadow);
}
.notification-bell__mark-all {
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    color: var(--cw-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.notification-bell__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem;
    padding: .45rem .65rem .55rem;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
}
.notification-bell__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin: 0;
    padding: .4rem .5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.notification-bell__tab:hover {
    color: var(--text);
    background: var(--hover-bg);
}
.notification-bell__tab.is-active {
    color: var(--text);
    background: var(--hover-bg);
    border-color: var(--border);
    box-shadow: inset 0 -2px 0 var(--cw-primary);
}
.notification-bell__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1;
}
.notification-bell__tab-count[hidden] {
    display: none !important;
}
.notification-bell__list {
    max-height: 18rem;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.notification-bell__foot {
    padding: .55rem .9rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: .8rem;
    box-shadow: var(--shadow);
}
.notification-bell__foot a {
    color: var(--cw-primary);
    font-weight: 600;
    text-decoration: none;
}
.notification-bell__foot a:hover { text-decoration: underline; }
.notification-bell__item {
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
}
.notification-bell__item:last-child { border-bottom: none; }
.notification-bell__item:hover { background: var(--hover-bg); }
.notification-bell__item--unread {
    background: var(--accent-surface);
}
.notification-bell__item--major {
    border-left: 3px solid var(--cw-primary);
    background: linear-gradient(90deg, rgba(61, 92, 153, .12), transparent 55%);
}
.notification-bell__item--major.notification-bell__item--unread {
    background: linear-gradient(90deg, rgba(61, 92, 153, .18), var(--accent-surface) 55%);
}
.notification-bell__item-badge {
    display: inline-block;
    margin-bottom: .35rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: var(--cw-primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.notification-bell__item--major .notification-bell__item-title {
    font-size: .98rem;
    color: var(--cw-primary);
}
.notification-bell__item-title {
    margin: 0 0 .35rem;
    font-size: .86rem;
    font-weight: 700;
    color: var(--text);
}
.notification-bell__item-body {
    font-size: .8rem;
    line-height: 1.45;
    color: var(--text-body);
}
.notification-bell__item-list {
    margin: .15rem 0 0;
    padding-left: 1.1rem;
}
.notification-bell__item-list li { margin: .15rem 0; }
.changelog-deploy-hint { margin-bottom: 1.25rem; }
.changelog-release { scroll-margin-top: 5rem; }
.changelog-deploy-hint kbd {
    display: inline-block;
    padding: .1rem .35rem;
    font-size: .85em;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--card-bg);
}
.notification-bell__item-link {
    display: inline-block;
    margin-top: .45rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--cw-primary);
    text-decoration: none;
}
.notification-bell__item-link:hover { text-decoration: underline; }
.notification-bell__empty,
.notification-bell__loading {
    padding: 1rem .9rem;
    margin: 0;
}

.changelog-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.changelog-release { padding: 1.1rem 1.25rem; }
.changelog-release__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1rem;
    margin-bottom: .75rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--border);
}
.changelog-release__version {
    margin: 0;
    font-size: 1.15rem;
    color: var(--cw-primary);
}
.changelog-release__date {
    font-size: .85rem;
    color: var(--muted);
}
.changelog-release__section { margin-top: .65rem; }
.changelog-release__section h3 {
    margin: 0 0 .4rem;
    font-size: .92rem;
    color: var(--text);
}
.changelog-release__section ul {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-body);
    font-size: .9rem;
    line-height: 1.5;
}
.changelog-release__section li + li { margin-top: .25rem; }
.changelog-release--major {
    border: 1px solid rgba(61, 92, 153, .35);
    background: linear-gradient(135deg, rgba(61, 92, 153, .08), var(--surface) 45%);
    box-shadow: 0 4px 18px rgba(61, 92, 153, .12);
}
.changelog-release--major .changelog-release__version { color: var(--cw-primary); }
.changelog-release__badge {
    display: inline-block;
    margin-left: .5rem;
    padding: .12rem .45rem;
    border-radius: 999px;
    background: var(--cw-primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem .45rem .2rem .2rem;
    border: 1px solid var(--header-control-border);
    border-radius: 999px;
    background: var(--header-control-bg);
    color: var(--header-text);
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.user-menu__trigger:hover,
.user-menu--open .user-menu__trigger {
    background: var(--hover-bg);
    border-color: var(--cw-primary);
}
[data-theme="dark"] .user-menu__trigger:hover,
[data-theme="dark"] .user-menu--open .user-menu__trigger {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.35);
}
.user-menu__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.9);
    flex-shrink: 0;
}
.user-menu__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-menu__avatar svg { width: 18px; height: 18px; }
.user-menu__name { font-weight: 600; max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 11rem;
    padding-top: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 50;
}
.user-menu__dropdown::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 6px;
}
.user-menu__dropdown-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.user-menu--open .user-menu__dropdown { display: block; }
.user-menu__dropdown a,
.user-menu__dropdown button {
    display: block;
    width: 100%;
    padding: .65rem .9rem;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
}
.user-menu__dropdown a:hover,
.user-menu__dropdown button:hover { background: var(--hover-bg); color: var(--cw-primary); }
.user-menu__dropdown form { margin: 0; border-top: 1px solid var(--border); }

.user-menu__theme {
    padding: .55rem .75rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--accent-surface);
}
.user-menu__theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}
.user-menu__theme-options .theme-pick,
.user-menu__theme-options button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: .4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.user-menu__theme-options .theme-pick svg,
.user-menu__theme-options button svg {
    display: block;
    width: 18px;
    height: 18px;
}
.user-menu__theme-options .theme-pick:hover,
.user-menu__theme-options button:hover { border-color: var(--cw-primary); color: var(--cw-primary); }
.user-menu__theme-options .theme-pick.is-active,
.user-menu__theme-options button.is-active {
    background: var(--cw-primary);
    border-color: var(--cw-primary);
    color: #fff;
}

.user-menu__layout {
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--border);
}
.user-menu__layout-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .35rem;
}
.user-menu__layout-options .ui-layout-pick {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: .4rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.user-menu__layout-options .ui-layout-pick:hover { border-color: var(--cw-primary); color: var(--cw-primary); }
.user-menu__layout-options .ui-layout-pick.is-active {
    background: var(--cw-primary);
    border-color: var(--cw-primary);
    color: #fff;
}

.app-release-label { margin: 0 0 .35rem; font-size: 1.05rem; color: var(--cw-primary); }
.avatar-upload { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: .75rem; }
.avatar-upload__preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #eef3fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cw-primary);
    flex-shrink: 0;
}
.avatar-upload__img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload__placeholder svg { width: 32px; height: 32px; }
.avatar-upload__fields { flex: 1; min-width: 200px; }
.avatar-remove-form { margin: 0 0 1rem; }
.btn--small { font-size: .82rem; padding: .35rem .65rem; }

.notice-contract {
    background: #f7f8fa;
    border: 1px solid #d8dee8;
    border-left: 4px solid #8fa4c8;
    padding: 14px 18px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.65;
    margin: 0 0 20px;
}
.notice-contract strong { color: #3d5c99; }
.notice-contract--ok {
    border-left-color: #3d5c99;
    background: #f4f7fb;
}

.stats-heatmap { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.stats-heatmap td { text-align: center; font-size: .85rem; padding: .65rem .5rem; border: 1px solid var(--border); }
.stats-heatmap .heat-day { font-weight: 700; display: block; margin-bottom: .15rem; }
.stats-heatmap .heat-0 { background: #f8fafc; }
.stats-heatmap .heat-1 { background: #dde6f3; }
.stats-heatmap .heat-2 { background: #b8c9e8; }
.stats-heatmap .heat-3 { background: #3d5c99; color: #fff; }
.stats-amounts { margin: 0; padding: 0; list-style: none; }
.stats-amounts li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.stats-amounts li:last-child { border-bottom: none; font-weight: 700; color: var(--cw-primary); }

.stats-compare { margin-bottom: 1rem; }
.stats-compare-table .num { text-align: right; white-space: nowrap; }
.delta-up { color: var(--danger); font-weight: 600; }
.delta-down { color: #27ae60; font-weight: 600; }

.stats-trend { margin-bottom: 1rem; }
.stats-trend h3 { margin: 0 0 .65rem; font-size: .95rem; color: var(--cw-primary); }
.stats-trend__charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: .5rem; }
.stats-trend__bars {
    display: flex;
    align-items: flex-end;
    gap: .35rem;
    height: 160px;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.stats-trend__col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
}
.stats-trend__col--current .stats-trend__bar { opacity: 1; box-shadow: 0 0 0 2px var(--cw-primary); }
.stats-trend__bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 120px;
}
.stats-trend__bar {
    width: 72%;
    max-width: 2.5rem;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    opacity: .85;
    transition: height .2s ease;
}
.stats-trend__bar--hours { background: var(--cw-primary); }
.stats-trend__bar--amount { background: #5a7ab8; }
.stats-trend__bar--total { background: #2e7d32; }
.stats-trend__short { font-size: .72rem; color: var(--muted); font-weight: 600; text-align: center; }
.stats-trend__val { font-size: .7rem; color: var(--text); text-align: center; white-space: nowrap; }
.stats-trend-table__current td { background: #f4f7fb; font-weight: 600; }
.stats-trend-table__current td:first-child a { color: var(--cw-primary); }

.form__subtitle { margin: 1.25rem 0 .5rem; font-size: .95rem; color: var(--cw-primary); }
.sms-template-counter { margin: .35rem 0 0; font-size: .85rem; font-weight: 600; color: var(--cw-primary); }

.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.auth-page__footer { margin-top: auto; }
.auth-page__foot {
    flex-shrink: 0;
    padding: .85rem 1.25rem;
    text-align: center;
    font-size: .78rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* Logowanie — układ split (marka + formularz) */
.auth-page--split { background: var(--bg); }
.auth-shell {
    display: grid;
    grid-template-columns: minmax(280px, 42%) 1fr;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.auth-page--split-b .auth-shell {
    grid-template-columns: minmax(260px, 38%) 1fr;
}
.auth-shell__brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2rem;
    color: #fff;
    /* Zawsze ciemny panel — nie używać var(--header-bg); w [data-theme=light] to biały kolor nagłówka app. */
    background: linear-gradient(165deg, var(--cw-dark-2) 0%, var(--cw-dark) 48%, #152945 100%);
}
[data-theme="light"] .auth-page--split .auth-shell__brand,
[data-theme="dark"] .auth-page--split .auth-shell__brand {
    background: linear-gradient(165deg, var(--cw-dark-2) 0%, var(--cw-dark) 48%, #152945 100%);
    color: #fff;
}
.auth-shell__brand::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 85% 55% at 15% 85%, rgba(61, 92, 153, .5), transparent 58%),
        radial-gradient(ellipse 45% 35% at 92% 8%, rgba(255, 255, 255, .07), transparent);
}
.auth-shell__brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
    margin: auto 0;
}
.auth-shell__logo { margin-bottom: 1.5rem; }
.auth-page--split-b .auth-shell__logo { margin-bottom: 0; }
.auth-shell__logo .logo__mark { color: #fff; font-size: 1.65rem; }
.auth-shell__logo .logo__sub { color: rgba(255, 255, 255, .72); font-size: 1rem; }
.auth-shell__logo-img { max-height: 44px; width: auto; }
.auth-page--split-b .auth-shell__logo-img {
    max-height: min(16rem, 72%);
    max-width: min(18rem, 88%);
    width: auto;
    height: auto;
}
.auth-page--split-b .auth-shell__logo .logo__mark { font-size: 3.25rem; }
.auth-page--split-b .auth-shell__logo .logo__sub { font-size: 1.35rem; }
.auth-shell__logo .logo__img--on-dark { display: block !important; }
.auth-shell__logo .logo__img--default { display: none !important; }
.auth-shell__logo .logo__img--default.logo__img--pad-on-dark { display: block !important; }
.auth-shell__logo .logo__img--pad-on-dark {
    background: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    box-sizing: content-box;
}
.auth-shell__tagline {
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, .88);
}
.auth-shell__features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .65rem;
    font-size: .9rem;
    color: rgba(255, 255, 255, .78);
}
.auth-shell__features li {
    position: relative;
    padding-left: 1.35rem;
}
.auth-shell__features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .45rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}
.auth-shell__brand-foot {
    position: relative;
    z-index: 1;
    margin: 2rem 0 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .45);
}

/* Split B — logo + tagline wyśrodkowane, wersja w stopce panelu */
.auth-page--split-b .auth-shell__brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 2.25rem 2rem;
}
.auth-shell__brand-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2rem;
    max-width: 100%;
    width: 100%;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}
.auth-page--split-b .auth-shell__tagline {
    margin: 0;
    max-width: 17rem;
    font-family: 'DM Sans', var(--font);
    font-size: 1.12rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.65;
    letter-spacing: 0.015em;
    color: rgba(255, 255, 255, .86);
}
.auth-shell__brand-version {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: .7rem 1rem;
    position: relative;
    z-index: 1;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)),
        repeating-linear-gradient(
            -12deg,
            rgba(255, 255, 255, .05) 0,
            rgba(255, 255, 255, .05) 1px,
            transparent 1px,
            transparent 10px
        );
    border: 1px solid rgba(255, 255, 255, .12);
}
.auth-shell__version-label {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}
.auth-shell__version-value {
    font-size: .88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .88);
}

.auth-shell__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}
.auth-page--split-b .auth-shell__body {
    background: var(--surface);
    border-left: 1px solid var(--border);
}
.auth-shell__toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.25rem 0;
}
.auth-shell__toolbar .user-menu__theme {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}
.auth-shell__toolbar .user-menu__theme-options {
    display: inline-flex;
    gap: .35rem;
}
.auth-shell__toolbar .user-menu__theme-options .theme-pick,
.auth-shell__toolbar .user-menu__theme-options button {
    width: 2.35rem;
    min-width: 2.35rem;
    flex: 0 0 auto;
}
.auth-shell__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem 2rem;
}
.auth-page--split-b .auth-shell__main {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem clamp(1.5rem, 4vw, 3rem) 2.5rem clamp(2rem, 6vw, 5rem);
}
.auth-page--split-b .auth-form-wrap {
    max-width: 22rem;
}

.auth-form-wrap {
    width: 100%;
    max-width: 24rem;
}
.auth-form-wrap__logo {
    display: none;
    margin-bottom: 1.15rem;
}
.auth-form-wrap__mobile-brand {
    display: none;
}
.auth-form-wrap__tagline {
    margin: 0 0 .35rem;
    font-family: 'DM Sans', var(--font);
    font-size: .88rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--muted);
}
.auth-form-wrap__logo-img { max-height: 36px; width: auto; }
.auth-form-wrap__logo .logo__img--default { display: block; }
.auth-form-wrap__logo .logo__img--on-dark { display: none; }
.auth-form-wrap__logo .logo__img--default.logo__img--pad-on-dark { display: block; }
[data-theme="dark"] .auth-form-wrap__logo .logo__img--default:not(.logo__img--pad-on-dark) { display: none; }
[data-theme="dark"] .auth-form-wrap__logo .logo__img--on-dark { display: block; }
[data-theme="dark"] .auth-form-wrap__logo .logo__img--pad-on-dark { display: block; }
.auth-form-wrap h1 {
    margin: 0 0 1.25rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.auth-form-wrap__setup-hint,
.auth-form-wrap__hint {
    margin: -.35rem 0 .85rem;
    font-size: .88rem;
}
.auth-form-wrap .alert { margin-bottom: 1rem; }
.auth-form-wrap .form.auth-form {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.auth-form-wrap .auth-form label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: 0 0 1rem;
    font-weight: 600;
    font-size: .88rem;
}
.auth-form-wrap .auth-form label.checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: .55rem;
    margin: .35rem 0 .75rem;
    font-weight: 500;
    line-height: 1.4;
}
.auth-form-wrap .auth-form label.checkbox input[type="checkbox"] {
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    min-height: 1rem;
    margin: .15rem 0 0;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: .2rem;
    background: var(--input-bg);
    box-shadow: none;
}
.auth-form-wrap .auth-form label.checkbox input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-unlock-methods {
    border: 0;
    margin: 0 0 .75rem;
    padding: 0;
}
.auth-unlock-methods legend {
    font-weight: 600;
    margin-bottom: .35rem;
}
.auth-unlock-methods__option {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .25rem 0;
    font-weight: 500;
}
.auth-unlock-methods__option input {
    width: auto;
    min-width: 0;
    margin: 0;
}
.auth-form-wrap .auth-form input {
    width: 100%;
    margin: 0;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    background: var(--input-bg);
    color: var(--text);
}
.auth-form-wrap .auth-form input:focus {
    outline: none;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-form-wrap .form__actions { margin-top: .25rem; }

.otp-input { margin: 0 0 1rem; }
.otp-input__caption {
    display: block;
    margin: 0 0 .45rem;
    font-weight: 600;
    font-size: .88rem;
    color: var(--text);
}
.otp-input__row {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: nowrap;
}
.otp-input__group {
    display: flex;
    gap: .35rem;
}
.otp-input__cell {
    box-sizing: border-box;
    width: 2.5rem;
    height: 2.6rem;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
}
.otp-input__backup {
    box-sizing: border-box;
    width: 10.5ch;
    max-width: 14rem;
    height: 2.6rem;
    margin: 0;
    padding: 0 .65rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text);
}
.otp-input__cell:focus,
.otp-input__backup:focus {
    outline: none;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.auth-form-wrap .auth-form .otp-input__cell,
.form .otp-input__cell {
    width: 2.5rem;
    max-width: 2.5rem;
    margin: 0;
}
.auth-form-wrap .auth-form .otp-input__backup,
.form .otp-input__backup {
    width: 10.5ch;
    max-width: 14rem;
    margin: 0;
}
.otp-input__switch-wrap { margin: .55rem 0 0; }
.otp-input__switch {
    border: 0;
    padding: 0;
    background: none;
    color: var(--cw-primary);
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
}
.otp-input__switch:hover { text-decoration: underline; }

.auth-shell__footer {
    padding: 0 1.25rem 1.25rem;
    text-align: center;
    font-size: .8rem;
    color: var(--muted);
}
.auth-shell__footer a { color: var(--cw-primary); text-decoration: none; }
.auth-shell__footer a:hover { text-decoration: underline; }

.auth-panel {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 2);
    box-shadow: var(--shadow);
}
.auth-panel h1 { font-size: 1.45rem; margin: 0 0 .4rem; }
.auth-panel__intro { margin: 0 0 1.25rem; font-size: .92rem; color: var(--muted); line-height: 1.5; }
.auth-panel__hint { margin: -.35rem 0 .75rem; font-size: .85rem; }
.auth-panel__version { margin: 1.25rem 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

.auth-card-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.35rem; margin: 0 0 .35rem; }
.auth-card__brand { text-align: center; margin-bottom: 1.25rem; }
.auth-card__logo { max-height: 40px; width: auto; }
.auth-card__brand .logo__mark { color: var(--text); }
.auth-card__brand .logo__sub { color: var(--muted); }
.auth-card__brand .logo__img--pad-on-dark { background: #fff; padding: 6px 10px; border-radius: 4px; box-sizing: content-box; }
[data-theme="dark"] .auth-card__brand .logo__img--default { display: none; }
[data-theme="dark"] .auth-card__brand .logo__img--on-dark { display: block; }
[data-theme="dark"] .auth-card__brand .logo__img--pad-on-dark { display: block; }
.auth-card__title { font-size: 1.2rem; color: var(--cw-primary); }
.auth-card__version { margin: 1.25rem 0 0; text-align: center; font-size: .8rem; color: #888; }
.auth-form label { display: block; margin: .75rem 0; font-weight: 600; font-size: .9rem; }
.auth-form input { width: 100%; margin-top: .35rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; background: var(--input-bg); color: var(--text); }
.auth-form input:focus { outline: none; border-color: var(--cw-primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.btn--block { width: 100%; justify-content: center; }

/* Logowanie — wariant CWB Modern (preferencja układu / cookie) */
.auth-page--modern .auth-shell {
    grid-template-columns: minmax(260px, 38%) 1fr;
}
.auth-page--modern .auth-shell__brand {
    background: linear-gradient(180deg, #000611 0%, #010f21 55%, #0a1628 100%);
}
.auth-page--modern .auth-shell__brand::before {
    background:
        radial-gradient(ellipse 70% 50% at 80% 20%, rgba(61, 92, 153, .35), transparent 55%),
        radial-gradient(ellipse 40% 30% at 20% 90%, rgba(255, 255, 255, .05), transparent);
}
.auth-page--modern .auth-shell__body {
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--cw-primary) 8%, transparent), transparent 55%),
        var(--bg);
    border-left: none;
}
.auth-page--modern .auth-shell__toolbar {
    gap: .55rem;
    align-items: center;
}
.auth-page--modern .auth-shell__toolbar .user-menu__layout {
    padding: 0;
    border: none;
}
.auth-page--modern .auth-shell__toolbar .user-menu__layout-options {
    display: inline-flex;
    gap: .3rem;
}
.auth-page--modern .auth-shell__toolbar .user-menu__layout-options .ui-layout-pick {
    min-height: 2.15rem;
    min-width: 4.4rem;
    padding: .35rem .65rem;
    font-size: .78rem;
}
.auth-page--modern .auth-form-wrap h1 {
    letter-spacing: -.02em;
}
.auth-page--modern .auth-form-wrap .auth-form input {
    border-radius: 8px;
    padding: .7rem .85rem;
}
.auth-page--modern .auth-form-wrap .btn--primary {
    border-radius: 8px;
    min-height: 2.65rem;
    font-weight: 700;
}

.footer {
    background: rgba(0,0,0,.85);
    color: rgba(255,255,255,.6);
    padding: 1.25rem 0;
    margin-top: 2rem;
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }

.muted { color: var(--muted); }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -0.25rem 0 1.25rem;
    padding: .85rem 0;
    flex-wrap: wrap;
    gap: .75rem;
    position: sticky;
    top: var(--site-top-height, 0px);
    z-index: 120;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color .15s, box-shadow .15s;
}
.page-header.is-stuck {
    border-bottom-color: var(--border);
    box-shadow: 0 4px 12px rgba(1, 15, 33, .06);
}
.page-header h1 { margin: 0; font-size: 1.5rem; line-height: 1.25; flex: 1 1 auto; min-width: 0; }
.dashboard-month-left {
    margin-left: .4rem;
    font-size: .72em;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}
.dashboard-month-left--soon { color: #8a4b08; }
.page-header__actions { display: flex; gap: .35rem; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.page-header > .btn,
.page-header > a.btn { flex-shrink: 0; }

.scroll-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--cw-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(1, 15, 33, .22);
    cursor: pointer;
    z-index: 190;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background .15s;
}
.scroll-top:hover { background: var(--cw-primary-dark); }
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top svg { display: block; margin: 0 auto; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card-grid--hub { margin-bottom: 1.5rem; }
.dashboard-section-title { margin: 0 0 .75rem; font-size: 1.1rem; color: var(--cw-primary); }
#dashboard-list { scroll-margin-top: calc(var(--site-top-height, 0px) + 5rem); }
.dashboard-page.is-clients-tab [data-dashboard-section="hub"],
.dashboard-page.is-clients-tab [data-dashboard-section="operations"] {
    display: none;
}
.dashboard-page:not(.is-clients-tab) [data-dashboard-section="clients"] {
    display: none;
}
.dashboard-page.is-clients-tab [data-dashboard-section="clients"] .dashboard-section-title {
    display: none;
}
.dashboard-ops-more { margin: -.35rem 0 .85rem; }
.firm-stats { margin: 0 0 1.75rem; }
.stat-row--link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: inherit;
    text-decoration: none;
}
.stat-row--link:hover .stat-row__label { color: var(--cw-primary); }
.firm-stats-table-wrap { overflow-x: auto; margin: .5rem 0 1rem; }
.firm-stats-table { width: 100%; }
.firm-stats-ranks { margin-top: .5rem; }
.firm-stats-rank { margin: .4rem 0 0; padding-left: 1.1rem; }
.firm-stats-rank li { margin: .35rem 0; }
.firm-stats-rank a { font-weight: 600; }
.firm-stats-status {
    display: inline-block;
    font-weight: 700;
    font-size: .82rem;
}
.firm-stats-status--ok { color: #1b7a3d; }
.firm-stats-status--over { color: #b42318; }
.firm-stats-status--empty,
.firm-stats-status--open { color: var(--muted, #5c6b80); }
.firm-stats-status__detail { display: block; margin-top: .15rem; font-size: .8rem; }
[data-theme="dark"] .firm-stats-status--ok { color: #6ee7a0; }
[data-theme="dark"] .firm-stats-status--over { color: #f87171; }
.card--hub-active { border-color: var(--cw-primary); background: var(--accent-surface); box-shadow: 0 0 0 1px var(--cw-primary); }
.card--hub-active:hover { transform: none; }
.card__cta { margin-top: auto; padding-top: .35rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--cw-primary); transform: translateY(-1px); }
.card h2 { margin: 0 0 .25rem; font-size: 1.05rem; color: var(--cw-primary); }
.card__desc { margin: 0; font-size: .82rem; }
.card__icon { display: block; color: var(--cw-primary); margin-bottom: .4rem; line-height: 0; }
.card--home .card__icon svg,
.card--client .card__icon svg { display: block; }
.card--client .card__logo-wrap + .card__icon,
.card--client .card__icon + .card__logo-wrap { margin-top: .35rem; }
.card--sms-balance { position: relative; }
.card--sms-balance .card__stat {
    margin: .15rem 0 .35rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--cw-primary);
}
.card--sms-balance .card__stat--muted { font-size: 1.25rem; color: var(--muted); }
.card--sms-low { border-color: var(--warn-border); background: var(--warn-surface); }
.card--sms-balance .card__meta { margin: .65rem 0 0; font-size: .75rem; }
.card--sms-balance .card__meta a { color: var(--cw-primary); }
.card--billing-period .card__stat {
    margin: .15rem 0 .35rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--cw-primary);
}
.card--period-urgent { border-color: var(--warn-border); background: var(--warn-surface); }
.dashboard-ops { margin-bottom: 1.5rem; }
.dashboard-ops-block { margin: 0 0 1.6rem; }
.dashboard-ops-block:last-child { margin-bottom: 0; }
.dashboard-ops-block .dashboard-section-title { margin-bottom: .65rem; }
.card-grid--ops { margin-bottom: .75rem; }
.card--ops-metric .card__stat {
    margin: .15rem 0 .35rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--cw-primary);
}
.card--ops-warn { border-color: var(--warn-border); background: var(--warn-surface); }
.card--ops-urgent { border-color: #c62828; background: color-mix(in srgb, #c62828 10%, var(--card-bg)); }
.card--ops-urgent .card__stat { color: #c62828; }
.dashboard-ops-list--urgent .dashboard-ops-list__title { color: #c62828; }
.dashboard-ops-list__badge {
    display: inline-block;
    margin-left: .5rem;
    padding: .15rem .45rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #fff;
    background: #c62828;
    border-radius: 4px;
    vertical-align: middle;
}
.card--ops-chip--urgent { border-color: #c62828; background: color-mix(in srgb, #c62828 8%, var(--card-bg)); }
.card--ops-chip--sent {
    border: 2px solid #2e7d32;
    background: color-mix(in srgb, #2e7d32 8%, var(--card-bg));
}
.card--ops-chip--sent:hover { border-color: #1b5e20; }
.card--ops-chip__sent-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.3rem;
    color: #2e7d32;
    vertical-align: -0.15em;
}
.card--ops-chip--due {
    border: 2px solid #c62828;
    background: color-mix(in srgb, #c62828 7%, var(--card-bg));
}
.card--ops-chip--due:hover { border-color: #b71c1c; }
.card-grid--revenue { margin-bottom: 1rem; }
.card-grid--revenue .card--metric-expandable[open] {
    grid-column: 1 / -1;
}
.card--metric-expandable[open] .card--metric-expandable__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem 1.25rem;
    align-items: start;
}
.card--metric-expandable[open] .metric-sparkline,
.card--metric-expandable[open] .metric-breakdown {
    grid-column: 1 / -1;
}
@media (max-width: 720px) {
    .card--metric-expandable[open] .card--metric-expandable__body {
        grid-template-columns: 1fr;
    }
}
.card--revenue-forecast {
    border-color: color-mix(in srgb, #1565c0 45%, var(--card-border));
    background: linear-gradient(135deg, color-mix(in srgb, #1565c0 11%, var(--card-bg)) 0%, var(--card-bg) 55%);
    border-left: 4px solid #1565c0;
}
.card--revenue-forecast .card__icon { color: #1565c0; }
.card--revenue-forecast .card__stat { color: #1565c0; }
.card--revenue-actual {
    border-color: color-mix(in srgb, #2e7d32 45%, var(--card-border));
    background: linear-gradient(135deg, color-mix(in srgb, #2e7d32 10%, var(--card-bg)) 0%, var(--card-bg) 55%);
    border-left: 4px solid #2e7d32;
}
.card--revenue-actual .card__icon { color: #2e7d32; }
.card--revenue-actual .card__stat { color: #2e7d32; }
.card--revenue-actual .card--metric-expandable__hint { color: #2e7d32; }
.card--revenue-actual .card--metric-expandable__body {
    border-top-color: color-mix(in srgb, #2e7d32 22%, var(--card-border));
}
.card--revenue-actual .metric-top-clients__list li a:hover {
    background: color-mix(in srgb, #2e7d32 10%, var(--card-bg));
}
.card--revenue-gap {
    border-color: color-mix(in srgb, #ef6c00 50%, var(--card-border));
    background: linear-gradient(135deg, color-mix(in srgb, #ef6c00 12%, var(--card-bg)) 0%, var(--warn-surface) 70%);
    border-left: 4px solid #ef6c00;
}
.card--revenue-gap .card__icon { color: #ef6c00; }
.card--revenue-gap .card__stat { color: #e65100; }
.card--ops-hours {
    border-color: color-mix(in srgb, #6a1b9a 40%, var(--card-border));
    background: linear-gradient(135deg, color-mix(in srgb, #6a1b9a 9%, var(--card-bg)) 0%, var(--card-bg) 55%);
    border-left: 4px solid #6a1b9a;
}
.card--ops-hours .card__icon { color: #6a1b9a; }
.card--ops-hours .card__stat { color: #6a1b9a; }
.card--ops-contract {
    border-color: color-mix(in srgb, #546e7a 35%, var(--card-border));
    background: linear-gradient(135deg, color-mix(in srgb, #546e7a 7%, var(--card-bg)) 0%, var(--card-bg) 55%);
    border-left: 4px solid #546e7a;
}
.card--ops-contract .card__icon { color: #546e7a; }
.card--ops-contract .card__stat { color: #455a64; }
.card--ops-metric .card__highlight {
    display: inline-block;
    margin-top: .35rem;
    font-size: .82rem;
    color: var(--text);
}
.card--ops-metric .card__highlight a {
    font-weight: 700;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.card--metric-expandable { padding: 0; }
.card--metric-expandable__summary {
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .65rem .85rem;
    align-items: start;
    padding: 1rem 1.1rem;
    cursor: pointer;
}
.card--metric-expandable__summary::-webkit-details-marker { display: none; }
.card--metric-expandable__summary::marker { content: ''; }
.card--metric-expandable__head { min-width: 0; }
.card--metric-expandable__head h2 { margin: 0 0 .25rem; }
.card--metric-expandable__chevron {
    width: .55rem;
    height: .55rem;
    margin-top: .45rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.card--metric-expandable[open] .card--metric-expandable__chevron {
    transform: rotate(-135deg);
    margin-top: .65rem;
}
.card--metric-expandable__hint {
    color: #1565c0;
    font-weight: 600;
}
.card--metric-expandable__hint-close { display: none; }
.card--metric-expandable[open] .card--metric-expandable__hint-open { display: none; }
.card--metric-expandable[open] .card--metric-expandable__hint-close { display: inline; }
.card--metric-expandable__body {
    padding: 0 1.1rem 1rem;
    border-top: 1px solid color-mix(in srgb, #1565c0 18%, var(--card-border));
}
.metric-breakdown {
    list-style: none;
    margin: .75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.metric-breakdown__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .45rem .6rem;
    border-radius: 6px;
    font-size: .86rem;
    background: var(--surface-muted);
    border: 1px solid var(--card-border);
}
.metric-breakdown__row strong {
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
}
.metric-breakdown__label::before {
    content: '';
    display: inline-block;
    width: .55rem;
    height: .55rem;
    margin-right: .45rem;
    border-radius: 50%;
    vertical-align: middle;
}
.metric-breakdown__row--hours .metric-breakdown__label::before { background: #6a1b9a; }
.metric-breakdown__row--subscription .metric-breakdown__label::before { background: #1565c0; }
.metric-breakdown__row--km .metric-breakdown__label::before { background: #00838f; }
.metric-breakdown__row--offers .metric-breakdown__label::before { background: #c62828; }
.metric-breakdown__row--costs .metric-breakdown__label::before { background: #ef6c00; }
.metric-breakdown__row--margin .metric-breakdown__label::before { background: #2e7d32; }
.metric-breakdown__row--offer .metric-breakdown__label::before { background: #c62828; }
.metric-breakdown__row--other .metric-breakdown__label::before { background: #546e7a; }
.forecast-client {
    grid-column: 1 / -1;
    margin-top: .85rem;
}
.forecast-client__title {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: baseline;
    margin: 0 0 .35rem;
    font-size: .95rem;
}
.forecast-client__title a {
    color: inherit;
    text-decoration: none;
}
.forecast-client__title a:hover { text-decoration: underline; }
.forecast-client__lines { margin-top: 0; }
.forecast-client__lines .metric-breakdown__label a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}
.forecast-client__lines .metric-breakdown__label a:hover { text-decoration: underline; }
.forecast-client__lines .metric-breakdown__hint {
    display: block;
    margin-top: .1rem;
    color: var(--muted);
}
.metric-breakdown__row--excluded {
    opacity: .72;
}
.metric-breakdown__row--excluded strong {
    font-weight: 600;
    color: var(--muted);
}
.metric-breakdown__hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    font-size: .78em;
}
.metric-breakdown__note {
    margin: .55rem 0 0;
    font-size: .78rem;
    line-height: 1.35;
}
.card--hub-offers {
    display: flex;
    flex-direction: column;
}
.card--hub-offers h2 a {
    color: inherit;
    text-decoration: none;
}
.card--hub-offers h2 a:hover { text-decoration: underline; }
.card--hub-quiet {
    background: var(--surface);
    box-shadow: none;
}
.card--hub-quiet .card__stat,
.card--hub-quiet.card--sms-balance .card__stat,
.card--hub-quiet.card--billing-period .card__stat {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
}
a.metric-breakdown__row {
    text-decoration: none;
    color: inherit;
}
a.metric-breakdown__row:hover {
    border-color: var(--cw-primary);
}
.metric-breakdown--hub {
    margin: .55rem 0 0;
    gap: .3rem;
}
.metric-breakdown--hub .metric-breakdown__row {
    padding: .4rem .55rem;
    font-size: .82rem;
    background: var(--hover-bg, #eef3fa);
    border-color: var(--border);
}
.metric-breakdown--hub .metric-breakdown__row strong {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text);
}
.metric-breakdown--hub .metric-breakdown__row.is-zero strong {
    color: var(--muted);
    font-weight: 600;
}
.metric-breakdown__row--waiting .metric-breakdown__label::before { background: #c62828; }
.metric-breakdown__row--accepted .metric-breakdown__label::before { background: #2e7d32; }
.metric-breakdown__row--declined .metric-breakdown__label::before { background: #78909c; }
.metric-breakdown__row--unbilled .metric-breakdown__label::before { background: #e65100; }
.metric-breakdown__row--unbilled.is-open {
    background: color-mix(in srgb, #e65100 10%, var(--surface));
    border-color: color-mix(in srgb, #e65100 28%, var(--border));
}
.metric-breakdown__row--unbilled.is-open strong { color: #e65100; }
.metric-breakdown__row--waiting.is-alert {
    background: color-mix(in srgb, #c62828 10%, var(--surface));
    border-color: color-mix(in srgb, #c62828 32%, var(--border));
}
.metric-breakdown__row--waiting.is-alert strong {
    color: #c62828;
}
.metric-top-clients { margin-top: .85rem; }
.metric-top-clients__title {
    margin: 0 0 .45rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.metric-top-clients__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.metric-top-clients__list li a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    padding: .4rem .55rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    background: color-mix(in srgb, #1565c0 6%, var(--card-bg));
    border: 1px solid color-mix(in srgb, #1565c0 18%, var(--card-border));
    transition: border-color .15s, background .15s;
}
.metric-top-clients__list li a:hover {
    border-color: #1565c0;
    background: color-mix(in srgb, #1565c0 10%, var(--card-bg));
}
.metric-top-clients__name {
    font-weight: 700;
    font-size: .86rem;
    color: #1565c0;
}
.metric-top-clients__meta {
    font-size: .78rem;
    color: var(--muted);
    white-space: nowrap;
}
.metric-sparkline { margin-top: .15rem; }
.metric-sparkline__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .35rem;
}
.metric-sparkline__title {
    margin: 0;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .035em;
    color: var(--muted);
}
.metric-sparkline__hint {
    margin: 0;
    font-size: .72rem;
    white-space: nowrap;
}
.metric-sparkline__svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.metric-sparkline__grid {
    stroke: color-mix(in srgb, #1565c0 10%, var(--card-border));
    stroke-width: 1;
    stroke-dasharray: 3 5;
}
.metric-sparkline__grid--base {
    stroke-dasharray: none;
    stroke: color-mix(in srgb, #1565c0 18%, var(--card-border));
}
.metric-sparkline__axis {
    font-size: 8px;
    fill: var(--muted);
    font-weight: 600;
}
.metric-sparkline__grad-top { stop-color: #1565c0; stop-opacity: .16; }
.metric-sparkline__grad-bottom { stop-color: #1565c0; stop-opacity: .015; }
.metric-sparkline__stroke-start { stop-color: #42a5f5; }
.metric-sparkline__stroke-end { stop-color: #0d47a1; }
.metric-sparkline__line {
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.metric-sparkline__current-guide {
    stroke: color-mix(in srgb, #1565c0 22%, transparent);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}
.metric-sparkline__dot {
    fill: var(--card-bg);
    stroke: #1976d2;
    stroke-width: 1.5;
}
.metric-sparkline__dot--current {
    fill: #1565c0;
    stroke: #fff;
    stroke-width: 1.75;
    filter: drop-shadow(0 1px 2px color-mix(in srgb, #1565c0 28%, transparent));
}
.metric-sparkline__value {
    font-size: 8px;
    fill: var(--muted);
    font-weight: 600;
}
.metric-sparkline__value--current {
    fill: #1565c0;
    font-size: 8.5px;
}
.metric-sparkline__label {
    font-size: 8.5px;
    fill: var(--muted);
    font-weight: 600;
}
.metric-sparkline__label--current {
    fill: #1565c0;
    font-weight: 700;
}
[data-theme="dark"] .metric-sparkline__grad-top { stop-color: #64b5f6; stop-opacity: .22; }
[data-theme="dark"] .metric-sparkline__grad-bottom { stop-color: #64b5f6; stop-opacity: .025; }
[data-theme="dark"] .metric-sparkline__stroke-start { stop-color: #90caf9; }
[data-theme="dark"] .metric-sparkline__stroke-end { stop-color: #42a5f5; }
[data-theme="dark"] .metric-sparkline__dot { stroke: #64b5f6; }
[data-theme="dark"] .metric-sparkline__dot--current {
    fill: #64b5f6;
    stroke: #0f172a;
}
[data-theme="dark"] .metric-sparkline__value--current,
[data-theme="dark"] .metric-sparkline__label--current { fill: #90caf9; }
[data-theme="dark"] .card--metric-expandable__hint { color: #90caf9; }
.card__stat-suffix {
    font-size: .72em;
    font-weight: 600;
    color: var(--muted);
}
.doc-share-card { max-width: 42rem; }
.doc-share-meta { margin: .75rem 0 1rem; font-size: .9rem; }
.doc-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}
.doc-share-hint {
    margin: 0;
    font-size: .9rem;
}
.table-inline-input {
    width: min(100%, 16rem);
    font-size: .78rem;
    padding: .25rem .4rem;
}
.table .num { text-align: right; white-space: nowrap; }
.card--expense-plus { border-color: color-mix(in srgb, #15803d 35%, var(--border)); }
.card--expense-minus { border-color: color-mix(in srgb, #b42318 35%, var(--border)); }
.card--expense-minus .card__stat { color: #b42318; }
[data-theme="dark"] .card--expense-minus .card__stat { color: #f5a8a8; }
a.card {
    color: inherit;
    text-decoration: none;
}
a.card:hover { filter: brightness(1.02); }
.inline-form { display: inline; margin: 0; }
.expenses-summary { margin-bottom: 1.25rem; }
.table-actions { white-space: nowrap; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.table-actions form { display: inline; margin: 0; }
.history-row--share td:nth-child(2) { font-weight: 600; }
.share-send-actions,
.share-send-cell {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.share-send-form { display: inline; margin: 0; }
.cost-margin-hint { display: block; font-weight: 400; font-size: .82rem; margin-top: .15rem; }
.history-row--access td:nth-child(2) { color: var(--cw-primary); }
.doc-type-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}
.doc-type-list-head h2 { margin: 0; font-size: 1rem; }
.card--compact { padding: .85rem 1rem; }
.doc-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-type-chips li {
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .82rem;
    background: var(--surface-muted);
    border: 1px solid var(--card-border);
}
.library-add {
    margin: 0 0 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.library-add > summary {
    cursor: pointer;
    padding: .7rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    list-style: none;
}
.library-add > summary::-webkit-details-marker { display: none; }
.library-add > summary::after {
    content: '▾';
    float: right;
    color: var(--muted);
}
.library-add:not([open]) > summary::after { content: '▸'; }
.library-add .form {
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
    padding: 1rem 1rem 1.1rem;
    background: transparent;
}
.library-add .form__actions { margin-top: .5rem; }
.library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0 0 1rem;
}
.library-filters__chip {
    display: inline-flex;
    align-items: center;
    padding: .28rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-muted, #f3f4f6);
    border: 1px solid var(--card-border, #e5e7eb);
}
.library-filters__chip:hover { border-color: var(--cw-primary); color: var(--cw-primary); }
.library-filters__chip.is-active {
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--card-bg, #fff));
    border-color: var(--cw-primary);
    color: var(--cw-primary);
}
.btn--sm { padding: .35rem .65rem; font-size: .82rem; }
.dashboard-ops-alert { margin: .75rem 0; font-size: .88rem; }
.dashboard-ops-alert a { font-weight: 600; }
.dashboard-ops-list { margin: .75rem 0 1rem; }
.dashboard-ops-list__title {
    margin: 0 0 .5rem;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
}
.card-grid--ops-chips {
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .5rem;
}
.card--ops-chip {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .7rem .85rem;
    text-decoration: none;
    color: inherit;
    min-height: 3.25rem;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card--ops-chip:hover {
    border-color: var(--cw-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 15, 33, .08);
}
.card--ops-chip__name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--cw-primary);
    line-height: 1.3;
    word-break: break-word;
}
.card--ops-chip__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 .35rem;
    font-size: .75rem;
    color: var(--muted);
    line-height: 1.25;
}
.card--ops-chip__amount { font-variant-numeric: tabular-nums; }
.card--ops-chip__go { white-space: nowrap; }
.card--ops-chip__go::before { content: "· "; }
.card--ops-chip--warn {
    border-left: 3px solid var(--warn-border);
    background: var(--warn-surface);
}
.card--ops-chip--alert {
    border-left: 3px solid var(--warn-border);
    background: var(--warn-surface);
}
.dashboard-ops-pools { margin-top: .5rem; }
.pool-bars { list-style: none; margin: 0; padding: 0; }
.pool-bars__item { margin-bottom: .85rem; }
.pool-bars__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .25rem .5rem;
    margin-bottom: .3rem;
    font-size: .88rem;
}
.pool-bars__head a { font-weight: 600; text-decoration: none; }
.pool-bars__meta { font-size: .8rem; }
.pool-bars__badge {
    display: inline-block;
    margin-left: .25rem;
    padding: .1rem .35rem;
    border-radius: 3px;
    background: #fde8e8;
    color: var(--danger);
    font-size: .72rem;
    font-weight: 700;
}
.pool-bars__track {
    height: 8px;
    border-radius: 4px;
    background: var(--hover-bg);
    overflow: hidden;
}
.pool-bars__fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--cw-primary);
    min-width: 0;
    transition: width .2s ease;
}
.pool-bars__fill--over { background: var(--danger); }
.card--info { cursor: default; }
.card--info:hover { transform: none; border-color: var(--border); }
.card--empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.75rem 1.25rem;
}
.card--empty > p { margin: 0 0 .65rem; }
.card--empty > p:last-child { margin-bottom: 0; }

.btn {
    display: inline-block;
    padding: .55rem 1.15rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font);
    background: var(--surface);
    border-color: var(--border);
    transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--cw-primary); color: var(--cw-primary); }
.btn--primary { background: var(--cw-primary); color: #fff; border-color: var(--cw-primary); }
.btn--primary:hover { background: var(--cw-primary-dark); border-color: var(--cw-primary-dark); color: #fff; }
.btn--ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.btn--ghost:hover {
    background: var(--hover-bg);
    border-color: var(--cw-primary);
    color: var(--cw-primary);
}
.btn--sm { padding: .3rem .65rem; font-size: .8rem; }

.filters {
    background: var(--surface);
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.filters__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.project-span {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    margin: .75rem 0 1rem;
}
.project-span label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; }
.project-span__custom { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.project-span__custom[hidden] { display: none !important; }
.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; color: var(--text); }
.offer-filters .offer-filter-range {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 11.5rem;
}
.offer-filters .offer-filter-range input {
    flex: 1 1 6.25rem;
    width: 6.25rem;
    min-width: 0;
}
.offer-filters .offer-filter-range__sep {
    color: var(--muted);
    font-weight: 400;
}
.offer-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
input, select, textarea {
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    color: var(--text);
    background: var(--input-bg);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

.stats-bar { display: flex; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; font-size: .9rem; }

.hour-timer {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 0 0 1.15rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.hour-timer--running,
.hour-timer--assign {
    border-color: color-mix(in srgb, var(--cw-primary) 35%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 7%, var(--surface));
}
.hour-timer__error {
    margin: 0;
    color: #b42318;
    font-size: .88rem;
}
[data-theme="dark"] .hour-timer__error {
    color: #f5a8a8;
}
.hour-timer__start,
.hour-timer__live,
.hour-timer__assign {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .85rem 1.25rem;
}
.hour-timer__live,
.hour-timer__assign {
    align-items: center;
}
.hour-timer__hint {
    margin: .35rem 0 0;
    font-size: .82rem;
    font-weight: 400;
    color: var(--muted);
    max-width: 28rem;
}
.hour-timer__copy {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: min(100%, 14rem);
    flex: 1;
}
.hour-timer__status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cw-primary);
}
.hour-timer__status--idle {
    color: var(--muted);
}
.hour-timer__dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--cw-primary);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--cw-primary) 55%, transparent);
    animation: hour-timer-pulse 1.6s ease-out infinite;
}
@keyframes hour-timer-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cw-primary) 45%, transparent); }
    70% { box-shadow: 0 0 0 .55rem color-mix(in srgb, var(--cw-primary) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cw-primary) 0%, transparent); }
}
.hour-timer__modes {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .35rem 0 .55rem;
}
.hour-timer__split {
    width: 100%;
    margin-top: .35rem;
}
.hour-timer__split-sum {
    margin: .15rem 0 .55rem;
    font-size: .88rem;
    font-weight: 600;
}
.hour-timer__split-sum.is-ok { color: #15803d; }
.hour-timer__split-sum.is-bad { color: #b42318; }
[data-theme="dark"] .hour-timer__split-sum.is-ok { color: #86efac; }
[data-theme="dark"] .hour-timer__split-sum.is-bad { color: #f5a8a8; }
.hour-timer__split-row {
    display: grid;
    grid-template-columns: 7.5rem minmax(11rem, 1fr) minmax(10rem, 1.1fr);
    gap: .5rem .65rem;
    margin-bottom: .55rem;
    align-items: end;
}
@media (max-width: 720px) {
    .hour-timer__split-row { grid-template-columns: 1fr; }
}
.hour-timer__split-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .15rem 0 .25rem;
}
.hour-timer__assign .hour-timer__copy {
    flex: 1 1 16rem;
    min-width: 0;
    overflow: visible;
}
.hour-timer__goals {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .5rem;
}
.hour-timer__goal {
    margin: 0;
    cursor: pointer;
}
.hour-timer__goal input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.hour-timer__goal span {
    display: inline-flex;
    padding: .28rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: .82rem;
    font-weight: 600;
    background: var(--surface);
}
.hour-timer__goal:has(input:checked) span {
    border-color: var(--cw-primary);
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface));
    color: var(--cw-primary);
}
.hour-timer__goal:has(input:focus-visible) span {
    outline: 2px solid var(--cw-primary);
    outline-offset: 2px;
}
.hour-timer__field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-top: .45rem;
    font-size: .82rem;
    font-weight: 600;
}
.hour-timer__field input,
.hour-timer__field select {
    font-weight: 400;
    width: 100%;
    max-width: 22rem;
}
.hour-timer__goal-line {
    margin: .35rem 0 0;
    font-size: .82rem;
    color: var(--muted);
}
.hour-timer__bar {
    height: .35rem;
    max-width: 22rem;
    margin-top: .4rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cw-primary) 14%, var(--border));
    overflow: hidden;
}
.hour-timer__bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--cw-primary);
}
.hour-timer--over .hour-timer__elapsed,
.hour-timer--over .hour-timer__goal-line {
    color: #b42318;
}
.hour-timer--over .hour-timer__bar-fill {
    background: #b42318;
}
[data-theme="dark"] .hour-timer--over .hour-timer__elapsed,
[data-theme="dark"] .hour-timer--over .hour-timer__goal-line {
    color: #f5a8a8;
}
.hour-timer__project {
    font-size: 1.15rem;
    line-height: 1.25;
}
.hour-timer__since {
    margin: .15rem 0 0;
    font-size: .82rem;
    color: var(--muted);
}
.hour-timer__readout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .65rem;
}
.hour-timer__elapsed {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-size: 2.05rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1;
    color: var(--cw-primary);
}
.hour-timer__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}
.hour-timer__actions form {
    margin: 0;
}
.hour-timer__go {
    min-width: 7.5rem;
    justify-content: center;
}
.timer-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}
.timer-chips__form {
    display: inline-flex;
    margin: 0;
}
.timer-chips--dock { display: none; }
.timer-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 18rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--cw-primary) 38%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface));
    color: var(--cw-primary);
    text-decoration: none;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
button.timer-chip {
    font-family: inherit;
}
.timer-chip:hover {
    background: color-mix(in srgb, var(--cw-primary) 18%, var(--surface));
}
.timer-chip--start { min-width: 4.2rem; justify-content: center; }
.timer-chip--sla.is-over {
    border-color: #e7b4b4;
    background: #fff5f5;
    color: #c62828;
}
.timer-chip--sla-start {
    border-color: transparent;
    background: var(--cw-primary);
    color: #fff;
    font-weight: 700;
}
.timer-chip--sla-start:hover {
    background: var(--cw-primary);
    color: #fff;
    filter: brightness(1.08);
}
.sla-dash {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin: 0 0 1.15rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}
.sla-dash__title {
    display: flex;
    align-items: baseline;
    gap: .75rem;
}
.sla-dash__title h2 { margin: 0; font-size: 1rem; }
.sla-dash__title a { font-size: .88rem; font-weight: 700; }
.sla-report {
    display: flex;
    flex: 1 1 18rem;
    align-items: center;
    gap: .5rem;
    margin: 0;
    min-width: 0;
}
.sla-report__field { margin: 0; flex: 0 1 11rem; min-width: 0; }
.sla-report__field--grow { flex: 1 1 12rem; }
.sla-report__field input,
.sla-report__field select { width: 100%; }
.sla-report__client { margin: 0; font-weight: 700; }
.sla-report .btn { flex: 0 0 auto; }
.sla-sheet {
    border: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    max-width: 100%;
    max-height: none;
    margin: auto 0 0;
    color: var(--text);
}
.sla-sheet::backdrop { background: rgba(1, 15, 33, .48); }
.sla-sheet__panel {
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    padding: 1rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 30px rgba(1, 15, 33, .16);
}
.sla-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.sla-sheet__head h2 { margin: 0; font-size: 1.15rem; }
.sla-sheet__hint { margin: .35rem 0 .85rem; }
.sla-sheet .sla-report { flex-direction: column; align-items: stretch; }
.sla-sheet .sla-report__field,
.sla-sheet .sla-report .btn { width: 100%; flex: none; }
.timer-chip--start.is-disabled {
    cursor: not-allowed;
    opacity: .45;
}
.timer-chip--stop {
    border-color: color-mix(in srgb, #b42318 35%, var(--border));
    background: color-mix(in srgb, #b42318 10%, var(--surface));
    color: #b42318;
}
.timer-chip--stop:hover {
    background: color-mix(in srgb, #b42318 16%, var(--surface));
}
[data-theme="dark"] .timer-chip--stop {
    color: #f5a8a8;
}
.timer-chip--assign {
    border-color: color-mix(in srgb, #b45309 40%, var(--border));
    background: color-mix(in srgb, #f59e0b 14%, var(--surface));
    color: #9a3412;
}
[data-theme="dark"] .timer-chip--assign {
    color: #fbbf24;
}
.timer-chip .hour-timer__dot {
    width: .45rem;
    height: .45rem;
    flex-shrink: 0;
}
.timer-chip__client {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text);
}
.timer-chip__time {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    letter-spacing: .03em;
}
@media (max-width: 720px) {
    .hour-timer__start,
    .hour-timer__live,
    .hour-timer__assign {
        flex-direction: column;
        align-items: stretch;
    }
    .hour-timer__readout { align-items: stretch; }
    .hour-timer__elapsed { font-size: 1.85rem; }
    .hour-timer__actions { justify-content: stretch; }
    .hour-timer__actions form { flex: 1; }
    .hour-timer__actions .btn,
    .hour-timer__go { width: 100%; }
}
.costs-privacy__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .85rem;
    margin: 0 0 1rem;
}
.costs-privacy__toggle {
    margin-left: auto;
    border: 1px solid var(--card-border);
    border-radius: 6px;
}
.costs-privacy__secret .costs-privacy__mask {
    display: none;
    letter-spacing: .12em;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    user-select: none;
}
.costs-privacy:not(.costs-privacy--revealed) .costs-privacy__secret .costs-privacy__value {
    display: none;
}
.costs-privacy:not(.costs-privacy--revealed) .costs-privacy__secret .costs-privacy__mask {
    display: inline;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.stats-grid .card { cursor: default; min-width: 0; }
.stats-grid .card:hover { transform: none; border-color: var(--border); }
.stats-grid .card h2 { margin: 0 0 .75rem; }
.stats-grid__full { grid-column: 1 / -1; }
.stats-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stats-weekday-table { width: 100%; min-width: 22rem; }
.stats-weekday-table .num { text-align: right; white-space: nowrap; }
.stat-row { display: flex; align-items: center; gap: .6rem; margin: .4rem 0 .15rem; font-size: .88rem; }
.stat-row__label { flex: 0 0 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row__bar { flex: 1; height: 12px; background: var(--hover-bg); border-radius: 2px; min-width: 40px; }
.stat-row__fill { height: 100%; background: var(--cw-primary); border-radius: 2px; min-width: 2px; }
.stat-row__value { flex: 0 0 52px; text-align: right; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.stat-row__meta { margin: 0 0 .5rem calc(120px + .6rem); font-size: .78rem; line-height: 1.35; }
.table--compact th, .table--compact td { padding: .45rem .6rem; font-size: .82rem; }
.table-wrap { overflow-x: auto; box-shadow: var(--shadow); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: .88rem; }
.form .table input[type=text] { width: 100%; max-width: 28rem; }
.table th { background: var(--table-head); font-weight: 700; color: var(--text); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.row--weekend { background: var(--weekend); }
.row--night { background: var(--night); }
.row--emergency { background: #fff8f0; }
.row--inactive { opacity: .5; }
.text-warn { color: #b71c1c; }
.worksheet tbody tr.data-row:nth-child(4n+1),
.worksheet tbody tr.data-row:nth-child(4n+3) { background: var(--zebra); }
.worksheet tbody tr.data-row.row--weekend:nth-child(4n+1),
.worksheet tbody tr.data-row.row--weekend:nth-child(4n+3) { background: #fff0f0; }
.worksheet tbody tr.data-row.row--night:nth-child(4n+1),
.worksheet tbody tr.data-row.row--night:nth-child(4n+3) { background: #e8eef8; }
.table tbody tr.data-row:nth-child(even) { background: var(--zebra); }
.badge { font-size: .72rem; padding: .2rem .45rem; border-radius: 3px; font-weight: 600; }
.badge--emergency { background: #fde8d0; color: #8b4513; }
.badge--special { background: #e0f2fe; color: #0369a1; }
.row--special { box-shadow: inset 3px 0 0 #0284c7; }
.badge--service { background: #e8f5e9; color: #2e7d32; }
.badge--test { background: #f3e8ff; color: #6b21a8; font-weight: 600; }
.badge--trip { background: #eef3fa; color: var(--cw-primary); font-weight: 600; }
.badge--project { background: #e8f0fe; color: #1a56db; font-weight: 600; }
.badge--implementation { background: #f3e8ff; color: #6b21a8; font-weight: 600; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge--muted { background: #f0f0f0; color: #666; }
.badge--primary { background: #e3f2fd; color: #1565c0; margin-left: .35rem; vertical-align: middle; }

.backlog-sort-group { margin-bottom: 1.5rem; }
.backlog-sort-group__title { font-size: 1rem; margin: 0 0 .5rem; color: var(--cw-text-muted, #666); display: flex; align-items: center; gap: .45rem; }

.backlog-marker {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    vertical-align: middle;
}
.backlog-marker__icon {
    display: inline-flex;
    width: .95rem;
    height: .95rem;
    flex-shrink: 0;
}
.backlog-marker__icon svg { width: 100%; height: 100%; display: block; }
.backlog-marker--compact .backlog-marker__icon { width: 1.15rem; height: 1.15rem; }
.backlog-marker--priority-high .backlog-marker__icon,
.backlog-marker.badge--emergency.backlog-marker--priority-high .backlog-marker__icon { color: #c62828; }
.backlog-marker--priority-low .backlog-marker__icon,
.backlog-marker.badge--muted.backlog-marker--priority-low .backlog-marker__icon { color: #6b7280; }
.backlog-marker--priority-normal .backlog-marker__icon { color: #4b5563; }
.backlog-marker--status-in_progress .backlog-marker__icon,
.backlog-marker.badge--service .backlog-marker__icon { color: #2e7d32; }
.backlog-marker--status-done .backlog-marker__icon { color: #5f6b7a; }
.backlog-marker--status-rejected .backlog-marker__icon { color: #c62828; }
.backlog-marker--status-todo .backlog-marker__icon { color: #6b7280; }

.backlog-source {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .88rem;
    color: var(--cw-text-muted, #666);
}
.backlog-source__icon {
    display: inline-flex;
    width: .9rem;
    height: .9rem;
    flex-shrink: 0;
}
.backlog-source__icon svg { width: 100%; height: 100%; display: block; }
.backlog-source--client .backlog-source__icon { color: var(--cw-primary, #2563eb); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.backlog-sort-col-handle { width: 2rem; }
.backlog-sort-handle { cursor: grab; color: var(--cw-text-muted, #888); text-align: center; user-select: none; }
.backlog-sort-handle:active { cursor: grabbing; }
.backlog-sort-row--dragging { opacity: .55; }
.backlog-sort-row--over td { border-top: 2px solid var(--cw-primary, #2563eb); }
#backlog-sort-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; max-width: 20rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.backlog-quoted-summary { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; }
.backlog-offers-note { margin-top: .75rem; font-size: .88rem; }
.backlog-export-form { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: flex-start; gap: .65rem 1rem; }
.backlog-export-form .muted { margin: .15rem 0 0; max-width: 40rem; }
.backlog-export-col { width: 2rem; text-align: center; }
.offer-status { display: inline-block; font-size: .85rem; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-muted, #f3f4f6); }
.offer-status--draft { background: #eef2ff; }
.offer-status--sent { background: #e0f2fe; }
.offer-status--accepted { background: #dcfce7; color: #047857; }
.offer-status--declined, .offer-status--cancelled { background: #fee2e2; color: #b91c1c; }
.offer-status--expired { background: #fef3c7; color: #b45309; }
.offers-row__title { display: block; margin-top: .1rem; max-width: 24rem; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.table td.offers-value,
.table th.offers-value { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.offers-value__stack { display: inline-grid; grid-template-columns: max-content max-content; justify-content: end; column-gap: .4rem; text-align: right; }
.offers-value__stack strong,
.offers-value__net { grid-column: 1; display: block; }
.offers-value__net { font-size: .78rem; font-weight: 400; color: var(--muted); }
.offers-value__tag { grid-column: 2; grid-row: 2; align-self: end; font-size: .75rem; color: var(--muted); }
.offers-table-wrap { overflow: visible; }
.row-menu { position: relative; display: inline-block; }
.row-menu__toggle { list-style: none; }
.row-menu__toggle::-webkit-details-marker { display: none; }
.row-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + .25rem);
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 13.5rem;
    padding: .3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(1, 15, 33, .12);
    white-space: normal;
}
.offers-table-wrap tr:nth-last-child(-n+2) .row-menu__panel { top: auto; bottom: calc(100% + .25rem); }
.row-menu__panel a,
.row-menu__panel button {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    margin: 0;
    padding: .5rem .65rem;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.row-menu__panel svg { flex: 0 0 auto; color: var(--cw-primary); }
.row-menu__panel a:hover,
.row-menu__panel button:hover { background: var(--hover-bg); color: var(--cw-primary); }
.row-menu__panel form { margin: 0; }
.offers-views { display: block; margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.offer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 1.25rem; align-items: start; }
.offer-side { display: flex; flex-direction: column; gap: .75rem; }
.offer-side__card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: .95rem 1rem 1rem;
    box-shadow: 0 1px 2px rgba(1, 15, 33, .04);
}
.offer-side__card h2 {
    margin: 0 0 .7rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.offer-side__status { margin: 0; }
.offer-side__when { margin: .55rem 0 0; font-size: .78rem; }
.offer-doc {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: color-mix(in srgb, var(--cw-primary) 6%, var(--surface));
}
.offer-doc:hover { border-color: var(--cw-primary); color: inherit; }
.offer-doc__mark {
    flex: 0 0 auto;
    width: 2.45rem;
    height: 2.45rem;
    display: grid;
    place-items: center;
    background: var(--cw-dark, #010f21);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    border-radius: var(--radius);
}
.offer-doc__body { min-width: 0; flex: 1; }
.offer-doc__body strong { display: block; font-size: .9rem; }
.offer-doc__body span { display: block; margin-top: .12rem; color: var(--muted); font-size: .75rem; }
.offer-doc__dl {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    color: var(--cw-primary);
}
.offer-doc__preview { display: inline-block; margin-top: .7rem; font-size: .82rem; }
.offer-history { list-style: none; margin: 0; padding: 0; }
.offer-history li {
    position: relative;
    margin: 0;
    padding: 0 0 1rem 1.2rem;
    border: 0;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
}
.offer-history li:last-child { padding-bottom: 0; }
.offer-history li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .28rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cw-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cw-primary) 16%, transparent);
}
.offer-history li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 1.05rem;
    bottom: 0;
    width: 2px;
    background: color-mix(in srgb, var(--cw-primary) 35%, var(--border));
}
.offer-history time {
    display: block;
    margin-top: .15rem;
    font-weight: 400;
    color: var(--muted);
    font-size: .75rem;
}
@media (max-width: 900px) {
    .offer-layout { grid-template-columns: 1fr; }
}
.offer-status--lg { font-size: .92rem; font-weight: 600; padding: .22rem .7rem; letter-spacing: .01em; }
[data-theme="dark"] .offer-status--draft { background: #1e2438; color: #c7cdee; }
[data-theme="dark"] .offer-status--sent { background: #132a3a; color: #90caf9; }
[data-theme="dark"] .offer-status--accepted { background: #14352a; color: #9fe8c8; }
[data-theme="dark"] .offer-status--declined,
[data-theme="dark"] .offer-status--cancelled { background: #331a1a; color: #f5a8a8; }
[data-theme="dark"] .offer-status--expired { background: #2e2618; color: #f5d78e; }
.page-header .offer-show-head {
    flex: 1 1 12rem;
    min-width: 0;
}
.page-header .offer-show-head h1 {
    flex: none;
    margin: 0;
}
.page-header h1.offer-show-head__number--accepted { color: #047857; }
.page-header h1.offer-show-head__number--declined,
.page-header h1.offer-show-head__number--cancelled { color: #b91c1c; }
.page-header h1.offer-show-head__number--expired { color: #b45309; }
[data-theme="dark"] .page-header h1.offer-show-head__number--accepted { color: #6ee7b7; }
[data-theme="dark"] .page-header h1.offer-show-head__number--declined,
[data-theme="dark"] .page-header h1.offer-show-head__number--cancelled { color: #f5a8a8; }
[data-theme="dark"] .page-header h1.offer-show-head__number--expired { color: #f5d78e; }
.offer-show-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .65rem;
    margin: .4rem 0 0;
}
.offer-show-head__until {
    color: var(--muted);
    font-size: .9rem;
}
.offer-outcome {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    margin: 0 0 1.25rem;
    padding: .85rem 1.05rem;
    border-radius: 10px;
    border: 1px solid var(--card-border, #e2e6ec);
    border-left-width: 4px;
    background: var(--surface, #fff);
}
.offer-outcome__mark {
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    margin-top: .05rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
}
.offer-outcome__mark::before { content: ''; }
.offer-outcome__body { min-width: 0; flex: 1; }
.offer-outcome__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}
.offer-outcome__lead,
.offer-outcome__when {
    margin: .2rem 0 0;
    font-size: .9rem;
}
.offer-outcome__when { color: var(--muted); }
.offer-outcome__note {
    margin: .65rem 0 0;
    font-size: .92rem;
    line-height: 1.45;
}
.offer-outcome--accepted {
    background: #f0fdf4;
    border-color: #86efac;
    border-left-color: #059669;
    color: #065f46;
}
.offer-outcome--accepted .offer-outcome__mark {
    background: #059669;
    color: #fff;
}
.offer-outcome--accepted .offer-outcome__mark::before { content: '✓'; }
.offer-outcome--accepted .offer-outcome__when { color: #047857; }
.offer-outcome--declined,
.offer-outcome--cancelled {
    background: #fff7f7;
    border-color: #fecaca;
    border-left-color: #dc2626;
    color: #7f1d1d;
}
.offer-outcome--declined .offer-outcome__mark,
.offer-outcome--cancelled .offer-outcome__mark {
    background: #dc2626;
    color: #fff;
}
.offer-outcome--declined .offer-outcome__mark::before { content: '×'; font-size: 1.15rem; }
.offer-outcome--cancelled .offer-outcome__mark::before { content: '–'; }
.offer-outcome--declined .offer-outcome__when,
.offer-outcome--cancelled .offer-outcome__when { color: #b91c1c; }
.offer-outcome--expired {
    background: #fffbeb;
    border-color: #fde68a;
    border-left-color: #d97706;
    color: #78350f;
}
.offer-outcome--expired .offer-outcome__mark {
    background: #d97706;
    color: #fff;
}
.offer-outcome--expired .offer-outcome__mark::before { content: '!'; }
.offer-outcome--expired .offer-outcome__when { color: #b45309; }
[data-theme="dark"] .offer-outcome--accepted {
    background: #14352a;
    border-color: #2d6a4f;
    border-left-color: #34d399;
    color: #bbf7d0;
}
[data-theme="dark"] .offer-outcome--accepted .offer-outcome__mark {
    background: #047857;
    color: #ecfdf5;
}
[data-theme="dark"] .offer-outcome--accepted .offer-outcome__when { color: #9fe8c8; }
[data-theme="dark"] .offer-outcome--declined,
[data-theme="dark"] .offer-outcome--cancelled {
    background: #331a1a;
    border-color: #7a3030;
    border-left-color: #f87171;
    color: #fecaca;
}
[data-theme="dark"] .offer-outcome--declined .offer-outcome__mark,
[data-theme="dark"] .offer-outcome--cancelled .offer-outcome__mark {
    background: #b91c1c;
    color: #fff;
}
[data-theme="dark"] .offer-outcome--declined .offer-outcome__when,
[data-theme="dark"] .offer-outcome--cancelled .offer-outcome__when { color: #f5a8a8; }
[data-theme="dark"] .offer-outcome--expired {
    background: #2e2618;
    border-color: #6b5424;
    border-left-color: #fbbf24;
    color: #fde68a;
}
[data-theme="dark"] .offer-outcome--expired .offer-outcome__mark {
    background: #b45309;
    color: #fffbeb;
}
[data-theme="dark"] .offer-outcome--expired .offer-outcome__when { color: #f5d78e; }
.offer-items-table input[type="text"], .offer-items-table select { width: 100%; }
.offer-items-table .offer-item-unit-cost { min-width: 4.5rem; }
.offer-item-roles {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}
.offer-item-roles__pkgs {
    display: inline-flex;
    align-items: stretch;
    padding: 2px;
    gap: 2px;
    background: var(--hover-bg, #eef3fa);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.offer-item-role {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-width: 1.7rem;
    height: 1.5rem;
    padding: 0 .42rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}
.offer-item-role input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.offer-item-role:hover { color: var(--text); background: color-mix(in srgb, var(--cw-primary) 10%, transparent); }
.offer-item-role:has(:checked) {
    background: var(--cw-primary);
    color: #fff;
}
.offer-item-role:has(:focus-visible) {
    outline: 2px solid var(--cw-primary);
    outline-offset: 1px;
}
.offer-item-role--opt {
    min-width: 2.15rem;
    padding: 0 .5rem;
    background: var(--hover-bg, #eef3fa);
    border: 1px solid var(--border);
    letter-spacing: 0;
    font-weight: 600;
}
.offer-item-role--opt:has(:checked) {
    background: color-mix(in srgb, var(--cw-primary) 14%, var(--surface, #fff));
    color: var(--cw-primary);
    border-color: var(--cw-primary);
    box-shadow: none;
}
.offer-item-roles__pkgs:not(:has(:checked))::after {
    content: 'Stała';
    display: inline-flex;
    align-items: center;
    padding: 0 .45rem 0 .2rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--muted);
    pointer-events: none;
}
.offer-item-roles:has(.offer-item-role-opt:checked) .offer-item-roles__pkgs {
    opacity: .42;
}
.offer-item-roles:has(.offer-item-role-opt:checked) .offer-item-roles__pkgs::after {
    content: none;
    display: none;
    padding: 0;
}
.offer-panel-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; margin-top: 1.25rem; }
.offer-intro { margin: 1rem 0; }
.offer-intro p { margin: .4rem 0; }
.offer-form .form-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
}
.offer-form .form-field__hint { font-weight: 400; color: var(--muted); }
.form.offer-form .offer-form__header {
    grid-template-columns: minmax(12rem, 1fr) minmax(20rem, 24rem);
    align-items: start;
}
@media (max-width: 720px) {
    .form.offer-form .offer-form__header { grid-template-columns: 1fr; }
}
.offer-valid-until {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    align-items: stretch;
    min-width: 0;
}
.offer-valid-until input[type="date"],
.offer-valid-until input[type="time"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.offer-form__estimate {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem 1.25rem;
    margin: .15rem 0 1rem;
}
.offer-form__estimate .form-field {
    min-width: min(100%, 16rem);
}
.offer-form__estimate input {
    max-width: 12rem;
}
.offer-form__rate {
    margin: 0 0 .35rem;
    font-size: .95rem;
}
.offer-estimate {
    margin: 0 0 1.15rem;
    padding: .85rem 1.05rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--hover-bg);
}
.offer-estimate__label {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.offer-estimate__rate {
    margin: 0 0 .35rem;
    font-size: 1.05rem;
}
.offer-estimate__form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .5rem .75rem;
    margin-top: .55rem;
}
.offer-estimate__form label {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin: 0;
    font-size: .82rem;
    font-weight: 600;
}
.offer-estimate__form input {
    width: 8rem;
}
.offer-estimate--over {
    border-color: #fecaca;
}
[data-theme="dark"] .offer-estimate--over {
    border-color: #7a3030;
}
.offer-form__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    margin-top: 1.25rem;
}
.offer-form__footer .form__actions {
    margin-top: 0;
    align-items: center;
}
.form label.offer-send-email {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: .55rem;
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    max-width: 36rem;
    cursor: pointer;
}
.form label.offer-send-email input[type="checkbox"] {
    margin: .2rem 0 0;
    flex-shrink: 0;
}
.offer-share {
    margin: 1rem 0 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border, #e2e6ec);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
}
.offer-share__label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
}
.offer-share__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.offer-share__input {
    flex: 1 1 16rem;
    min-width: 0;
    width: auto;
}
.offer-share .muted { margin: .45rem 0 0; }
.offer-share__stats { margin-top: .35rem; }
.offer-email-form { display: inline-flex; margin: 0; }
.offer-doc-footer { margin: 1rem 0 1.25rem; font-size: .92rem; color: var(--muted, #5b6573); }
.offer-copy-form { display: inline-flex; margin: 0; }
.offer-copy-dialog {
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1rem;
    width: min(28rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
    background: var(--surface, #fff);
    color: var(--text, #1c2430);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
    white-space: normal;
}
.offer-copy-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.offer-copy-dialog h2 { margin: 0 0 .85rem; font-size: 1.15rem; white-space: normal; }
.offer-copy-dialog .form-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    width: 100%;
    min-width: 0;
    margin: 0 0 .75rem;
}
.offer-copy-dialog .form-field select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.offer-copy-dialog .muted {
    white-space: normal;
    overflow-wrap: anywhere;
}
.offer-copy-dialog__note { margin: .35rem 0 .75rem; }
.offer-copy-dialog .form__actions { margin-top: .9rem; }
.offer-reactivate {
    margin-top: 1.75rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
}
.offer-reactivate h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.offer-reactivate .muted { margin: 0 0 1rem; }
.offer-reactivate__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
}
.offer-reactivate__form .offer-valid-until {
    flex: 0 1 18rem;
}
.offer-reactivate__email {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .92rem;
}
.offer-decide { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--card-border, #e2e6ec); }
.offer-decide h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.offer-decide__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) {
    .offer-decide__grid { grid-template-columns: 1fr; }
}
.offer-decide__card { padding: 1rem 1.1rem; border: 1px solid var(--card-border, #e2e6ec); border-radius: var(--radius, 8px); background: var(--surface, #fff); }
.offer-decide__card h3 { margin: 0 0 .35rem; font-size: 1rem; }
.offer-decide__card .muted { margin: 0 0 .85rem; }
.offer-decide__card textarea { width: 100%; min-height: 5.5rem; }
.offer-decide__card--accept { border-color: #bbf7d0; background: #f0fdf4; }
.offer-decide__card--decline { border-color: #fecaca; background: #fff7f7; }
[data-theme="dark"] .offer-decide__card--accept {
    background: #14352a;
    border-color: #2d6a4f;
}
[data-theme="dark"] .offer-decide__card--accept h3 { color: #9fe8c8; }
[data-theme="dark"] .offer-decide__card--decline {
    background: #331a1a;
    border-color: #7a3030;
}
[data-theme="dark"] .offer-decide__card--decline h3 { color: #f5a8a8; }
.offer-decide__cancel { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.offer-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .55rem;
    margin: 0 0 1.15rem;
}
.offer-status-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .7rem;
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: 999px;
    background: var(--surface, #fff);
    color: inherit;
    text-decoration: none;
    font-size: .88rem;
}
.offer-status-tabs__item:hover { border-color: var(--cw-primary, #2563eb); }
.offer-status-tabs__item.is-active {
    border-color: var(--cw-primary, #2563eb);
    background: color-mix(in srgb, var(--cw-primary, #2563eb) 10%, #fff);
    font-weight: 600;
}
.offer-image img { max-width: 100%; max-height: 22rem; border-radius: var(--radius, 8px); border: 1px solid var(--card-border, #e2e6ec); }
.offer-image--form img { max-height: 12rem; }
.offer-image-field { margin: 1rem 0; }
.offer-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin: .5rem 0 .75rem;
}
.offer-image-list__item {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    width: 8.5rem;
}
.offer-image-list__item img {
    width: 100%;
    height: 6.5rem;
    object-fit: cover;
    border-radius: var(--radius, 8px);
    border: 1px solid var(--border);
    background: var(--surface);
}
.offer-image-list__item--file { width: 12.5rem; }
.offer-image-list__file {
    display: block;
    min-height: 4.5rem;
    padding: .65rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--surface-muted, var(--surface));
    word-break: break-word;
    font-size: .82rem;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
}
.offer-image-list__file:hover { border-color: var(--cw-primary, #2563eb); }
.offer-image-field.is-enhanced .offer-image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.offer-image-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.offer-image-picker__msg { margin: 0; flex: 1 1 12rem; }
.offer-image-list__item--pending .offer-image-list__file { border-style: dashed; }
.offer-files { margin: 1rem 0 1.35rem; }
.offer-files__list { list-style: none; margin: 0; padding: 0; }
.offer-files__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .85rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--card-border, #eef1f5);
}
.offer-files__name { flex: 1 1 12rem; font-weight: 600; word-break: break-word; }
.offer-gallery { margin: 1rem 0 1.25rem; }
.offer-gallery__hero {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    text-align: center;
}
.offer-gallery__hero img {
    max-width: 100%;
    max-height: 22rem;
    border-radius: var(--radius, 8px);
    border: 1px solid var(--border);
}
.offer-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .65rem;
}
.offer-gallery__thumb {
    display: block;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface);
}
.offer-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.offer-gallery__thumb.is-active { border-color: var(--cw-primary, #3d5c99); }
.offer-gallery__more { margin: .55rem 0 0; font-size: .9rem; }
.offer-lightbox:not([open]) {
    display: none;
}
.offer-lightbox[open] {
    position: fixed;
    inset: 0;
    z-index: 400;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: none;
    padding: 0;
    background: #0c1016;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.offer-lightbox::backdrop { background: rgba(0, 0, 0, .78); }
.offer-lightbox__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding: .55rem .7rem;
    background: #0c1016;
}
.offer-lightbox__meta { margin: 0; min-width: 0; color: #e8eef7; }
.offer-lightbox__label { display: block; font-size: .92rem; font-weight: 600; line-height: 1.25; }
.offer-lightbox__count { display: block; margin-top: .1rem; font-size: .82rem; font-weight: 500; line-height: 1.25; color: #c5d0de; }
.offer-lightbox__actions { display: flex; flex: 0 0 auto; gap: .45rem; }
.offer-lightbox__stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    text-align: center;
    background: #fff;
}
.offer-lightbox__stage img {
    display: inline-block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: calc(100vh - 4.6rem);
    vertical-align: middle;
}
.offer-lightbox__close,
.offer-lightbox__nav {
    border: 1px solid rgba(255, 255, 255, .35);
    background: #1c2430;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    font-size: 1.45rem;
}
.offer-lightbox__close { font-size: 1.35rem; }
.offer-summary-pick { margin: 1.25rem 0; }
.offer-summary-pick__list { list-style: none; padding: 0; margin: 0 0 1rem; }
.offer-summary-pick__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .4rem 0; border-bottom: 1px solid var(--card-border, #e2e6ec); }
.offer-summary-pick__list label { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; flex: 1; }
.backlog-cost-link { font-weight: 600; }

.dashboard-layout-empty-hint { margin: .5rem 0 0; font-size: .9rem; }
.dashboard-layout-empty-hint--edit-only { display: none; }
body.dashboard-layout-editing .dashboard-layout-empty-hint--edit-only { display: block; font-style: italic; }
.dashboard-layout__hidden { display: none !important; }
.dashboard-layout-tile--inactive { display: none !important; }
body.dashboard-layout-editing .dashboard-layout-tile--inactive { display: block !important; opacity: .55; }
.dashboard-layout-section--hidden-edit,
.dashboard-layout-tile--hidden-edit { opacity: .45; outline: 2px dashed var(--muted); outline-offset: 2px; }
.dashboard-layout-controls,
.dashboard-layout-tile-controls {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
    margin-bottom: .65rem;
    padding: .45rem .65rem;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid var(--card-border);
    font-size: .82rem;
}
.dashboard-layout-controls__label,
.dashboard-layout-tile-controls__label {
    font-weight: 600;
    margin-right: .25rem;
}
.dashboard-layout-tile-controls {
    margin-bottom: .5rem;
    width: 100%;
}
.dashboard-layout-btn {
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 6px;
    padding: .2rem .55rem;
    font-size: .78rem;
    cursor: pointer;
    line-height: 1.3;
}
.dashboard-layout-btn:hover { border-color: var(--accent); color: var(--accent); }
.dashboard-layout-bar {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 400;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    padding: .65rem 1rem;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 8px 28px rgba(0,0,0,0.14);
}
body.dashboard-layout-editing .dashboard-layout-bar {
    display: flex;
}
.dashboard-layout-bar[hidden] {
    display: none !important;
}
.dashboard-layout-bar__label { font-weight: 600; margin-right: .25rem; }
body.dashboard-layout-editing .dashboard-layout-controls,
body.dashboard-layout-editing .dashboard-layout-tile-controls { display: flex; }
body.dashboard-layout-editing { padding-bottom: 5rem; }
body.dashboard-layout-editing .modern-content { padding-bottom: 6rem; }
#dashboard-layout-toast {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    z-index: 410;
    max-width: 22rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.trip-fields { margin-top: .75rem; }

.form {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.form__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.form__grid > .form__full { grid-column: 1 / -1; }
.gus-fetch {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    margin: 0;
}
.gus-fetch .form-field__control { flex-wrap: wrap; gap: .5rem; }
.gus-fetch .btn { white-space: nowrap; }
.gus-fetch__status { font-size: .78rem; font-weight: 400; }
.gus-fetch__status--error { color: var(--danger, #c0392b); }
.layout-public__main { padding: 2rem 0 3rem; min-height: calc(100vh - 120px); display: flex; align-items: flex-start; justify-content: center; }
.footer--minimal { margin-top: auto; }
.accept-card__amount { margin: 1.25rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-muted, var(--surface)); text-align: center; }
.accept-card__label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .35rem; }
.accept-card__value { display: block; font-size: 1.75rem; line-height: 1.2; }
.accept-card__actions { margin-top: 1rem; }
.accept-card__actions .form-field { text-align: left; margin-bottom: .85rem; }
.accept-card__actions textarea { width: 100%; }
.accept-card__alt { text-align: center; margin-top: .75rem; font-size: .95rem; }
.accept-card--offer {
    max-width: 640px;
    margin: 0 auto;
}
.accept-offer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}
.accept-card--offer .auth-card__brand {
    text-align: left;
    margin-bottom: 0;
}
.accept-offer__brand { margin-bottom: 0; }
.offer-theme-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}
.offer-theme-toggle:hover {
    color: var(--text);
    border-color: var(--cw-primary);
}
.offer-theme-toggle__sun { display: none; }
[data-theme="dark"] .offer-theme-toggle__sun { display: block; }
[data-theme="dark"] .offer-theme-toggle__moon { display: none; }
.accept-offer__number {
    margin: 0 0 .2rem;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--muted);
}
.accept-offer__title {
    margin: 0 0 .4rem;
    font-size: 1.45rem;
    line-height: 1.25;
}
.offer-parties {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .75rem;
    margin: 0 0 1.25rem;
}
.offer-party {
    background: var(--accent-surface);
    padding: .75rem .9rem;
}
.offer-party h2,
.offer-terms h2,
.offer-about h2 {
    margin: 0 0 .35rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--cw-primary);
}
.offer-party p { margin: 0; color: var(--text-body); font-size: .88rem; }
.offer-party__name { color: var(--text) !important; font-weight: 500; }
.offer-party--buyer { border-left: 3px solid var(--cw-primary); }
.offer-pay { margin: 1rem 0 1.25rem; }
.offer-pay p { margin: .15rem 0; }
.offer-pay__due,
.offer-pay__due strong {
    color: #fff;
}
.offer-pay__due {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .45rem;
    padding: .65rem .8rem;
    background: var(--cw-dark);
}
.offer-pay__due strong { font-size: 1.15rem; }
.offer-pay__words { color: var(--muted); font-size: .82rem; }
.offer-terms { margin: 1rem 0; }
.offer-terms dl { margin: 0; }
.offer-terms dl div {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--border);
}
.offer-terms dt { color: var(--muted); }
.offer-terms dd { margin: 0; }
.offer-about { margin: 1rem 0; }
.offer-about p { margin: 0; }
.offer-prepared { margin: 1rem 0 0; color: var(--muted); font-size: .88rem; }
.offer-prepared span { display: block; color: var(--cw-primary); font-size: .78rem; }
.offer-prepared strong { color: var(--text); }
@media (max-width: 640px) {
    .offer-parties,
    .offer-terms dl div { grid-template-columns: 1fr; }
}
.accept-offer__for {
    margin: 0 0 .85rem;
    font-size: 1.02rem;
}
.accept-offer__meta {
    margin: 0 0 1.35rem;
    font-size: .9rem;
    color: var(--muted);
}
.accept-offer__total {
    margin: 1.35rem 0 1.6rem;
}
.accept-offer__total-label {
    display: block;
    margin-bottom: .15rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.accept-offer__total-net {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--cw-primary);
}
.accept-offer__total-gross {
    display: block;
    margin-top: .3rem;
    font-size: .9rem;
    color: var(--muted);
}
.accept-card--offer .accept-card__actions.form {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}
.accept-card--offer .accept-card__actions .form__grid {
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 1rem;
}
.accept-card--offer .accept-card__actions .form__grid .form-field { margin-bottom: 0; }
.accept-card--offer .accept-card__actions .form__grid input {
    width: 100%;
}
.accept-offer__hint {
    margin: .7rem 0 0;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--muted);
}
.accept-offer__note-toggle {
    display: inline-block;
    margin-top: .7rem;
    font-size: .85rem;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}
.accept-offer__note-toggle:hover { color: var(--text); }
.accept-offer__note { display: none; margin-top: .65rem; }
.accept-offer__note.is-open { display: block; }
.accept-offer__note textarea { width: 100%; min-height: 4.5rem; }
.accept-offer__pdf { margin: 0 0 1rem; }
.accept-card--offer { max-width: 44rem; }
.offer-choice__heading {
    margin: 1.15rem 0 .55rem;
    font-size: 1.02rem;
    font-weight: 700;
}
.offer-packages, .offer-optionals {
    margin: .85rem 0 1.1rem;
    padding: 0;
    border: 0;
    min-width: 0;
}
.offer-packages--panel, .offer-optionals--panel {
    margin: .65rem 0 1rem;
}
.offer-packages--panel .checkbox,
.offer-optionals--panel .checkbox { display: flex; gap: .45rem; margin: .35rem 0; font-weight: 500; }
.offer-packages__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
    gap: .7rem;
}
.offer-package {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    padding: .8rem .85rem;
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
    cursor: pointer;
}
.offer-package input { margin: 0 .35rem 0 0; }
.offer-package.is-selected {
    border-color: var(--cw-primary, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary, #2563eb) 22%, transparent);
}
.offer-package__name { font-weight: 700; }
.offer-package__total { font-size: .92rem; }
.offer-package__items {
    margin: .2rem 0 0;
    padding-left: 1.15rem;
    font-size: .86rem;
}
.offer-package__items .muted { margin-left: .25rem; }
.offer-optional {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: .65rem;
    margin: 0;
    padding: .65rem .8rem;
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
    font-weight: 500;
    cursor: pointer;
}
.form label.offer-optional {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: .65rem;
    font-weight: 500;
}
.offer-optional input[type="checkbox"] {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    align-self: center;
}
.offer-optional__desc {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.35;
}
.offer-optional__amt {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.offer-next-steps {
    margin: 1.15rem 0 1.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: var(--radius, 8px);
    background: var(--surface-muted, var(--surface));
}
.offer-next-steps h2, .offer-next-steps .offer-choice__heading { margin-top: 0; }
.offer-next-steps p { margin: .35rem 0; }
.offer-next-steps__lead {
    color: var(--text-body, var(--muted));
    line-height: 1.45;
}
.offer-next-steps__deposit { margin-top: .7rem !important; }
.offer-pay {
    display: grid;
    grid-template-columns: 8.75rem minmax(0, 1fr);
    gap: .3rem .9rem;
    margin: .85rem 0 0;
    align-items: baseline;
}
.offer-pay dt {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 500;
}
.offer-pay dd {
    margin: 0;
    font-weight: 600;
    user-select: all;
    word-break: break-word;
}
.offer-pay__mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
}
@media (max-width: 520px) {
    .offer-pay {
        grid-template-columns: 1fr;
        gap: .08rem 0;
    }
    .offer-pay dt { margin-top: .45rem; }
    .offer-pay dt:first-child { margin-top: 0; }
}
.offer-checklist { margin: 1.1rem 0; }
.offer-checklist__list { list-style: none; margin: 0; padding: 0; }
.offer-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .4rem 0;
    border-bottom: 1px solid var(--card-border, #eef1f5);
}
.offer-checklist__item.is-done { color: var(--muted); text-decoration: line-through; }
.offer-checklist__mark { width: 1.1rem; text-align: center; }
.offer-progress .offer-checklist__item label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: .5rem;
    cursor: pointer;
}
.form.offer-form .offer-form__packages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: .35rem 0 1rem;
}
.form.offer-form .offer-form__next { margin: .75rem 0 1rem; }
@media (max-width: 720px) {
    .form.offer-form .offer-form__packages { grid-template-columns: 1fr; }
}
[data-theme="dark"] .offer-package {
    background: var(--surface);
    border-color: var(--card-border, #3a4250);
}
[data-theme="dark"] .offer-package.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, .28);
}
.accept-card--offer .accept-card__alt a { color: var(--muted); }
.accept-card--offer .accept-card__alt a:hover { color: var(--text); }
.offer-item-picks {
    margin: .75rem 0 1rem;
    padding: 0;
    border: 0;
    min-width: 0;
}
.offer-item-picks__legend {
    padding: 0;
    font-size: .82rem;
    font-weight: 600;
}
.offer-item-picks__hint {
    margin: .25rem 0 .5rem;
    font-size: .8rem;
    line-height: 1.4;
    color: var(--muted);
}
.offer-item-picks__row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: .55rem;
    margin: 0 0 .4rem;
    font-size: .88rem;
    font-weight: 400;
    cursor: pointer;
}
.form .offer-item-picks__row {
    flex-direction: row;
    font-weight: 400;
}
.offer-item-picks__row input { margin-top: .2rem; flex-shrink: 0; }
.offer-item-picks__desc { flex: 1; min-width: 0; line-height: 1.35; }
.offer-item-picks__ctx,
.offer-item-picks__amt { flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer-item-chip {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: var(--surface-muted, rgba(0,0,0,.06));
    border: 1px solid var(--border);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.35;
}
.offer-item-row--flagged td { background: color-mix(in srgb, var(--cw-primary) 8%, transparent); }
[data-theme="dark"] .offer-item-row--flagged td { background: color-mix(in srgb, var(--cw-primary) 18%, transparent); }
.offer-picked-note { margin: 0 0 0.75rem; }
.offer-item-row--picked td { background: color-mix(in srgb, var(--cw-primary) 12%, transparent); }
.offer-item-row--skipped td { opacity: 0.48; }
[data-theme="dark"] .offer-item-row--picked td { background: color-mix(in srgb, var(--cw-primary) 22%, transparent); }
@media (max-width: 640px) {
    .accept-card--offer .accept-card__actions .form__grid { grid-template-columns: 1fr; }
    .accept-offer__total-net { font-size: 1.7rem; }
}
.btn--block { width: 100%; }
.acceptance-panel { margin-bottom: 1.5rem; }
.acceptance-panel__history { margin-top: 1rem; }
.auth-card-wrap--wide { max-width: 960px; margin: 0 auto; }
.accept-card--wide { max-width: none; width: 100%; }
.accept-card--wide.accept-card--offer { max-width: 640px; }
.accept-decline-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.accept-decline-table th,
.accept-decline-table td { padding: .55rem .45rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.accept-decline-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.accept-decline-table__amount { white-space: nowrap; text-align: right !important; width: 7rem; }
.accept-decline-table input[type=text] { width: 100%; min-width: 10rem; font-size: .9rem; }
.accept-decline-table__total-row td { background: var(--surface-muted, rgba(0,0,0,.03)); font-weight: 600; }
.acceptance-notes-list { margin: .5rem 0 0; padding-left: 1.1rem; }
.acceptance-notes-list li { margin-bottom: .35rem; }
.acceptance-panel__general { margin: 1rem 0; padding: .75rem 1rem; background: var(--surface-muted, rgba(0,0,0,.03)); border-radius: var(--radius, 6px); }
.acceptance-panel__general p { margin: .35rem 0 0; }
.acceptance-panel__hint { margin: 1rem 0 .5rem; font-size: .92rem; }
.acceptance-panel__lock-hint { margin: 0 0 1rem; font-size: .9rem; }
.acceptance-panel__amount-mismatch { margin: .75rem 0 1rem; font-size: .9rem; }
.acceptance-panel__admin-accept {
    margin: 1rem 0 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid color-mix(in srgb, #2e7d32 28%, var(--card-border));
    border-radius: 8px;
    background: color-mix(in srgb, #2e7d32 6%, var(--card-bg));
}
.acceptance-panel__admin-accept-title {
    margin: 0 0 .35rem;
    font-size: 1rem;
}
.acceptance-panel__admin-accept .form__actions { margin-top: .65rem; }
.consent-admin-contact { margin: 1.25rem 0 1.75rem; }
.consent-admin-contact h3 { margin: 0 0 .55rem; font-size: 1.05rem; }
.consent-snapshot {
    margin-top: .5rem;
    padding: .75rem 1rem;
    max-height: 22rem;
    overflow: auto;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: .88rem;
    line-height: 1.45;
}
.consent-card { max-width: 52rem; text-align: left; }
.consent-card h1 { text-align: center; }
.consent-lead { color: var(--muted); margin: 0 0 1rem; line-height: 1.5; }
.consent-lead__action { color: #c62828; font-weight: 700; }
.consent-select-all {
    display: flex; gap: .55rem; align-items: center;
    font-weight: 700; margin: .25rem 0 1rem; padding: .65rem .85rem;
    background: #f4f7fb; border: 1px solid #d8dee8; border-radius: 6px;
}
.consent-consequence {
    margin: .55rem 0 0; padding: .55rem .75rem; border-radius: 4px;
    background: #fff3e0; border-left: 3px solid #ef6c00;
    color: #6d4c00; font-size: .88rem; line-height: 1.45;
}
.consent-consequence.is-visible { display: block; }
.consent-admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.table--consents { table-layout: fixed; width: 100%; }
.table--consents__doc { width: 22%; }
.table--consents__nature { width: 28%; white-space: normal; word-break: break-word; line-height: 1.35; }
.table--consents__status { width: 14%; }
.table--consents__ver { width: 10%; white-space: nowrap; }
.table--consents__date { width: 14%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table--consents__actions { width: 7.5rem; }
/* Ikony akcji w tabelach / RODO */
.icon-btn,
.consent-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0; margin: 0;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text);
    cursor: pointer; text-decoration: none; line-height: 0;
    list-style: none; flex-shrink: 0;
    font: inherit;
}
.icon-btn::-webkit-details-marker,
.consent-icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover,
.consent-icon-btn:hover { border-color: #8fa4c8; color: #1565c0; background: #f4f7fb; }
.icon-btn--danger:hover,
.consent-icon-btn--danger:hover { border-color: #e57373; color: #c62828; background: #fff5f5; }
.table-icon-actions,
.consent-admin-icons {
    display: flex; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: .3rem; justify-content: flex-end;
}
.table-icon-actions form,
.consent-admin-icons__form { margin: 0; display: inline-flex; }
.table-actions .icon-btn,
.actions .icon-btn,
.table__actions .icon-btn,
.entry-card__actions .icon-btn,
.hours-card__actions .icon-btn { vertical-align: middle; }
.actions,
.table-actions,
.table__actions {
    white-space: nowrap;
}
.actions form,
.table-actions form,
.table__actions form { display: inline-flex; margin: 0; }
.table__actions .row-menu__panel form { display: block; width: 100%; margin: 0; }
.consent-admin-read { position: relative; }
.consent-admin-read__panel {
    position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20;
    width: min(28rem, 70vw); max-height: 16rem; overflow: auto;
    padding: .75rem .85rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); text-align: left;
}
.consent-doc__body,
.consent-snapshot,
.consent-admin-read__panel {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.consent-doc__body img,
.consent-doc__body table,
.consent-snapshot img,
.consent-snapshot table,
.consent-admin-read__panel img,
.consent-admin-read__panel table {
    max-width: 100%;
}
.consent-doc__body table,
.consent-snapshot table,
.consent-admin-read__panel table {
    display: block;
    overflow-x: auto;
}
.consent-events { margin-top: 1.25rem; }
.consent-changes {
    margin: .65rem 0 .85rem;
    padding: .75rem .9rem;
    border: 1px solid #d7e0ef;
    border-radius: 8px;
    background: #f7f9fc;
}
.consent-changes__title {
    margin: 0 0 .4rem;
    font-size: .95rem;
    font-weight: 700;
    color: #1a237e;
}
.consent-changes__summary { margin: 0 0 .55rem; line-height: 1.45; }
.consent-changes__diff > summary {
    cursor: pointer; font-weight: 600; color: #1565c0; list-style: none;
}
.consent-changes__diff > summary::-webkit-details-marker { display: none; }
.consent-changes__diff > summary::before { content: '▸ '; }
.consent-changes__diff[open] > summary::before { content: '▾ '; }
.consent-changes__legend {
    margin: .5rem 0 0;
    font-size: .8rem;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}
.consent-changes__fallback { margin: .35rem 0 0; font-size: .85rem; }
.consent-diff { margin-top: .55rem; display: grid; gap: .45rem; }
.consent-diff__seg {
    border-radius: 6px;
    padding: .4rem .55rem;
    border: 1px solid transparent;
}
.consent-diff__seg--eq { background: #fff; border-color: #e6ebf2; }
.consent-diff__seg--add { background: #e8f5e9; border-color: #a5d6a7; }
.consent-diff__seg--del { background: #ffebee; border-color: #ef9a9a; }
.consent-diff__label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .2rem;
    color: #455a64;
}
.consent-diff__text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: .85rem;
    line-height: 1.45;
}
.consent-diff__seg--del .consent-diff__text { text-decoration: line-through; opacity: .9; }
.consent-diff__swatch {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 2px;
    margin-right: .25rem;
    vertical-align: -1px;
    border: 1px solid transparent;
}
.consent-diff__swatch--add { background: #a5d6a7; border-color: #66bb6a; }
.consent-diff__swatch--del { background: #ef9a9a; border-color: #e57373; }
.consent-manage-read { margin: .65rem 0 .85rem; }
.consent-manage-read > summary {
    cursor: pointer; font-weight: 600; color: #1565c0; list-style: none;
}
.consent-manage-read > summary::-webkit-details-marker { display: none; }
.consent-manage-read > summary::before { content: '▸ '; }
.consent-manage-read[open] > summary::before { content: '▾ '; }
.consent-manage-read .consent-doc__body {
    margin-top: .65rem; padding: .75rem .85rem;
    background: #f7f8fa; border: 1px solid #d8dee8; border-radius: 6px;
    max-height: 22rem; overflow: auto;
}
.badge--warn {
    display: inline-block; margin-left: .35rem; padding: .1rem .4rem;
    border-radius: 3px; background: #fff3e0; color: #e65100; font-size: .75rem; font-weight: 700;
}
.consent-overview-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin: 0 0 1.35rem;
}
.consent-overview-stats--3 {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.consent-stat {
    padding: .95rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left-width: 4px;
    background: var(--card-bg, var(--surface));
}
.consent-stat__label {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--text);
}
.consent-stat__label svg { flex-shrink: 0; }
.consent-stat__value {
    margin: .35rem 0 .2rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.consent-stat__hint {
    margin: 0;
    font-size: .85rem;
    line-height: 1.35;
    color: var(--muted);
}
.consent-stat--ok {
    border-left-color: #2e7d32;
    background: color-mix(in srgb, #2e7d32 9%, var(--card-bg, #fff));
}
.consent-stat--ok .consent-stat__label,
.consent-stat--ok .consent-stat__value { color: #1b5e20; }
.consent-stat--warn {
    border-left-color: #e65100;
    background: var(--warn-surface);
}
.consent-stat--warn .consent-stat__label,
.consent-stat--warn .consent-stat__value { color: #e65100; }
.consent-stat--warn.is-quiet {
    border-left-color: var(--border);
    background: var(--card-bg, var(--surface));
}
.consent-stat--warn.is-quiet .consent-stat__label,
.consent-stat--warn.is-quiet .consent-stat__value { color: var(--text); }
[data-theme="dark"] .consent-stat--ok .consent-stat__label,
[data-theme="dark"] .consent-stat--ok .consent-stat__value { color: #9fe8c8; }
[data-theme="dark"] .consent-stat--warn .consent-stat__label,
[data-theme="dark"] .consent-stat--warn .consent-stat__value { color: #ffb74d; }
[data-theme="dark"] .consent-stat--warn.is-quiet .consent-stat__label,
[data-theme="dark"] .consent-stat--warn.is-quiet .consent-stat__value { color: var(--text); }
@media (max-width: 640px) {
    .consent-overview-stats { grid-template-columns: 1fr; }
}
.consent-overview-heading {
    margin: 0 0 .65rem;
    font-size: 1.05rem;
    color: var(--cw-primary);
}
.consent-overview-complete {
    margin: 1.25rem 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.consent-overview-complete > summary {
    cursor: pointer;
    padding: .7rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    list-style: none;
}
.consent-overview-complete > summary::-webkit-details-marker { display: none; }
.consent-overview-complete > summary::after {
    content: '▾';
    float: right;
    color: var(--muted);
}
.consent-overview-complete:not([open]) > summary::after { content: '▸'; }
.consent-overview-complete .table-wrap {
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
}
.project-month-snap {
    margin: 0 0 1.5rem;
}
.project-month-snap__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .35rem 1rem;
    margin: 0 0 .75rem;
}
.project-month-snap__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cw-primary);
}
.project-month-snap__more {
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}
.project-month-snap__more:hover { text-decoration: underline; }
.project-month-snap__grid { margin: 0; }
.project-month-snap__pool {
    display: block;
    margin: .9rem 0 0;
    padding: .75rem .85rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.project-month-snap__pool:hover {
    border-color: var(--cw-primary);
}
.project-month-snap__pool-label {
    font-weight: 700;
    font-size: .88rem;
}
.project-month-snap__pool .pool-bars__head { margin-bottom: .4rem; }
.project-month-snap__pool .pool-bars__track { height: 10px; }
.project-month-snap .consent-stat__value {
    font-size: 1.45rem;
}
a.consent-stat--link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
a.consent-stat--link:hover {
    border-color: color-mix(in srgb, var(--cw-primary) 45%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--cw-primary) 20%, transparent);
}
.project-month-snap__total {
    margin: .85rem 0 0;
    font-size: .95rem;
}
.consent-doc {
    margin: 1.25rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg) 92%, #e3f2fd);
}
.consent-doc--required { border-left: 4px solid #1565c0; }
.consent-doc h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.consent-doc__nature { margin: 0 0 .75rem; font-size: .85rem; }
.consent-doc__body { font-size: .9rem; line-height: 1.5; margin-bottom: .85rem; }
.consent-doc__body h2, .consent-doc__body h3 { font-size: 1rem; margin: .85rem 0 .35rem; }
.consent-doc__body ul { margin: .35rem 0 .75rem 1.1rem; }
.consent-doc__check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 600; }
.consent-doc__req { color: #c62828; }
.consent-html-editor { display: flex; flex-direction: column; gap: .45rem; }
.consent-html-editor:not(.is-ready) .consent-html-editor__frame,
.consent-html-editor:not(.is-ready) .consent-html-editor__tools,
.consent-html-editor:not(.is-ready) .consent-html-editor__modes {
    display: none;
}
.consent-html-editor__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.consent-html-editor__label { font-weight: 600; }
.consent-html-editor__hint { margin: 0; font-size: .85rem; }
.consent-html-editor__modes {
    display: inline-flex;
    border: 1px solid var(--border, #d8dee8);
    border-radius: 6px;
    overflow: hidden;
}
.consent-html-editor__mode {
    appearance: none;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--border, #d8dee8);
    padding: .35rem .7rem;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    color: var(--muted, #546e7a);
}
.consent-html-editor__mode:last-child { border-right: 0; }
.consent-html-editor__mode.is-active {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
}
.consent-html-editor__tools {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.consent-html-editor__tool {
    appearance: none;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    padding: .28rem .55rem;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    color: #37474f;
}
.consent-html-editor__tool:hover { border-color: #90caf9; background: #f4f8fd; }
.consent-html-editor__frame { margin-top: .15rem; }
.consent-html-editor__preview { margin: 0; }
.consent-html-editor__visual {
    min-height: 18rem;
    max-height: 36rem;
    overflow: auto;
    outline: none;
    margin-bottom: 0;
    padding: .15rem .2rem;
}
.consent-html-editor__visual:focus {
    box-shadow: inset 0 0 0 2px rgba(21, 101, 192, .18);
    border-radius: 4px;
}
.consent-html-editor__source {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85rem;
}
/* display:flex / .form__textarea przebijają UA [hidden] — jak szukajka 1.43.14 */
.consent-html-editor.is-ready[data-mode="visual"] .consent-html-editor__source,
.consent-html-editor.is-ready:not([data-mode="html"]) .consent-html-editor__source,
.consent-html-editor__source[hidden] {
    display: none !important;
}
.consent-html-editor.is-ready[data-mode="html"] .consent-html-editor__frame,
.consent-html-editor.is-ready[data-mode="html"] .consent-html-editor__tools,
.consent-html-editor__frame[hidden],
.consent-html-editor__tools[hidden] {
    display: none !important;
}
.document-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.document-list li { margin-bottom: .45rem; }
.document-list__type { display: inline-block; min-width: 5.5rem; color: var(--muted); font-size: .85rem; }
.acceptance-admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: .5rem; }
.acceptance-admin-table th,
.acceptance-admin-table td { padding: .55rem .45rem; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.acceptance-admin-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.acceptance-admin-table__amount { white-space: nowrap; text-align: right !important; width: 7rem; }
.acceptance-admin-table__action { width: 9rem; white-space: nowrap; }
.acceptance-admin-table__comment { min-width: 12rem; }
.acceptance-admin-table__flagged { background: rgba(255, 193, 7, .08); }
[data-theme="dark"] .acceptance-admin-table__flagged { background: rgba(255, 193, 7, .12); }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
.form__grid--align-fields .form-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
    font-weight: 600;
    color: var(--text);
}
.form__grid--align-fields .form-field[hidden] {
    display: none;
}
.form__grid--align-fields .form-field__head {
    line-height: 1.35;
    font-size: .88rem;
}
.form__grid--align-fields .form-field input:not([type=checkbox]):not([type=radio]),
.form__grid--align-fields .form-field select {
    width: 100%;
    box-sizing: border-box;
}
.form__grid--align-fields .form-field__control {
    display: flex;
    align-items: center;
    min-height: 2.35rem;
}
.form__grid--align-fields .form-field__hint {
    font-size: .78rem;
    line-height: 1.35;
    font-weight: 400;
    color: var(--muted);
}
.form--hours .form__section--flat { margin: 0 0 1.25rem; padding: 0; border-top: none; }
.form--hours .form__section--flat h3 { margin: 0 0 .75rem; font-size: .95rem; color: var(--cw-primary); }
.form--hours label input:not([type="checkbox"]):not([type="radio"]),
.form--hours label select,
.form--hours .form__notes textarea,
.form--hours .markdown-editor { width: 100%; max-width: 100%; box-sizing: border-box; }
.form--hours label.checkbox {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: .55rem;
}
.form--hours label.checkbox input[type="checkbox"] {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    margin: 0;
}
.form--hours .form__notes { display: block; margin: 1rem 0; }
.multiplier-auto__value {
    background: var(--hover-bg);
    color: var(--cw-primary);
    font-weight: 700;
    cursor: default;
}
.multiplier-auto__hint { color: var(--muted); font-weight: 400; }
.form__grid--flags { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; font-weight: 600; color: var(--text); min-width: 0; }
.form label small { font-weight: 400; color: var(--muted); }
.form label.checkbox { flex-direction: row; align-items: center; font-weight: 400; gap: .5rem; }
.form.form--hours label.entry-billing-mode__seg-item {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.35rem;
    margin: 0;
    padding: 0 .5rem;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-muted, #5b6573);
    background: transparent;
    cursor: pointer;
    border-right: 1px solid var(--border, #d8dee6);
}
.form.form--hours label.entry-billing-mode__seg-item:last-child { border-right: none; }
.form.form--hours label.entry-billing-mode__seg-item svg { flex-shrink: 0; }
.form.form--hours label.entry-billing-mode__seg-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.form.form--hours label.entry-billing-mode__seg-item:hover {
    background: color-mix(in srgb, var(--cw-primary) 6%, transparent);
    color: var(--text);
}
.form.form--hours label.entry-billing-mode__seg-item:has(input:checked) {
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface, #fff));
    color: var(--cw-primary);
}
.form.form--hours label.entry-billing-mode__seg-item:has(input:focus-visible) {
    outline: 2px solid var(--cw-primary);
    outline-offset: -2px;
    z-index: 1;
}
.entry-billing-mode {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}
.entry-billing-mode__seg {
    display: flex;
    align-items: stretch;
    min-height: 2.35rem;
    border: 1px solid var(--border, #d8dee6);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface, #fff);
}
.form-field--premium { margin: .25rem 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.form-field--premium__hint { display: block; margin: .5rem 0 0 1.75rem; font-weight: 400; line-height: 1.45; }
.form__section { margin: 1.25rem 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.form__section h3 { margin: 0 0 .75rem; font-size: 1rem; color: var(--cw-primary); }
.form__actions { display: flex; gap: .5rem; margin-top: 1.25rem; flex-wrap: wrap; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.card--info h2 { margin: 0 0 .75rem; font-size: .95rem; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.card--info dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; margin: 0; font-size: .88rem; }
.card--info dt { color: var(--muted); }
.card--info dd { margin: 0; font-weight: 600; color: var(--text); text-align: right; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.summary-grid dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; margin: 0; }
.summary-grid dt { color: var(--muted); }
.summary-grid .amounts-info {
    margin: 0 0 .65rem;
    padding: .6rem .75rem;
    background: var(--accent-surface);
    border: 1px solid var(--border);
    border-left: 3px solid color-mix(in srgb, var(--cw-primary) 28%, var(--border));
    border-radius: var(--radius);
}
.summary-grid .amounts-info__title { grid-column: 1 / -1; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: .15rem; }
.summary-grid .amounts-info dt:not(.amounts-info__title),
.summary-grid .amounts-info dd:not(.amounts-info__title) { color: var(--muted); font-size: .9rem; }
.summary-grid .amounts-divider { border-top: 1px dashed var(--border); margin: 0 0 .75rem; }
.summary-grid .amounts-subtotal { border-top: 1px solid var(--border); padding-top: .45rem; margin-top: .35rem; color: var(--text); font-weight: 600; }
.summary-grid .total { font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: .5rem; margin-top: .25rem; }

/* Stała, niska wysokość — bez hover expand (nie skacze layout). */
.worksheet .insert-row td {
    padding: .15rem .8rem;
    background: transparent;
    border-bottom: 1px solid transparent;
}
.worksheet .insert-row:hover td,
.worksheet .insert-row:focus-within td {
    background: var(--accent-surface);
    border-bottom-color: var(--border);
}
.form label.checkbox--block {
    align-items: flex-start;
}
.form label.checkbox--block > span {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.insert-link { font-size: .78rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.insert-link:hover { color: var(--cw-primary); }

.hint-box, .alert {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.hint-box { background: var(--hover-bg); border: 1px solid var(--border); color: var(--text); }
[data-theme="dark"] .hint-box--ok { background: #14352a; border-color: #2d6a4f; color: #9fe8c8; }
[data-theme="dark"] .alert--success { background: #14352a; border-color: #2d6a4f; color: #9fe8c8; }
[data-theme="dark"] .alert--warning { background: #2e2618; border-color: #7a5c1e; color: #f5d78e; }
[data-theme="dark"] .alert--error { background: #331a1a; border-color: #7a3030; color: #f5a8a8; }
[data-theme="dark"] .notice-contract { background: var(--accent-surface); border-color: var(--border); }
[data-theme="dark"] .notice-contract--ok { background: var(--accent-surface); }
[data-theme="dark"] .stats-heatmap .heat-0 { background: var(--zebra); }
[data-theme="dark"] .stats-trend-table__current td { background: var(--accent-surface); }
[data-theme="dark"] .avatar-upload__preview { background: var(--hover-bg); }
[data-theme="dark"] .nav-toggle {
    border-color: var(--header-control-border);
    background: var(--header-control-bg);
}
[data-theme="light"] .nav-toggle {
    border-color: var(--border);
    background: var(--hover-bg);
}
[data-theme="light"] .nav-toggle__bar { background: var(--text); }
.hint-box--ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.settings-2fa { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--card-border); }
.settings-2fa__setup {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    margin: .75rem 0 1rem;
}
.settings-2fa__qr {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: #fff;
    padding: .35rem;
}
.settings-2fa__secret {
    display: inline-block;
    padding: .35rem .55rem;
    border-radius: 6px;
    background: var(--surface-muted);
    font-size: .92rem;
    letter-spacing: .06em;
    word-break: break-all;
}
.settings-2fa__backup-box {
    margin: .75rem 0 1rem;
    padding: .85rem 1rem;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    background: color-mix(in srgb, #f59e0b 10%, var(--card-bg));
}
.settings-2fa__backup-box h3 { margin: 0 0 .35rem; font-size: .95rem; }
.settings-2fa__backup-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: .35rem .75rem;
    list-style: none;
    margin: .65rem 0 0;
    padding: 0;
}
.settings-2fa__backup-list code {
    font-size: .88rem;
    font-weight: 700;
}
.settings-2fa__method-pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: .85rem;
    margin: .75rem 0;
}
.settings-2fa__method-form {
    padding: .9rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: var(--surface-muted);
}
.settings-2fa__method-form h3 { margin: 0 0 .35rem; font-size: .95rem; }
.settings-2fa__method-form .btn { margin-top: .65rem; }
.settings-2fa__revoke-form { margin: .5rem 0 1rem; }
.auth-form__divider {
    text-align: center;
    margin: .85rem 0;
    font-size: .82rem;
}
.auth-form--duo-push { margin-bottom: .25rem; }
.alert--success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert--warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert--error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); }
.logo-preview { max-height: 48px; margin-top: .5rem; }
.logo-preview-dark {
    display: inline-block;
    padding: .65rem 1rem;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--cw-dark-2) 0%, var(--cw-dark) 47%);
    margin-top: .25rem;
}
.client-logo-wrap { margin-bottom: .5rem; }
.client-logo { max-height: 48px; height: 44px; }

.client-meta { margin-top: .65rem; }
.client-meta__empty { margin: 0; font-size: .88rem; }
.client-meta__list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .85rem;
    margin: 0;
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--accent-surface);
}
.client-meta__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .5rem;
    margin: 0;
    font-size: .88rem;
}
.client-meta__item--wide { flex: 1 1 100%; }
.client-meta__item dt {
    margin: 0;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.client-meta__item dd { margin: 0; color: var(--text); }
.client-meta__item a { color: var(--cw-primary); text-decoration: none; }
.client-meta__item a:hover { text-decoration: underline; }

.card--client { display: flex; flex-direction: column; align-items: flex-start; min-height: 140px; }
.card__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin-bottom: .65rem;
    padding: .4rem .55rem;
    border-radius: 6px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}
[data-theme="dark"] .card__logo-wrap {
    background: #f4f6f9;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.card__logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 148px;
    object-fit: contain;
    object-position: left center;
}
.checkbox--emergency { grid-column: 1 / -1; border: 1px dashed #d4a574; padding: .6rem; border-radius: var(--radius); background: #fffaf5; }
.formula-hint { margin-top: 1rem; font-size: .88rem; color: var(--muted); }

.notes-cell { max-width: 280px; }

/* Arkusz godzin — bez poziomego scrolla na desktopie */
.hours-table.table-wrap {
    overflow-x: visible;
    max-width: 100%;
}
.hours-table .table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.hours-table .table th,
.hours-table .table td {
    padding: .45rem .4rem;
    font-size: .8rem;
    vertical-align: top;
}
.hours-table .table th {
    font-size: .72rem;
    letter-spacing: .02em;
    line-height: 1.25;
}
.hours-table .table th:last-child,
.hours-table .table td.hours-table__actions {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: 4.25rem;
    padding: .35rem .3rem;
    box-sizing: border-box;
}
.hours-table__actions-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    font-size: .75rem;
    line-height: 1.25;
}
.hours-table__actions-inner form {
    margin: 0;
}
.hours-table__actions-inner a,
.hours-table__actions-inner button {
    white-space: nowrap;
}
.hours-table .table td.hours-table__actions {
    vertical-align: top;
}
.hours-table .notes-cell,
.hours-table .hours-table__notes {
    width: 12rem;
    max-width: 12rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.hours-table .notes-cell .markdown-preview {
    overflow: visible;
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    font-size: .78rem;
    line-height: 1.4;
}
.hours-table .notes-cell .markdown-preview p {
    margin: 0;
}
.hours-table .notes-cell .markdown-preview p + p {
    margin-top: .25rem;
}
.notes-points {
    margin: 0;
    padding-left: 1.05rem;
}
.notes-points li + li {
    margin-top: .2rem;
}
.hours-card__notes .notes-points,
.entry-card__notes .notes-points {
    margin-top: .15rem;
}
.hours-table .badge--special {
    display: inline-block;
    margin-top: .2rem;
}
.hours-line-net {
    display: block;
    margin-top: .15rem;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--muted);
}
.hours-table--contract .table th:nth-child(1),
.hours-table--contract .table td:nth-child(1) { width: 4.8rem; }
.hours-table--contract .table th:nth-child(2),
.hours-table--contract .table td:nth-child(2) { width: 5rem; }
.hours-table--contract .table th:nth-child(3),
.hours-table--contract .table td:nth-child(3) { width: 6.2rem; }
.hours-table--contract .table th:nth-child(4),
.hours-table--contract .table td:nth-child(4) { width: 3.2rem; }
.hours-table--contract .table th:nth-child(5),
.hours-table--contract .table td:nth-child(5) { width: 3rem; }
.hours-table--contract .table th:nth-child(6),
.hours-table--contract .table td:nth-child(6) { width: 4.6rem; }
.hours-table--contract .table th:nth-child(7),
.hours-table--contract .table td:nth-child(7) { width: 4.2rem; }
.hours-table--contract .table th:nth-child(8),
.hours-table--contract .table td:nth-child(8) { width: 4.5rem; }
.hours-table--contract .table th:nth-child(9),
.hours-table--contract .table td:nth-child(9) { width: 3rem; }
.hours-table--contract .table th:nth-child(10),
.hours-table--contract .table td:nth-child(10) { width: 7rem; }
.hours-table--contract .table th:nth-child(11),
.hours-table--contract .table td:nth-child(11) { width: 5.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(1),
.hours-table:not(.hours-table--contract) .table td:nth-child(1) { width: 4.8rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(2),
.hours-table:not(.hours-table--contract) .table td:nth-child(2) { width: 5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(3),
.hours-table:not(.hours-table--contract) .table td:nth-child(3) { width: 6.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(4),
.hours-table:not(.hours-table--contract) .table td:nth-child(4) { width: 3.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(5),
.hours-table:not(.hours-table--contract) .table td:nth-child(5) { width: 4.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(6),
.hours-table:not(.hours-table--contract) .table td:nth-child(6) { width: 4.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(7),
.hours-table:not(.hours-table--contract) .table td:nth-child(7) { width: 3rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(8),
.hours-table:not(.hours-table--contract) .table td:nth-child(8) { width: 7.5rem; }
.hours-table:not(.hours-table--contract) .table th:nth-child(9),
.hours-table:not(.hours-table--contract) .table td:nth-child(9) { width: 6rem; }

.markdown-preview { font-size: .85rem; }
.offer-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.offer-item-row__tools { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; }
.offer-catalog-picker {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 18rem;
    overflow: auto;
}
.offer-catalog-picker label {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    margin: .4rem 0;
}
.offer-catalog-add { margin-bottom: 1.5rem; }
.offer-catalog-add__grid { align-items: end; }
.offer-catalog-list { display: flex; flex-direction: column; gap: .75rem; }
.offer-catalog-row { padding: .75rem 0; border-top: 1px solid var(--border); }
.offer-catalog-row__form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) 7rem 8rem 8rem auto;
    gap: .4rem;
    align-items: center;
}
.offer-catalog-row__tools {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    margin-top: .35rem;
}
@media (max-width: 800px) {
    .offer-catalog-row__form { grid-template-columns: 1fr 1fr; }
}
.actions { white-space: nowrap; }
.actions form { display: inline; }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
.empty { text-align: center; color: var(--muted); padding: 2rem !important; }

.page-header__actions--wrap { flex-wrap: wrap; }
.btn--preview { font-size: .95rem; }
.reopen-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.reopen-form__check { font-weight: 400; font-size: .85rem; margin: 0; }

.audit-log { margin-top: 1.25rem; }
.audit-log__list { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.audit-log__list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.audit-log__list time { color: var(--muted); margin-right: .5rem; font-size: .82rem; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-left: auto;
    border: 1px solid var(--header-control-border);
    border-radius: var(--radius);
    background: var(--header-control-bg);
    cursor: pointer;
}
.nav-toggle__bar {
    display: block;
    height: 2px;
    background: var(--header-text);
    border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Oferty — accordion na telefonie */
.offers-cards { display: none; }
.offer-card {
    margin: 0 0 .65rem;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(1, 15, 33, .04);
    overflow: hidden;
}
.offer-card--empty {
    padding: .9rem 1rem;
    color: var(--muted);
}
.offer-card--draft {
    background: #eef2ff;
    border-color: #c7d2fe;
    border-left-color: #4f46e5;
}
.offer-card--sent {
    background: #e0f2fe;
    border-color: #bae6fd;
    border-left-color: #0284c7;
}
.offer-card--accepted {
    background: #dcfce7;
    border-color: #bbf7d0;
    border-left-color: #047857;
}
.offer-card--declined,
.offer-card--cancelled {
    background: #fee2e2;
    border-color: #fecaca;
    border-left-color: #b91c1c;
}
.offer-card--expired {
    background: #fef3c7;
    border-color: #fde68a;
    border-left-color: #b45309;
}
[data-theme="dark"] .offer-card--draft {
    background: #1e2438;
    border-color: #2a3354;
    border-left-color: #818cf8;
}
[data-theme="dark"] .offer-card--sent {
    background: #132a3a;
    border-color: #1b3d52;
    border-left-color: #38bdf8;
}
[data-theme="dark"] .offer-card--accepted {
    background: #14352a;
    border-color: #1c4a3a;
    border-left-color: #34d399;
}
[data-theme="dark"] .offer-card--declined,
[data-theme="dark"] .offer-card--cancelled {
    background: #331a1a;
    border-color: #4a2222;
    border-left-color: #f87171;
}
[data-theme="dark"] .offer-card--expired {
    background: #2e2618;
    border-color: #45381c;
    border-left-color: #fbbf24;
}
.offer-card__summary {
    position: relative;
    display: grid;
    gap: .12rem;
    padding: .75rem 2.4rem .75rem .85rem;
    list-style: none;
    cursor: pointer;
}
.offer-card__summary::-webkit-details-marker { display: none; }
.offer-card__summary::after {
    content: '';
    position: absolute;
    right: .85rem;
    top: 50%;
    width: .45rem;
    height: .45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    opacity: .45;
}
.offer-card[open] .offer-card__summary::after {
    transform: translateY(-20%) rotate(225deg);
}
.offer-card__client {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.offer-card__number {
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: .01em;
}
.offer-card__title {
    font-size: .88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.offer-card__body {
    padding: 0 .85rem .85rem;
}
.offer-card__meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .28rem .75rem;
    margin: 0 0 .7rem;
    font-size: .86rem;
}
.offer-card__meta div { display: contents; }
.offer-card__meta dt { color: var(--muted); font-weight: 600; }
.offer-card__meta dd { margin: 0; }
.offer-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    padding-top: .65rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.offer-card__actions .offer-copy-form { margin: 0; display: inline; }

/* Listy godzin / kilometrówki — karty na mobile */
.entry-cards,
.hours-cards,
.mileage-cards { display: none; }
.entry-cards__add { margin: 0 0 .85rem; }
.entry-card,
.hours-card,
.mileage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .75rem;
    box-shadow: 0 1px 2px rgba(1, 15, 33, .04);
}
.hours-card--weekend { background: var(--weekend); }
.hours-card--night { background: var(--night); }
.hours-card--emergency {
    border-color: color-mix(in srgb, #c62828 45%, var(--border));
    box-shadow: inset 3px 0 0 #c62828;
}
.hours-card--special {
    border-color: color-mix(in srgb, #0284c7 45%, var(--border));
    box-shadow: inset 3px 0 0 #0284c7;
}
.entry-card__head,
.hours-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin-bottom: .65rem;
}
.entry-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .55rem;
    min-width: 0;
}
.entry-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    justify-content: flex-end;
}
.entry-card__meta,
.hours-card__meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .3rem .75rem;
    margin: 0;
    font-size: .88rem;
}
.entry-card__meta div,
.hours-card__meta div { display: contents; }
.entry-card__meta dt,
.hours-card__meta dt { color: var(--muted); font-weight: 600; }
.entry-card__meta dd,
.hours-card__meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.entry-card__notes,
.hours-card__notes { font-size: .85rem; margin-top: .55rem; line-height: 1.45; }
.entry-card__actions,
.hours-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem .9rem;
    margin-top: .75rem;
    padding-top: .55rem;
    border-top: 1px solid var(--border);
    font-size: .9rem;
}
.entry-card__actions form,
.hours-card__actions form { margin: 0; display: inline; }

@media (max-width: 1024px) {
    .form--hours .form__grid--time {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Logowanie — telefon i wąski tablet (wyśrodkowany układ) */
@media (max-width: 900px) {
    .auth-page--split .auth-shell__brand {
        display: none;
    }
    .auth-page--split-b .auth-shell__body {
        border-left: none;
        background: var(--bg);
    }
    .auth-page {
        min-height: 100dvh;
        min-height: 100svh;
    }
    .auth-shell {
        display: flex;
        flex-direction: column;
        flex: 1;
        grid-template-columns: 1fr;
        min-height: 0;
        width: 100%;
    }
    .auth-shell__body {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 0;
        padding: max(.5rem, env(safe-area-inset-top, 0px))
            max(1rem, env(safe-area-inset-right, 0px))
            max(.5rem, env(safe-area-inset-bottom, 0px))
            max(1rem, env(safe-area-inset-left, 0px));
    }
    .auth-shell__toolbar {
        position: static;
        flex-shrink: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: .35rem 0 .75rem;
    }
    .auth-shell__main {
        flex: 0 1 auto;
        width: 100%;
        max-width: 22rem;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0 auto;
    }
    .auth-page--split-b .auth-shell__main {
        width: 100%;
        max-width: 22rem;
        justify-content: center;
        align-items: center;
        padding: 0;
    }
    .auth-form-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 22rem;
        margin: 0 auto;
    }
    .auth-page--split-b .auth-form-wrap__logo {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: .75rem;
    }
    .auth-form-wrap__logo .logo__mark {
        display: block;
        font-size: 1.45rem;
        color: var(--cw-primary);
    }
    .auth-form-wrap__logo .logo__sub {
        display: block;
        font-size: .95rem;
        color: var(--muted);
        margin-top: .15rem;
    }
    .auth-form-wrap__logo-img,
    .auth-form-wrap__logo .logo__img--default,
    .auth-form-wrap__logo .logo__img--on-dark {
        max-height: 3rem;
        max-width: min(16rem, 78vw);
        width: auto;
        margin: 0 auto;
    }
    .auth-form-wrap__mobile-brand {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    .auth-form-wrap__tagline {
        max-width: 18rem;
        margin-inline: auto;
    }
    .auth-form-wrap h1 {
        width: 100%;
        text-align: center;
        font-size: 1.35rem;
        margin: 0 0 .85rem;
    }
    .auth-form-wrap__setup-hint,
    .auth-form-wrap__hint,
    .auth-form-wrap .alert {
        width: 100%;
        text-align: center;
    }
    .auth-form-wrap .form.auth-form {
        width: 100%;
        align-items: center;
    }
    .auth-form-wrap .auth-form label {
        width: 100%;
        align-items: center;
        text-align: center;
    }
    .auth-form-wrap .auth-form label.checkbox {
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
    }
    .auth-form-wrap .auth-form label.checkbox input[type="checkbox"] {
        min-height: 1rem;
    }
    .auth-form-wrap .auth-form input {
        width: 100%;
        font-size: 16px;
        min-height: 2.75rem;
        box-sizing: border-box;
    }
    .auth-form-wrap .form__actions,
    .auth-form-wrap .btn--block {
        width: 100%;
    }
    .auth-form-wrap .btn--block {
        min-height: 3rem;
        font-size: 1rem;
    }
    .auth-page__foot {
        text-align: center;
        padding-bottom: max(.55rem, env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 768px) {
    .header__client-logo,
    .header__user { display: none; }

    .client-switcher {
        margin-left: .35rem;
        padding-left: .45rem;
        max-width: 42vw;
    }
    .client-switcher__trigger { max-width: 100%; padding: .2rem .3rem; }

    /* Lista klientów: panel od dołu — dropdown z nagłówka chowa się za drugim rzędem / klawiaturą */
    .client-switcher__dropdown {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 400;
        min-width: 0;
        max-width: none;
        width: 100%;
        padding: 0;
    }
    .client-switcher__dropdown-inner {
        display: flex;
        flex-direction: column;
        max-height: min(82dvh, 36rem);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 40px rgba(1, 15, 33, .22);
        overflow: hidden;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .client-switcher__sheet-head {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        flex-shrink: 0;
        padding: 1.15rem .9rem .65rem 1rem;
        border-bottom: 1px solid var(--border);
        background: var(--surface, #fff);
    }
    .client-switcher__sheet-head::before {
        content: '';
        position: absolute;
        top: .45rem;
        left: 50%;
        width: 2.4rem;
        height: 4px;
        border-radius: 99px;
        background: var(--border);
        transform: translateX(-50%);
    }
    .client-switcher__sheet-title {
        font-weight: 700;
        font-size: .95rem;
        color: var(--text);
    }
    .client-switcher__sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        margin: -.35rem -.25rem -.35rem 0;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: var(--hover-bg, var(--surface));
        color: var(--text);
        cursor: pointer;
    }
    .client-switcher__sheet-close:hover {
        border-color: var(--cw-primary);
        color: var(--cw-primary);
    }
    .client-switcher__filter-input {
        font-size: 16px;
    }
    .client-switcher__list {
        max-height: none;
        flex: 1 1 auto;
        min-height: 8rem;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .client-switcher__item {
        padding: .75rem .9rem;
        font-size: 1rem;
    }

    body.client-switcher-open {
        overflow: hidden;
    }
    body.client-switcher-open::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 390;
        background: rgba(1, 15, 33, .45);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .header { padding: .55rem 0; }
    .header__inner { gap: .5rem; }

    .logo { flex: 0 1 auto; min-width: 0; }
    .logo__img { height: 28px; }
    .logo__mark { font-size: 1.1rem; }

    .header__links {
        margin-left: auto;
        gap: .35rem;
        flex-shrink: 0;
    }

    .user-menu__name { display: none; }
    .user-menu__trigger { padding: .15rem .2rem .15rem .15rem; }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        margin-left: .15rem;
    }

    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 210;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 0;
        max-height: min(70vh, 22rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 28px rgba(1, 15, 33, .15);
    }

    .nav.nav--open { display: flex; }

    .nav__more { display: none !important; }

    .nav a,
    .nav a.nav__link {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        padding: .85rem 1.25rem;
        font-size: .95rem;
        gap: .55rem;
        margin-left: 0;
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
    }

    .nav a.nav__dashboard {
        padding: .85rem 1.25rem;
        justify-content: flex-start;
    }

    .nav__sep { display: none; }
    .nav__group-label {
        display: block;
        margin: 0;
        padding: .55rem 1.25rem .25rem;
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .nav__icon {
        width: 18px;
        height: 18px;
    }

    .nav a:last-child { border-bottom: none; }

    body.nav-open { overflow: hidden; }

    body.nav-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(1, 15, 33, .45);
        z-index: 199;
    }

    .user-menu--open .user-menu__dropdown { z-index: 220; }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        padding: .65rem 0;
        gap: .5rem;
        position: static;
        top: auto;
    }

    .page-header h1 { font-size: 1.25rem; }

    .page-header__actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
        gap: .35rem;
    }

    .page-header__actions .btn,
    .page-header__actions form,
    .page-header__actions > a {
        width: 100%;
        margin: 0;
    }

    .page-header__actions form .btn { width: 100%; text-align: center; }

    .page-header__actions--wrap .btn {
        font-size: .82rem;
        padding: .45rem .65rem;
    }

    .main { padding: 1rem 1rem 2.5rem; }

    .filters__row { flex-direction: column; align-items: stretch; }
    .project-span,
    .project-span__custom { flex-direction: column; align-items: stretch; }
    .project-span .btn { width: 100%; }
    .hour-timer__start,
    .hour-timer__live,
    .hour-timer__assign {
        align-items: stretch;
        flex-direction: column;
    }
    .hour-timer__readout { align-items: stretch; }
    .hour-timer__elapsed { font-size: 1.85rem; }
    .hour-timer__actions { justify-content: stretch; }
    .hour-timer__actions form { flex: 1; }
    .hour-timer__actions .btn,
    .hour-timer__go { width: 100%; }
    .filters label { width: 100%; }
    .form__grid,
    .form--hours .form__grid,
    .form--hours .form__grid--time { grid-template-columns: 1fr; }
    .form--hours { padding: 1rem; }
    .form--hours .form__actions { flex-direction: column; }
    .form--hours .form__actions .btn { width: 100%; text-align: center; }

    body.has-mobile-tabbar .footer {
        display: none;
    }
    body.is-dashboard-clients .version-banner {
        display: none;
    }
    .dashboard-page.is-clients-tab > .page-header,
    .dashboard-page.is-clients-tab > .muted,
    .is-clients-tab [data-dashboard-section="hub"],
    .is-clients-tab [data-dashboard-section="operations"] {
        display: none;
    }

    .hours-table,
    .mileage-table { display: none; }
    .entry-cards,
    .hours-cards,
    .mileage-cards { display: block; }

    /* CTA dodawania jest przy listach kart — nie dubluj w nagłówku */
    body:has(.entry-cards) .page-header__actions > a.btn--primary {
        display: none;
    }

    .summary-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .stats-trend__charts { grid-template-columns: 1fr; }
    .stats-trend__bars { height: 140px; }
    .stat-row__label { flex: 0 0 5.5rem; }
    .stat-row__value { flex: 0 0 2.75rem; }
    .stat-row__meta { margin-left: calc(5.5rem + .6rem); }
}

.rate-toggle { display: none; }
.rate-toggle.is-visible { display: contents; }

/* Ustawienia — nawigacja sekcji (1.18.0) */
.settings-layout {
    display: grid;
    grid-template-columns: minmax(10.5rem, 13rem) minmax(0, 1fr);
    gap: 1.25rem 1.5rem;
    align-items: start;
    margin-top: .5rem;
}
.settings-nav-mobile {
    display: none;
    grid-column: 1 / -1;
    margin: 0;
}
.settings-nav-mobile__label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .35rem;
}
.settings-nav-mobile__select {
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    position: sticky;
    top: calc(var(--site-top-height, 7.5rem) + .75rem);
    padding: .65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.settings-nav__link {
    display: block;
    padding: .5rem .65rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    text-decoration: none;
    font-size: .92rem;
    line-height: 1.35;
}
.settings-nav__link:hover {
    background: var(--accent-surface);
    color: var(--cw-primary);
}
.settings-nav__link.is-active {
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface));
    color: var(--cw-primary);
    font-weight: 600;
}
.settings-panel {
    min-width: 0;
}
.settings-panel__title {
    margin: 0 0 .75rem;
    font-size: 1.15rem;
    color: var(--cw-primary);
}
.settings-panel .form__section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.settings-panel__actions {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

/* Wystawca licencji (1.42.x) */
.license-issue [hidden] {
    display: none !important;
}
.license-issue__block {
    margin: 1.5rem 0 0;
    padding: 1.15rem 1.2rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 94%, var(--bg));
}
.license-issue__block--renew {
    border-color: color-mix(in srgb, var(--cw-primary) 35%, var(--border));
    background: color-mix(in srgb, var(--cw-primary) 6%, var(--surface));
}
.license-issue__heading {
    margin: 0 0 .65rem;
    font-size: 1rem;
    font-weight: 650;
    color: var(--text);
}
.license-issue__lead {
    margin: 0 0 1rem;
    max-width: 52rem;
    line-height: 1.45;
}
.license-issue__modules {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.license-issue__module {
    display: grid;
    grid-template-columns: 1fr minmax(9.5rem, 11rem);
    gap: .75rem 1rem;
    align-items: center;
    padding: .75rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.license-issue__module-text strong {
    display: inline;
    font-size: .95rem;
}
.license-issue__module-text p {
    margin: .25rem 0 0;
    font-size: .85rem;
    color: var(--muted);
    line-height: 1.4;
}
.license-issue__tier {
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    background: color-mix(in srgb, var(--cw-primary) 12%, var(--surface));
    color: var(--cw-primary);
    vertical-align: middle;
}
.license-issue__key {
    display: inline-block;
    margin-top: .35rem;
    font-size: .72rem;
    opacity: .65;
}
.license-issue__mode select {
    width: 100%;
}
.form-gus-root { display: contents; }
.license-issue__nip-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .4rem .55rem;
    margin-top: .45rem;
}
.license-issue__nip-label {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin: 0;
    font-size: .85rem;
}
.license-issue__nip-label input {
    width: 9.5rem;
    max-width: 100%;
}
.license-remain {
    display: block;
    margin-top: .2rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}
.license-remain--ok { color: #2e7d32; }
.license-remain--soon { color: #e65100; }
.license-remain--over { color: #c62828; }
.license-remain--wait { font-weight: 500; }
.sla-settings {
    margin: 1rem 0 1.25rem;
    padding: .9rem 1rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.sla-settings__days {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .9rem;
    margin: .35rem 0 .6rem;
}
.sla-settings__days label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
}
.license-registry-edit {
    margin-top: .4rem;
}
.license-registry-edit > summary {
    cursor: pointer;
    font-size: .82rem;
    font-weight: 600;
    color: var(--cw-primary);
    list-style: none;
}
.license-registry-edit > summary::-webkit-details-marker { display: none; }
.license-registry-edit > summary::before {
    content: '';
    display: inline-block;
    width: .45rem;
    height: .45rem;
    margin-right: .35rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    vertical-align: .15rem;
}
.license-registry-edit[open] > summary::before {
    transform: rotate(45deg);
    vertical-align: .35rem;
}
.license-registry-edit__form {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .55rem;
    max-width: 22rem;
}
.license-registry-edit__form label {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: 0;
    font-size: .82rem;
    font-weight: 500;
}
.license-registry-edit__form input[type=text],
.license-registry-edit__form input[type=date] {
    width: 100%;
    box-sizing: border-box;
}
.license-registry-edit__gus {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .6rem;
}
.license-registry-edit__hint {
    margin: 0;
    font-size: .75rem;
}
.license-archive {
    position: relative;
}
.license-archive > summary {
    list-style: none;
}
.license-archive > summary::-webkit-details-marker { display: none; }
.license-archive__form {
    position: absolute;
    right: 0;
    z-index: 8;
    margin-top: .35rem;
    min-width: 16rem;
    padding: .75rem .85rem;
    background: var(--surface, #fff);
    border: 1px solid var(--card-border, #e2e6ec);
    border-radius: var(--radius, 8px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.license-archive__form label {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: 0;
}
.license-archive__form select,
.license-archive__form input[type=text] {
    width: 100%;
    box-sizing: border-box;
}
.license-issue .form-field__hint,
.license-issue label .form-field__hint {
    display: block;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.35;
}
@media (max-width: 720px) {
    .license-issue__module {
        grid-template-columns: 1fr;
    }
}
.license-issue-add {
    margin: 1.25rem 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.license-issue-add > summary {
    cursor: pointer;
    padding: .7rem 1rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
    list-style: none;
}
.license-issue-add > summary::-webkit-details-marker { display: none; }
.license-issue-add > summary::after {
    content: '▾';
    float: right;
    color: var(--muted);
}
.license-issue-add:not([open]) > summary::after { content: '▸'; }
.license-issue-add .form {
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
    padding: 1rem 1rem 1.1rem;
    background: transparent;
}

.settings-accordion {
    margin: .85rem 0 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface) 92%, var(--bg));
}
.settings-accordion > summary {
    cursor: pointer;
    padding: .7rem .85rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--text);
    list-style: none;
}
.settings-accordion > summary::-webkit-details-marker { display: none; }
.settings-accordion > summary::after {
    content: '▾';
    float: right;
    color: var(--text-muted);
}
.settings-accordion:not([open]) > summary::after { content: '▸'; }
.settings-accordion__body {
    padding: 0 .85rem .85rem;
    border-top: 1px solid var(--border);
}
.settings-accordion__body .form__full:first-child { margin-top: .75rem; }
.settings-test-inline {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-nav {
        display: none;
    }
    .settings-nav-mobile {
        display: block;
    }

    /* RODO admin — tabela jako karty (bez nakładania kolumn) */
    .table--consents {
        table-layout: auto;
        min-width: 0;
    }
    .table--consents thead {
        display: none;
    }
    .table--consents,
    .table--consents tbody,
    .table--consents tr,
    .table--consents th,
    .table--consents td {
        display: block;
        width: 100%;
    }
    .table--consents tr {
        margin: 0 0 .85rem;
        padding: .75rem .85rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        box-shadow: none;
    }
    .table--consents td {
        padding: .25rem 0;
        border: none;
        font-size: .9rem;
    }
    .table--consents__doc { margin-bottom: .15rem; }
    .table--consents__nature { margin-bottom: .35rem; }
    .table--consents__status,
    .table--consents__ver,
    .table--consents__date {
        display: flex;
        flex-wrap: wrap;
        gap: .25rem .5rem;
        align-items: baseline;
    }
    .table--consents__status::before { content: 'Status: '; font-weight: 600; color: var(--muted); }
    .table--consents__ver::before { content: 'Wersja: '; font-weight: 600; color: var(--muted); }
    .table--consents__date::before { content: 'Data: '; font-weight: 600; color: var(--muted); }
    .table--consents__actions {
        margin-top: .55rem;
        padding-top: .55rem;
        border-top: 1px solid var(--border);
    }
    .table--consents__actions .consent-admin-icons {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: .4rem;
    }
    .consent-admin-read__panel {
        position: static;
        width: 100%;
        max-width: none;
        max-height: 14rem;
        margin-top: .5rem;
        box-shadow: none;
    }
    .consent-admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .consent-admin-actions .btn,
    .consent-admin-actions form {
        width: 100%;
    }
    .consent-admin-actions form .btn {
        width: 100%;
    }

    /* Publiczne /consent — bez ściskania i nakładania */
    .layout-public__main {
        padding: 1rem 0 2.5rem;
        align-items: stretch;
    }
    .layout-public .auth-card-wrap {
        padding: .5rem 0 1.25rem;
        align-items: stretch;
    }
    .layout-public .auth-card.consent-card {
        max-width: none;
        width: 100%;
        padding: 1.15rem 1rem;
        border-radius: 10px;
    }
    .consent-card h1 { font-size: 1.2rem; }
    .consent-doc {
        padding: .85rem .9rem;
        margin: 1rem 0;
    }
    .consent-doc__check {
        align-items: flex-start;
    }
    .consent-select-all {
        flex-wrap: wrap;
    }
    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner__ok { width: 100%; }
}

.license-lock {
    position: relative;
}
.license-lock__content {
    filter: blur(7px);
    opacity: .55;
    user-select: none;
    pointer-events: none;
}
.license-lock__overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    padding: 0.75rem 1.25rem 3rem;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--bg) 82%, transparent) 0%,
        color-mix(in srgb, var(--bg) 45%, transparent) 14rem,
        color-mix(in srgb, var(--bg) 35%, transparent) 100%
    );
    pointer-events: auto;
}
.license-lock__card {
    position: sticky;
    top: calc(var(--site-top-height, 7.5rem) + 1.25rem);
    z-index: 21;
    max-width: 26rem;
    width: min(26rem, calc(100% - 1rem));
    margin: 0.75rem auto 2.5rem;
    text-align: center;
    padding: 1.75rem 1.5rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.license-lock__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: .85rem;
    border-radius: 50%;
    background: var(--accent-surface);
    color: var(--cw-primary);
}
.license-lock__title {
    margin: 0 0 .65rem;
    font-size: 1.15rem;
    color: var(--text);
}
.license-lock__text {
    margin: 0 0 1.1rem;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--text-body);
}
.license-lock__text a {
    font-weight: 600;
    white-space: nowrap;
}
.license-lock__actions {
    margin: 0;
}

/* 1.31.0 — dokumenty prawne + banner cookies */
.legal-page {
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}
.legal-page__header { margin-bottom: 1.5rem; }
.legal-page__brand { margin: 0 0 .75rem; font-size: .9rem; }
.legal-page__header h1 {
    margin: 0 0 .5rem;
    font-size: 1.55rem;
    line-height: 1.25;
}
.legal-page__meta { margin: 0; font-size: .92rem; }
.legal-page__body {
    font-size: .95rem;
    line-height: 1.65;
}
.legal-page__body p { margin: 0 0 .9rem; }
.legal-page__body ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal-page__body li { margin-bottom: .35rem; }
.legal-page__body strong { font-weight: 700; }
.legal-page__nav {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: .92rem;
}
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface, #fff);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .08);
}
[data-theme="dark"] .cookie-banner {
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .35);
}
.cookie-banner__inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem 1rem;
}
.cookie-banner__text {
    flex: 1 1 16rem;
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: var(--text-body, var(--text));
}
.cookie-banner__text a { font-weight: 600; }
.cookie-banner__ok { flex: 0 0 auto; white-space: nowrap; }
.footer__sep { opacity: .65; }
.form__textarea { width: 100%; min-height: 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.45; }

/* 1.32.0 — backlog wiele list */
.backlog-lists {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: flex-end;
    margin: 0 0 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 6px);
    background: var(--surface-muted, rgba(0,0,0,.02));
}
.backlog-lists__switch label,
.backlog-lists__create,
.backlog-lists__rename {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .5rem;
    margin: 0;
    font-size: .9rem;
}
.backlog-lists__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    align-items: center;
}
.backlog-lists input[type="text"],
.backlog-lists select {
    min-width: 10rem;
    max-width: 16rem;
}

/* Dashboard — oczekujące RODO + SMS */
.card--ops-chip--consent {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: .55rem;
    text-decoration: none;
    cursor: default;
}
.card--ops-chip__link {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}
.card--ops-chip__link:hover .card--ops-chip__name { color: var(--cw-primary); }
.card--ops-chip__sms { margin: 0; flex-shrink: 0; position: relative; z-index: 2; }
.alert-inline {
    display: inline-block;
    margin-top: .2rem;
    color: #b71c1c;
    font-weight: 600;
}
.icon-btn--disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}
.card--ops-chip--expired {
    border-style: dashed;
}

/* 1.38 — status miesiąca na panelu klienta */
.month-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin: 0 0 1.35rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--cw-primary) 8%, var(--surface)) 0%,
            var(--surface) 55%);
}
.month-status__eyebrow {
    margin: 0 0 .2rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.month-status__title {
    margin: 0 0 .35rem;
    font-size: 1.35rem;
    line-height: 1.2;
}
.month-status__state { margin: 0; font-size: .95rem; }
.month-status__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.month-status--open { border-color: color-mix(in srgb, #2e7d32 35%, var(--border)); }
.month-status--closed,
.month-status--closed_unlocked { border-color: color-mix(in srgb, #c62828 30%, var(--border)); }
.month-status--accepted { border-color: color-mix(in srgb, #2e7d32 45%, var(--border)); }
.month-status--pending_acceptance { border-color: color-mix(in srgb, #ef6c00 40%, var(--border)); }
.month-status--declined { border-color: color-mix(in srgb, #c62828 45%, var(--border)); }

.demo-banner {
    margin: 0 0 1rem;
    padding: .7rem 1rem;
    border: 1px solid color-mix(in srgb, #ef6c00 40%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, #fff3e0 70%, var(--surface));
}
.demo-banner__text {
    margin: 0;
    font-size: .9rem;
    line-height: 1.45;
    color: #e65100;
}

/* 1.38 — banner po deployu (także patche) */
.version-banner {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border: 1px solid color-mix(in srgb, var(--cw-primary) 35%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--cw-primary) 8%, var(--surface));
}
.version-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem 1rem;
}
.version-banner__text {
    margin: 0;
    flex: 1 1 16rem;
    font-size: .9rem;
    line-height: 1.45;
}
.version-banner kbd {
    display: inline-block;
    padding: .05rem .35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    font-size: .78rem;
}

/* 1.38 — publiczne RODO / akceptacja */
.consent-doc__details {
    margin: 0 0 .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}
.consent-doc__details > summary {
    cursor: pointer;
    padding: .55rem .75rem;
    font-weight: 600;
    color: #1565c0;
    list-style: none;
}
.consent-doc__details > summary::-webkit-details-marker { display: none; }
.consent-doc__details > summary::before { content: '▸ '; }
.consent-doc__details[open] > summary::before { content: '▾ '; }
.consent-doc__details .consent-doc__body {
    margin: 0;
    padding: .15rem .85rem .85rem;
    max-height: 18rem;
    overflow: auto;
    border-top: 1px solid var(--border);
}
.consent-card__footnote { font-size: .85rem; }
.consent-sticky-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 1rem -0.25rem 0;
    padding: .75rem .25rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--surface) 70%, transparent);
}
.consent-sticky-bar__progress {
    margin: 0 0 .45rem;
    font-size: .85rem;
    text-align: center;
}
.accept-sticky-bar {
    display: none;
}
@media (max-width: 768px) {
    .month-status {
        flex-direction: column;
        align-items: stretch;
    }
    .month-status__actions .btn { width: 100%; justify-content: center; }
    .consent-page .auth-card.consent-card {
        padding-bottom: 5.5rem;
    }
    .consent-sticky-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
    }
    .accept-page {
        padding-bottom: 5rem;
    }
    .accept-sticky-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 6;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
    }
    .accept-sticky-bar__amount {
        display: flex;
        flex-direction: column;
        gap: .1rem;
        min-width: 0;
    }
    .accept-card__actions .btn--block { display: none; }
}

/* ── Telefon: pasek kciuka + PWA ──────────────────────────────────────── */
.mobile-tabbar,
.pwa-install { display: none; }

@media (max-width: 768px) {
    :root { --mobile-tabbar-h: calc(3.55rem + env(safe-area-inset-bottom, 0px)); --timer-dock-h: 0px; }
    body.has-timer-dock { --timer-dock-h: 3.05rem; }

    body.has-mobile-tabbar {
        padding-bottom: calc(var(--mobile-tabbar-h) + var(--timer-dock-h));
    }
    .header__links .timer-chips,
    .modern-topbar .timer-chips:not(.timer-chips--dock) {
        display: none;
    }
    .timer-chips--dock {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--mobile-tabbar-h);
        z-index: 279;
        padding: .35rem .65rem;
        border-top: 1px solid var(--border);
        background: var(--surface);
        justify-content: center;
    }
    .timer-chips--dock .timer-chip {
        max-width: none;
        flex: 1;
        justify-content: center;
    }
    .timer-chips--dock {
        flex-wrap: nowrap;
        gap: .35rem;
    }
    .timer-chips--dock .timer-chip--sla-start {
        flex: 0 0 auto;
        padding-left: .85rem;
        padding-right: .85rem;
        white-space: nowrap;
    }
    .sla-dash { align-items: stretch; }
    .sla-dash .sla-report {
        flex-direction: column;
        align-items: stretch;
        flex-basis: 100%;
    }
    .sla-dash .sla-report__field,
    .sla-dash .sla-report .btn { width: 100%; flex: none; }
    body.has-mobile-tabbar .nav-toggle { display: none; }
    body.has-mobile-tabbar .nav.nav--open {
        max-height: calc(100dvh - var(--site-top-height, 4rem) - var(--mobile-tabbar-h) - .25rem);
    }
    .scroll-top { display: none !important; }

    #dashboard-layout-edit,
    #dashboard-layout-bar,
    .dashboard-layout-controls,
    .dashboard-layout-tile-controls {
        display: none !important;
    }

    .mobile-tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 280;
        height: auto;
        min-height: 3.55rem;
        padding: .2rem .15rem calc(.2rem + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 20px rgba(1, 15, 33, .08);
        justify-content: space-around;
        align-items: stretch;
        gap: 0;
    }
    .mobile-tabbar__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        min-height: 2.85rem;
        padding: .35rem .2rem;
        border: 0;
        background: none;
        color: var(--muted);
        text-decoration: none;
        font: inherit;
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .01em;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    .mobile-tabbar__item .nav__icon {
        width: 1.35rem;
        height: 1.35rem;
        opacity: .85;
    }
    .mobile-tabbar__item.is-active {
        color: var(--cw-primary);
    }
    .mobile-tabbar__item.is-active .nav__icon { opacity: 1; }

    .pwa-install:not([hidden]) {
        display: flex;
        flex-direction: column;
        gap: .45rem;
        position: fixed;
        left: .65rem;
        right: .65rem;
        bottom: calc(var(--mobile-tabbar-h) + var(--timer-dock-h) + .55rem);
        z-index: 270;
        padding: .75rem .85rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 10px 28px rgba(1, 15, 33, .16);
    }
    .pwa-install__text,
    .pwa-install__hint {
        margin: 0;
        font-size: .85rem;
        line-height: 1.4;
        color: var(--text);
    }
    .pwa-install__hint { color: var(--muted); }
    .pwa-install__actions {
        display: flex;
        gap: .4rem;
        justify-content: flex-end;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px;
    }
    .btn.btn--primary,
    .btn.btn--block {
        min-height: 2.75rem;
    }
}

@media (display-mode: standalone) {
    body {
        overscroll-behavior-y: contain;
    }
}

[data-theme="dark"] .mobile-tabbar {
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .dashboard-month-left--soon { color: #fdba74; }

/* Oferty: karty do 960px, tabela na szerszym ekranie — nigdy obie naraz. */
@media (max-width: 960px) {
    .offers-table-wrap { display: none; }
    .offers-cards { display: block; }
}
@media (min-width: 961px) {
    .offers-cards { display: none; }
    .offers-table-wrap { display: block; }
    .offers-table--main tbody tr:nth-child(even) { background: var(--zebra); }
}
