
    .purchase-order-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
    :root {
      --brand: #f05a28;
      --brand-dark: #c83f13;
      --ink: #20242a;
      --muted: #65707c;
      --line: #dfe4ea;
      --page: #f4f6f8;
      --panel: #ffffff;
      --soft: #fff3ed;
      --ok: #2f7d32;
      --ok-bg: #eaf6e8;
      --info: #244ed8;
      --info-bg: #e9efff;
      --warn: #a06500;
      --warn-bg: #fff5dc;
      --danger: #bf1d1d;
      --danger-bg: #fff0f0;
      --shadow: 0 12px 30px rgba(18, 28, 45, .08);
    }

    * { box-sizing: border-box; }

    html, body { height: 100%; overflow: hidden; }

    body {
      margin: 0;
      font: 13px Arial, Helvetica, sans-serif;
      color: var(--ink);
      background: var(--page);
    }

    button, input, select, textarea { font: inherit; }

    button { cursor: pointer; }

    .hidden { display: none !important; }
    [data-material-section][data-section-collapsed="true"] > :not(.panelhead) { display:none !important; }
    .material-section-toggle { flex-shrink:0; margin-inline-start:auto; }
    .top #title { display:flex; align-items:center; gap:.42em; font-size:clamp(25px, 2vw, 35px); font-weight:850; letter-spacing:-.025em; line-height:1.17; }
    .top:has(#title) { min-height:68px; padding-block:10px; border-bottom:2px solid var(--line, #d9e0e8); }
    .top #title .page-title-icon { font-size:.82em; }
    .material-heading-icon { margin-inline-end:.38em; }
    #nav :is(button,a) { min-width:78px; font-size:12px; font-weight:700; }
    #nav .nav-icon { font-size:23px; }
    [data-material-section] > .panelhead h2,
    [data-material-section] > .panelhead h3 { font-size:clamp(19px, 1.55vw, 24px); font-weight:800; line-height:1.24; }
    .warehouse-page-nav { justify-content:flex-start !important; flex-wrap:wrap; gap:9px; margin-bottom:14px; }
    .warehouse-page-nav .btn { font-size:14px; font-weight:750; min-height:44px; padding:8px 14px; }
    #stockBookingsLink.warehouse-navigation { margin-bottom:8px; }
    [data-material-section] > .panelhead > .material-section-toggle { font-size:13px; font-weight:700; min-height:38px; padding-inline:11px; }
    @media(max-width:600px) {
      .top #title { font-size:23px; gap:.28em; }
      .top:has(#title) { min-height:56px; }
      .warehouse-page-nav .btn { font-size:13px; padding-inline:11px; }
    }
    [data-material-section][data-section-collapsed="true"] > .panelhead p { display:none; }
    [data-material-section][data-section-collapsed="true"]:not([data-material-section="procurement-overview"]) > .panelhead > :not(h2,h3,h4,.badge,.material-section-toggle):not(:has(h2,h3,h4)) { display:none !important; }
    .material-action-icon { display:inline-block; margin-inline-end:.35em; }
    .material-section-toggle:focus-visible { outline:2px solid var(--accent, #e45826); outline-offset:2px; }


    .boot-screen { position:fixed; inset:0; z-index:10000; display:flex; align-items:center; justify-content:center; background:#fff; }
    .boot-content { width:min(360px,calc(100vw - 48px)); text-align:center; color:var(--muted); }
    .boot-content img { width:100%; height:auto; display:block; margin:0 auto 28px; }
    .boot-progress { height:4px; border-radius:99px; background:#f1e6df; overflow:hidden; }
    .boot-progress::after { content:""; display:block; width:40%; height:100%; border-radius:99px; background:var(--brand); animation:boot-slide 1.2s ease-in-out infinite alternate; }
    .boot-progress, .boot-content p { visibility:hidden; animation:boot-status 0s .35s forwards; }
    @keyframes boot-status { to { visibility:visible; } }
    @keyframes boot-slide { from { transform:translateX(-100%); } to { transform:translateX(250%); } }
    @media (prefers-reduced-motion:reduce) { .boot-progress::after { animation:none; width:100%; } }
    .bulk-download-toolbar { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:10px 0; }
    .bulk-select-item { display:flex; align-items:flex-start; gap:8px; min-width:0; }
    .bulk-select-item > input { flex:none; margin:12px 0 0; width:17px; height:17px; accent-color:var(--brand); }
    .bulk-select-item > .chat-image-attachment, .bulk-select-item > .member { flex:1; min-width:0; }

    .login-screen {
      min-height: 100vh;
      display: grid;
      grid-template-columns: minmax(360px, 480px) 1fr;
      background: #111827;
      color: #fff;
    }

    .login-panel {
      background: #fff;
      color: var(--ink);
      padding: 42px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      box-shadow: var(--shadow);
      z-index: 1;
    }

    .brand-mark {
      width: min(330px, 100%);
      height: auto;
      object-fit: contain;
      margin-bottom: 28px;
    }

    .login-panel h1 {
      font-size: 25px;
      line-height: 1.15;
      margin: 0 0 9px;
      letter-spacing: 0;
    }

    .login-panel p {
      color: var(--muted);
      margin: 0 0 24px;
      line-height: 1.45;
    }

    .login-visual {
      padding: 48px;
      display: flex;
      align-items: end;
      background:
        linear-gradient(135deg, rgba(240,90,40,.92), rgba(32,36,42,.88)),
        url("https://images.unsplash.com/photo-1504917595217-d4dc5ebe6122?auto=format&fit=crop&w=1600&q=80");
      background-size: cover;
      background-position: center;
    }

    .login-visual h2 {
      max-width: 700px;
      margin: 0;
      font-size: 42px;
      line-height: 1.05;
      letter-spacing: 0;
    }

    .field { margin-bottom: 12px; }

    .field label {
      display: block;
      color: #56606b;
      font-size: 11px;
      font-weight: 700;
      margin-bottom: 5px;
      text-transform: uppercase;
      letter-spacing: .02em;
    }

    .field input, .field select, .field textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 10px;
      background: #fff;
      color: var(--ink);
    }

    .field textarea {
      resize: vertical;
      min-height: 72px;
    }

    .login-help {
      background: #f7f8fa;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 10px;
      margin-top: 14px;
      color: #4f5964;
      line-height: 1.45;
    }

    .error {
      min-height: 18px;
      color: var(--danger);
      margin: 8px 0 0;
      font-weight: 700;
    }

    .app {
      display: grid;
      grid-template-columns: 78px 1fr;
      height: 100vh;
      height: 100dvh;
    }

    .rail {
      background: #fff;
      border-right: 1px solid var(--line);
      padding-top: 14px;
      overflow-y: auto;
    }

    .logo {
      width: 64px;
      height: 44px;
      object-fit: contain;
      margin: 0 auto 12px;
    }

    .nav {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .nav :is(button, a) {
      text-align: center;
      font-family: inherit;
      cursor: pointer;
      box-sizing: border-box;
      position: relative;
      border: 0;
      background: transparent;
      padding: 11px 4px;
      color: #6d7580;
      font-size: 10px;
      min-height: 58px;
    }

    .nav-notification-badge {
      position: absolute;
      top: 5px;
      right: 7px;
      display: grid;
      place-items: center;
      min-width: 18px;
      height: 18px;
      padding: 0 4px;
      border: 2px solid #fff;
      border-radius: 999px;
      background: #c91f18;
      color: #fff;
      font-size: 10px;
      font-weight: 800;
      line-height: 1;
      box-sizing: border-box;
    }

    .nav :is(button, a) .nav-icon {
      display: block;
      font-size: 18px;
      font-weight: 800;
      margin-bottom: 5px;
    }

    .nav :is(button, a).active {
      color: var(--brand);
      background: var(--soft);
      border-left: 3px solid var(--brand);
    }

    main { min-width: 0; min-height: 0; overflow: hidden; }

    .top {
      height: 58px;
      background: #fff;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 18px;
    }

    .top h2 {
      font-size: 17px;
      margin: 0;
      white-space: nowrap;
    }

    .spacer { flex: 1; }

    .user-pill {
      border: 1px solid var(--line);
      background: #fff;
      border-radius: 999px;
      padding: 7px 10px;
      color: #4d5661;
      white-space: nowrap;
    }
    .mention-notifications { position:relative; }
    .mention-notifications > button[hidden], .mention-notification-panel[hidden] { display:none; }
    .mention-notification-panel { position:absolute; z-index:80; top:calc(100% + 7px); right:0; width:min(390px,calc(100vw - 24px)); max-height:390px; overflow:auto; padding:8px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 12px 30px #0003; }
    .mention-notification-panel > strong { display:block; padding:5px 7px 9px; }
    .mention-notification-panel button { display:block; width:100%; padding:9px; border:0; border-top:1px solid var(--line); background:#fff; text-align:left; cursor:pointer; }
    .mention-notification-panel button:hover { background:#fff3ed; }
    .mention-notification-panel small { display:block; margin-top:3px; color:var(--muted); }

    .btn {
      border: 1px solid var(--line);
      background: #fff;
      color: var(--ink);
      border-radius: 6px;
      padding: 8px 11px;
      min-height: 34px;
    }

    .btn.primary {
      background: var(--brand);
      border-color: var(--brand);
      color: #fff;
    }

    .btn.danger {
      color: var(--danger);
      border-color: #efc7c7;
      background: #fffafa;
    }

    .page {
      height: calc(100vh - 58px);
      height: calc(100dvh - 58px);
      overflow: auto;
      min-height: 0;
      overscroll-behavior: contain;
      padding: 14px 14px max(88px, calc(env(safe-area-inset-bottom) + 72px));
      scroll-padding-bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
      scrollbar-gutter: stable;
      box-sizing: border-box;
    }

    .view { min-width: 0; box-sizing: border-box; }
    html:has(#accounting:not(.hidden)), body:has(#accounting:not(.hidden)), #page:has(#accounting:not(.hidden)) { overflow-x:hidden; }
    #accounting, #accounting .panel, #accounting .table-wrap { min-width:0; max-width:100%; }
    #profile > .panel, #profile > .personal-workspace { margin-bottom: 16px; }
    .admin-settings-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:14px; align-items:start; }
    .admin-settings-nav { position:sticky; top:0; display:grid; gap:4px; padding:6px; border:1px solid var(--line); border-radius:7px; background:#fff; }
    .admin-settings-nav button { display:flex; align-items:center; gap:9px; width:100%; min-height:40px; padding:8px 10px; border:0; border-left:3px solid transparent; border-radius:4px; background:transparent; color:var(--ink); text-align:left; cursor:pointer; }
    .admin-settings-nav button:hover { background:#f5f7f9; }
    .admin-settings-nav button.active { border-left-color:var(--brand); background:#fff2ec; color:#a92d12; font-weight:700; }
    .admin-settings-nav .admin-nav-spacer { height:12px; }
    .admin-settings-content { min-width:0; }
    .admin-settings-content > .panel, .admin-settings-content > details.panel { margin:0; }
    .admin-settings-content > .panel[hidden], .admin-settings-content > details.panel[hidden] { display:none; }
    .admin-employee-rate-table .field { margin:0; }
    .admin-employee-rate-table .field input { width:100%; max-width:10rem; }
    .admin-employee-rate-table th[scope="rowgroup"] { background:var(--bg); color:var(--ink); }
    .admin-employee-rate-table th[scope="row"] { color:var(--ink); font-size:13px; letter-spacing:normal; text-transform:none; white-space:normal; }
    .admin-settings-content > .admin-backup-section .table-wrap {
      max-height: clamp(320px, 52dvh, 560px);
      overflow: auto;
      overscroll-behavior: contain;
    }
    .admin-settings-content > .admin-backup-section .table th {
      position: sticky;
      top: 0;
      z-index: 2;
      background: #f4f6f7;
    }
    .admin-status-list { display:grid; gap:6px; margin-top:12px; }
    .admin-status-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:#fafbfc; }
    .admin-status-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
    .admin-status-delete { width:34px; height:34px; padding:7px !important; display:inline-flex; align-items:center; justify-content:center; flex:0 0 34px; }
    .admin-status-row small { display:block; margin-top:2px; color:var(--muted); }
    .admin-status-order { display:flex; gap:4px; }
    .admin-status-order .btn { width:34px; padding:6px; }
    .admin-status-drag { display:flex; align-items:center; gap:8px; min-width:0; }
    .admin-status-drag-handle { flex:none; min-width:32px; height:34px; cursor:grab; touch-action:none; user-select:none; }
    .admin-status-drag-handle:active { cursor:grabbing; }
    .admin-status-row.is-dragging { opacity:.55; }
    .admin-status-row.drop-before { box-shadow:0 -2px 0 var(--brand); }
    .admin-status-row.drop-after { box-shadow:0 2px 0 var(--brand); }
    .admin-module-editor { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:7px; }
    .admin-module-option { display:flex; align-items:center; gap:8px; min-height:36px; padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:#fafbfc; font-size:12px; }
    .admin-module-option input { margin:0; }
    .admin-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
    .admin-role-card { border:1px solid var(--line); border-radius:10px; padding:14px; background:#fff; }
    .admin-role-card h4 { margin:0 0 5px; }
    .admin-role-card .admin-module-editor { grid-template-columns:repeat(2,minmax(0,1fr)); margin-top:12px; }
    .project-search-wrap { position:relative; }
    #projectSearch::-webkit-search-cancel-button { -webkit-appearance:none; display:none; }
    .project-search-wrap .search { width:100%; padding-right:38px; }
    .project-search-clear { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:28px; height:28px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:20px; cursor:pointer; }
    .project-search-clear:hover { background:var(--soft); color:var(--brand); }
    .tsp-project-results { display:grid; gap:4px; max-height:220px; overflow:auto; margin-top:6px; }
    .tsp-project-results button { width:100%; text-align:left; padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:#fff; cursor:pointer; }
    .tsp-project-results button:hover, .tsp-project-results button[aria-selected="true"] { border-color:var(--brand); background:var(--soft); }
    .admin-group-list { display:grid; gap:10px; margin-top:14px; }
    .admin-group-card { border:1px solid var(--line); border-radius:10px; background:#fff; overflow:hidden; }
    .admin-group-head { display:flex; align-items:center; gap:10px; padding:10px 12px; }
    .admin-group-toggle { display:flex; align-items:center; gap:12px; flex:1; min-width:0; border:0; background:transparent; text-align:left; color:var(--ink); padding:4px; }
    .admin-group-toggle span:nth-child(2) { min-width:0; }
    .admin-group-toggle small { display:block; color:var(--muted); margin-top:3px; }
    .admin-group-toggle .chevron { color:var(--brand); width:16px; text-align:center; }
    .admin-group-actions { display:flex; gap:7px; flex-wrap:wrap; }
    .admin-group-members { border-top:1px solid var(--line); padding:4px 12px 10px; background:#fffaf7; }
    .admin-group-member { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 4px; border-bottom:1px solid var(--line); }
    .admin-group-member:last-child { border-bottom:0; }
    .admin-group-member small { display:block; color:var(--muted); margin-top:2px; }
    @media (max-width:900px) { .admin-role-grid { grid-template-columns:1fr; } }
    @media (max-width:600px) { .admin-group-head,.admin-group-member { align-items:flex-start; flex-direction:column; } .admin-group-actions { margin-left:28px; } }
    .admin-profile-list { display:grid; gap:6px; max-width:1380px; margin-top:10px; }
    .admin-profile-row { display:grid; grid-template-columns:minmax(210px,1.5fr) minmax(145px,1fr) 110px minmax(370px,auto); gap:12px; align-items:center; min-height:54px; padding:8px 12px; border:1px solid var(--line); border-radius:6px; background:#fff; }
    .admin-profile-row > div { min-width:0; }
    .admin-profile-row > div:first-child { overflow-wrap:anywhere; }
    .admin-profile-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:6px; }
    .admin-profile-actions .btn { width:auto; min-width:82px; white-space:nowrap; }
    .admin-profile-row small { display:block; margin-top:2px; color:var(--muted); }
    .admin-finance-table { max-height:min(70dvh,720px); overflow:auto; overscroll-behavior:contain; }
    .admin-finance-table thead th { position:sticky; top:0; z-index:2; background:#f4f6f7; box-shadow:0 1px 0 var(--line); }
    .admin-responsibility-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
    .admin-responsibility-card { min-width:0; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fafbfc; }
    .admin-responsibility-card h4 { margin:0 0 6px; }
    .admin-responsibility-people { display:grid; gap:5px; max-height:430px; overflow:auto; margin-top:12px; }
    .admin-responsibility-person { display:flex; align-items:center; gap:9px; min-height:47px; padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:#fff; cursor:pointer; }
    .admin-responsibility-person:has(input:disabled) { opacity:.6; cursor:not-allowed; }
    .admin-responsibility-person input { flex:none; margin:0; }
    .admin-responsibility-person span { min-width:0; overflow-wrap:anywhere; }
    .admin-responsibility-person small { display:block; margin-top:2px; color:var(--muted); }
    .tabs.admin-template-tabs { margin:0; padding:0 12px; }
    .admin-template-panel[hidden] { display:none; }
    .admin-config-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
    .admin-config-tabs .btn.active { background:var(--brand); border-color:var(--brand); color:#fff; }
    .admin-config-grid { display:grid; grid-template-columns:minmax(320px,.9fr) minmax(420px,1.4fr); gap:16px; align-items:start; }
    .admin-config-list { display:grid; gap:6px; max-height:640px; overflow:auto; }
    .admin-config-list button { display:block; width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:6px; background:#fff; text-align:left; cursor:pointer; }
    .admin-config-list button.active { border-color:var(--brand); background:#fff2ec; }
    .admin-config-list button small { display:block; margin-top:3px; color:var(--muted); }
    .admin-email-editor textarea { min-height:300px; font-family:Consolas,"Courier New",monospace; font-size:12px; }
    .admin-email-preview { width:100%; min-height:420px; border:1px solid var(--line); border-radius:6px; background:#fff; }
    .admin-template-images { display:grid; gap:6px; margin-top:8px; }
    .admin-template-image { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:#fafbfc; }
    .admin-template-image code { display:block; margin-top:3px; overflow-wrap:anywhere; color:var(--muted); font-size:11px; }
    .admin-visibility-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; max-height:220px; overflow:auto; }
    .admin-visibility-groups label { display:flex; gap:8px; align-items:flex-start; padding:8px; border:1px solid var(--line); border-radius:6px; background:#fff; }
    .admin-template-panel > .panel { margin:0; border:0; }
    .profile-name-wrap { position:relative; }
    .profile-name-wrap input { padding-right:42px; background:#f6f7f8; cursor:not-allowed; }
    .profile-name-lock { position:absolute; top:50%; right:12px; transform:translateY(-50%); font-size:17px; pointer-events:none; }
    .external-account-note { padding:9px 10px; border-left:3px solid var(--brand); background:#fff7f3; color:#71351f; }
    .admin-access-list { display:grid; gap:6px; }
    .admin-access-row { display:grid; grid-template-columns:minmax(230px,1.4fr) minmax(220px,1fr) minmax(300px,1.2fr); align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:#fff; }
    .admin-access-row p { margin:2px 0 0; color:var(--muted); font-size:11px; }
    .admin-access-row .skill-list { margin:0; }
    .admin-access-add { display:grid; grid-template-columns:minmax(150px,1fr) auto; gap:6px; }
    .admin-access-add select, .admin-access-add .btn { min-height:32px; }
    @media (max-width:1100px) { .admin-module-editor { grid-template-columns:repeat(3,minmax(140px,1fr)); } .admin-access-row { grid-template-columns:1fr 1fr; } .admin-access-add { grid-column:1/-1; } }
    @media (max-width:980px) { .admin-profile-row { grid-template-columns:minmax(0,1fr) auto; } .admin-profile-actions { grid-column:1/-1; justify-content:flex-start; } }
    @media (max-width:900px) { .admin-responsibility-grid,.admin-config-grid { grid-template-columns:1fr; } }
    @media (max-width:700px) { .admin-settings-layout { grid-template-columns:1fr; } .admin-settings-nav { position:static; grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-settings-nav .admin-nav-spacer { display:none; } .admin-module-editor { grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-access-row, .admin-profile-row { grid-template-columns:1fr; } .admin-profile-actions { justify-content:flex-start; flex-wrap:wrap; } .admin-access-add { grid-column:auto; } .admin-status-row { grid-template-columns:1fr auto; } .admin-status-actions { grid-column:1/-1; } }

    .cards {
      display: grid;
      grid-template-columns: repeat(4, minmax(170px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 13px;
    }

    .card small {
      display: block;
      color: var(--muted);
    }

    .card strong {
      display: block;
      font-size: 21px;
      margin-top: 8px;
    }
    #vacation .vacation-panel-head { padding:10px 14px; gap:10px; }
    #vacation .vacation-panel-head h3 { margin:0 0 2px; }
    #vacation .vacation-summary { grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:0; padding:10px 14px; border-bottom:1px solid var(--line); }
    #vacation .vacation-summary .card { min-width:0; padding:9px 12px; }
    #vacation .vacation-summary .card strong { font-size:18px; margin-top:4px; }
    #vacation .vacation-summary .card p { margin:3px 0 0; font-size:10px; color:var(--muted); }
    #vacation .vacation-carryover { padding:6px 14px; border-bottom:1px solid var(--line); font-size:11px; }
    #vacation .vacation-carryover[hidden] { display:none; }
    #vacation .vacation-toolbar { display:flex; align-items:end; gap:10px; padding:10px 14px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
    #vacation .vacation-filter-grid { display:grid; grid-template-columns:minmax(180px,1.5fr) repeat(2,minmax(135px,1fr)); gap:8px; flex:1 1 590px; min-width:0; }
    #vacation .vacation-filter-grid .field { min-width:0; margin:0; }
    #vacation .vacation-filter-grid .field input, #vacation .vacation-filter-grid .field select { width:100%; }
    #vacation .vacation-toolbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
    #vacation .vacation-toolbar-actions #vacationResultCount { margin-right:4px; white-space:nowrap; }
    #vacation .vacation-toolbar-actions .btn { white-space:nowrap; }
    #vacation .table th, #vacation .table td { padding:7px 9px; }
    @media(max-width:1100px) { #vacation .vacation-toolbar-actions { justify-content:flex-start; } }
    @media(max-width:700px) { #vacation .vacation-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } #vacation .vacation-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); flex-basis:100%; } #vacation .vacation-filter-grid .field:first-child { grid-column:1/-1; } }
    @media(max-width:480px) { #vacation .vacation-panel-head { align-items:flex-start; flex-wrap:wrap; } #vacation .vacation-panel-head .spacer { display:none; } #vacation .vacation-summary .card { padding:8px; } #vacation .vacation-summary .card strong { font-size:16px; } #vacation .vacation-toolbar-actions { width:100%; } }
    .accounting-tabs { position:sticky; top:0; z-index:30; display:flex; gap:6px; flex-wrap:wrap; padding:8px; margin:0 0 10px; border:1px solid var(--line); border-radius:9px; background:#fff; box-shadow:0 6px 18px rgba(18,28,45,.06); }
    .accounting-tab { border:1px solid transparent; border-radius:6px; background:transparent; color:var(--muted); padding:8px 12px; font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
    .accounting-tab:hover { background:#f5f6f8; color:var(--ink); }
    .accounting-tab[aria-selected="true"] { background:#fff1ea; border-color:#ffc9b6; color:#b63b17; }
    .accounting-tab-count { display:inline-block; margin-left:5px; padding:1px 6px; border-radius:20px; background:#eef1f5; color:#4c5a69; font-size:11px; }
    .accounting-tab-count.alert { min-width:18px; background:#d92d20; color:#fff; font-weight:800; text-align:center; }
    .accounting-focus-row { outline:2px solid #f4511e; outline-offset:-2px; background:#fff4ee !important; }
    .accounting-tab-pane { display:grid; gap:10px; }
    .accounting-tab-pane[hidden] { display:none; }
    .accounting-tab-pane > .panel { margin:0; min-width:0; }
    .accounting-report-panel { margin:8px 12px; border:1px solid var(--line); border-radius:8px; background:#f8fafc; }
    .accounting-report-panel summary { list-style:none; display:flex; align-items:center; gap:7px; padding:9px 11px; cursor:pointer; font-size:12px; font-weight:700; color:#334155; }
    .accounting-report-panel summary::-webkit-details-marker { display:none; }
    .accounting-report-panel summary::before { content:"▤"; color:var(--orange); font-size:16px; }
    .accounting-report-panel summary::after { content:"⌄"; margin-left:auto; color:#64748b; }
    .accounting-report-panel[open] summary::after { content:"⌃"; }
    .accounting-report-fields { display:flex; flex-wrap:wrap; align-items:end; gap:7px; padding:0 11px 10px; }
    .accounting-report-fields .field { min-width:150px; flex:0 1 180px; margin:0; }
    .accounting-report-fields .field.customer { flex-basis:220px; }
    .accounting-party-field { position:relative; }
    .accounting-party-suggestions { display:none; position:absolute; z-index:20; top:100%; left:0; right:0; margin-top:4px; max-height:210px; overflow:auto; padding:4px; border:1px solid #e9ddd7; border-radius:7px; background:#fff; box-shadow:0 10px 24px rgba(25,35,50,.13); }
    .accounting-party-field:focus-within .accounting-party-suggestions { display:block; }
    .accounting-party-suggestions button { display:block; width:100%; padding:8px 9px; border:0; border-radius:4px; background:transparent; color:var(--ink); text-align:left; font-size:12px; }
    .accounting-party-suggestions button:hover,.accounting-party-suggestions button:focus-visible { background:#fff3ed; color:var(--brand-dark); outline:0; }
    .accounting-party-suggestions small { display:block; padding:8px 9px; color:var(--muted); }
    .accounting-report-fields label { font-size:10px; margin-bottom:3px; }
    .accounting-report-fields input,.accounting-report-fields select { box-sizing:border-box; width:100%; height:34px; padding:5px 7px; font-size:12px; }
    .accounting-report-fields .btn { box-sizing:border-box; height:34px; padding:5px 9px; white-space:nowrap; }
    .accounting-report-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
    .cash-opening-row { background:#f8fafc; }
    .cash-opening-row td { border-top:2px solid #cbd5e1; }
    .accounting-focus-row { outline:2px solid #ea580c; outline-offset:-2px; }
    .accounting-critical-card { border-color:#fecaca; background:#fff1f2; }
    .accounting-critical-card small,.accounting-critical-card strong,.accounting-critical-card p { color:#991b1b; }
    #dashboard .dashboard-task.overdue { padding:8px 10px; border:1px solid #fecaca; border-radius:7px; background:#fff1f2; }
    .accounting-summary { grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; }
    .accounting-summary .card { padding:10px 12px; min-width:0; }
    .accounting-summary .card strong { font-size:18px; margin-top:4px; overflow-wrap:anywhere; }
    .accounting-summary .card p { margin:3px 0 0; font-size:11px; color:var(--muted); }
    @media(max-width:850px) { .accounting-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media(max-width:520px) { .accounting-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .accounting-tab { text-align:left; padding:8px; } }
    #dashboard .dashboard-metrics { gap:7px; margin-bottom:10px; }
    #dashboard .dashboard-metrics .card { min-width:0; padding:9px 10px; text-align:left; }
    #dashboard .dashboard-metrics .card strong { margin-top:4px; font-size:17px; overflow-wrap:anywhere; }
    #dashboard .dashboard-metrics .card p { margin:3px 0 0; color:var(--muted); font-size:11px; line-height:1.3; }
    #dashboard .dashboard-day .dashboard-metrics { margin:0; padding:10px; }
    #dashboard .dashboard-day .panelhead h2 { margin:0; font-size:17px; }
    #dashboard .dashboard-day .panelhead p { margin:3px 0 0; }
    #dashboard .dashboard-panels { gap:10px; }
    #dashboard .dashboard-panels .panel { margin-bottom:10px; }
    #dashboard .dashboard-panels .panelhead { min-height:40px; padding:7px 10px; }
    #dashboard .dashboard-panels .panelhead .btn { min-height:29px; padding:5px 8px; font-size:12px; }
    #dashboard .dashboard-panels .panelbody { padding:9px 10px; }
    #dashboard .dashboard-panels .panelbody p { margin:4px 0 8px; }
    #dashboard .dashboard-panels .member { padding:5px 0; }
    #dashboard .dashboard-panels .table th, #dashboard .dashboard-panels .table td { padding:6px 8px; }
    #dashboard .dashboard-modules summary { min-height:40px; padding:7px 10px; cursor:pointer; list-style:none; font-weight:700; }
    #dashboard .dashboard-modules summary::-webkit-details-marker { display:none; }
    #dashboard .dashboard-modules summary::before { content:"▸"; margin-right:8px; }
    #dashboard .dashboard-modules[open] summary::before { content:"▾"; }
    #dashboard .dashboard-modules .module-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:7px; padding:10px; }
    #dashboard .dashboard-modules .module-tile { padding:8px; }
    #dashboard .dashboard-modules .module-tile h4 { margin-bottom:4px; font-size:12px; }
    #dashboard .dashboard-modules .module-tile p { font-size:11px; }
    @media (max-width:1000px) { #dashboard .dashboard-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media (max-width:600px) { #dashboard .dashboard-metrics { grid-template-columns:1fr; } }
    #dashboard, #dashboardPerformancePanel { width:100%; max-width:100%; min-width:0; box-sizing:border-box; }
    #dashboardPerformanceDisclosure { margin-bottom:16px; }
    #dashboardPerformanceDisclosure > summary { cursor:pointer; padding:14px 18px; font-size:16px; font-weight:700; }
    #dashboardPerformanceDisclosure[open] > summary { border-bottom:1px solid var(--line); }
    #dashboardPerformancePanel > .panelhead { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
    #dashboardPerformancePanel > .panelhead > div:first-child { min-width:220px; flex:1 1 320px; }
    #dashboardPerformancePanel .dashboard-performance-table { width:100%; max-width:100%; min-width:0; overflow:hidden; }
    #dashboardPerformancePanel .dashboard-performance-table table { width:100%; min-width:0; table-layout:fixed; }
    #dashboardPerformancePanel .dashboard-performance-table th,
    #dashboardPerformancePanel .dashboard-performance-table td { box-sizing:border-box; min-width:0; padding:7px 6px; white-space:normal; overflow-wrap:anywhere; word-break:normal; vertical-align:top; }
    #dashboardPerformancePanel .dashboard-performance-table th { font-size:10px; line-height:1.3; white-space:normal; }
    #dashboardPerformancePanel .dashboard-performance-table td { font-size:11px; line-height:1.45; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(1) { width:10%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(2) { width:23%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(3) { width:17%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(4) { width:8%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(5) { width:7%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(6) { width:7%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(7) { width:10%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(8) { width:13%; }
    #dashboardPerformancePanel .dashboard-performance-table th:nth-child(9) { width:5%; }
    #dashboardPerformancePanel .dashboard-performance-table input,
    #dashboardPerformancePanel .dashboard-performance-table select,
    #dashboardPerformancePanel .dashboard-performance-table .btn { box-sizing:border-box; width:100% !important; max-width:100%; min-width:0 !important; }
    #dashboardPerformancePanel .dashboard-performance-table .link-button { max-width:100%; text-align:left; white-space:normal; overflow-wrap:anywhere; }
    #dashboardPerformancePanel .dashboard-performance-table .btn { padding:5px 3px; font-size:11px; white-space:normal; }
    #dashboardPerformancePanel .dashboard-performance-table [data-performance-hide] { margin-top:4px; }
    .dashboard-performance-pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:12px 14px; border-top:1px solid var(--line); font-size:12px; }
    .dashboard-performance-pagination > div { display:flex; gap:6px; }
    @media (max-width:1300px) {
      #dashboardPerformancePanel .dashboard-performance-table table,
      #dashboardPerformancePanel .dashboard-performance-table thead,
      #dashboardPerformancePanel .dashboard-performance-table tbody { display:block; }
      #dashboardPerformancePanel .dashboard-performance-table thead > tr:first-child { display:none; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(165px,1fr)); gap:8px; padding:12px; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th { display:block; width:auto; padding:0; border:0; text-align:left; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:last-child { display:none; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th::before { display:block; margin-bottom:3px; color:var(--muted); font-size:10px; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(1)::before { content:"Abschlussdatum"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(2)::before { content:"Projekt"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(3)::before { content:"Monteur"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(4)::before { content:"Arbeitsschritte"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(5)::before { content:"Offen"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(6)::before { content:"Erledigt"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(7)::before { content:"Nicht durchführbar"; }
      #dashboardPerformancePanel .dashboard-performance-table .performance-column-filters th:nth-child(8)::before { content:"Rückmeldung"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:10px; }
      #dashboardPerformancePanel .dashboard-performance-table tbody tr { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0 8px; min-width:0; border:1px solid var(--line); border-radius:8px; padding:8px; background:#fff; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td { display:block; width:auto; border:0; padding:5px 2px; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td::before { display:block; margin-bottom:2px; font-size:10px; font-weight:600; color:var(--muted); }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(1) { grid-column:span 2; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(1)::before { content:"Geplanter Abschluss"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(2) { grid-column:1/-1; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(2)::before { content:"Projekt"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(3) { grid-column:span 2; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(3)::before { content:"Monteure"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(4)::before { content:"Schritte"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(5)::before { content:"Offen"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(6)::before { content:"Erledigt"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(7)::before { content:"Nicht durchführbar"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(8) { grid-column:span 3; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(8)::before { content:"Rückmeldung"; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(9) { align-self:end; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td:nth-child(9) .btn { min-width:70px !important; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td[colspan] { grid-column:1/-1; }
      #dashboardPerformancePanel .dashboard-performance-table tbody td[colspan]::before { display:none; }
    }
    @media (max-width:760px) {
      #dashboardPerformancePanel .dashboard-performance-table tbody { grid-template-columns:1fr; }
      #dashboardPerformancePanel .cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
    }
    @media (max-width:520px) {
      #dashboardPerformancePanel .cards { grid-template-columns:1fr; }
      #dashboardPerformancePanel > .panelhead > div:first-child { flex-basis:100%; }
    }
    .warehouse-main-card { width:100%; text-align:left; cursor:pointer; padding:18px; margin-bottom:12px; }
    .warehouse-main-card strong { font-size:26px; }
    .warehouse-vehicle-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:8px; }
    .warehouse-vehicle-card { text-align:left; cursor:pointer; padding:10px 12px; min-height:0; }
    .warehouse-vehicle-card strong { font-size:17px; margin-top:3px; }
    .warehouse-vehicle-card span { font-size:13px; color:var(--muted); }
    .warehouse-vehicles { margin-top:6px; }
    .warehouse-vehicles summary { cursor:pointer; color:var(--muted); font-weight:600; }

    .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 7px;
      overflow: hidden;
      margin-bottom: 14px;
    }

    .panelhead {
      min-height: 49px;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
    }

    .panelhead h3 {
      margin: 0;
      font-size: 14px;
    }
    .panel-toggle { appearance:none; border:0; background:transparent; padding:5px 0; margin:-5px 0; font-weight:700; text-align:left; color:inherit; width:100%; }
    .panel-toggle span { display:inline-block; width:18px; }
    .panel-toggle:hover, .panel-toggle:focus-visible { color:var(--brand-dark); outline:0; }

    .panelbody { padding: 12px; }

    .table-wrap { overflow-x: auto; }

    .table {
      width: 100%;
      border-collapse: collapse;
    }

    .table th, .table td {
      padding: 9px 10px;
      border-bottom: 1px solid #edf0f2;
      text-align: left;
      white-space: nowrap;
      vertical-align: middle;
    }

    .table th {
      background: #fff;
      color: #58616d;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .02em;
    }
    .table thead th { border-bottom-color:#eaded8; }
    .table tfoot th { background:#fff8f4; border-top:1px solid #f2dfd5; }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table thead th {
      background: #fff;
      border-bottom: 1px solid #eaded8;
    }
    #accounting-pane-incoming .accounting-book .table { table-layout:fixed; min-width:0; width:100%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(1) { width:14%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(2) { width:5%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(3) { width:9%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(4) { width:7%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(5) { width:7%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(6) { width:7%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(7) { width:7%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(8) { width:12%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(9) { width:7%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(10) { width:17%; }
    #accounting-pane-incoming .accounting-book .table th:nth-child(11) { width:8%; }
    #accounting-pane-incoming .accounting-book .table th, #accounting-pane-incoming .accounting-book .table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; padding:10px 8px; }
    #accounting-pane-incoming .accounting-book .table td:last-child { white-space:normal; }
    #accounting-pane-incoming [data-incoming-approve], #accounting-pane-incoming [data-incoming-book] { display:block; width:100%; white-space:normal; margin-bottom:5px; }
    #accounting-pane-incoming [data-incoming-reject] { display:block; width:100%; margin-bottom:5px; white-space:normal; }
    .incoming-invoice-comment { margin:8px 0; padding:6px; border-left:3px solid #ff5825; background:#fff8f4; white-space:pre-wrap; overflow-wrap:anywhere; }
    #accounting-pane-incoming .accounting-book .table-wrap { max-width:100%; overflow-x:auto; }
    #accounting-pane-incoming .accounting-book .table td:last-child, #accounting-pane-incoming .accounting-book .table th:last-child { position:sticky; right:0; background:#fff; z-index:2; box-shadow:-2px 0 4px #0000000a; }
    #accounting-pane-incoming .accounting-book .table .badge { max-width:100%; white-space:normal; box-sizing:border-box; }
    #accounting-pane-incoming .accounting-book .table button { max-width:100%; box-sizing:border-box; }
    .incoming-comment-label { display:block; margin:8px 0 4px; font-size:11px; }
    .incoming-comment-label textarea { display:block; width:100%; min-width:0; resize:vertical; box-sizing:border-box; }
    .incoming-workflow-tabs { display:flex; flex-wrap:wrap; gap:10px; padding:12px 12px 0; }
    .incoming-workflow-tabs .btn { flex:1 1 230px; min-height:48px; white-space:normal; }
    #accounting-pane-incoming .accounting-book .table td:last-child .icon-file-action { margin:1px; }
    #accounting-pane-incoming .accounting-book .icon-file-action[data-book-payment]:not(:disabled),
    #accounting-pane-incoming .incoming-payment-done { color:#19803b; background:#e8f6eb; border-color:#a7dcb5; }
    #accounting-pane-incoming .incoming-payment-done { display:inline-grid; place-items:center; width:30px; height:30px; min-width:30px; border:1px solid #a7dcb5; border-radius:6px; vertical-align:middle; }
    #accounting-pane-incoming .incoming-payment-done svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; }
    #accounting-pane-incoming .incoming-supplier-name { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; overflow-wrap:anywhere; line-height:1.35; max-width:100%; }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table tfoot th {
      background: #fff8f4;
      border-top: 1px solid #f2dfd5;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table tbody tr:hover:not(.accounting-focus-row) {
      background: #fffaf7;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .accounting-report-panel {
      background: #fff;
      border-color: #e9ddd7;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .accounting-report-panel summary:hover {
      background: #fff8f4;
    }
    .link-button {
      appearance: none;
      display: inline;
      max-width: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      color: #344b62;
      font: inherit;
      line-height: 1.35;
      text-align: left;
      text-decoration: underline;
      text-decoration-color: transparent;
      text-underline-offset: 3px;
      cursor: pointer;
    }
    .link-button:is([data-material-ref],[data-material-project-ref]) {
      text-decoration-color: currentColor;
    }
    .link-button:hover {
      color: var(--brand-dark);
      text-decoration-color: currentColor;
    }
    .link-button:focus-visible {
      outline: 2px solid var(--brand);
      outline-offset: 3px;
      border-radius: 2px;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table thead .link-button {
      color: inherit;
      font-size: inherit;
      font-weight: 700;
      text-transform: inherit;
      letter-spacing: inherit;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table thead .link-button::after {
      content: " ↕";
      color: #9aa4af;
      font-size: 11px;
    }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book .table thead .link-button:hover {
      color: var(--brand-dark);
      text-decoration-color: currentColor;
    }

    .money { text-align: right !important; }

    .search {
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px;
      width: min(290px, 100%);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 11px;
      background: #eef1f4;
      color: #4d5661;
      white-space: nowrap;
    }

    .badge.green { background: var(--ok-bg); color: var(--ok); }
    .badge.blue { background: var(--info-bg); color: var(--info); }
    .badge.amber { background: var(--warn-bg); color: var(--warn); }
    .badge.red { background: var(--danger-bg); color: var(--danger); }

    .two {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
      gap: 12px;
    }

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

    .grid3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .module-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 10px;
    }

    .module-tile {
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 12px;
      background: #fff;
    }

    .module-tile h4 {
      margin: 0 0 7px;
      font-size: 14px;
    }

    .module-tile p {
      margin: 0;
      color: var(--muted);
      line-height: 1.35;
    }

    .projectlink {
      color: var(--info);
      cursor: pointer;
      font-weight: 700;
    }

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

    .planner {
      display: grid;
      grid-template-columns: 190px repeat(var(--planner-days, 7), minmax(var(--planner-column-width, 120px), 1fr));
      min-width: var(--planner-min-width, 1030px);
    }

    .planner.month-view .cell { min-height: 38px; padding: 3px; }
    .planner.month-view .headcell { height: 54px; padding-top: 7px; }
    .planner.month-view .name { padding: 10px 8px; }
    .planner .today-column { background: #fff7f2; }
    .planner .weekend-column { background: #fafbfc; }

    .planner-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .calendar-nav, .calendar-view-switch {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .calendar-nav .icon-btn {
      width: 34px;
      min-width: 34px;
      padding: 7px 0;
      font-size: 18px;
      line-height: 1;
    }

    .calendar-view-switch {
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #f5f6f7;
    }

    .calendar-view-switch button { border: 0; background: transparent; padding: 6px 10px; border-radius: 4px; }
    .calendar-view-switch button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px #20242a20; font-weight: 700; }
    .planner-period-title { margin: 0 4px; font-size: 15px; }

    .cell {
      min-height: 46px;
      border-right: 1px solid #d9dee3;
      border-bottom: 1px solid #d9dee3;
      background: #fff;
      padding: 5px;
    }

    .cell[data-employee] {
      display: flex;
      align-items: flex-start;
      align-content: flex-start;
      gap: 5px;
      flex-wrap: wrap;
    }

    .headcell {
      height: 62px;
      text-align: center;
      padding-top: 11px;
    }

    #planner .planner-day-heading {
      display: flex;
      min-width: 0;
      height: 100%;
      flex-direction: column;
      align-items: stretch;
      gap: 3px;
    }

    #planner .planner-day-heading > b { flex: 0 0 auto; }
    #planner .planner-day-heading .time-scale { flex: 0 0 auto; }
    #planner .planner-holiday-name {
      display: block;
      min-width: 0;
      padding: 3px 4px 0;
      border-top: 1px solid #dc9b9b;
      font-size: 10px;
      font-weight: 700;
      line-height: 1.2;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .name {
      font-weight: 700;
      padding: 14px 10px;
    }
    .planner-employee-drag { cursor: grab; user-select: none; }
    .planner-employee-drag:active { cursor: grabbing; }
    .planner-employee-drag.dragging { opacity: .45; }
    .planner-employee-drag.drop-target { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff5ee !important; }
    .planner-employee-handle { color: var(--muted); margin-right: 7px; letter-spacing: -2px; }

    .group {
      grid-column: 1 / -1;
      background: #eef0f2;
      font-weight: 800;
      padding: 7px 12px;
      border-bottom: 1px solid #d3d9df;
    }
    button.group { text-align:left; border:0; width:100%; cursor:pointer; color:inherit; font:inherit; }
    button.group:hover, button.group:focus-visible { background:#e1e6ea; outline:2px solid var(--brand); outline-offset:-2px; }
    .planner-department-drag { cursor:grab !important; user-select:none; }
    .planner-department-drag:active { cursor:grabbing !important; }
    .planner-department-drag.dragging { opacity:.45; }
    .planner-department-drag.drop-before { box-shadow:inset 0 3px var(--brand); }
    .planner-department-drag.drop-after { box-shadow:inset 0 -3px var(--brand); }
    .group-toggle-icon { display:inline-block; width:20px; }
    .planner-department-handle { color:var(--muted); margin-right:7px; letter-spacing:-2px; }

    .job {
      border: 1px solid #61a833;
      background: #edf8e8;
      border-radius: 4px;
      padding: 6px;
      margin: 2px 0;
      color: #32790f;
      cursor: grab;
      min-width: 18px;
      max-width: 100%;
      resize: horizontal;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      user-select: none;
    }

    .job:active { cursor: grabbing; }

    .job.dragging { opacity: .55; }

    .job small {
      display: block;
      margin-top: 3px;
      font-size: 10px;
      color: inherit;
      opacity: .85;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #planner .month-fit { grid-template-columns: minmax(0, 1fr); }
    #planner .month-fit > div:last-child:not(.planner-scroll) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    #planner .month-fit .planner { width: 100%; min-width: 0 !important; }
    #planner .month-fit .cell { min-width: 0; padding: 2px; gap: 2px; }
    #planner .month-fit .name { padding: 12px 5px; font-size: 11px; overflow-wrap: anywhere; }
    #planner .month-fit .headcell { font-size: 11px; height: 44px; padding-top: 6px; }
    #planner .month-fit .headcell.holiday { height: 68px; }
    #planner .month-fit .headcell small { font-size: 9px; }
    #planner .month-fit .planner-add { min-width: 0; width: 24px; min-height: 24px; padding: 0; font-size: 15px; }
    #planner .month-fit .cell .job { min-width: 0; width: 100% !important; padding: 5px 1px; font-size: 10px; position: relative; }
    #planner .month-fit .cell .job small { display: none; }
    #planner .month-fit .range-handle { position: absolute; right: 0; bottom: 0; padding: 0; border: 0; font-size: 8px; line-height: 8px; }
    #planner > .planner-main-panel { overflow: visible; border: 0; background: transparent; }
    #planner .planner-overview-sticky { position: relative; z-index: 1; background: #fff; border: 1px solid var(--line); border-radius: 7px 7px 0 0; }
    #planner .planner-scroll { max-height: none; overflow: visible; border-top: 0; border-radius: 0 0 7px 7px; }
    #planner .headcell { position: sticky; top: var(--planner-controls-height, 48px); z-index: 7; background: #fff; }
    #planner .cell.name { position: static; left: auto; z-index: auto; background: #fff; overflow-wrap: anywhere; }
    #planner .planner-scroll { max-width:100%; max-height:none; overflow:visible; }
    #planner .planner-shell .headcell { height:auto; align-self:stretch; box-sizing:border-box; min-height:52px; }
    #planner .planner-shell .headcell.holiday { min-height:72px; }
    #planner .planner-shell.month-fit .headcell { min-height:44px; }
    #planner .planner-shell.month-fit .headcell.holiday { min-height:68px; }
    #planner .planner-on-call-name { color:#b42318; font-weight:700; }
    #planner .weekend { background: #f1f3f6; }
    #planner .cell.saturday { background: #fff1ee; }
    #planner .cell.sunday, #planner .cell.holiday { background: #fde2e2; }
    #planner .headcell.saturday { color: #8a4b3f; }
    #planner .headcell.sunday, #planner .headcell.holiday { color: #9f1f1f; }
    #planner .headcell.holiday { box-shadow: inset 0 -3px #d54141; }
    #planner .today { box-shadow: inset 0 3px var(--brand); }
    .project-workspace { display:grid; grid-template-columns:290px minmax(0,1fr); gap:12px; align-items:start; }
    .project-sidebar { background:#fff; border:1px solid var(--line); border-radius:8px; padding:12px; position:sticky; top:12px; max-height:85vh; overflow:auto; }
    .project-sidebar .search { width:100%; min-width:0; margin:10px 0; }
    #customers .project-workspace { grid-template-columns:330px minmax(0,1fr); }
    #customers .project-sidebar { padding:12px; }
    #customers .project-sidebar .tabs { display:flex; gap:4px; margin:8px 0 12px !important; }
    #customers .project-sidebar .tabs button { flex:1; min-width:0; padding:7px 5px; font-size:11px; }
    #customers .master-list-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
    #customers .master-list-head h4 { margin:0; }
    #customers .master-list-head .btn { padding:6px 8px; white-space:nowrap; }
    #customers .master-import-tools { margin:0 0 8px; border:1px solid var(--line); border-radius:6px; }
    #customers .master-import-tools summary { cursor:pointer; padding:7px 9px; color:var(--muted); font-size:11px; }
    #customers .master-import-tools .actions { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:0 8px 8px; margin:0 !important; }
    #customers .master-import-tools .btn { white-space:normal; font-size:10px; line-height:1.2; padding:5px; }
    #customers .master-list-controls { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:8px; }
    #customers .master-list-controls select { min-width:0; width:100%; padding:6px 4px; font-size:11px; }
    #customers .project-sidebar .search { margin:0 0 7px; }
    #customers .master-list-item { padding:7px 9px; min-height:46px; border:1px solid transparent; border-bottom-color:var(--line); border-radius:5px; }
    #customers .master-list-item:hover { background:#f7fafc; }
    #customers .master-list-item.active { border-color:#ffd4c4; background:#fff3ed; }
    #customers .master-list-item b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-left-width:3px; padding-left:7px; font-size:12px; }
    #customers .master-list-item small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin:3px 0 0 10px; font-size:10px; }
    #customers .master-list-pagination { padding:8px 0 0; font-size:10px; }
    #customers .master-list-pagination .page-buttons { gap:2px; }
    #customers .master-list-pagination .btn { min-width:25px; min-height:25px; padding:3px 5px; font-size:10px; }
    #customers .master-list-empty { color:var(--muted); font-size:12px; padding:10px 4px; }
    #customers .service-catalog-tabs { margin:0 0 12px; }
    #customers #tspServiceSearch { flex:1; min-width:220px; }
    #customers #tspServiceGroup { min-width:140px; }
    #customers .tsp-service-description { max-width:420px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
    @media(max-width:800px) { #customers .project-workspace { grid-template-columns:1fr; } #customers .project-sidebar { position:static; max-height:none; } }
    .project-sidebar-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:2px 0 10px; }
    .project-sidebar-actions .btn { display:flex; align-items:center; justify-content:center; min-width:0; min-height:32px; padding:5px 6px; font-size:11px; line-height:1.2; text-align:center; white-space:normal; }
    .project-list-item { display:block; width:100%; text-align:left; padding:12px; border:0; border-bottom:1px solid var(--line); background:#fff; border-radius:4px; color:inherit; text-decoration:none; cursor:pointer; }
    .project-group { margin-top:8px; }
    .project-group summary { cursor:pointer; background:#eef0f2; padding:9px 6px; font-size:12px; font-weight:700; }
    .status-group > summary { display:flex; align-items:center; gap:6px; }
    .status-drag-handle { cursor:grab; user-select:none; font-size:15px; line-height:1; padding:2px 3px; color:#65707c; border-radius:3px; }
    .status-drag-handle:hover { background:#dde2e7; color:#20242a; }
    .status-drag-handle:active { cursor:grabbing; }
    .status-delete-btn { margin-left:auto; border:0; background:transparent; color:#9b2c2c; font-size:19px; line-height:1; cursor:pointer; padding:1px 5px; border-radius:4px; }
    .status-delete-btn:hover { background:#fbe4e4; color:#7a1111; }
    .status-group.status-dragging { opacity:.48; }
    .status-group > summary.status-drop-target { outline:2px dashed var(--brand); outline-offset:-2px; background:#fff3ed; }
    .project-list-item b { display:block; border-left:4px solid #79cf20; padding-left:8px; }
    .project-color-palette { display:flex; flex-wrap:wrap; gap:9px; margin:8px 0 16px; }
    .project-color-dot { width:31px; height:31px; border:2px solid transparent; border-radius:50%; padding:0; cursor:pointer; }
    .project-color-dot[aria-pressed="true"] { border-color:#20242a; outline:2px solid #fff; box-shadow:0 0 0 2px #20242a; }
    .project-follow-up { margin:14px 0; padding:12px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
    .project-follow-up-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:9px; }
    .project-follow-up-head strong { font-size:14px; }
    .project-follow-up-fields { display:grid; grid-template-columns:minmax(145px,1fr) minmax(110px,.65fr); gap:8px; }
    .project-follow-up .actions { margin-top:8px; }
    .project-follow-up-summary { margin:0 0 9px; padding:8px 10px; background:#fff7ed; border-left:3px solid var(--brand); }
    @media(max-width:520px) { .project-follow-up-fields { grid-template-columns:minmax(0,1fr); } }
    #projectTabContent .project-photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:8px; }
    .project-photo-grid .chat-image-attachment { display:block; width:100%; min-width:0; padding:5px; overflow:hidden; }
    .project-photo-grid .workstep-photo { width:100%; height:88px; max-height:none; margin:0 0 5px; object-fit:cover; }
    .project-photo-grid .chat-image-actions { gap:4px; margin:0; }
    .project-photo-grid .chat-image-name { width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .project-photo-grid .chat-image-actions .btn { font-size:10px; min-height:25px; padding:3px 6px; }
    .project-list-item .unread-dot { float:right; margin:4px 0 0 6px; }
    .project-list-item.active { background:#fff3ed; }
    .project-list-item small { display:block; color:var(--muted); margin-top:5px; }
    .unread-dot { display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--brand); margin-right:6px; }
    .project-detail-pane { background:#fff; border:1px solid var(--line); border-radius:8px; padding:18px; min-width:0; }
    .project-detail-pane .chat-log { max-height:50vh; overflow:auto; }
    .project-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
    .project-detail-heading h2 { margin:0; font-size:18px; line-height:1.3; }
    .project-detail-heading .btn { padding:6px 9px; }
    .project-detail-badges { display:flex; gap:5px; flex-wrap:wrap; margin:0 0 10px; }
    .project-detail-stats { grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; margin-bottom:8px; }
    .project-detail-stats .card { padding:9px 10px; min-width:0; }
    .project-detail-stats .card strong { font-size:16px; margin-top:4px; overflow-wrap:anywhere; }
    .project-detail-stats .card p { margin:3px 0 0; font-size:11px; }
    .project-detail-tabs { gap:2px; margin:7px 0 0; }
    .project-detail-tabs button { padding:7px 9px; font-size:12px; }
    .project-detail-subtabs { display:flex; align-items:center; gap:5px; padding:6px 8px; border-bottom:1px solid var(--line); background:#f8f9fa; }
    .project-detail-subtabs .btn { min-height:30px; padding:5px 10px; }
    .project-detail-subtabs .btn.active { border-color:var(--brand); background:#fff2ec; color:#a92d12; font-weight:700; }
    #projectTabContent .chat-log { min-height:200px; max-height:360px; }
    #detailContent, #projectDetailPane { container:project-record / inline-size; }
    .project-record-workspace { display:grid; grid-template-columns:minmax(300px,.65fr) minmax(0,1.35fr); gap:12px; align-items:start; }
    .project-record-workspace.context-collapsed { grid-template-columns:minmax(0,1fr); }
    .project-chat-pane, .project-context-pane { min-width:0; }
    .project-chat-pane { position:sticky; top:8px; height:clamp(520px,calc(100vh - 238px),760px); display:flex; flex-direction:column; border:1px solid var(--line); border-radius:7px; background:#fff; overflow:hidden; }
    .project-workspace-title { min-height:42px; padding:9px 12px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--line); background:#f8f9fa; box-sizing:border-box; }
    .project-workspace-title h3 { margin:0; font-size:14px; }
    .project-workspace-title small { color:var(--muted); }
    .project-workspace-title .spacer { flex:1; }
    .project-context-toggle { width:30px; min-width:30px; height:28px; min-height:28px; padding:0; display:grid; place-items:center; font-size:18px; line-height:1; }
    .project-chat-pane .project-chat-drop { flex:1; min-height:0; display:flex; flex-direction:column; padding:8px; border:0; border-radius:0; }
    .project-chat-pane .chat-log { flex:1; min-height:220px; max-height:none; }
    .project-chat-pane .grid2 { flex:0 0 auto; }
    .project-context-pane { container:project-context / inline-size; max-height:none; overflow:visible; border:1px solid var(--line); border-radius:7px; background:#fff; }
    .project-context-pane .project-detail-tabs { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; gap:3px; margin:0; padding:5px; overflow:visible; border-bottom:1px solid var(--line); background:#fff; }
    .project-context-pane .project-detail-tabs button { min-width:0; width:auto; min-height:27px; padding:4px 7px; white-space:nowrap; text-align:left; line-height:1.2; }
    .project-context-pane .project-detail-subtabs { position:static; display:grid; grid-template-columns:auto repeat(2,minmax(0,1fr)); gap:6px; }
    .project-context-pane #projectTabContent { padding:8px; }
    .project-context-pane #projectTabContent > .panel, .project-context-pane #projectTabContent > .document-files-layout { margin:0; }
    .project-context-pane .file-folder-toolbar { grid-template-columns:1fr; }
    .project-context-pane .file-folder-toolbar .actions { justify-content:flex-start; flex-wrap:wrap; }
    .project-context-pane #projectTabContent > .cards { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
    .project-context-pane #projectTabContent > .two { grid-template-columns:minmax(0,1fr); }
    .project-context-pane #projectTabContent .panel, .project-context-pane #projectTabContent .card, .project-context-pane #projectTabContent .field { min-width:0; }
    .project-context-pane #projectTabContent .panelhead { flex-wrap:wrap; gap:8px; }
    .project-context-pane #projectTabContent .card strong { overflow-wrap:anywhere; }
    .project-context-pane #projectTabContent .two .table { min-width:680px; }
    .project-context-pane #projectTabContent .table th, .project-context-pane #projectTabContent .table td { white-space:normal; overflow-wrap:break-word; }
    .project-context-pane #projectTabContent .table .money { white-space:nowrap; }
    .project-context-pane #projectTabContent .table .btn { margin:2px; white-space:normal; }
    @container project-context (max-width:600px) { .project-context-pane #projectTabContent .grid2, .project-context-pane #projectTabContent .grid3 { grid-template-columns:minmax(0,1fr); } }
    @container project-record (max-width:1000px) { .project-record-workspace { grid-template-columns:minmax(0,1fr); } .project-chat-pane { position:static; height:min(440px,60vh); } .project-context-pane { max-height:none; overflow:visible; } }
    @media(max-width:1100px) { .project-record-workspace { grid-template-columns:1fr; } .project-chat-pane { position:static; height:min(620px,72vh); } .project-context-pane { max-height:none; overflow:visible; } }
    @media(max-width:520px) { .project-context-pane .project-detail-tabs { grid-template-columns:1fr; } .project-context-pane .project-detail-subtabs { grid-template-columns:1fr 1fr; } .project-context-pane .project-detail-subtabs .access-note { grid-column:1/-1; } }
    #detailModal { padding:10px; }
    #detailModal .modalbox { width:min(1700px,calc(100vw - 20px)); max-height:calc(100vh - 20px); padding:14px; overflow-x:hidden; }
    #detailModal .project-detail-tabs { flex-wrap:wrap; overflow-x:visible; gap:2px 4px; margin:6px 0 10px; }
    #detailModal .project-detail-tabs button { flex:0 1 auto; padding:6px 8px; font-size:11px; }
    #detailModal .project-detail-stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
    #detailModal .project-detail-stats .card { padding:7px 9px; }
    #detailModal #projectTabContent .panelhead { padding:10px 12px; }
    #detailModal #projectTabContent .panelbody { padding:12px; }
    #detailModal > .modalbox > .actions { margin-top:10px; }
    @media(max-width:700px) { #detailModal .project-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    @media(max-width:800px) { .project-workspace { grid-template-columns:210px minmax(0,1fr); } .project-sidebar-actions { grid-template-columns:1fr; } .project-detail-pane .cards, .project-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
    #assignmentModal .modalbox { width:min(760px,calc(100vw - 32px)); padding:20px; }
    #assignmentModal .field, #assignmentModal .assignment-option > span { min-width:0; }
    #assignmentModal .assignment-option { white-space:normal; overflow-wrap:anywhere; }
    #assignmentModal .assignment-heading .btn { flex-shrink:0; }
    .assignment-heading { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
    #assignmentSelectedTitle { margin:0 0 18px; padding:10px 12px; border-left:4px solid var(--brand); border-radius:4px; background:#fff7f2; font-weight:700; line-height:1.4; overflow-wrap:anywhere; }
    #assignmentSelectedTitle[hidden] { display:none; }
    #assignmentModal h2 { font-size:16px; flex:1; min-width:0; overflow-wrap:anywhere; margin:0; }
    #assignmentModal .field { margin-bottom:12px; }
    #assignmentModal .grid2 { gap:12px; }
    .assignment-types { display:flex; justify-content:center; gap:16px; margin:8px 0 18px; }
    .assignment-types label { font-size:12px; }
    #assignmentSearch { width:100%; margin-bottom:8px; padding:10px; border:1px solid var(--line); border-radius:4px; font:inherit; }
    #assignmentResults { max-height:230px; overflow:auto; border:1px solid var(--line); margin-bottom:12px; }
    .assignment-option { width:100%; background:white; border:0; border-bottom:1px solid var(--line); text-align:left; padding:11px; display:flex; gap:9px; align-items:center; }
    .assignment-option[aria-pressed="true"] { background:#fff3ed; box-shadow:inset 3px 0 var(--brand); }
    .assignment-option small { display:block; color:var(--muted); }
    .assignment-project-address { display:block; margin-top:2px; color:#344454; font-weight:600; }
    #assignmentSelectedAddress { margin:0 0 8px; padding:7px 9px; border-left:3px solid var(--brand); background:#fff7f2; overflow-wrap:anywhere; }
    #assignmentSelectedAddress[hidden] { display:none; }
    .assignment-icon { border-radius:50%; background:#58a900; color:white; width:26px; height:26px; display:grid; place-items:center; flex-shrink:0; }
    #assignmentNote { min-height:45px; height:55px; }
    .portal-pull-indicator { position:fixed; z-index:120; top:max(8px,env(safe-area-inset-top)); left:50%; display:flex; align-items:center; gap:8px; padding:9px 14px; border-radius:999px; background:#20242a; color:#fff; box-shadow:0 8px 24px #0003; font-size:12px; font-weight:700; opacity:0; pointer-events:none; transform:translate(-50%,-70px); transition:opacity .15s,transform .15s; }
    .portal-pull-indicator.visible { opacity:1; transform:translate(-50%,calc(min(var(--pull-distance,80px),96px) - 48px)); }
    .portal-pull-indicator.ready .portal-pull-icon { transform:rotate(180deg); }
    .portal-pull-indicator.loading .portal-pull-icon { animation:portal-pull-spin .8s linear infinite; }
    @keyframes portal-pull-spin { to { transform:rotate(360deg); } }
    #planner .time-track { position:relative; flex:1 1 auto; height:44px; min-width:0; background:repeating-linear-gradient(to right, transparent 0,transparent calc(25% - 1px),#dfe4ea calc(25% - 1px),#dfe4ea 25%); }
    #planner .cell[data-date] .time-track .job { position:absolute; left:var(--time-left); width:var(--time-width) !important; max-width:none; height:42px; top:1px; box-sizing:border-box; padding:5px 2px; }
    #planner .month-fit .time-track { height:30px; }
    #planner .month-fit .cell[data-date] .time-track .job { height:28px; }
    #planner .time-track .job:hover { z-index:3; }
    .planner-range-preview { position:absolute; left:var(--time-left); width:var(--time-width); top:0; bottom:0; background:rgba(255,88,40,.18); border:1px dashed var(--brand); box-sizing:border-box; pointer-events:none; z-index:4; }
    .time-resize { position:absolute; top:0; bottom:0; width:6px; z-index:5; cursor:ew-resize; touch-action:none; background:rgba(0,0,0,.10); }
    .time-resize[data-edge="start"] { left:0; }
    .time-resize[data-edge="end"] { right:0; }
    #planner .time-track .job { display:flex; align-items:flex-start; justify-content:flex-start; text-align:left; padding-left:7px !important; padding-right:7px !important; font-size:10px; line-height:1.1; }
    #planner .planner-job-label { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; min-width:0; margin-block:auto; overflow:hidden; overflow-wrap:anywhere; white-space:normal; }
    #planner .job[data-project] { overflow:visible; }
    #planner .cell[data-employee][data-date]:has(.job[data-project]:hover), #planner .cell[data-employee][data-date]:has(.job[data-project]:focus-visible) { overflow:visible; z-index:10; }
    #planner .time-track .job[data-project]:hover, #planner .time-track .job[data-project]:focus-visible { z-index:30; }
    #planner .job[data-project] .planner-job-label { display:block; width:100%; }
    #planner .planner-job-project-name, #planner .planner-job-address { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    #planner .planner-job-address { font-size:9px; font-weight:500; opacity:.95; }
    #planner .job[data-project]:hover::after, #planner .job[data-project]:focus-visible::after { content:attr(data-project-details); position:absolute; left:0; top:calc(100% + 4px); z-index:20; box-sizing:border-box; min-width:220px; max-width:min(330px,calc(100vw - 32px)); padding:8px 10px; border:1px solid #cbd4dd; border-radius:5px; background:#fff; color:#17212b; box-shadow:0 8px 22px #17212b33; white-space:normal; overflow-wrap:anywhere; font-size:12px; line-height:1.35; pointer-events:none; }
    #planner .time-track .range-handle { margin-right:5px; }
    .time-scale { display:flex; justify-content:space-between; font-size:9px; padding-top:5px; }
    .planner-add { position:absolute; z-index:2; margin:0; padding:0; border:1px dashed transparent; border-radius:4px; background:rgba(255,243,237,.94); color:var(--brand); font-size:17px; line-height:1; opacity:0; pointer-events:auto; transition:opacity .12s ease, background .12s ease, border-color .12s ease; }
    #planner .planner-add:hover,
    #planner .planner-add:focus-visible { opacity:1; border-color:var(--brand); }
    .range-handle { float: right; cursor: ew-resize; padding: 0 5px; border: 1px solid currentColor; border-radius: 3px; margin-left: 5px; }
    .range-middle { border-radius: 0; }
    .range-start { border-top-right-radius: 0; border-bottom-right-radius: 0; }
    .range-end { border-top-left-radius: 0; border-bottom-left-radius: 0; }
    #planner .cell .job { resize: none; }
    /* One planning row per employee, including multiple jobs and the add button. */
    #planner .cell[data-employee][data-date] {
      position: relative;
      flex-wrap: nowrap;
      align-items: center;
      min-width: 0;
      height: 54px;
      min-height: 54px;
      overflow: hidden;
    }
    #planner .cell[data-date] .job {
      flex: 1 1 0;
      min-width: 0;
      width: auto !important;
      margin: 0;
    }
    #planner .cell[data-date] .planner-add {
      width: 24px;
      min-width: 0;
      padding: 0;
      margin: 0;
    }
    #planner .month-fit .cell[data-date] { height: 38px; min-height: 38px; }
    #planner .month-fit .cell[data-date] .planner-add { width:20px; min-width:20px; min-height:20px; right:3px; font-size:12px; }
    #planner .planner-controls { min-height:0; padding:8px 10px; gap:5px; flex-wrap:wrap; }

    #planner .planner-controls { position:sticky; top:0; z-index:9; background:#fff; border:1px solid var(--line); border-radius:7px 7px 0 0; box-shadow:0 2px 5px #20242a08; }
    .time-employee-suggestions { position:absolute; top:100%; left:0; right:0; z-index:40; max-height:260px; overflow:auto; padding:4px; border:1px solid var(--line); border-radius:8px; background:#fff; box-shadow:0 8px 24px #20242a20; }
    .time-filters .field:has(#timeFilterSearch) { position:relative; }
    .time-employee-suggestions button { display:flex; flex-direction:column; gap:3px; width:100%; padding:9px 10px; border:0; border-radius:5px; background:#fff; text-align:left; color:var(--text,#20242a); cursor:pointer; }
    .time-employee-suggestions button:hover,.time-employee-suggestions button:focus-visible { background:#fff0e9; outline:0; }
    .time-employee-suggestions small,.time-employee-suggestions p { color:var(--muted); font-size:11px; }
    #planner .planner-pool-search { display:flex; align-items:center; gap:8px; margin-bottom:10px; padding:0 10px; min-height:38px; border:1px solid var(--line); border-radius:9px; background:#f7f8fa; color:#718096; transition:border-color .15s,box-shadow .15s; }
    #planner .planner-pool-search:focus-within { border-color:var(--accent,#ff5722); box-shadow:0 0 0 3px #ff572215; background:#fff; }
    #planner .planner-pool-search input { flex:1; min-width:0; width:100%; border:0; outline:0; box-shadow:none; padding:9px 0; background:transparent; color:var(--text,#20242a); font:inherit; font-size:12px; }
    #planner .planner-pool-search input::-webkit-search-cancel-button { -webkit-appearance:none; }
    #planner .planner-pool-search button { border:0; border-radius:5px; width:24px; height:24px; background:transparent; color:#718096; cursor:pointer; font-size:18px; }
    #planner .planner-pool-search button:hover { background:#fff0e9; color:#ed5625; }
    #planner .planner-pool-search button[hidden] { display:none; }
    #planner .planner-controls .btn { min-height:30px; padding:5px 8px; font-size:12px; }
    #planner .planner-controls h3 { margin:0 4px; font-size:13px; }
    #planner .planner-date-jump { display:flex; align-items:center; gap:5px; margin:0; white-space:nowrap; font-size:12px; }
    #planner .planner-date-jump input { box-sizing:border-box; width:150px; min-height:30px; padding:4px 7px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); font:inherit; }
    #planner .planner-summary { gap:7px; padding:8px 10px 0; margin-bottom:0; }
    #planner .planner-summary .card { padding:8px 10px; }
    #planner .planner-summary .card strong { margin-top:3px; font-size:17px; }
    #planner .planner-help { margin:8px 0; padding:0 10px; color:var(--muted); font-size:11px; }
    #planner .planner-shell:not(.month-fit) .headcell { height:auto; min-height:52px; padding-top:7px; }
    #planner .planner-shell:not(.month-fit) .headcell.holiday { height:auto; min-height:72px; }
    #planner .planner-shell:not(.month-fit) .cell.name { display:flex; align-items:center; flex-wrap:nowrap; min-width:0; overflow:hidden; padding:9px 8px; white-space:nowrap; }
    #planner .planner-employee-name { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    #planner .planner-employee-name.truncated { cursor:pointer; }
    #planner .planner-row-add { display:grid; place-items:center; flex:0 0 24px; width:24px; height:24px; margin-left:auto; padding:0; border:1px solid var(--brand); border-radius:50%; background:#fff; color:var(--brand); font-size:17px; font-weight:800; line-height:1; cursor:pointer; }
    #planner .planner-row-add:hover, #planner .planner-row-add:focus-visible { background:var(--brand); color:#fff; outline:none; }
    #planner .planner-shell:not(.month-fit) .group { padding:5px 10px; }
    #planner .planner-shell:not(.month-fit) .cell[data-employee][data-date] { height:auto; min-height:40px; padding:3px; }
    #planner .planner-shell:not(.month-fit) .time-track { height:34px; }
    #planner .planner-shell:not(.month-fit) .cell[data-date] .time-track .job { height:32px; padding-top:4px; padding-bottom:4px; }
    #planner .planner-shell:not(.month-fit) .cell[data-date] .planner-add { min-height:26px; font-size:17px; }
    #planner .planner-shell:not(.month-fit) .cell[data-date].planner-multi-lane { min-height:calc(6px + var(--planner-lanes) * 28px); }
    #planner .planner-shell:not(.month-fit) .cell[data-date].planner-multi-lane .time-track { height:calc(var(--planner-lanes) * 28px); }
    #planner .planner-shell:not(.month-fit) .cell[data-date].planner-multi-lane .time-track .job { top:calc(var(--planner-lane) * 28px + 1px); height:26px; padding-top:2px; padding-bottom:2px; }
    #planner .planner-shell:not(.month-fit) .cell[data-date].planner-multi-lane .planner-job-label { font-size:9.5px; line-height:1; }
    #planner .month-fit .cell[data-date].planner-multi-lane { height:auto; min-height:calc(6px + var(--planner-lanes) * 25px); }
    #planner .month-fit .cell[data-date].planner-multi-lane .time-track { height:calc(var(--planner-lanes) * 25px); }
    #planner .month-fit .cell[data-date].planner-multi-lane .time-track .job { top:calc(var(--planner-lane) * 25px + 1px); height:23px; }
    #planner .month-fit .cell[data-date].planner-multi-lane .planner-job-label { -webkit-line-clamp:1; }
    #planner .month-fit .job[data-project] .planner-job-address { display:block; font-size:8px; }
    #planner .month-fit .cell[data-date] .planner-job-label { display:block; -webkit-line-clamp:unset; }

    .absence-tray { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); padding: 6px 10px; box-shadow: 0 -4px 16px #20242a12; }
    .absence-tray-head { display:flex; align-items:center; gap:7px; min-height:28px; }
    .absence-tray-toggle { display:inline-flex; align-items:center; gap:7px; border:0; background:transparent; padding:4px 2px; color:var(--ink); cursor:pointer; }
    .absence-tray-toggle span { width:14px; color:var(--muted); }
    .absence-tray-head .btn { min-height:28px; padding:4px 7px; font-size:11px; }
    .absence-help { position:relative; display:inline-grid; place-items:center; width:17px; height:17px; border:1px solid #9aa5b1; border-radius:50%; color:#5f6a76; font-size:11px; font-weight:700; cursor:help; }
    .absence-help::after { content:attr(data-tooltip); position:absolute; left:0; bottom:calc(100% + 7px); width:min(320px,80vw); padding:8px 10px; border:1px solid var(--line); border-radius:6px; background:#fff; box-shadow:0 3px 12px #20242a25; color:var(--ink); font-size:12px; font-weight:400; line-height:1.4; opacity:0; visibility:hidden; pointer-events:none; }
    .absence-help:hover::after, .absence-help:focus-visible::after { opacity:1; visibility:visible; }
    .absence-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-top:6px; }
    .planner-workload-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:7px; padding:10px; }
    .planner-workload-card { min-width:0; border:1px solid var(--line); border-radius:6px; padding:8px 9px; background:#fff; }
    .planner-workload-card.idle { background:#fafbfc; }
    .planner-workload-card-head { display:flex; align-items:center; justify-content:space-between; gap:6px; }
    .planner-workload-card-head b { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
    .planner-workload-card-head .badge { min-height:18px; padding:1px 6px; font-size:10px; }
    .planner-workload-metrics { display:flex; flex-wrap:wrap; gap:3px 8px; margin-top:5px; color:var(--muted); font-size:11px; }
    .planner-workload-metrics strong { margin-left:auto; color:var(--ink); white-space:nowrap; }
    .category-item { display: inline-flex; align-items: stretch; max-width: 190px; }
    .absence-tabs .job { flex: 0 1 auto; display:inline-flex; align-items:center; gap:6px; min-height: 28px; margin: 0; padding: 4px 7px; font-size: 11px; font-weight: 700; text-align: left; text-transform:uppercase; resize: none; border-radius: 4px 0 0 4px; }
    .planner-category-icon { display:inline-flex; align-items:center; justify-content:center; flex:none; width:14px; height:14px; vertical-align:middle; }
    .planner-category-icon svg { display:block; width:100%; height:100%; }
    #planner .cell .job .planner-category-icon { margin-right:4px; }
    .assignment-icon .planner-category-icon { width:16px; height:16px; }
    .category-delete { width: 27px; min-width: 27px; padding: 0; border-radius: 0 4px 4px 0; border-left: 0; font-size: 15px; }
    .job.absence-urlaub { background: #58a900; border-color: #478900; color: #fff; }
    .job.absence-krank { background: #3021cf; border-color: #2518a8; color: #fff; }
    .job.absence-schule { background: #ffbf00; border-color: #d39c00; color: #332600; }
    .job.absence-seminar { background: #a72bce; border-color: #8720a8; color: #fff; }

    .drop-target {
      background: #fff9f5;
      outline: 2px dashed var(--brand);
      outline-offset: -4px;
    }

    .job.blue { border-color: #3657ed; background: #edf0ff; color: #1736c5; }
    .job.amber { border-color: #f0a000; background: #fff6df; color: #a96d00; }

    .skill-list {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
    }

    .check-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
      gap: 6px 12px;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 12px;
      background: #fbfcfd;
    }

    .check-grid label {
      display: grid;
      grid-template-columns: 20px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      color: #36404a;
      min-height: 25px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .02em;
    }

    .check-grid input[type="checkbox"] {
      width: 14px;
      height: 14px;
      margin: 0;
    }
    .project-member-picker { border:1px solid var(--line); border-radius:8px; padding:10px; background:#fbfcfd; }
    .project-member-picker .check-grid { border:0; padding:0; margin-top:8px; max-height:240px; overflow:auto; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); }
    .project-member-picker .check-grid label { text-transform:none; letter-spacing:0; font-size:12px; font-weight:600; }
    .project-member-picker .check-grid label small { grid-column:2; margin-top:-7px; color:var(--muted); font-weight:400; }
    .project-member-picker .check-grid label[hidden] { display:none; }
    .project-group-choices { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
    .project-group-choices .btn.active { background:var(--brand); border-color:var(--brand); color:#fff; }
    .project-trade-schedule-row {
      display:grid;
      align-items:stretch;
      gap:10px;
      padding:12px;
      margin-bottom:10px;
      border:1px solid var(--line);
      border-radius:7px;
      background:#fbfcfd;
    }
    .project-trade-date-grid {
      display:grid;
      grid-template-columns:minmax(210px,1.6fr) minmax(145px,1fr) 112px minmax(145px,1fr) 112px;
      gap:10px;
      align-items:end;
    }
    .project-trade-assignment-grid {
      display:grid;
      grid-template-columns:minmax(280px,1fr) auto auto;
      gap:10px;
      align-items:end;
    }
    .project-trade-schedule-row .field { margin:0; min-width:0; }
    .project-trade-block-toggle {
      height:40px;
      display:flex;
      align-items:center;
      justify-content:center;
      gap:7px;
      padding:0 12px;
      border:1px solid var(--line);
      border-radius:5px;
      background:#fff;
      white-space:nowrap;
      font-size:12px;
      font-weight:700;
      text-transform:none;
      letter-spacing:0;
    }
    .project-trade-block-toggle input { width:auto; margin:0; }
    .project-trade-remove { height:40px; }
    .project-trade-selected { min-width:0; overflow-wrap:anywhere; }
    @media(max-width:1050px) {
      .project-trade-date-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
      .project-trade-date-grid .project-trade-cost { grid-column:1 / -1; }
      .project-trade-assignment-grid { grid-template-columns:minmax(240px,1fr) auto auto; }
    }
    @media(max-width:650px) {
      .project-trade-date-grid, .project-trade-assignment-grid { grid-template-columns:minmax(0,1fr); }
      .project-trade-date-grid .project-trade-cost { grid-column:auto; }
      .project-trade-block-toggle, .project-trade-remove { width:100%; }
    }
    #staleProjectsModal .modalbox { width:min(820px,94vw); max-height:88vh; overflow:auto; }
    .stale-project-list { max-height:55vh; overflow:auto; border:1px solid var(--line); border-radius:7px; }
    .stale-project-row { display:flex; align-items:center; gap:10px; padding:9px 11px; border-bottom:1px solid var(--line); }
    .stale-project-row:last-child { border-bottom:0; }
    .stale-project-row span { min-width:0; flex:1; }
    .stale-project-row small { display:block; color:var(--muted); }

    .section-title {
      margin: 16px 0 10px;
      font-size: 13px;
      color: #303943;
    }

    .doc-drop {
      border: 1px dashed #bac4cf;
      border-radius: 7px;
      padding: 12px;
      background: #fbfcfd;
    }

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

    /* In der Wochenansicht erhält die Plantafel die volle Breite. Die
       Nebeninformationen stehen darunter, damit Montag bis Sonntag sichtbar bleiben. */
    #planner .planner-shell:not(.month-fit) { grid-template-columns: minmax(0, 1fr); }

    .planner-scroll {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 7px;
    }

    .doc-preview {
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 18px;
      background: #e9ecef;
      min-height: 220px;
      line-height: 1.45;
      overflow: auto;
    }

    #billingModal .modalbox { width: min(1580px, calc(100vw - 24px)); max-height:96vh; padding:20px 24px; }

    /* Dokumenteneditor: Bearbeitung und A4-Vorschau als feste Arbeitsfläche. */
    .billing-document-meta { border:1px solid var(--line); border-radius:10px; padding:14px; margin:0 0 14px; background:linear-gradient(110deg,#f8fafc,#fff); }
    .billing-reverse-charge { grid-column:1/-1; padding:10px 12px; border:1px solid var(--line); border-radius:8px; background:#fff; }
    .billing-reverse-charge label { display:flex; align-items:center; gap:8px; font-weight:700; cursor:pointer; }
    .billing-reverse-charge input { width:auto; margin:0; }
    .billing-reverse-charge small { display:block; margin:5px 0 0 24px; color:var(--muted); }
    .billing-meta-heading, .billing-preview-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:12px; }
    .billing-meta-heading h3, .billing-preview-heading h3 { margin:2px 0 0; font-size:16px; }
    .eyebrow { display:block; color:var(--orange); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
    .billing-workspace { display:grid; grid-template-columns:minmax(440px, .9fr) minmax(480px, 1.1fr); gap:20px; align-items:start; }
    .billing-editor-column { min-width:0; }
    #billingTextTemplatePanel .grid2, #billingCompletionPanel .grid2 { grid-template-columns:minmax(0,1fr); gap:12px; }
    #billingTextTemplatePanel .field, #billingCompletionPanel .field { min-width:0; }
    #billingTextTemplatePanel .actions, #billingCompletionPanel .actions { justify-content:flex-start; flex-wrap:wrap; }
    #billingTextTemplate, #billingClosingBlock { width:100%; min-width:0; flex:1 1 100% !important; }
    .billing-selected-texts { display:grid; gap:6px; margin:10px 0; }
    .billing-selected-text { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:8px 10px; border:1px solid #d8e0ea; border-radius:8px; background:#f8fafc; }
    .billing-selected-text div { min-width:0; }
    .billing-selected-text small { display:block; white-space:pre-wrap; overflow-wrap:anywhere; max-height:5.5em; overflow:auto; color:#516174; }
    #billingTextTemplatePanel .actions .btn, #billingCompletionPanel .actions .btn { flex:0 0 auto; white-space:nowrap; }
    .billing-editor-column > .panel, .billing-editor-column > details, .billing-editor-column > section { margin-bottom:12px; border-radius:10px; }
    .billing-editor-column > details { border:1px solid var(--line); background:#fff; padding:12px; }
    .billing-editor-column > details summary { cursor:pointer; font-size:14px; }
    .billing-step .panelhead { background:#fafbfc; }
    .billing-preview-column { position:sticky; top:8px; min-width:0; border:1px solid var(--line); border-radius:10px; padding:14px; background:#f7f8fa; }
    .billing-preview-heading { align-items:center; flex-wrap:wrap; padding:0 2px 10px; border-bottom:1px solid var(--line); }
    .billing-preview-heading h3 { margin:0; white-space:nowrap; }
    .billing-preview-heading .access-note { margin:0; white-space:nowrap; }
    .billing-preview-column .doc-preview { min-height:650px; max-height:calc(96vh - 190px); padding:16px; background:#dfe3e8; }
    .billing-preview-column .kwb-document { width:794px; zoom:.62; transform-origin:top left; }
    @media (min-width:1450px) { .billing-preview-column .kwb-document { zoom:.78; } }
    .billing-document-actions { position:sticky; bottom:0; z-index:2; justify-content:flex-end; gap:8px; padding:12px 0 0; margin-top:14px; border-top:1px solid var(--line); background:#fff; }
    .billing-action { min-height:42px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:7px 10px; }
    .billing-action svg { width:18px; height:18px; flex:0 0 18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .billing-action-label { font-size:11px; line-height:1.15; white-space:nowrap; }

    .billing-editor-column .billing-line { grid-template-columns:64px minmax(105px,1fr) 72px 72px 150px; grid-template-areas:"drag kind kind quantity unit" "drag description description description price" "drag controls controls controls controls"; gap:7px; padding:10px 0; }
    .billing-editor-column .billing-line > :nth-child(1) { grid-area:drag; align-self:stretch; }
    .billing-editor-column .billing-line > :nth-child(2) { grid-area:kind; }
    .billing-editor-column .billing-line > :nth-child(3) { grid-area:description; }
    .billing-editor-column .billing-line > :nth-child(4) { grid-area:quantity; }
    .billing-editor-column .billing-line > :nth-child(5) { grid-area:unit; }
    .billing-editor-column .billing-line > :nth-child(6) { grid-area:price; }
    .billing-editor-column .billing-line > :nth-child(7) { grid-area:controls; justify-self:start; }
    .billing-editor-column .billing-line > :nth-child(8) { grid-area:controls; justify-self:center; }
    .billing-editor-column .billing-line > :nth-child(9) { grid-area:controls; justify-self:end; }
    .billing-editor-column .billing-line [data-line-field="unitPrice"] { width:100%; min-width:0; font-weight:700; font-variant-numeric:tabular-nums; }

    .kwb-document {
      width: min(794px, 100%);
      height: 1123px;
      min-height: 1123px;
      margin: 0 auto;
      padding: 60px 57px 144px;
      background: #fff;
      color: #111;
      box-shadow: 0 2px 9px rgba(0,0,0,.12);
      position: relative;
      display: flex;
      flex-direction: column;
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
      line-height: 1.35;
      box-sizing: border-box;
      overflow: hidden;
    }
    .kwb-document + .kwb-document { margin-top: 22px; }
    .kwb-document * { font-family: inherit; }

    .kwb-doc-top { display:table; width:100%; height:290px; table-layout:fixed; border-collapse:collapse; }
    .kwb-doc-top > div { display:table-cell; vertical-align:top; }
    .kwb-doc-top > div:first-child { box-sizing:border-box; padding-right:60px; }
    .kwb-doc-top > div:last-child { width:332px; }
    .kwb-doc-logo { display:block; width:234px; max-width:100%; height:auto; margin:0 0 0 auto; }
    .kwb-sender { margin-top: 91px; font-size: 9px; color: #555; }
    .kwb-recipient { white-space: pre-line; font-size: 16px; line-height: 1.45; margin-top: 15px; min-height: 76px; }
    .kwb-doc-meta { margin-top: 91px; font-size: 11px; }
    .kwb-doc-meta h2 { font-size: 16px; margin: 0; padding-bottom: 4px; border-bottom: 1px solid #a9a9a9; }
    .kwb-meta-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.15fr); align-items:start; gap:12px; padding-top:6px; }
    .kwb-meta-row > :last-child { text-align:right; overflow-wrap:break-word; }
    .kwb-subject { margin: 0 0 19px; font-size: 13px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
    .kwb-intro { white-space: pre-line; margin-bottom: 19px; }
    .kwb-position-table { width: 100%; border-collapse: collapse; }
    .kwb-invoice-positions { width:calc(100% + 22px); margin-left:-11px; table-layout:fixed; }
    .kwb-invoice-positions th:nth-child(1) { width:56%; }
    .kwb-invoice-positions th:nth-child(2) { width:11%; }
    .kwb-invoice-positions th:nth-child(3) { width:9%; }
    .kwb-invoice-positions th:nth-child(4), .kwb-invoice-positions th:nth-child(5) { width:12%; }
    .kwb-invoice-positions th, .kwb-invoice-positions td { padding-left:6px; padding-right:6px; }
    .kwb-invoice-positions th:nth-child(3), .kwb-invoice-positions td:nth-child(3) { text-align:center; }
    .kwb-position-table th { padding: 3px 4px; background: #c8baba; border: 1px solid #111; font-weight: 400; text-align: left; }
    .kwb-position-table td { padding: 5px 4px; vertical-align: top; border-bottom: 1px solid #ececec; }
    .kwb-position-table .num { text-align: right; white-space: nowrap; }
    .kwb-totals { width: 48%; margin: 16px 0 20px auto; border-collapse: collapse; }
    .kwb-totals td { padding: 5px 4px; border-bottom: 1px solid #111; }
    .kwb-totals td:last-child { text-align: right; font-weight: 700; }
    .kwb-final-text { white-space: pre-line; margin-top: 16px; }
    .kwb-final-text p { margin: 0 0 7px; }
    .kwb-final-text p:last-child { margin-bottom: 0; }
    .kwb-advance-schedule { margin: 8px 0 10px; font-size: 10px; }
    .kwb-advance-schedule table { width: 100%; border-collapse: collapse; margin-top: 5px; }
    .kwb-advance-schedule th, .kwb-advance-schedule td { border-bottom: 1px solid #b5b5b5; padding: 3px 5px; text-align: left; }
    .kwb-advance-schedule th:nth-child(2), .kwb-advance-schedule td:nth-child(2) { text-align: right; }
    .kwb-advance-schedule th:nth-child(3), .kwb-advance-schedule td:nth-child(3) { text-align: right; }
    #billingAdvanceHistory .kwb-advance-schedule { font-size: 13px; color: #17243a; overflow-x: auto; }
    #billingAdvanceHistory .kwb-advance-schedule th, #billingAdvanceHistory .kwb-advance-schedule td { padding: 7px 9px; }
    .kwb-payment-block { position: static; min-height: 104px; display: block; margin-top: 5px; padding-top: 6px; border-top: 1px solid #d9d9d9; break-inside: avoid; }
    .kwb-payment-block.kwb-payment-compact-preview { min-height: 92px; margin-top: 0; padding-top: 5px; }
    .kwb-payment-layout, .kwb-payment-details, .kwb-footer-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .kwb-payment-layout td, .kwb-payment-details td, .kwb-payment-details th, .kwb-footer-table td { padding: 0; border: 0; vertical-align: top; }
    .kwb-payment-copy { padding-right: 22px !important; font-size: 11px; line-height: 1.35; }
    .kwb-payment-copy > strong { display: block; margin-bottom: 3px; font-size: 13px; }
    .kwb-payment-details td { width: 120px; padding: 1px 12px 2px 0; color: #555; text-align: left; font-weight: 400; }
    .kwb-payment-details th { padding: 1px 0 2px; text-align: left; overflow-wrap: break-word; }
    .kwb-payment-qr { width: 104px; text-align: center; }
    .kwb-payment-qr img { display: block; width: 98px; height: 98px; image-rendering: pixelated; }
    .kwb-payment-qr small { display: block; margin-top: 3px; color: #555; font-size: 8px; }
    .kwb-continuation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 23px; padding-bottom: 11px; border-bottom: 2px solid #c6b7b7; }
    .kwb-continuation-head img { width: 210px; height: auto; }
    .kwb-continuation-head div { text-align: right; }
    .kwb-continuation-head b { display: block; font-size: 16px; }
    .kwb-continuation-head small { display: block; margin-top: 5px; color: #555; }
    .kwb-footer { position: absolute; left: 57px; right: 57px; bottom: 45px; display: block; margin: 0; padding-top: 15px; border-top: 3px solid #c6b7b7; font-size: 9px; line-height: 1.35; }
    .kwb-footer-table td { padding-right: 12px; overflow-wrap: break-word; }
    .kwb-footer-table td:last-child { padding-right: 0; }
    .kwb-page-number { margin-top: 3px; text-align: right; font-size: 9px; color: #555; }
    .billing-measure-host { position: fixed; left: -20000px; top: 0; width: 210mm; visibility: hidden; pointer-events: none; z-index: -1; }
    .billing-measure-host .kwb-document { display: block; width: 210mm; height: auto; min-height: 0; margin: 0; padding: 0 15mm; box-shadow: none; font-size: 8.5pt; line-height: 1.35; overflow: visible; }
    .billing-measure-host .kwb-position-table { font-size: 8.5pt; }
    .billing-measure-host .kwb-position-table th { padding: .5mm .7mm; }
    .billing-measure-host .kwb-position-table td { padding: 1mm .7mm; }

    .member {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 0;
      border-bottom: 1px solid #edf0f2;
    }

    .member:last-child { border-bottom: 0; }

    .project-billing-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,230px)); gap:12px; margin-top:14px; }
    .project-billing-grid > .bulk-select-item { align-items:flex-start; min-width:0; }
    .project-billing-grid .project-billing-entry { display:flex; flex-direction:column; align-items:stretch; flex:1; gap:10px; padding:10px; border:1px solid var(--line); border-radius:9px; background:#fff; min-width:0; height:100%; box-sizing:border-box; }
    .project-billing-cover { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:104px; border:1px solid var(--line); border-radius:6px; background:#f3f5f7; color:var(--text); cursor:pointer; font:inherit; font-weight:700; }
    .project-billing-cover svg { width:30px; height:34px; stroke:var(--brand); }
    .project-billing-grid .project-billing-meta { display:grid; gap:6px; }
    .project-billing-grid .project-billing-title { font-size:13px; line-height:1.4; }
    .project-billing-grid .project-billing-actions { margin:0; margin-top:auto; padding-top:4px; }
    .project-billing-grid .project-billing-status { width:fit-content; }
    @media(max-width:480px) { .project-billing-grid { grid-template-columns: minmax(0,1fr); } }

    .kwb-file-menu-host { position:relative; }
    .kwb-file-menu { position:absolute; right:6px; top:6px; z-index:8; }
    .kwb-file-menu > summary { display:flex; align-items:center; justify-content:center; width:30px; height:30px; border:1px solid var(--line); border-radius:50%; background:#fff; color:var(--text); cursor:pointer; font-size:21px; list-style:none; box-shadow:0 2px 6px #0002; }
    .kwb-file-menu > summary::-webkit-details-marker { display:none; }
    .kwb-file-menu[open] { z-index:30; }
    .kwb-file-menu-panel { position:absolute; right:0; top:34px; display:grid; gap:5px; padding:8px; min-width:150px; max-width:230px; background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 5px 18px #0002; }
    .kwb-file-menu-panel button { width:100%; text-align:left; }
    .kwb-file-menu-panel .icon-file-action { width:auto; }
    .kwb-file-menu-panel .icon-file-action::after { content:attr(title); margin-left:6px; font-size:12px; }
    .kwb-file-menu-host.chat-image-attachment { width:180px; max-width:100%; padding:4px; }
    .kwb-file-menu-host .chat-inline-image, .kwb-file-menu-host .workstep-photo { display:block; width:100%; height:160px; object-fit:cover; border-radius:7px; cursor:pointer; background:#f1f3f5; }
    .kwb-file-menu-host .chat-image-actions { display:none; }
    .kwb-file-menu-host:focus-within .chat-image-actions, .kwb-file-menu-host:hover .chat-image-actions { display:block; font-size:11px; }
    @media(hover:hover) and (pointer:fine) { .kwb-file-menu:not([open]) { opacity:0; } .kwb-file-menu-host:hover .kwb-file-menu, .kwb-file-menu-host:focus-within .kwb-file-menu { opacity:1; } }
    .project-billing-entry { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid #edf0f2; min-width:0; }
    .project-billing-entry:last-child { border-bottom:0; }
    .project-billing-title { border:0; background:none; color:var(--text); padding:0; text-align:left; cursor:pointer; font:inherit; font-weight:700; }
    .project-billing-title:hover, .project-billing-title:focus-visible { color:var(--brand); text-decoration:underline; }
    .project-billing-meta { min-width:0; overflow-wrap:anywhere; font-size:12px; }
    .project-billing-actions { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px; margin-left:10px; }
    .project-billing-actions .icon-file-action { flex:0 0 28px; }
    .project-billing-preview .modalbox { width:min(980px,96vw); max-height:92vh; display:flex; flex-direction:column; }
    .project-billing-preview-head { display:flex; align-items:center; gap:12px; padding-bottom:10px; }
    .project-billing-preview-head h2 { margin:0; font-size:18px; flex:1; }
    .project-billing-preview-body { overflow:auto; background:#e9edf2; padding:16px; }
    .project-billing-preview-body .kwb-document { margin:0 auto 12px; }
    @media(max-width:700px) { .project-billing-entry { flex-wrap:wrap; } .project-billing-actions { margin-left:0; } }
    .project-member-search { width: 100%; }
    .project-member-choices { max-height: 280px; overflow-y: auto; margin-top: 6px; }
    .project-member-choice { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #edf0f2; }
    .project-member-choice:last-child { border-bottom: 0; }
    .project-member-choice span { flex: 1; min-width: 0; }
    .project-member-choice b { font-size: 12px; }
    .project-member-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
    .project-member-choice .btn { padding: 5px 8px; }
    .project-member-empty { margin: 10px 0 0; color: var(--muted); }
    .project-member-profile-trigger { flex:1; min-width:0; padding:0; border:0; background:transparent; color:inherit; text-align:left; cursor:pointer; }
    .project-member-profile-trigger:hover b { color:var(--brand); text-decoration:underline; }
    .member-profile-card { text-align:center; }
    .member-profile-avatar { width:58px; height:58px; margin:2px auto 10px; display:grid; place-items:center; border-radius:50%; background:#edf0f2; color:#6c737c; font-size:23px; font-weight:700; }
    .member-profile-card h2 { margin:0 0 5px; font-size:20px; }
    .member-profile-details { margin-top:18px; border-top:1px solid var(--line); text-align:left; }
    .member-profile-detail { display:grid; grid-template-columns:minmax(100px,.8fr) minmax(160px,1.2fr); gap:12px; padding:12px 2px; border-bottom:1px solid var(--line); }
    .member-profile-detail b { text-align:right; overflow-wrap:anywhere; }
    #plannerDepartmentRows .planner-person-header,
    #plannerDepartmentRows .planner-person-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 190px 170px;
      align-items: center;
      gap: 16px;
    }
    #plannerDepartmentRows .planner-person-header {
      padding: 12px 0 8px;
      border-bottom: 1px solid var(--line);
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
    }
    #plannerDepartmentRows .planner-person-row > span { min-width: 0; overflow-wrap: anywhere; }
    #plannerDepartmentRows .planner-person-row select { width: 100%; min-width: 0; }
    #plannerDepartmentRows .planner-person-row label { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
    @media (max-width: 620px) {
      #plannerDepartmentRows .planner-person-header { display: none; }
      #plannerDepartmentRows .planner-person-row { grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
      #plannerDepartmentRows .planner-person-row label { grid-column: 1 / -1; }
    }

    .tabs {
      display: flex;
      gap: 6px;
      border-bottom: 1px solid var(--line);
      margin: 12px 0;
      overflow-x: auto;
    }

    .tabs button {
      border: 0;
      background: transparent;
      padding: 10px 12px;
      color: #59636f;
      border-bottom: 3px solid transparent;
      white-space: nowrap;
    }

    .tabs button.active {
      color: var(--brand);
      border-bottom-color: var(--brand);
      font-weight: 700;
    }

    .module-ribbon {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      overflow-x: auto;
      margin: 0 0 16px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
    }

    .module-ribbon-group {
      display: flex;
      align-items: flex-start;
      gap: 2px;
      flex-wrap: wrap;
      padding: 0 12px 0 0;
      min-width: max-content;
      border-right: 1px solid #d8dde3;
      flex: 0 0 auto;
    }

    .module-ribbon-group:last-child { border-right: 0; }
    .module-ribbon-group > small { flex-basis:100%; padding:5px 7px 0; color:var(--muted); font-size:11px; font-weight:700; }
    .ribbon-action { min-width:92px; min-height:42px; border:1px solid transparent; background:transparent; color:var(--ink); padding:6px 8px; display:flex; align-items:center; gap:7px; text-align:left; border-radius:6px; }
    .ribbon-action:hover, .ribbon-action:focus-visible { background:var(--soft); border-color:#f5c6b4; outline:0; }
    .ribbon-icon { display:grid; place-items:center; flex:0 0 24px; width:24px; height:24px; color:var(--brand); background:var(--soft); border-radius:5px; font-size:11px; line-height:1; font-weight:800; }
    .ribbon-action span:last-child { line-height:1.15; font-size:12px; }
    #billing .billing-sticky-header { position:sticky; top:0; z-index:30; padding-bottom:8px; margin-bottom:4px; background:var(--page); box-shadow:0 7px 14px rgba(18,28,45,.04); }
    #billing .billing-sticky-header > .module-ribbon { flex-wrap:nowrap; align-items:stretch; gap:6px; overflow-x:auto; margin-bottom:6px; }
    #billing .billing-sticky-header > .module-ribbon .module-ribbon-group { position:relative; flex-wrap:nowrap; align-items:center; min-width:0; padding:17px 7px 0 0; gap:1px; }
    #billing .billing-sticky-header > .module-ribbon .module-ribbon-group > small { position:absolute; top:0; left:5px; padding:0; white-space:nowrap; }
    #billing .billing-sticky-header > .module-ribbon .ribbon-action { min-width:0; min-height:34px; padding:4px 5px; gap:4px; white-space:nowrap; }
    #billing .billing-sticky-header > .module-ribbon .ribbon-icon { flex-basis:22px; width:22px; height:22px; }
    .billing-tabs { display:flex; gap:5px; padding:5px; margin:0; border:1px solid var(--line); border-radius:9px; background:#fff; }
    .billing-tabs button { border:0; border-radius:6px; background:transparent; color:var(--muted); padding:8px 13px; font-weight:700; }
    .billing-tabs button[aria-selected="true"] { background:var(--soft); color:var(--brand-dark); }
    .billing-tabs button:hover,.billing-tabs button:focus-visible { color:var(--brand-dark); outline:2px solid transparent; }
    #billing [data-billing-panel][hidden] { display:none; }
    .dunning-last-document { display:inline-flex; align-items:center; gap:10px; }
    .dunning-last-document-main { min-width:0; }
    .dunning-last-document-actions { display:inline-flex; align-items:center; flex:none; gap:4px; }
    .billing-document-actions { display:flex; align-items:center; gap:4px; width:max-content; white-space:nowrap; }
    .billing-output-tags { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
    #billing-panel-documents .table { table-layout:fixed; min-width:1380px; }
    #billing-panel-documents .table th,#billing-panel-documents .table td { padding:7px 8px; overflow:hidden; text-overflow:ellipsis; }
    #billing-panel-documents .table td:last-child { overflow:visible; }
    .billing-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:10px 12px; border-top:1px solid var(--line); }
    .billing-pagination .page-buttons { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
    .billing-pagination .btn { min-width:32px; min-height:30px; padding:5px 8px; }
    .accounting-info-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:14px 0; }
    .accounting-info-grid > div { padding:10px; border:1px solid var(--line); border-radius:7px; background:#fff; }
    .accounting-info-grid small { display:block; margin-bottom:4px; color:var(--muted); }
    .accounting-info-grid b { overflow-wrap:anywhere; }
    @media(max-width:600px) { .accounting-info-grid { grid-template-columns:1fr; } }
    .billing-document-actions .icon-file-action, .billing-document-actions .billing-badge-action { flex:0 0 30px; width:30px; height:30px; min-width:30px; min-height:30px; }
    .billing-badge-action { display:inline-grid; place-items:center; padding:3px; color:var(--brand); font-size:10px; font-weight:800; line-height:1; }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book td:last-child .icon-file-action,
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book td:last-child .billing-badge-action { display:inline-grid; place-items:center; width:30px; height:30px; min-width:30px; min-height:30px; padding:4px; vertical-align:middle; }
    :is(#accounting-pane-outgoing, #accounting-pane-incoming) .accounting-book td:last-child .billing-badge-action { font-size:12px; }
    .billing-document-actions [data-mail-document] { background:var(--brand); border-color:var(--brand); color:#fff; }

    .chat-log {
      min-height: 310px;
      max-height: 420px;
      overflow: auto;
      padding: 12px;
      background: #fbfcfd;
      border: 1px solid var(--line);
      border-radius: 7px;
    }

    .message {
      width: fit-content;
      min-width: 220px;
      max-width: min(680px, 76%);
      background: #eef1f4;
      border: 1px solid #d8dee5;
      border-radius: 7px;
      padding: 8px 9px;
      margin-bottom: 7px;
    }

    .message.own {
      margin-left: auto;
      background: #fff2eb;
      border-color: #f6cbb9;
    }

    .message small {
      display: block;
      color: var(--muted);
      margin-bottom: 5px;
    }

    .chat-message-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
    .chat-message-head small { margin-bottom:5px; }
    .chat-message-text { white-space:pre-wrap; overflow-wrap:anywhere; }
    .chat-mentioned-member { font-weight:700; text-decoration:underline; text-underline-offset:2px; }
    .chat-message-menu { position:relative; flex:0 0 auto; }
    .chat-message-menu summary { display:grid; place-items:center; width:24px; height:24px; border:1px solid transparent; border-radius:5px; color:var(--muted); cursor:pointer; list-style:none; font-size:15px; line-height:1; }
    .chat-message-menu summary::-webkit-details-marker { display:none; }
    .chat-message-menu summary:hover, .chat-message-menu[open] summary { border-color:var(--line); background:#fff; color:var(--ink); }
    .chat-message-menu-popover { position:absolute; z-index:25; top:27px; right:0; width:128px; padding:4px; border:1px solid var(--line); border-radius:6px; background:#fff; box-shadow:0 8px 22px #0002; }
    .chat-message-menu-popover button { display:block; width:100%; border:0; border-radius:4px; padding:7px 9px; background:transparent; color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
    .chat-message-menu-popover button:hover { background:#f3f5f7; }
    .chat-message-menu-popover button.danger { color:#b4232d; }
    .chat-reply-quote { margin:0 0 7px; padding:6px 8px; border-left:3px solid var(--brand); border-radius:3px; background:#f4f6f8; color:var(--muted); font-size:12px; }
    .chat-reply-quote b { display:block; color:var(--ink); margin-bottom:2px; }
    .chat-composer-context { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; padding:7px 9px; border-left:3px solid var(--brand); border-radius:4px; background:#f4f6f8; }
    .chat-composer-context[hidden] { display:none; }
    .chat-composer-context span { min-width:0; }
    .chat-composer-context b, .chat-composer-context small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .chat-composer-context button { flex:0 0 auto; width:26px; height:26px; padding:0; }
    .chat-mention-suggestions { margin-top:4px; border:1px solid var(--line); border-radius:6px; background:#fff; box-shadow:0 6px 18px #0002; max-height:180px; overflow:auto; }
    .chat-mention-suggestions[hidden] { display:none; }
    .chat-mention-suggestions button { display:block; width:100%; border:0; border-bottom:1px solid var(--line); padding:8px 10px; background:#fff; text-align:left; cursor:pointer; }
    .chat-mention-suggestions button:hover, .chat-mention-suggestions button.active { background:#fff3ed; }
    .chat-mention-suggestions small { color:var(--muted); margin-left:6px; }
    @media(max-width:720px) { .message { min-width:0; max-width:92%; } }

    .file-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 10px;
    }

    .file-card {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 7px;
      padding: 12px;
      background: #fff;
      color: inherit;
      text-align: left;
      cursor: pointer;
    }

    .file-card:hover {
      border-color: var(--info);
      background: #f7faff;
    }

    .file-card:disabled {
      cursor: not-allowed;
      opacity: .62;
      background: #f6f7f8;
    }

    .file-card h4 { margin: 0 0 7px; overflow-wrap: anywhere; }
    .file-card p { margin: 0; color: var(--muted); line-height: 1.35; }
    .file-actions { display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .file-actions .btn { min-height:28px; padding:4px 8px; font-size:11px; }
    .project-file-drop { display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; box-sizing:border-box; width:100%; min-height:68px; clear:both; border:2px dashed #b9c2cc; border-radius:7px; padding:11px 14px; margin:0 0 10px 0; text-align:center; background:#fbfcfd; transition:.15s ease; cursor:pointer; overflow:hidden; }
    .project-file-drop + .file-grid { clear:both; width:100%; margin-top:0; }
    .project-file-drop:hover, .project-file-drop:focus-within { border-color:var(--brand); background:#fff7f2; }
    .project-file-drop.dragover { border-color:var(--brand); background:#fff3ed; box-shadow:inset 0 0 0 1px var(--brand); }
    .project-file-drop strong { display:block; margin-bottom:6px; font-size:14px; }
    .project-file-drop small { color:var(--muted); }
    .project-file-drop input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
    .project-file-card { border:1px solid var(--line); border-radius:7px; padding:8px 10px; background:#fff; min-width:0; overflow:hidden; display:grid; grid-template-columns:46px minmax(0,1fr) auto; gap:10px; align-items:center; }
    .project-file-card h4 { margin:0 0 3px; font-size:13px; overflow-wrap:anywhere; line-height:1.25; }
    .project-file-card p { margin:0; color:var(--muted); font-size:11px; line-height:1.3; white-space:normal; }
    .project-file-uploader { display:block; margin-top:3px; color:#4d5661; font-size:10px; line-height:1.25; }
    .chat-image-actions .project-file-uploader { flex:1 0 100%; }
    .project-file-previewbox { width:46px; height:46px; border:1px solid var(--line); border-radius:6px; background:#f3f5f7; overflow:hidden; display:grid; place-items:center; padding:0; color:#29313a; font-size:11px; font-weight:800; }
    .project-file-main { min-width:0; }
    .document-files-layout { display:grid; grid-template-columns:minmax(300px,1fr) minmax(230px,290px); gap:12px; align-items:start; }
    .document-files-layout > aside { position:sticky; top:8px; }
    .document-template-list { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; }
    .document-template-item { min-width:0; border:1px solid var(--line); border-radius:7px; padding:7px 8px; background:#fff; }
    .document-template-item h4 { margin:0 0 2px; font-size:12px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .document-template-item small { display:block; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .document-template-item .actions { display:flex; flex-wrap:nowrap; gap:4px; margin-top:5px; }
    .document-template-item .actions .icon-file-action { flex:0 0 28px; }
    [data-admin-section="templates"] .document-template-item .actions { flex-wrap:wrap; }
    [data-admin-section="templates"] .document-template-item [data-admin-move-document-template] { min-width:32px; padding:5px 8px; }
    [data-admin-section="templates"] .document-template-item [data-template-name-input] { width:min(100%,520px); margin-bottom:4px; }
    .document-template-item [data-use-document-template] { color:#fff; background:var(--brand); border-color:var(--brand); }
    .document-file-state { display:flex; gap:5px; align-items:center; flex-wrap:wrap; margin:3px 0; }
    @media(max-width:980px) { .document-files-layout { grid-template-columns:1fr; } .document-files-layout > aside { position:static; } }
    .document-name-dialog { width:min(620px,calc(100vw - 32px)); max-width:620px; border:0; border-radius:8px; padding:0; background:#fff; color:var(--text); box-shadow:0 20px 70px #0007; }
    .document-name-dialog::backdrop { background:rgba(20,27,35,.62); }
    .document-name-dialog form { padding:20px; }
    .document-name-dialog h3 { margin:0 0 16px; font-size:18px; }
    .document-name-dialog input { width:100%; }
    .project-file-thumb { display:block; width:100%; height:100%; object-fit:cover; background:#f3f5f7; cursor:pointer; }
    .project-file-thumb:hover { opacity:.92; }
    .project-file-image-loading { color:var(--muted); font-size:12px; }
    #projectTabContent .file-grid { grid-template-columns:minmax(0,1fr); gap:6px; align-items:start; }
    #projectTabContent .project-upload-grid { grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:8px; }
    .project-upload-grid .bulk-select-item, .project-photo-grid .bulk-select-item { gap:4px; }
    .project-upload-grid .project-file-card { width:100%; padding:5px; display:flex; flex-direction:column; align-items:stretch; gap:5px; }
    .project-upload-grid .project-file-previewbox { width:100%; height:88px; box-sizing:border-box; cursor:pointer; }
    .project-upload-grid .project-file-main h4 { font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .project-upload-grid .project-file-main p { font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .project-upload-grid .file-card-actions { justify-content:flex-start; gap:3px; }
    .icon-file-action { display:inline-grid; place-items:center; width:28px; height:28px; min-width:28px; min-height:28px; padding:4px; line-height:1; }
    .icon-file-action svg { display:block; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
    .project-photo-grid .chat-image-actions .icon-file-action { width:27px; height:27px; min-width:27px; min-height:27px; padding:4px; }
    .photo-folder-bar { display:flex; gap:4px; flex-wrap:wrap; margin:4px 0 7px; }
    .photo-folder-bar .btn { min-height:27px; padding:4px 7px; font-size:11px; }
    .photo-folder-bar .btn.active { background:#f05a28; border-color:#f05a28; color:#fff; }
    .photo-folder-tools { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin:5px 0; }
    .photo-folder-tools select { width:auto; max-width:180px; min-width:110px; min-height:29px; }
    .photo-folder-tools .btn { min-height:29px; padding:5px 7px; }
    .photo-upload-strip { display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin:5px 0; }
    .photo-upload-strip input[type=file] { max-width:240px; font-size:11px; }
    .photo-options { margin:4px 0; font-size:11px; }
    .photo-options summary { cursor:pointer; color:var(--muted); }
    .project-photo-grid { margin-top:6px !important; }
    .project-photo-grid .workstep-photo { height:76px; }
    .post-edit-files { display:grid; gap:5px; margin-top:7px; }
    .post-edit-files .post-file-item { display:flex; align-items:center; gap:8px; }
    .file-folder-toolbar { display:grid; grid-template-columns:minmax(160px,1fr) auto; gap:7px; align-items:end; margin:0 0 9px; }
    .file-folder-toolbar .field { margin:0; }
    .file-folder-toolbar .actions { margin:0; flex-wrap:nowrap; }
    .file-folder-toolbar .icon-file-action { width:32px; height:32px; }
    @media(max-width:620px) { .file-folder-toolbar { grid-template-columns:1fr; } .file-folder-toolbar .actions { justify-content:flex-start; } }
    .file-card-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
    .file-card-actions .btn { min-height:29px; padding:5px 8px; font-size:11px; }
    .chat-document-attachment { display:flex; align-items:center; gap:9px; width:min(560px,100%); margin-top:7px; padding:7px 8px; border:1px solid var(--line); border-radius:6px; background:#fff; box-sizing:border-box; }
    .chat-document-icon { flex:0 0 34px; width:34px; height:34px; display:grid; place-items:center; border-radius:5px; background:#eef1f4; font-size:10px; font-weight:800; }
    .chat-pdf-attachment { display:flex; flex-direction:column; align-items:flex-start; gap:6px; margin-top:7px; max-width:min(260px,100%); }
    .chat-pdf-preview { display:grid; place-items:center; width:160px; min-height:190px; max-width:100%; overflow:hidden; border:1px solid var(--line); border-radius:6px; background:#f1f3f5; cursor:pointer; padding:4px; }
    .chat-pdf-preview canvas { display:block; max-width:100%; height:auto; background:#fff; box-shadow:0 1px 4px #0002; }
    .chat-pdf-preview canvas[hidden] { display:none; }
    .chat-pdf-preview .project-file-image-loading { padding:12px; text-align:center; }
    .chat-pdf-attachment .file-actions { max-width:100%; flex-wrap:wrap; }
    .chat-document-attachment .chat-pdf-preview { flex:0 0 90px; width:90px; min-height:115px; }
    .chat-document-info { min-width:0; flex:1; }
    .chat-document-info b { display:block; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .chat-document-info small { margin:1px 0 0; font-size:10px; }
    @media(max-width:720px) { .project-file-card { grid-template-columns:40px minmax(0,1fr); } .project-file-previewbox { width:40px; height:40px; } .project-file-card .file-card-actions { grid-column:1/-1; justify-content:flex-start; } }
    .project-chat-drop { position:relative; border:2px dashed transparent; border-radius:8px; padding:4px; transition:.15s ease; }
    .project-chat-drop.dragover { border-color:var(--brand); background:#fff7f2; }
    .project-chat-drop.dragover::after { content:"PDFs und Bilder hier ablegen"; position:absolute; inset:8px; z-index:5; display:grid; place-items:center; border-radius:7px; background:rgba(255,247,242,.94); color:var(--brand); font-weight:800; font-size:16px; pointer-events:none; }
    .chat-attachments-preview { margin-top:7px; color:var(--muted); font-size:12px; line-height:1.4; }
    .chat-attachments-preview span { display:inline-block; margin:2px 5px 2px 0; padding:4px 7px; border-radius:999px; background:#eef1f4; color:#4d5661; }
    .chat-inline-image { display:block; width:min(420px,100%); max-height:320px; object-fit:contain; margin:8px 0 6px; border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; }
    .workstep-photo { display:block; width:min(360px,100%); max-height:280px; object-fit:contain; margin:10px 0 6px; border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; }
    .project-completion-option { position:relative; }
    .project-completion-option input { position:absolute; width:1px; height:1px; opacity:0; }
    .project-completion-option .btn { display:inline-flex; cursor:pointer; }
    .project-completion-option input:checked + .btn { background:var(--brand); border-color:var(--brand); color:#fff; }
    .project-completion-option input:focus-visible + .btn { outline:2px solid currentColor; outline-offset:2px; }
    .project-completion-option input:disabled + .btn { cursor:wait; opacity:.65; }
    .workstep-fold > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px; cursor:pointer; list-style:none; }
    .workstep-fold > summary::-webkit-details-marker { display:none; }
    .workstep-fold > summary::before { content:"−"; flex:0 0 22px; width:22px; height:22px; display:grid; place-items:center; border:1px solid var(--line); border-radius:5px; font-size:18px; line-height:1; color:var(--muted); }
    .workstep-fold:not([open]) > summary::before { content:"+"; }
    .workstep-fold:not([open]) > summary { padding-block:10px; }
    .workstep-fold > summary > span:first-of-type { flex:1; }
    .chat-image-actions { display:flex; gap:7px; flex-wrap:wrap; align-items:center; margin:0 0 6px; }
    .chat-image-name { color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
    .project-file-card .file-card-actions { display:flex; gap:7px; flex-wrap:wrap; margin:0 2px 2px; }
    .project-upload-grid .project-file-card .file-card-actions { flex-wrap:nowrap; gap:3px; margin:0; }
    .project-upload-grid .file-card-actions .icon-file-action { flex:0 0 26px; width:26px; height:26px; min-width:26px; min-height:26px; padding:4px; }

    .file-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 7px;
      border: 0;
      background: transparent;
      color: var(--info);
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }

    #filePreviewModal { z-index: 40; }

    .file-preview {
      min-height: 55vh;
      display: grid;
      place-items: center;
      background: #f2f4f6;
      border: 1px solid var(--line);
      border-radius: 7px;
      overflow: hidden;
    }

    .file-preview img,
    .file-preview video {
      display: block;
      max-width: 100%;
      max-height: 70vh;
    }

    .file-preview.image-preview-mode {
      place-items: normal;
      justify-items: start;
      align-items: start;
      position: relative;
      display: block;
      height: 70vh;
      min-height: 0;
      min-width: 0;
      max-width: 100%;
      overscroll-behavior: contain;
      overflow: auto;
      padding: 12px;
      box-sizing: border-box;
    }

    .image-preview-stage {
      justify-self: start;
      margin: 0;
      display: flex;
      width: max-content;
      min-width: 100%;
      min-height: 100%;
      align-items: flex-start;
      justify-content: center;
    }

    .file-preview .image-preview-stage img {
      flex: 0 0 auto;
      max-width: none;
      max-height: none;
      cursor: zoom-in;
      box-shadow: 0 2px 12px rgba(0,0,0,.2);
    }

    .file-preview.xml-preview-mode {
      display: block;
      max-height: 70vh;
      overflow: auto;
      padding: 18px;
      box-sizing: border-box;
      background: #fff;
    }

    .xml-invoice-summary { max-width: 980px; margin: 0 auto; }
    .xml-invoice-summary .cards { margin: 0 0 14px; }

    .file-preview iframe {
      width: 100%;
      height: 70vh;
      border: 0;
      background: #fff;
    }

    .file-preview audio { width: min(620px, 90%); }

    .billing-line {
      display: grid;
      grid-template-columns: 68px 105px minmax(220px, 2fr) 90px 90px 120px 42px 42px 42px;
      gap: 8px;
      align-items: end;
      padding: 9px 0;
      border-bottom: 1px solid var(--line);
    }

    .billing-line .field { margin: 0; }
    .billing-drag-handle { align-self: end; min-height: 38px; display:flex; align-items:center; justify-content:center; cursor:grab; user-select:none; border:1px dashed var(--line); border-radius:6px; color:var(--muted); font-size:12px; font-weight:700; }
    .billing-drag-handle:active { cursor:grabbing; }
    .locked-project { color: var(--muted); font-weight: 700; }
    .access-note { color: var(--muted); font-size: 12px; }

    .report-months {
      display: grid;
      grid-template-columns: repeat(12, minmax(76px, 1fr));
      gap: 5px;
      min-width: 980px;
    }

    .report-months span {
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 4px;
      text-align: right;
      background: #fff;
      font-size: 12px;
    }

    .modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(16, 24, 39, .55);
      padding: 20px;
      z-index: 20;
    }

    .modal.open { display: flex; }

    .modalbox {
      width: min(920px, 96vw);
      max-height: 92vh;
      overflow: auto;
      background: #fff;
      border-radius: 8px;
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .warehouse-workspace { width:min(1400px,96vw); }
    .warehouse-workspace .card-pad { padding:16px; display:block; }
    .warehouse-workspace .form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
    .warehouse-workspace .action-line, #warehouseActionModal .action-line { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
    .warehouse-workspace .field, #warehouseActionModal .field { display:flex; flex-direction:column; gap:6px; }
    .warehouse-workspace th, .warehouse-workspace td { padding:10px; text-align:left; border-bottom:1px solid var(--line); }
    .warehouse-workspace .muted { color:var(--muted); }
    .warehouse-workspace [hidden] { display:none; }
    #warehouseMaterialHandoverContent > section:first-child > h1 { display:none; }
    .modalbox.compact { width: min(560px, 94vw); }
    #incomingInvoiceModal .modalbox { width:min(950px,calc(100vw - 32px)); }

    #accountingInfoModalContent:has(.accounting-customer-dialog) { width:min(1180px,calc(100vw - 32px)); }
    #customerMasterModal .modalbox { width:min(1180px,calc(100vw - 32px)); }
    #projectModal .modalbox { width:min(1320px,calc(100vw - 32px)); max-height:96vh; }
    .planner-search-results td:first-child { white-space:normal; overflow-wrap:anywhere; }
    #planner .job.planner-search-match { outline:3px solid var(--accent, #f4551e); outline-offset:1px; z-index:2; }
    #stockModalContent:has(.forecast-cost-details) { width:min(1160px,calc(100vw - 32px)); }
    .forecast-cost-details .forecast-controls { display:flex; flex-wrap:wrap; align-items:end; gap:8px 18px; margin-bottom:12px; }
    .forecast-cost-details .forecast-controls .field { margin:0; min-width:min(250px,100%); }
    .forecast-cost-details .forecast-controls p { margin:0 0 8px; }
    .forecast-cost-details .table th { white-space:normal; }
    .forecast-cost-details .table th:nth-child(2) { width:34%; }
    .forecast-cost-details .table td:nth-child(2),
    .forecast-cost-details .table td:nth-child(4) { white-space:normal; overflow-wrap:anywhere; }
    .forecast-cost-details .table .link-button { white-space:normal; text-align:left; }

    #stockModalContent:has(.warehouse-inventory-search) { width:min(1480px,calc(100vw - 32px)); }
    #stockModalContent:has(#warehousePurchaseRequestForm) { width:min(1280px,calc(100vw - 32px)); }
    #stockModalContent:has(.billing-text-library) { width:min(1100px,calc(100vw - 32px)); }
    .accounting-customer-dialog .tabs { margin:16px 0; flex-wrap:wrap; }
    .accounting-customer-dialog .accounting-info-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    @media(max-width:700px) { .accounting-customer-dialog .accounting-info-grid { grid-template-columns:1fr; } }

    #stockModalContent:has(.commission-detail-table) { width: min(1480px, calc(100vw - 32px)); }
    #stockModalContent:has(.stock-article-dialog) { width: min(1480px, calc(100vw - 32px)); }
    #stockModalContent:has(#newStockForm) { width:min(1560px,calc(100vw - 32px)); }
    #stockModalContent:has(#newStockForm) #materialCatalogResults .table { width:100%; min-width:720px; table-layout:fixed; }
    #stockModalContent:has(#newStockForm) #materialCatalogResults th:nth-child(1) { width:4%; }
    #stockModalContent:has(#newStockForm) #materialCatalogResults th:nth-child(2) { width:44%; }
    #stockModalContent:has(#newStockForm) #materialCatalogResults th:nth-child(3) { width:8%; }
    #stockModalContent:has(#newStockForm) #materialCatalogResults th:nth-child(4) { width:20%; }
    #stockModalContent:has(#newStockForm) #materialCatalogResults th:nth-child(5) { width:24%; }
    #materialImportReview .table { width:100%; min-width:900px; table-layout:fixed; }
    #materialImportReview th:nth-child(1) { width:24%; }
    #materialImportReview th:nth-child(2) { width:10%; }
    #materialImportReview th:nth-child(3) { width:24%; }
    #materialImportReview th:nth-child(4) { width:22%; }
    #materialImportReview th:nth-child(5) { width:20%; }
    #materialCatalogResults .table th, #materialCatalogResults .table td,
    #materialImportReview .table th, #materialImportReview .table td { white-space:normal; overflow-wrap:anywhere; vertical-align:top; }
    #materialCatalogResults .table .btn, #materialImportReview .table .btn { max-width:100%; margin:2px 4px 2px 0; white-space:normal; }
    .stock-article-dialog .table th, .stock-article-dialog .table td { white-space: normal; overflow-wrap: anywhere; }
    .stock-article-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; border-bottom:1px solid var(--line); padding-bottom:10px; }
    .stock-article-tabs .btn[aria-selected="true"] { background:var(--brand); border-color:var(--brand); color:#fff; }
    .list-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:10px 12px; border-top:1px solid var(--line); }
    .list-pagination .page-buttons { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
    .list-pagination .btn { min-width:32px; min-height:30px; padding:5px 8px; }
    .commission-detail-table .table { table-layout: fixed; }
    .commission-detail-table .table th,
    .commission-detail-table .table td { white-space: normal; overflow-wrap: anywhere; }
    .commission-detail-table .table th:nth-child(1) { width: 10%; }
    .commission-detail-table .table th:nth-child(2) { width: 15%; }
    .commission-detail-table .table th:nth-child(3) { width: 30%; }
    .commission-detail-table .table th:nth-child(4) { width: 13%; }
    .commission-detail-table .table th:nth-child(5) { width: 16%; }
    .commission-detail-table .table th:nth-child(6) { width: 16%; }

    .modalbox h3, .modalbox h2 { margin-top: 0; }

    .kwb-dialog { z-index: 6000 !important; }

    .kwb-dialog .modalbox {
      width: min(460px, calc(100vw - 32px));
      padding: 0;
      overflow: hidden;
    }

    .kwb-dialog-content { padding: 22px 22px 8px; }
    .kwb-dialog-content h2 { font-size: 20px; margin: 0 0 10px; }
    .kwb-dialog-message { margin: 0; color: var(--muted); line-height: 1.5; white-space: pre-line; }
    .kwb-dialog-input { width: 100%; margin-top: 16px; }
    .kwb-dialog .actions { margin: 0; padding: 14px 22px 20px; }

    .actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 15px;
    }

    .toast {
      position: fixed;
      left: 50%;
      top: 18px;
      transform: translateX(-50%);
      max-width: min(440px, calc(100vw - 36px));
      background: #20242a;
      color: #fff;
      padding: 11px 13px;
      border-radius: 7px;
      box-shadow: var(--shadow);
      z-index: 60000;
      pointer-events: none;
      text-align: center;
      font-weight: 650;
    }
    .toast.success { background: #168443; }

    .empty-state {
      padding: 32px;
      text-align: center;
      color: var(--muted);
    }

    @media (max-width: 960px) {
      .login-screen { grid-template-columns: 1fr; }
      .login-visual { display: none; }
      .app { grid-template-columns: 1fr; }
      .rail {
        height: auto;
        padding: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }
      .logo { display: none; }
      .nav { flex-direction: row; overflow-x: auto; }
      .nav :is(button, a) { min-width: 76px; }
      .top { flex-wrap: wrap; height: auto; min-height: 58px; padding: 10px; }
      .page { height: calc(100vh - 118px); }
      .cards, .two, .grid2, .grid3, .billing-workspace { grid-template-columns: 1fr; }
      .billing-preview-column { position:static; }
      .billing-preview-column .doc-preview { max-height:none; min-height:300px; }
      .billing-line { grid-template-columns: 1fr 1fr; }
      .kwb-document { padding: 26px 22px; min-height: 0; }
      .kwb-doc-top { display:block; height:auto; }
      .kwb-doc-top > div { display:block; width:auto; padding-right:0; }
      .kwb-sender { margin-top: 20px; }
      .kwb-footer { grid-template-columns: 1fr 1fr; }
      .login-panel { padding: 28px; }
    }

    @page { size: A4 portrait; margin: 0; }

    @media print {
      html, body {
        width: 210mm !important;
        min-width: 210mm !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
      }

      body > :not(#billingModal) { display: none !important; }
      #billingModal {
        position: static !important;
        display: block !important;
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
      }
      #billingModal > .modalbox {
        display: block !important;
        width: 210mm !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border-radius: 0 !important;
        box-shadow: none !important;
      }
      #billingModal > .modalbox > :not(#billingForm) { display: none !important; }
      #billingForm, #billingPreview, #billingPreview * { visibility: visible !important; }
      #billingForm > :not(.billing-workspace) { display:none !important; }
      #billingForm > .billing-workspace { display:block !important; }
      #billingForm > .billing-workspace > .billing-editor-column { display:none !important; }
      #billingForm > .billing-workspace > .billing-preview-column { display:block !important; padding:0 !important; border:0 !important; background:#fff !important; }
      #billingForm .billing-preview-heading { display:none !important; }
      #billingForm .billing-preview-column .kwb-document { zoom:1 !important; transform:none !important; }

      #billingPreview {
        position: static !important;
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
        background: #fff !important;
      }

      .kwb-document {
        position: relative !important;
        box-sizing: border-box !important;
        width: 210mm !important;
        max-width: none !important;
        height: 297mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 16mm 15mm 38mm !important;
        overflow: hidden !important;
        break-after: auto !important;
        page-break-after: auto !important;
        box-shadow: none !important;
        font-size: 8.5pt !important;
        line-height: 1.35 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
      }
      .kwb-document + .kwb-document {
        margin-top: 0 !important;
        break-before: page !important;
        page-break-before: always !important;
      }

      .kwb-doc-top {
        display: table !important;
        width: 180mm !important;
        height: 72mm !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
      }
      .kwb-doc-top > div { display:table-cell !important; vertical-align:top !important; }
      .kwb-doc-top > div:first-child { width:auto !important; padding-right:16mm !important; }
      .kwb-doc-top > div:last-child { width:88mm !important; }

      .kwb-doc-logo {
        display: block !important;
        width: 62mm !important;
        max-width: 62mm !important;
        margin: 0 0 0 auto !important;
      }

      .kwb-sender {
        margin-top: 24mm !important;
        font-size: 7pt !important;
      }

      .kwb-recipient {
        margin-top: 4mm !important;
        min-height: 20mm !important;
        font-size: 12pt !important;
        line-height: 1.45 !important;
      }

      .kwb-doc-meta { margin-top: 24mm !important; font-size: 8pt !important; }
      .kwb-doc-meta h2 {
        margin: 0 !important;
        padding-bottom: 1mm !important;
        font-size: 11pt !important;
        border-bottom: .3mm solid #a9a9a9 !important;
      }
      .kwb-meta-row { padding-top: 2mm !important; }
      .kwb-subject { margin: 0 0 5mm !important; font-size: 9pt !important; white-space: normal !important; overflow: visible !important; overflow-wrap: anywhere !important; }
      .kwb-intro { margin-bottom: 5mm !important; }
      .kwb-position-table { font-size: 8.5pt !important; }
      .kwb-invoice-positions { width:186mm !important; margin-left:-3mm !important; table-layout:fixed !important; }
      .kwb-position-table thead { display: table-header-group; }
      .kwb-position-table tr { break-inside: avoid; page-break-inside: avoid; }
      .kwb-position-table th { padding: .5mm .7mm !important; }
      .kwb-position-table td { padding: 1mm .7mm !important; }
      .kwb-invoice-positions th { padding-left:1.2mm !important; padding-right:1.2mm !important; }
      .kwb-invoice-positions td { padding-left:1.2mm !important; padding-right:1.2mm !important; }
      .kwb-totals { width: 45% !important; break-inside: avoid; page-break-inside: avoid; }
      .kwb-final-text p { break-inside: avoid; page-break-inside: avoid; }
      .kwb-payment-block {
        position: static !important;
        margin-top: 1.5mm !important;
        min-height: 27mm !important;
        display: block !important;
        padding-top: 1.5mm !important;
      }
      .kwb-payment-block.kwb-payment-compact-preview { margin-top: 0 !important; padding-top: 1mm !important; }
      .kwb-payment-copy { padding-right: 6mm !important; font-size: 8pt !important; }
      .kwb-payment-copy > strong { margin-bottom: .8mm !important; font-size: 9.5pt !important; }
      .kwb-payment-details td { width: 29mm !important; padding: .2mm 3mm .8mm 0 !important; }
      .kwb-payment-details th { padding: .2mm 0 .8mm !important; overflow-wrap: break-word !important; }
      .kwb-payment-qr { width: 27mm !important; }
      .kwb-payment-qr img { width: 27mm !important; height: 27mm !important; image-rendering: pixelated !important; }
      .kwb-payment-qr small { margin-top: .8mm !important; font-size: 6pt !important; }
      .kwb-continuation-head { margin-bottom: 6mm !important; padding-bottom: 3mm !important; }
      .kwb-continuation-head img { width: 52mm !important; }

      .kwb-footer {
        position: absolute !important;
        left: 15mm !important;
        right: 15mm !important;
        bottom: 12mm !important;
        display: block !important;
        margin: 0 !important;
        padding-top: 4mm !important;
        border-top: .7mm solid #c6b7b7 !important;
        font-size: 7pt !important;
        line-height: 1.28 !important;
      }
      .kwb-footer-table td { box-sizing: border-box !important; padding-right: 4mm !important; overflow-wrap: break-word !important; }
      .kwb-footer-table td:nth-child(1) { width: 32mm !important; }
      .kwb-footer-table td:nth-child(2) { width: 50mm !important; }
      .kwb-footer-table td:nth-child(3) { width: 39mm !important; }
      .kwb-footer-table td:nth-child(4) { width: 59mm !important; padding-right: 0 !important; }
      .kwb-page-number { width: 180mm !important; margin-top: .8mm !important; font-size: 7pt !important; }
      html.kwb-pdf-render .kwb-page-number { display: block !important; }
    }
    /* Hauptnavigation waagerecht oben */
    .app { grid-template-columns: 1fr; grid-template-rows: 68px minmax(0, 1fr); }
    .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 14px; display: flex; align-items: center; gap: 16px; overflow: hidden; }
    .logo { width: 118px; height: 56px; object-fit: contain; margin: 0; flex: 0 0 auto; }
    .nav { flex-direction: row; gap: 2px; align-items: stretch; overflow-x: auto; overflow-y: hidden; height: 68px; flex: 1; }
    .nav :is(button, a) { min-width: 74px; min-height: 68px; padding: 7px 9px; font-size: 10px; white-space: nowrap; }
    .nav :is(button, a) .nav-icon { font-size: 16px; margin-bottom: 3px; }
    .nav :is(button, a).active { border-left: 0; border-bottom: 3px solid var(--brand); }
    main { min-height: 0; }
    #postTopButton { display: none; }    /* Beschaffung vollständig in der Seitenbreite darstellen */
    #procurement .panelhead { flex-wrap: wrap; gap: 8px; }
    #procurement .table-wrap { overflow-x: auto; }
    #procurement .table { width: auto; min-width: 820px; table-layout: auto; }
    #procurement .table th, #procurement .table td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; padding: 8px; }
    #procurement .table th:first-child { min-width: 245px; }
    #procurement .table th:nth-child(2) { min-width: 88px; }
    #procurement .table th:nth-child(3) { min-width: 105px; }
    #procurement .table th:nth-child(4) { min-width: 180px; }
    #procurement .table th:last-child { min-width: 165px; }
    .procurement-column-button { border:0; background:transparent; color:inherit; font:inherit; font-weight:700; text-align:left; cursor:pointer; padding:2px 4px; border-radius:4px; }
    .procurement-column-button:hover, .procurement-column-button.active { background:#e7edf5; color:#1557a0; }
    .procurement-column-button:focus-visible { outline:2px solid #1557a0; outline-offset:2px; }
    #procurement .table .btn { max-width: 100%; white-space: normal; }
    #procurement .procurement-overview { display:flex; flex-wrap:wrap; gap:10px; padding:0 12px 12px; }
    #procurement .procurement-overview .card { min-width:145px; flex:0 1 190px; padding:10px 12px; }
    @media (max-width:650px) {
      .billing-editor-column .billing-line { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-areas:"drag drag" "kind kind" "description description" "quantity unit" "price price" "controls controls"; }
    }
    @media (max-width:1050px) {
      .app { height:100vh; height:100svh; grid-template-columns:minmax(0,1fr); grid-template-rows:68px minmax(0,1fr); }
      .rail { min-width:0; padding:0 8px; }
      .nav { min-width:0; touch-action:pan-x; }
      main { display:flex; flex-direction:column; min-width:0; min-height:0; }
      .top { flex:0 0 auto; }
      .page { flex:1 1 auto; height:auto; min-height:0; scrollbar-gutter:auto; }
      .project-workspace, #customers .project-workspace { grid-template-columns:minmax(0,1fr); }
      .project-sidebar, #customers .project-sidebar { position:static; max-height:min(35svh,320px); }
      .admin-settings-layout { grid-template-columns:minmax(0,1fr); }
      .admin-settings-nav { position:static; display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; }
      .admin-settings-nav button { flex:0 0 auto; width:auto; white-space:nowrap; }
      .modalbox { max-width:100%; max-height:calc(100svh - 24px); }
      #planner .planner-shell, #planner .month-fit { grid-template-columns:minmax(0,1fr); }
      #planner .planner-scroll { width:100%; }
      #planner .planner-controls { flex-wrap:wrap; }
      #planner .planner-controls h3 { flex:1 1 180px; }
    }
    @media (max-width:600px) {
      .app { grid-template-rows:calc(70px + env(safe-area-inset-top)) minmax(0,1fr); }
      .rail { align-items:flex-end; padding:max(8px,env(safe-area-inset-top)) 5px 0; }
      .logo { width:74px; height:56px; }
      .nav { height:70px; align-items:stretch; -webkit-font-smoothing:antialiased; text-rendering:geometricPrecision; }
      .nav :is(button, a) { min-width:72px; min-height:70px; padding:8px 8px 7px; font-size:11px; font-weight:650; line-height:1.2; }
      .nav :is(button, a) .nav-icon { font-size:19px; margin-bottom:5px; }
      .top { padding:7px 9px; min-height:48px; gap:6px; }
      .top h2 { font-size:15px; }
      .page { padding:8px 8px max(72px,calc(env(safe-area-inset-bottom) + 54px)); }
      input, select, textarea { font-size:16px; }
      .btn, .tabs button { min-height:42px; }
      .modal { padding:max(6px,env(safe-area-inset-top)) 6px max(6px,env(safe-area-inset-bottom)); }
      .modalbox, .modalbox.compact, #incomingInvoiceModal .modalbox { width:100%; max-width:100%; max-height:calc(100svh - 16px); padding:12px; }
      .actions, .panelhead { flex-wrap:wrap; }
      .table-wrap { max-width:100%; -webkit-overflow-scrolling:touch; }
      #planner .planner-shell { padding:6px; }
      #planner .planner-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #planner .planner-summary .card { min-width:0; padding:8px; }
      #planner .planner-controls { gap:5px; padding:8px; }
      #planner .planner-controls .btn { padding:6px 8px; }
      #planner .planner-controls h3 { flex-basis:100%; order:-1; margin:0; font-size:14px; }
      #planner .planner .name { padding:8px 5px; font-size:11px; line-height:1.25; }
      #planner .planner .headcell { padding:6px 2px; font-size:11px; }
      #planner .planner .cell { min-width:0; }
      #assignmentModal { align-items:flex-start; padding:max(8px,env(safe-area-inset-top)) 6px 6px; }
      #assignmentModal .modalbox { width:min(100%,460px); max-height:calc(100svh - max(16px,env(safe-area-inset-top))); overflow:auto; padding:10px; }
      #assignmentModal .assignment-heading { position:sticky; top:-10px; z-index:3; margin:-10px -10px 8px; padding:10px; background:#fff; border-bottom:1px solid var(--line); }
      #assignmentModal .field { margin-bottom:7px; }
      #assignmentModal .grid2 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
      #assignmentModal .assignment-types { gap:10px; margin:4px 0 9px; }
      #assignmentModal #assignmentSearch { margin-bottom:5px; padding:8px; }
      #assignmentModal #assignmentResults { max-height:132px; margin-bottom:7px; }
      #assignmentModal .assignment-option { padding:7px 8px; }
      #assignmentModal #assignmentNote { height:42px; min-height:42px; }
      #assignmentModal details { margin-top:2px; }
      #assignmentModal .actions { margin-top:7px; }
    }
    .project-mobile-back { display:none; }
    @media (max-width:700px) {
      html, body, .app, main, .page, .view { min-width:0; max-width:100%; }
      html, body { overflow-x:hidden; }
      #projects, #projects .project-workspace, #projects .project-sidebar, #projects .project-detail-pane { min-width:0; max-width:100%; box-sizing:border-box; }
      #projects .project-workspace { display:grid; grid-template-columns:minmax(0,1fr) !important; }
      #projects .project-sidebar { display:flex; flex-direction:column; max-height:none !important; overflow:visible; padding:10px; }
      #projects .project-sidebar > h3 { order:0; margin:0 0 8px; }
      #projects .project-search-wrap { order:1; }
      #projects .project-mode-actions { order:2; }
      #projects #projectList { order:3; max-height:max(300px, min(52svh, 520px)); overflow-y:auto; border:1px solid var(--line); border-radius:6px; -webkit-overflow-scrolling:touch; }
      #projects .project-filter-actions { order:4; margin-top:10px; }
      #projects .project-manage-actions { order:5; }
      #projects .project-detail-pane { display:none; padding:12px; overflow-wrap:anywhere; }
      #projects .mobile-project-detail-open > .project-sidebar { display:none; }
      #projects .mobile-project-detail-open > .project-detail-pane { display:block; }
      #projects .project-mobile-back { display:inline-flex; align-items:center; margin-bottom:10px; }
      #projects .project-detail-heading { align-items:stretch; }
      #projects .project-detail-heading h2 { min-width:0; overflow-wrap:anywhere; }
      #projects .project-detail-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
      #projects .project-record-workspace, #projects .project-record-workspace.context-collapsed { grid-template-columns:minmax(0,1fr); }
      #projects .project-chat-pane { height:auto; min-height:260px; }
      #projects .project-context-pane { min-width:0; }
      #planner .planner-shell:not(.month-fit) .planner-scroll { overflow:visible; }
      #planner .compact-week { width:100% !important; min-width:0 !important; }
      #planner .compact-week .cell { min-width:0; padding:2px 1px; }
      #planner .compact-week .name { padding:7px 2px; font-size:10px; line-height:1.2; }
      #planner .planner-shell:not(.month-fit) .compact-week .headcell { height:auto; min-height:45px; padding:4px 1px; font-size:9px; }
      #planner .compact-week .planner-day-heading { justify-content:center; }
      #planner .compact-week .planner-day-heading .time-scale { display:none; }
      #planner .compact-week .time-track .job { min-width:9px; padding:2px !important; }
      #planner .compact-week .planner-job-label { font-size:8px; line-height:1; }
      #planner .compact-week .planner-job-address { font-size:8px; }
      #planner .compact-week .range-handle { display:none; }
      #planner .compact-week .cell.name,
      #planner .compact-week .cell[data-employee][data-date] { min-height:56px; box-sizing:border-box; }
      #planner .compact-week .cell.name { display:flex; align-items:center; align-content:center; flex-wrap:nowrap; gap:2px; }
      #planner .compact-week .planner-employee-handle { margin-right:2px; }
      #planner .compact-week .cell.name > span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      #planner .compact-week .planner-row-add { flex-basis:20px; width:20px; height:20px; font-size:14px; }
      #planner .mobile-planner-memberships { display:block; }
      #planner .mobile-planner-memberships { margin:0 10px 10px; border:1px solid var(--line); border-radius:6px; background:#fff; }
      #planner .mobile-planner-memberships summary { padding:10px; font-weight:700; cursor:pointer; }
      #planner .mobile-planner-memberships .member { padding:8px 10px; flex-wrap:wrap; }
      #planner .mobile-planner-memberships .member > span { min-width:0; flex:1 1 160px; overflow-wrap:anywhere; }
    }

    .chat-log .message.chat-media-message { display:inline-block; vertical-align:top; box-sizing:border-box; width:calc(33.333% - 8px); min-width:150px; max-width:210px; margin:0 6px 8px 0; padding:6px; }
    .chat-media-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,140px)); gap:6px; margin-top:6px; }
    .chat-media-message .chat-media-grid { grid-template-columns:repeat(auto-fit,minmax(95px,1fr)); }
    .chat-media-grid .kwb-file-menu-host.chat-image-attachment { width:100%; box-sizing:border-box; }
    .chat-media-grid .chat-inline-image, .chat-media-grid .workstep-photo { height:110px; }
    .chat-media-grid .chat-document-attachment { min-width:0; max-width:100%; flex-wrap:wrap; box-sizing:border-box; }
    .chat-media-grid .chat-document-attachment { display:flex; flex-direction:column; align-items:stretch; gap:7px; padding:7px; border-radius:10px; width:100%; background:#fff; }
    .chat-media-grid .chat-document-attachment .chat-pdf-preview { flex:none; width:100%; height:110px; min-height:110px; margin:0; }
    .chat-media-grid .chat-document-info { display:block; flex:none; width:100%; min-width:0; overflow:hidden; }
    .chat-media-grid .chat-document-info b { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; font-size:12px; line-height:1.35; }
    .chat-media-grid .chat-document-info small { display:block; font-size:10px; line-height:1.5; white-space:normal; overflow-wrap:normal; word-break:normal; margin-top:4px; }
    .chat-media-grid .chat-document-attachment .file-card-actions:empty { display:none; }

    .chat-media-message .chat-message-head { font-size:10px; overflow-wrap:anywhere; }
    @media(max-width:650px) { .chat-log .message.chat-media-message { width:calc(50% - 8px); min-width:0; max-width:none; } }
  .chat-media-grid .chat-pdf-preview { width:100%; height:110px; min-height:110px; max-height:110px; box-sizing:border-box; }
    .chat-media-grid .chat-pdf-attachment { min-width:0; width:100%; }
    .chat-media-grid .chat-pdf-preview canvas { max-height:102px; object-fit:contain; }
    .kwb-file-menu-panel a { overflow-wrap:anywhere; }
    .project-file-previewbox canvas { display:block; max-width:100%; max-height:100%; object-fit:contain; background:#fff; }
    .project-file-previewbox canvas[hidden] { display:none; }
    .project-file-previewbox .project-file-image-loading { font-size:10px; font-weight:400; padding:4px; }
    #kwbDialog { margin:0; width:100vw; height:100dvh; max-width:none; max-height:none; border:0; box-sizing:border-box; color:var(--text); }
    #kwbDialog::backdrop { background:transparent; }
    
.credit-table-wrap{overflow-x:auto}.credit-table{min-width:1080px!important;table-layout:auto!important}.credit-table th,.credit-table td{width:auto!important;vertical-align:top;padding:10px 8px!important}.credit-table td:last-child{min-width:160px;position:sticky;right:0;background:white}.credit-table .money{white-space:nowrap}.credit-positive{color:#19813a}.invoice-negative{color:#b42318}.credit-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.credit-actions .btn{padding:6px 9px;min-height:30px}.credit-dialog{width:min(680px,94vw);max-height:85vh;border:1px solid #dbe2eb;border-radius:14px;padding:0;box-shadow:0 15px 50px #0003}.credit-dialog::backdrop{background:#16233266}.credit-dialog .panelhead{display:flex;justify-content:space-between;padding:14px;border-top:3px solid #ff5722}.credit-dialog-body{padding:16px;overflow:auto}.credit-dialog label{display:block;margin:12px 0}.credit-dialog input,.credit-dialog select,.credit-dialog textarea{width:100%;box-sizing:border-box}.credit-history{padding-left:20px}.credit-history li{padding:8px 0;border-bottom:1px solid #e5e7eb}


/* Compact, consistently aligned incoming invoice rows. */
#accounting .credit-table{width:100%;min-width:1040px!important}
#accounting .credit-table th,#accounting .credit-table td{vertical-align:middle!important;padding:10px 8px!important;line-height:1.35}
#accounting .credit-table th.money,#accounting .credit-table td.money{text-align:right!important;font-variant-numeric:tabular-nums}
#accounting .credit-table th:nth-child(2),#accounting .credit-table td:nth-child(2){min-width:145px;max-width:230px;overflow-wrap:anywhere}
#accounting .credit-table th:last-child,#accounting .credit-table td:last-child{width:180px!important;min-width:180px!important;position:sticky;right:0;background:var(--panel,#fff);box-shadow:-1px 0 #e2e7ee}
#accounting .credit-table .credit-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center;gap:5px;margin-top:5px}
#accounting .credit-table .credit-actions .btn{display:inline-flex!important;align-items:center;justify-content:center;width:30px!important;min-width:30px!important;max-width:30px!important;height:30px!important;min-height:30px!important;padding:5px!important;flex:0 0 30px!important;margin:0!important}
#accounting .credit-table .credit-actions svg,.credit-settled svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#accounting .credit-table .credit-zero{color:#536171!important}
.credit-settled{display:inline-flex;color:#19813a;vertical-align:middle}

/* Approved window-envelope layout, 2026-12-03. Shared by measurement, preview and PDF. */
.kwb-document{padding-left:20mm!important;padding-right:25mm!important}
.kwb-doc-top{width:175mm!important;flex-shrink:0!important}
.kwb-doc-top>div:first-child{padding-right:8mm!important}
.kwb-doc-top>div:last-child{width:88mm!important}
.kwb-doc-meta{width:68mm!important;margin-left:auto!important}
.kwb-meta-row{grid-template-columns:42% minmax(0,1fr)!important;gap:4mm!important}
.kwb-sender,.kwb-recipient{position:relative;left:5mm;top:8mm}
.kwb-invoice-positions{width:165mm!important;margin-left:0!important}
.kwb-footer{left:20mm!important;right:25mm!important}
.kwb-footer-table td:nth-child(1){width:17.7778%!important}
.kwb-footer-table td:nth-child(2){width:27.7778%!important}
.kwb-footer-table td:nth-child(3){width:21.6667%!important}
.kwb-footer-table td:nth-child(4){width:32.7778%!important}
.kwb-page-number{width:165mm!important}
.kwb-totals{width:52%!important}
.kwb-totals td:first-child{padding-right:4mm!important}
.kwb-document[data-document-page="1"]::before,.kwb-document[data-document-page="1"]::after{content:"";position:absolute;left:5mm;width:5mm;height:0;border-top:.2mm solid #707070;pointer-events:none}
.kwb-document[data-document-page="1"]::before{top:105mm}
.kwb-document[data-document-page="1"]::after{top:210mm}
