.ksef-project-button { display:inline-flex; align-items:center; gap:6px; max-width:210px; min-height:30px; box-sizing:border-box; padding:5px 8px; border:1px solid var(--border,#dbe5ee); border-radius:6px; color:var(--text,#475569); background:var(--card,#fbfdff); font-size:11.5px; font-weight:600; text-decoration:none; transition:background .12s,border-color .12s; }
.ksef-project-button [data-project-label] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ksef-project-button:hover { background:#f1f5f9; border-color:#94a3b8; }
.ksef-project-button--assigned { color:#0f766e; background:#ecfdf8; border-color:#9fd8ca; }
.ksef-project-button--missing { color:#b42318; border-color:#f0a49f; background:#fff8f7; }
.ksef-project-button--missing:hover { color:#991b1b; border-color:#dc2626; background:#fee2e2; }
.ksef-project-button:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.ksef-project-warning { display:inline-flex; flex:none; justify-content:center; align-items:center; width:15px; height:15px; border:1px solid currentColor; border-radius:50%; font-weight:800; }
.ksef-project-warning[hidden] { display:none; }
.app-modal__dialog:has([data-invoice-project-form]) { width:min(880px,calc(100vw - 24px)); }
.invoice-project-page { max-width:880px; margin:0 auto; padding:18px; border:1px solid var(--border,#dbe5ee); border-radius:8px; background:var(--card,#fff); }
form.invoice-project-picker { margin:0; padding:0; border:0; background:transparent; }
.invoice-project-picker__invoice { margin:0 0 16px; font-size:13px; overflow-wrap:anywhere; }
.invoice-project-context.ksef-invoice-lines { display:block; min-width:0; margin-bottom:22px; padding:0 0 16px; border:0; border-bottom:1px solid var(--line,#dbe5ee); border-radius:0; background:transparent; }
.invoice-project-context__head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:12px; }
.invoice-project-context__head > div { min-width:0; }
.invoice-project-context__eyebrow, .invoice-project-context__amount > span { color:var(--muted,#64748b); font-size:11px; }
.invoice-project-context__head h3 { margin:3px 0 5px; font-size:17px; overflow-wrap:anywhere; }
.invoice-project-context__head p { margin:0; font-size:13px; overflow-wrap:anywhere; }
.invoice-project-context__amount { flex:none; text-align:right; }
.invoice-project-context__amount strong, .invoice-project-context__amount small { display:block; margin-top:4px; }
.invoice-project-context__amount strong { font-size:15px; font-variant-numeric:tabular-nums; }
.invoice-project-context__amount small { color:var(--muted,#64748b); font-size:11px; }
.invoice-project-context .ksef-invoice-lines__table-wrap { max-height:250px; overflow:auto; }
.invoice-project-context table, .ksef-invoice-modal .ksef-invoice-lines table { min-width:720px; }
.ksef-invoice-modal .ksef-invoice-lines__table-wrap { overflow-x:auto; }
.invoice-project-context__empty { margin:12px 0; color:var(--muted,#64748b); font-size:13px; }
.invoice-project-context__preview { display:inline-flex; margin-top:10px; color:var(--accent,#0f766e); font-size:12px; text-underline-offset:3px; }
.ksef-invoice-project-detail .ksef-project-button { max-width:100%; padding:7px 10px; font-size:12px; }
.ksef-invoice-project-detail [data-project-label] { white-space:normal; overflow-wrap:anywhere; }
.ksef-project-change { flex:none; margin-left:4px; font-size:11px; font-weight:400; text-decoration:underline; text-underline-offset:3px; }
.ksef-project-button--missing .ksef-project-change, .ksef-project-button--unassigned .ksef-project-change { display:none; }
.invoice-project-options { padding:0; margin:12px 0; border:1px solid var(--border,#dbe5ee); border-radius:6px; max-height:300px; overflow:auto; }
label.invoice-project-option { display:flex; gap:10px; align-items:center; margin:0; padding:10px; cursor:pointer; font-weight:400; text-transform:none; font-size:13px; }
.invoice-project-option[hidden] { display:none; }
.invoice-project-option:hover, .invoice-project-option:has(input:checked) { background:#eef7f5; }
.invoice-project-option input { width:16px; min-height:16px; height:16px; margin:0; flex:none; accent-color:#0f766e; }
.invoice-project-option span { min-width:0; overflow-wrap:anywhere; }
.invoice-project-option strong, .invoice-project-option small { display:block; }
.invoice-project-option small { margin-top:3px; color:var(--muted,#64748b); font-size:12px; }
.invoice-project-alternatives { border-top:1px solid var(--border,#dbe5ee); padding-top:6px; }
.invoice-project-picker__actions { display:flex; gap:8px; margin-top:16px; }
.invoice-project-error { color:#b42318; padding:10px; background:#fff1f2; border-radius:6px; }
.invoice-project-picker[aria-busy="true"] { opacity:.7; }
[data-theme="dark"] .ksef-project-button { color:#cbd5e1; background:#172332; border-color:#475569; }
[data-theme="dark"] .ksef-project-button:hover { background:#26364a; }
[data-theme="dark"] .ksef-project-button--assigned { color:#99e2cc; border-color:#347b6d; background:#18362f; }
[data-theme="dark"] .ksef-project-button--missing { color:#fca5a5; border-color:#b35c5c; background:#382328; }
[data-theme="dark"] .ksef-project-button--missing:hover { background:#51292e; border-color:#ef8a8a; }
[data-theme="dark"] .invoice-project-page { background:#172332; }
[data-theme="dark"] .invoice-project-option:hover, [data-theme="dark"] .invoice-project-option:has(input:checked) { background:#223e3c; }
[data-theme="dark"] .invoice-project-error { color:#fecaca; background:#42252b; }
@media(max-width:600px) {
  .invoice-project-options { max-height:35vh; }
  .invoice-project-page { padding:12px; }
  .invoice-project-context__head { flex-direction:column; gap:10px; }
  .invoice-project-context__amount { text-align:left; }
  .invoice-project-context .ksef-invoice-lines__table-wrap { max-height:220px; }
}
