﻿    :root {
      --bg: #eef0f4;
      --bg-soft: #ffffff;
      --bg-hover: #e4e6eb;
      --bg-chip: #e1e3ea;
      --text: #0a0a0a;
      --text-rgb: 15, 23, 42;
      --text-muted: #6b7280;
      --border: #e5e5e5;
      --border-hover: #d4d4d4;
      --accent: #C0143C;
      --accent-hover: #9A1030;
      --accent-soft: rgba(192, 20, 60, 0.10);
      --accent-border: rgba(192, 20, 60, 0.25);
      --primary-bg: #0a0a0a;
      --primary-text: #ffffff;
      --primary-bg-hover: #262626;
      --primary-bg-disabled: #525252;
      --backdrop: rgba(10, 10, 10, 0.6);
      --shadow: rgba(10, 10, 10, 0.15);
      --layout-cols-gap: 16px;
      --page-max: 1120px;
      --body-pad-top: 12px;
      --body-pad-x: 24px;
      --body-pad-bottom: 56px;
      --card-pad: 36px;
      --logo-h: 88px;
      --section-stack: 24px;
      --sticky-top: 24px;
      --lightbox-max-h: 1273px;
      color-scheme: light;
    }

    [data-theme="dark"] {
      --bg: #0a0a0a;
      --bg-soft: #141414;
      --bg-hover: #1f1f1f;
      --bg-chip: #2a2a2a;
      --text: #ffffff;
      --text-rgb: 255, 255, 255;
      --text-muted: #9ca3af;
      --border: #2a2a2a;
      --border-hover: #3a3a3a;
      --accent: #E01848;
      --accent-hover: #C0143C;
      --accent-soft: rgba(224, 24, 72, 0.12);
      --accent-border: rgba(224, 24, 72, 0.32);
      --primary-bg: #ffffff;
      --primary-text: #0a0a0a;
      --primary-bg-hover: #e5e5e5;
      --primary-bg-disabled: #525252;
      --backdrop: rgba(0, 0, 0, 0.7);
      --shadow: rgba(0, 0, 0, 0.5);
      color-scheme: dark;
    }

    input[type="date"] {
      color-scheme: light;
    }
    [data-theme="dark"] input[type="date"] {
      color-scheme: dark;
    }
    input[type="date"]::-webkit-calendar-picker-indicator {
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
      background-repeat: no-repeat;
      background-position: center;
      background-size: 18px 18px;
      width: 20px;
      height: 20px;
      opacity: 1;
      filter: none;
      cursor: pointer;
      transition: opacity 0.15s ease;
    }
    input[type="date"]::-webkit-calendar-picker-indicator:hover {
      opacity: 0.7;
    }
    [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1d5db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>");
    }

    * { box-sizing: border-box; }

    html, body {
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      min-height: 100vh;
      padding: var(--body-pad-top) var(--body-pad-x) var(--body-pad-bottom);
      letter-spacing: -0.01em;
      position: relative;
    }

    [data-theme="light"] body {
      background: radial-gradient(circle at 50% -10%, #ffffff 0%, transparent 60%), #eef0f4;
      background-attachment: fixed;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: -1;
    }

    [data-theme="light"] body::before {
      display: none;
    }

    [data-theme="dark"] body::before {
      background: radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.05), transparent 50%);
    }

    .page {
      max-width: var(--page-max);
      margin: 0 auto;
      position: relative;
    }

    .header {
      margin-bottom: 4px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      position: relative;
      padding: 0;
    }

    .header-brand {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 0;
    }

    .header-toolbar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: var(--layout-cols-gap);
      width: 100%;
      align-items: center;
      margin-top: 4px;
    }

    .logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      font-size: 32px;
      font-weight: 700;
      letter-spacing: -0.04em;
      color: var(--text);
    }

    .logo-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--text);
      display: inline-block;
    }

    .tagline {
      margin: 2px 0 0;
      text-align: center;
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 400;
      letter-spacing: -0.01em;
    }

    .mobile-flow-intro {
      display: none;
    }

    .mobile-section-head,
    .step-badge {
      display: none;
    }

    .btn-settings {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      margin-top: 4px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      letter-spacing: -0.005em;
      cursor: pointer;
      transition: border-color 0.15s ease, color 0.15s ease;
      white-space: nowrap;
    }
    .btn-settings:hover { border-color: var(--text); }
    .btn-settings:focus-visible {
      outline: none;
      border-color: var(--text);
    }
    .btn-settings svg {
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
      color: var(--text-muted);
      transition: color 0.15s ease;
    }
    .btn-settings:hover svg,
    .btn-settings:focus-visible svg { color: var(--text); }

    .btn-theme {
      padding: 8px;
    }

    .btn-theme-mobile,
    .btn-settings-mobile {
      display: none;
    }

    .view-tab-settings {
      display: none;
    }

    .btn-theme svg {
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
    }
    .btn-theme .theme-icon-sun { display: none; }
    .btn-theme .theme-icon-moon { display: block; }
    [data-theme="dark"] .btn-theme .theme-icon-sun { display: block; }
    [data-theme="dark"] .btn-theme .theme-icon-moon { display: none; }

    .header-actions {
      justify-self: center;
      align-self: center;
    }

    .view-tabs,
    .header-actions {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-chip);
      border-radius: 10px;
      padding: 5px;
      width: max-content;
      flex-shrink: 0;
      margin: 0;
      flex-wrap: nowrap;
    }

    .view-tabs {
      justify-self: center;
      align-self: center;
    }

    .view-tab,
    .header-actions .btn-settings {
      appearance: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      margin-top: 0;
      border: 0;
      background: transparent;
      color: var(--text-muted);
      padding: 10px 22px;
      border-radius: 6px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: -0.005em;
      cursor: pointer;
      white-space: nowrap;
      transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .view-tab:hover,
    .header-actions .btn-settings:hover {
      color: var(--text);
    }

    .view-tab:focus-visible,
    .header-actions .btn-settings:focus-visible {
      outline: none;
      color: var(--text);
      border-color: transparent;
      background: transparent;
    }

    .header-actions .btn-settings:not(.btn-theme) svg {
      display: none;
    }

    .header-actions .btn-theme .theme-icon {
      width: 16px;
      height: 16px;
      flex: 0 0 16px;
      color: var(--text-muted);
    }

    .header-actions .btn-theme .theme-icon-moon {
      display: block;
    }

    .header-actions .btn-theme .theme-icon-sun {
      display: none;
    }

    [data-theme="dark"] .header-actions .btn-theme .theme-icon-moon {
      display: none;
    }

    [data-theme="dark"] .header-actions .btn-theme .theme-icon-sun {
      display: block;
    }

    .header-actions .btn-theme:hover .theme-icon,
    .header-actions .btn-theme:focus-visible .theme-icon {
      color: var(--text);
    }

    [data-theme="dark"] .view-tabs,
    [data-theme="dark"] .header-actions {
      background: var(--bg-soft);
    }

    #app-logo {
      position: relative;
      flex-shrink: 0;
      line-height: 0;
    }

    #app-logo img {
      display: block;
      height: var(--logo-h);
      width: auto;
      object-fit: contain;
      visibility: hidden;
    }

    #app-logo::after {
      content: '';
      position: absolute;
      inset: 0;
      background-color: var(--accent);
      -webkit-mask-image: url('/static/sumit-logo.png');
      mask-image: url('/static/sumit-logo.png');
      -webkit-mask-size: contain;
      mask-size: contain;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      -webkit-mask-position: center;
      mask-position: center;
      transition: background-color 0.3s ease;
    }

    .view-tab.is-active {
      background: var(--accent);
      color: #ffffff;
      box-shadow: 0 1px 2px var(--shadow);
      transform: translateY(-1px);
    }

    [data-theme="dark"] .view-tab.is-active {
      background: var(--accent);
      color: #ffffff;
      box-shadow: none;
    }

    .view.hidden { display: none; }

    .view.view-enter {
      animation: sumit-view-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    @keyframes sumit-view-in {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .view.view-enter {
        animation: none;
      }

      .view-tab.is-active {
        transform: none;
      }

      .lightbox,
      .lightbox-content,
      .lightbox-backdrop {
        transition: none;
      }

      .lightbox.is-settled .lightbox-backdrop {
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
      }
    }

    .card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: var(--card-pad);
      margin: 0 auto;
    }

    .section + .section { margin-top: var(--section-stack); }

    .section-title {
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin: 0 0 18px;
    }

    .accordion-header {
      display: none;
      width: 100%;
      margin: 0;
      padding: 0;
      border: none;
      background: none;
      font: inherit;
      text-align: left;
      color: inherit;
    }

    .accordion-body {
      overflow: visible;
    }

    @media (min-width: 1024px) {
      .accordion-header {
        display: none;
      }

      .accordion-section > .section-title {
        display: block;
      }

      .accordion-body {
        max-height: none !important;
        overflow: visible;
      }

      .accordion-body-hint {
        display: none;
      }

      #oferta-form .section-title {
        margin-bottom: 14px;
      }

      /* Szczegóły: typ dokumentu — inline, bez dodatkowego paska */
      #accordion-body-szczegoly > .field-doc-type {
        display: block;
        margin-top: 4px;
        margin-bottom: 20px;
      }

      #accordion-body-szczegoly .doc-type-switcher {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 5px;
        width: max-content;
        max-width: 100%;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--bg-chip);
      }

      [data-theme="dark"] #accordion-body-szczegoly .doc-type-switcher {
        background: var(--bg-soft);
      }

      #accordion-body-szczegoly .doc-type-switcher .chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        height: 40px;
        min-height: 40px;
        padding: 0 16px;
        margin: 0;
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: -0.005em;
        white-space: nowrap;
        color: var(--text-muted);
        background: transparent;
        border: none;
        border-radius: 6px;
        box-shadow: none;
        cursor: pointer;
        transition: color 0.15s ease, background 0.15s ease;
      }

      #accordion-body-szczegoly .doc-type-switcher .chip.is-active {
        background: var(--accent);
        color: #ffffff;
      }

      #accordion-body-szczegoly .doc-type-switcher .chip:hover:not(.is-active),
      #accordion-body-szczegoly .doc-type-switcher .chip:focus-visible:not(.is-active) {
        color: var(--text);
        background: transparent;
      }
    }

    .row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }

    .field {
      display: flex;
      flex-direction: column;
    }

    label {
      font-size: 14px;
      font-weight: 500;
      color: var(--text);
      margin-bottom: 8px;
      letter-spacing: -0.01em;
    }

    .label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 8px;
    }
    .label-row label { margin-bottom: 0; }

    .btn-link-nip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 0;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      transition: color 0.15s ease;
    }
    .btn-link-nip:hover { color: var(--text); }
    .btn-link-nip:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;
      border-radius: 4px;
    }
    .btn-link-nip svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      stroke-width: 1.6;
      stroke-linecap: round;
      stroke-linejoin: round;
      fill: none;
      flex-shrink: 0;
    }
    .btn-link-nip[aria-busy="true"] {
      color: var(--text-muted);
      cursor: progress;
      opacity: 0.7;
    }

    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="email"],
    input[type="tel"],
    textarea {
      font: inherit;
      font-size: 15px;
      padding: 12px 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      color: var(--text);
      transition: border-color 0.15s ease;
      width: 100%;
      letter-spacing: -0.005em;
    }

    input::placeholder,
    textarea::placeholder { color: var(--text-muted); }

    input:hover:not(:focus),
    textarea:hover:not(:focus) {
      border-color: var(--border-hover);
    }

    input:focus,
    textarea:focus {
      outline: none;
      border-color: var(--accent);
    }

    textarea {
      font-family: inherit;
      line-height: 1.5;
      resize: vertical;
      min-height: 96px;
    }

    .klient-wrapper {
      position: relative;
    }

    .dropdown-menu {
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      width: 100%;
      max-height: 240px;
      overflow-y: auto;
      margin: 0;
      padding: 6px;
      list-style: none;
      z-index: 50;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.55) 100%);
      border: 1px solid rgba(255, 255, 255, 0.85);
      border-radius: 10px;
      -webkit-backdrop-filter: blur(32px) saturate(180%);
      backdrop-filter: blur(32px) saturate(180%);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 0 1px rgba(255, 255, 255, 0.35),
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 16px 40px -12px rgba(15, 23, 42, 0.18);
      scrollbar-width: thin;
      scrollbar-color: var(--border) transparent;
    }
    [data-theme="dark"] .dropdown-menu {
      background: linear-gradient(180deg, rgba(20, 20, 20, 0.92) 0%, rgba(20, 20, 20, 0.85) 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.45);
    }
    .dropdown-menu.hidden { display: none; }
    .dropdown-menu::-webkit-scrollbar { width: 8px; }
    .dropdown-menu::-webkit-scrollbar-track { background: transparent; }
    .dropdown-menu::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 4px;
    }
    .dropdown-menu::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

    .dropdown-item {
      display: block;
      padding: 8px 10px;
      border-radius: 6px;
      font-size: 14px;
      line-height: 1.4;
      color: var(--text);
      letter-spacing: -0.005em;
      cursor: pointer;
      white-space: pre-line;
      transition: background 0.12s ease;
    }
    .dropdown-item:hover,
    .dropdown-item.is-active {
      background: var(--accent-soft);
    }
    .dropdown-item.is-active {
      border-left: 2px solid var(--accent);
      padding-left: 8px;
    }
    .dropdown-item-meta {
      display: block;
      margin-top: 2px;
      font-size: 12px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    input[type="number"] {
      -moz-appearance: textfield;
    }
    input[type="number"]::-webkit-outer-spin-button,
    input[type="number"]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

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

    thead th {
      text-align: left;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      padding: 0 8px 12px;
      border-bottom: 1px solid var(--border);
    }
    thead th:first-child { padding-left: 0; }
    thead th:last-child { padding-right: 0; }

    tbody td {
      padding: 10px 8px;
      vertical-align: middle;
      border-bottom: 1px solid var(--border);
    }
    tbody td:first-child { padding-left: 0; }
    tbody td:last-child { padding-right: 0; }
    tbody tr:last-child td { border-bottom: none; }

    .col-lp {
      width: 32px;
      text-align: left;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      font-size: 13px;
    }
    .col-nazwa { min-width: 180px; }
    .col-ilosc { width: 120px; }
    .col-cena  { width: 140px; }
    .col-akcja { width: 72px; text-align: right; white-space: nowrap; }

    button {
      font: inherit;
      cursor: pointer;
      border: none;
      background: none;
      color: inherit;
    }

    .btn-add {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 12px 0;
      margin-top: 14px;
      font-size: 14px;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      transition: color 0.15s ease;
    }
    .btn-add:hover { color: var(--text); }
    .btn-add .plus {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg);
      font-size: 14px;
      line-height: 1;
      transition: border-color 0.15s ease, color 0.15s ease;
    }
    .btn-add:hover .plus {
      border-color: var(--text);
      color: var(--text);
    }

    .btn-remove {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      color: var(--text-muted);
      font-size: 18px;
      line-height: 1;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .btn-remove:hover,
    .btn-remove:focus-visible {
      outline: none;
      background: var(--bg-hover);
      color: var(--text);
    }

    .row-actions {
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      gap: 4px;
    }

    .btn-duplicate {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      color: var(--text-muted);
      line-height: 1;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .btn-duplicate:hover,
    .btn-duplicate:focus-visible {
      outline: none;
      background: var(--bg-hover);
      color: var(--text);
    }
    .btn-duplicate svg {
      width: 14px;
      height: 14px;
      flex: 0 0 14px;
    }

    .ilosc-wrap {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }
    .ilosc-wrap .in-ilosc {
      flex: 1 1 auto;
      min-width: 0;
    }

    .btn-calc {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border-radius: 6px;
      color: var(--text-muted);
      line-height: 1;
      flex: 0 0 28px;
      transition: background 0.15s ease, color 0.15s ease;
    }
    .btn-calc:hover,
    .btn-calc:focus-visible {
      outline: none;
      background: var(--bg-hover);
      color: var(--text);
    }
    .btn-calc svg {
      width: 14px;
      height: 14px;
      flex: 0 0 14px;
    }

    .price-wrap {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }

    .koszt-row {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }
    .koszt-label {
      font-size: 11px;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      user-select: none;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .price-wrap .in-koszt {
      width: 100%;
      min-width: 0;
      padding: 8px 10px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
      background: var(--bg-soft);
      border: 1px solid var(--border);
      border-radius: 6px;
      font-variant-numeric: tabular-nums;
      transition: border-color 0.15s ease, background 0.15s ease;
    }
    .price-wrap .in-koszt::placeholder { color: var(--text-muted); }
    .price-wrap .in-koszt:hover:not(:focus) { border-color: var(--border-hover); }
    .price-wrap .in-koszt:focus {
      outline: none;
      border-color: var(--accent);
      background: var(--bg);
    }

    .price-adjusts {
      display: flex;
      gap: 4px;
    }

    .btn-adjust {
      padding: 2px 6px;
      font-size: 10px;
      font-weight: 500;
      line-height: 1.4;
      color: var(--text-muted);
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 4px;
      letter-spacing: -0.005em;
      font-variant-numeric: tabular-nums;
      transition: color 0.15s ease, border-color 0.15s ease;
    }
    .btn-adjust:hover {
      color: var(--text);
      border-color: var(--text);
    }
    .btn-adjust:focus-visible {
      outline: none;
      color: var(--text);
      border-color: var(--text);
    }

    .btn-clear {
      display: inline-block;
      margin-top: 16px;
      padding: 0;
      font-size: 12px;
      font-weight: 400;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      text-decoration: underline;
      text-underline-offset: 2px;
      transition: color 0.15s ease;
    }
    .btn-clear:hover { color: var(--text); }

    .logo-wrap {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      margin-top: 12px;
    }
    .logo-preview {
      display: inline-flex;
      align-items: center;
      gap: 12px;
    }
    .logo-preview[hidden] { display: none; }
    .logo-preview img {
      max-width: 80px;
      max-height: 80px;
      width: auto;
      height: auto;
      border: 1px solid var(--border);
      border-radius: 6px;
      object-fit: contain;
      background: var(--bg-soft);
    }
    .logo-preview .btn-clear { margin-top: 0; }

    .date-helpers {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }

    .chip {
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      letter-spacing: -0.005em;
      transition: border-color 0.15s ease, color 0.15s ease;
    }
    .chip:hover {
      border-color: var(--text);
      color: var(--text);
    }
    .chip:focus-visible {
      outline: none;
      border-color: var(--accent);
      color: var(--text);
    }

    .footer-presets {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 12px;
    }

    .footer-presets .chip {
      background: var(--bg-chip);
      border-color: var(--bg-chip);
    }

    .footer-presets .chip:hover,
    .footer-presets .chip:focus-visible {
      background: var(--bg);
      border-color: var(--text);
      color: var(--text);
    }

    .footer-presets .chip[aria-pressed="true"] {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }

    .submit-wrap { margin-top: 28px; }

    .submit-actions {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;
      margin-top: 12px;
    }
    .submit-actions .btn-clear { margin-top: 0; }

    .cta-row {
      display: flex;
      gap: 12px;
      align-items: stretch;
      width: 100%;
    }
    .cta-row .btn-primary {
      flex: 1;
      width: auto;
    }

    .btn-cta-secondary {
      flex: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 14px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: -0.01em;
      transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    }
    .btn-cta-secondary:hover:not(:disabled) {
      border-color: var(--text);
      background: var(--bg-hover);
    }
    .btn-cta-secondary:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .btn-cta-secondary:disabled {
      cursor: progress;
      opacity: 0.6;
    }
    .btn-cta-secondary svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
      flex-shrink: 0;
    }

    .profit-badge {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: baseline;
      gap: 8px;
      padding: 14px 16px;
      border-radius: 8px;
      background: #ecfdf5;
      color: #047857;
      border: 1px solid #a7f3d0;
      font-size: 14px;
      font-weight: 600;
      letter-spacing: -0.005em;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }
    .profit-badge-label {
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      font-size: 11px;
      opacity: 0.85;
    }
    .profit-badge-value {
      font-size: 15px;
      font-weight: 700;
    }
    .profit-badge.is-zero {
      background: var(--bg);
      color: var(--text-muted);
      border-color: var(--border);
    }
    .profit-badge.is-loss {
      background: #fef2f2;
      color: #b91c1c;
      border-color: #fecaca;
    }
    [data-theme="dark"] .profit-badge {
      background: rgba(16, 185, 129, 0.12);
      color: #6ee7b7;
      border-color: rgba(110, 231, 183, 0.32);
    }
    [data-theme="dark"] .profit-badge.is-zero {
      background: var(--bg-soft);
      color: var(--text-muted);
      border-color: var(--border);
    }
    [data-theme="dark"] .profit-badge.is-loss {
      background: rgba(239, 68, 68, 0.12);
      color: #fca5a5;
      border-color: rgba(252, 165, 165, 0.32);
    }
    .btn-primary {
      width: 100%;
      padding: 14px;
      background: var(--accent);
      color: #ffffff;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: -0.01em;
      transition: background 0.15s ease;
    }
    .btn-primary:hover:not(:disabled) {
      background: var(--accent-hover);
    }
    .btn-primary:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    .btn-primary:disabled {
      cursor: not-allowed;
      background: var(--primary-bg-disabled);
    }

    .message {
      margin-top: 16px;
      padding: 12px 14px;
      border-radius: 8px;
      font-size: 13px;
      letter-spacing: -0.005em;
      display: none;
      border: 1px solid var(--border);
    }
    .message.error {
      background: var(--bg);
      color: var(--text);
      border-color: var(--text);
      display: block;
    }
    .message.success {
      background: var(--bg);
      color: var(--text);
      border-color: var(--border);
      display: block;
    }

    .page-signature {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-top: 16px;
      padding-bottom: 4px;
      color: #6b7280;
      font-size: 10px;
      letter-spacing: 0.04em;
      font-weight: 400;
    }

    .modal {
      position: fixed;
      inset: 0;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .modal[hidden] { display: none; }
    .modal.hidden { display: none; }

    .ai-fab {
      display: none;
    }

    .btn-add-ai {
      display: none;
    }

    .modal-backdrop {
      position: absolute;
      inset: 0;
      background: var(--backdrop);
    }

    .lightbox {
      position: fixed;
      inset: 0;
      z-index: 1500;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 32px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .lightbox[hidden] { display: none; }
    .lightbox.is-open {
      opacity: 1;
      pointer-events: auto;
    }

    .lightbox-backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.52);
      cursor: zoom-out;
      transform: translateZ(0);
      transition: background 0.28s ease;
    }
    .lightbox.is-settled .lightbox-backdrop {
      background: rgba(15, 23, 42, 0.35);
      -webkit-backdrop-filter: blur(16px) saturate(140%);
      backdrop-filter: blur(16px) saturate(140%);
    }
    [data-theme="dark"] .lightbox-backdrop {
      background: rgba(0, 0, 0, 0.72);
    }
    [data-theme="dark"] .lightbox.is-settled .lightbox-backdrop {
      background: rgba(0, 0, 0, 0.6);
    }

    .lightbox-content {
      position: relative;
      z-index: 1;
      height: min(calc(100vh - 64px), var(--lightbox-max-h));
      aspect-ratio: 1 / 1.414;
      max-width: calc(100vw - 64px);
      background: #ffffff;
      border-radius: 12px;
      overflow: hidden;
      transform: scale(0.97) translateZ(0);
      transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      will-change: transform;
      contain: layout paint;
    }
    .lightbox.is-open .lightbox-content {
      transform: scale(1) translateZ(0);
    }

    .lightbox-content iframe {
      position: absolute;
      top: -2%;
      left: -2%;
      width: 104%;
      height: 104%;
      border: none;
      outline: none;
      background: #ffffff;
      pointer-events: none;
      touch-action: none;
      user-select: none;
      -webkit-user-select: none;
      transform: translateZ(0);
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
    }

    .lightbox-close {
      position: absolute;
      top: 20px;
      right: 20px;
      z-index: 2;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.95);
      border: 1px solid rgba(255, 255, 255, 0.6);
      color: #0a0a0a;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 0;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
      transition: transform 0.15s ease, background 0.15s ease;
    }
    .lightbox-close svg {
      width: 18px;
      height: 18px;
    }
    .lightbox-close:hover {
      transform: scale(1.05);
      background: #ffffff;
    }
    .lightbox-close:focus-visible {
      outline: 2px solid #0a0a0a;
      outline-offset: 2px;
    }
    [data-theme="dark"] .lightbox-close {
      background: rgba(20, 20, 20, 0.9);
      border-color: rgba(255, 255, 255, 0.15);
      color: #ffffff;
    }
    [data-theme="dark"] .lightbox-close:hover {
      background: rgba(40, 40, 40, 0.95);
    }

    .modal-card {
      position: relative;
      width: 100%;
      max-width: 860px;
      max-height: 90vh;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 20px 40px var(--shadow);
    }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 20px 24px;
      border-bottom: 1px solid var(--border);
    }

    .modal-title {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text);
    }

    .modal-body {
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      padding: 16px 24px;
    }

    .modal-body iframe {
      width: 100%;
      height: 70vh;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      display: block;
    }

    .modal-footer {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 12px;
      padding: 16px 24px;
      border-top: 1px solid var(--border);
    }

    .modal-footer .btn-primary {
      width: auto;
      padding: 10px 20px;
      font-size: 14px;
    }

    /* Podgląd PDF po wygenerowaniu */
    .pdf-preview-header {
      position: relative;
      flex-shrink: 0;
    }

    .pdf-sheet-handle {
      display: none;
    }

    .pdf-preview-close {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      margin: -4px -8px -4px 0;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      color: var(--text);
      cursor: pointer;
      transition: border-color 0.15s ease, background 0.15s ease;
    }

    .pdf-preview-close svg {
      width: 18px;
      height: 18px;
    }

    .pdf-preview-close:hover {
      border-color: var(--text);
    }

    .pdf-preview-close:focus-visible {
      outline: 2px solid var(--text);
      outline-offset: 2px;
    }

    .pdf-preview-body {
      padding: 0;
      background: #ffffff;
    }

    .pdf-preview-tap {
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      min-height: inherit;
      padding: 0;
      margin: 0;
      border: none;
      background: #ffffff;
      cursor: zoom-in;
      text-align: left;
    }

    .pdf-preview-tap:focus-visible {
      outline: 2px solid var(--text);
      outline-offset: -2px;
    }

    .pdf-preview-tap-hint {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(10, 10, 10, 0.72);
      color: #ffffff;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: -0.01em;
      pointer-events: none;
      white-space: nowrap;
    }

    .pdf-preview-tap-hint svg {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
    }

    .pdf-preview-body iframe {
      border: none;
      border-radius: 0;
      pointer-events: none;
    }

    .pdf-preview-actions {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }

    .pdf-action-primary {
      width: 100%;
      margin: 0;
    }

    .pdf-action-share {
      width: 100%;
      justify-content: center;
    }

    .pdf-preview-actions-secondary {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .pdf-action-secondary {
      width: 100%;
      margin: 0;
    }

    @media (min-width: 1024px) {
      #pdf-modal .pdf-preview-header {
        padding: 20px 24px;
      }

      #pdf-modal .pdf-preview-body {
        padding: 16px 24px;
      }

      #pdf-modal .pdf-preview-tap {
        min-height: 0;
        border: 1px solid var(--border);
        border-radius: 8px;
        overflow: hidden;
      }

      #pdf-modal .pdf-preview-body iframe {
        border: none;
        border-radius: 0;
        height: 70vh;
        min-height: 0;
      }

      #pdf-modal .pdf-preview-tap-hint {
        display: none;
      }

      #pdf-modal .pdf-preview-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
      }

      #pdf-modal .pdf-action-primary,
      #pdf-modal .pdf-action-share {
        width: auto;
      }

      #pdf-modal .pdf-preview-actions-secondary {
        display: contents;
      }
    }

    .btn-secondary {
      padding: 10px 20px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text);
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: -0.01em;
      transition: border-color 0.15s ease;
    }
    .btn-secondary:hover { border-color: var(--text); }

    .btn-secondary.btn-with-icon {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-secondary.btn-with-icon svg {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
    }

    .ai-quick-input {
      margin-bottom: 16px;
      padding: 0;
      overflow: hidden;
    }
    .ai-quick-input-summary {
      list-style: none;
      cursor: pointer;
      padding: 14px 16px;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text);
      border-bottom: 1px solid transparent;
      user-select: none;
    }
    .ai-quick-input[open] .ai-quick-input-summary {
      border-bottom-color: var(--border);
    }
    .ai-quick-input-summary::-webkit-details-marker { display: none; }
    .ai-quick-input-summary::after {
      content: '';
      float: right;
      width: 8px;
      height: 8px;
      margin-top: 4px;
      border-right: 1.5px solid var(--text-muted);
      border-bottom: 1.5px solid var(--text-muted);
      transform: rotate(45deg);
      transition: transform 0.15s ease;
    }
    .ai-quick-input[open] .ai-quick-input-summary::after {
      transform: rotate(-135deg);
      margin-top: 7px;
    }
    .ai-quick-input-body {
      padding: 14px 16px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .ai-sheet-intro {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      margin: 0;
      font-size: 13px;
      font-weight: 400;
      letter-spacing: -0.01em;
      color: var(--text-muted);
      line-height: 1.4;
    }
    .ai-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      min-width: 32px;
      height: 24px;
      padding: 0 8px;
      border-radius: 6px;
      background: var(--accent);
      color: #ffffff;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    .ai-quick-input-body textarea {
      min-height: 88px;
      resize: vertical;
    }
    .ai-quick-input-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .ai-quick-input-actions .btn-primary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-width: 148px;
      padding: 11px 16px;
      background: var(--accent);
      color: #ffffff;
      font-weight: 600;
      border: none;
    }
    .ai-quick-input-actions .btn-primary:hover:not(:disabled) {
      background: var(--accent);
      filter: brightness(1.06);
      color: #ffffff;
    }
    .btn-ai-parse-spinner {
      width: 14px;
      height: 14px;
      border: 2px solid rgba(255, 255, 255, 0.35);
      border-top-color: #ffffff;
      border-radius: 50%;
      animation: aiParseSpin 0.7s linear infinite;
      flex-shrink: 0;
    }
    @keyframes aiParseSpin {
      to { transform: rotate(360deg); }
    }
    .btn-ai-mic {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      padding: 0;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .btn-ai-mic svg {
      width: 18px;
      height: 18px;
    }
    .btn-ai-photo {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      padding: 0;
      border-radius: 8px;
      flex-shrink: 0;
    }
    .btn-ai-photo svg {
      width: 18px;
      height: 18px;
    }
    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .ai-photo-thumb {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .ai-photo-thumb.hidden {
      display: none;
    }
    .ai-photo-thumb img {
      width: 80px;
      height: 80px;
      object-fit: cover;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--bg-soft);
    }
    .btn-ai-photo-remove {
      padding: 8px 12px;
      font-size: 13px;
    }
    .btn-ai-mic.is-recording {
      border-color: #dc2626;
      box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
      animation: aiMicPulse 1.4s ease-out infinite;
    }
    @keyframes aiMicPulse {
      0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
      70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
      100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    }
    .ai-parse-status {
      margin: 0;
      font-size: 13px;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      min-height: 1.2em;
    }
    .ai-parse-status.is-error { color: var(--text); }
    .ai-parse-status.is-success { color: var(--text-muted); }

    /* Desktop: ręczna edycja pozycji zawsze widoczna */
    details.manual-items > summary.manual-items-summary {
      display: none;
    }
    details.manual-items .manual-items-body {
      display: block;
    }

    .modal-card.ai-preview-card { max-width: 560px; }
    .ai-preview-table-wrap {
      overflow-x: auto;
      margin-top: 8px;
    }
    .ai-preview-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }
    .ai-preview-table thead th {
      text-align: left;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      padding: 0 8px 10px;
      border-bottom: 1px solid var(--border);
    }
    .ai-preview-table thead th.col-num {
      text-align: right;
    }
    .ai-preview-table tbody td {
      padding: 10px 8px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }
    .ai-preview-table tbody td.col-num {
      text-align: right;
      white-space: nowrap;
    }
    .ai-preview-table tbody tr:last-child td {
      border-bottom: none;
    }
    .ai-preview-tag {
      display: inline-block;
      margin-left: 4px;
      font-size: 11px;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .items-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 24px;
      margin-top: 14px;
    }
    .items-actions .btn-add { margin-top: 0; }

    .modal-card.catalog-card { max-width: 560px; }
    .modal-card.settings-card { max-width: 560px; }
    .modal-card.app-settings-card { max-width: 480px; }
    .modal-card.historia-card { max-width: 560px; }
    .modal-card.kalkulator-card { max-width: 440px; }
    .modal-card.nip-card { max-width: 440px; }

    .nip-card #nip-input {
      font-variant-numeric: tabular-nums;
      letter-spacing: 0.05em;
    }
    .nip-card #nip-input:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .kalkulator-wynik {
      margin-top: 20px;
      padding: 14px 16px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg-soft);
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: -0.005em;
      font-variant-numeric: tabular-nums;
      text-align: center;
    }

    .historia-list {
      list-style: none;
      margin: 0;
      padding: 0;
      max-height: 60vh;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
    }

    .historia-empty {
      padding: 32px 16px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
      letter-spacing: -0.005em;
    }

    .historia-item {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 14px;
      border-bottom: 1px solid var(--border);
    }
    .historia-item:last-child { border-bottom: none; }

    .historia-item-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .historia-item-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      min-width: 0;
    }

    .historia-item-numer {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: -0.005em;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }

    .historia-item-suma {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .historia-item-meta {
      font-size: 12px;
      color: var(--text-muted);
    }

    .historia-item-klient {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }

    .historia-item-data {
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }

    .historia-item-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .btn-historia-action {
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      letter-spacing: -0.005em;
      cursor: pointer;
      transition: border-color 0.15s ease, color 0.15s ease;
    }
    .btn-historia-action:hover,
    .btn-historia-action:focus-visible {
      outline: none;
      border-color: var(--text);
      color: var(--text);
    }
    .btn-historia-action:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }
    .btn-historia-action.is-delete {
      margin-left: auto;
      color: var(--accent);
      border-color: var(--accent-border);
      background: var(--accent-soft);
    }
    .btn-historia-action.is-delete:hover,
    .btn-historia-action.is-delete:focus-visible {
      outline: none;
      color: var(--accent);
      border-color: var(--accent);
      background: color-mix(in srgb, var(--accent) 16%, transparent);
    }

    .historia-card .modal-footer #btn-historia-wyczysc {
      margin-right: auto;
      margin-top: 0;
    }

    .stats-section {
      margin: 48px auto 0;
    }

    .firma-layout {
      width: 100%;
      margin: 48px auto 0;
    }

    .firma-preview-frame {
      width: 100%;
      padding: 18px 20px;
      border-radius: 12px;
      background: #ffffff;
      box-sizing: border-box;
      border: none;
      display: flex;
      flex-direction: column;
    }

    .firma-preview-frame .firma-status-bar {
      flex-shrink: 0;
      margin-top: auto;
      padding-top: 12px;
    }

    .firma-preview-body {
      flex: 1 1 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 0;
      padding: 20px;
    }

    .firma-footer-wrap {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-top: 20px;
      padding-top: 16px;
      border-top: 1px solid var(--border);
    }

    .firma-footer-wrap .firma-section-actions {
      flex-shrink: 0;
      margin: 0;
      padding: 0;
      border: none;
    }

    .firma-footer-wrap .firma-section-actions .cta-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .firma-save-status {
      flex-shrink: 0;
      min-height: 18px;
      margin: 0;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: -0.005em;
      white-space: nowrap;
    }

    .firma-save-status:empty {
      display: none;
    }

    .firma-save-status:not(:empty) {
      color: #16a34a;
      margin-left: auto;
    }

    .firma-save-status:not(:empty)::before {
      content: '✓ ';
      font-weight: 700;
    }

    [data-theme="dark"] .firma-save-status:not(:empty) {
      color: #4ade80;
    }

    .firma-section-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 16px;
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }

    .firma-section-actions-end {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      margin-left: auto;
      flex-shrink: 0;
    }

    .firma-section-actions .btn-clear {
      margin-top: 0;
    }

    .firma-section-actions .btn-primary {
      min-width: 112px;
      padding: 10px 20px;
      font-size: 14px;
    }

    .firma-group {
      padding-top: 20px;
    }

    .firma-group + .firma-group {
      margin-top: 4px;
      border-top: 1px solid var(--border);
    }

    .firma-group-title {
      margin: 0 0 14px;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--text-muted);
    }

    .firma-fields-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px 16px;
    }

    .firma-fields-grid .field-span-2 {
      grid-column: 1 / -1;
    }

    .firma-fields-grid .field {
      margin: 0;
    }

    .firma-identity-row {
      display: flex;
      gap: 16px;
      align-items: flex-start;
    }

    .firma-logo-dropzone {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .firma-logo-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 80px;
      height: 80px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      cursor: pointer;
      overflow: hidden;
      transition: border-color 0.15s ease;
    }

    .firma-logo-btn:hover,
    .firma-logo-btn:focus-visible {
      border-color: var(--text-muted);
    }

    .firma-logo-placeholder {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .firma-logo-plus {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border-radius: 5px;
      background: var(--accent);
      color: #ffffff;
      font-size: 17px;
      font-weight: 500;
      line-height: 1;
    }

    .firma-logo-img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: contain;
      background: #ffffff;
    }

    .firma-logo-img[hidden],
    .firma-logo-placeholder[hidden] {
      display: none !important;
    }

    .firma-logo-remove {
      font-size: 12px;
    }

    .firma-logo-remove[hidden] {
      display: none;
    }

    .firma-identity-fields {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .firma-identity-fields .field {
      margin: 0;
    }

    .firma-field-hint {
      margin: 6px 0 0;
      font-size: 12px;
      color: var(--text-muted);
      letter-spacing: -0.005em;
    }

    .firma-preview-seller {
      display: flex;
      gap: 16px;
      align-items: flex-start;
      width: auto;
      max-width: 100%;
      padding: 0;
      border: none;
      border-radius: 0;
      background: transparent;
      color: #0a0a0a;
      box-shadow: none;
    }

    [data-theme="dark"] .firma-preview-frame {
      background: #ffffff;
    }

    [data-theme="dark"] .firma-preview-seller {
      background: transparent;
      color: #0a0a0a;
    }

    .firma-preview-logo {
      flex-shrink: 0;
      width: 64px;
      height: 64px;
      object-fit: contain;
      border-radius: 4px;
      background: #ffffff;
    }

    .firma-preview-logo[hidden] {
      display: none !important;
    }

    .firma-preview-text {
      flex: 1;
      min-width: 0;
      text-align: left;
    }

    .firma-preview-name {
      margin: 0 0 6px;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.35;
      letter-spacing: -0.01em;
    }

    .firma-preview-line {
      margin: 0;
      font-size: 14px;
      line-height: 1.5;
      letter-spacing: -0.005em;
    }

    .firma-preview-line + .firma-preview-line {
      margin-top: 2px;
    }

    .firma-preview-muted {
      color: #6b7280;
    }

    .firma-preview-line[hidden] {
      display: none !important;
    }

    .firma-preview-name.is-empty {
      color: #9ca3af;
      font-weight: 500;
    }

    .firma-status-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      flex: 0 0 auto;
      align-content: flex-start;
    }

    .firma-status-chip {
      display: inline-flex;
      align-items: center;
      padding: 6px 10px;
      font-size: 12px;
      font-weight: 500;
      line-height: 1.2;
      letter-spacing: -0.005em;
      color: var(--text-muted);
      background: var(--bg-chip);
      border: 1px solid var(--border);
      border-radius: 6px;
      white-space: nowrap;
    }

    [data-theme="dark"] .firma-status-chip {
      background: var(--bg-soft);
    }

    .firma-status-chip[data-state="ok"] {
      color: var(--text);
      border-color: rgba(22, 163, 74, 0.35);
    }

    .firma-status-chip[data-state="ok"]::before {
      content: '✓ ';
      color: #16a34a;
      font-weight: 600;
    }

    [data-theme="dark"] .firma-status-chip[data-state="ok"] {
      border-color: rgba(74, 222, 128, 0.35);
    }

    .firma-section {
      margin: 48px auto 0;
    }

    #view-firma .firma-layout > .firma-section {
      margin: 0;
    }

    .stats-section .section-title {
      margin: 0 0 16px;
    }

    .stats-okres-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 0 0 16px;
    }

    .stats-okres-bar .chip[aria-pressed="true"],
    .stats-okres-bar .chip.is-active {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }

    .stats-trend-positive { color: #16a34a; }
    .stats-trend-negative { color: #dc2626; }
    [data-theme="dark"] .stats-trend-positive { color: #4ade80; }
    [data-theme="dark"] .stats-trend-negative { color: #f87171; }

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

    @media (min-width: 1024px) {
      .stats-grid {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    .stats-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .stats-card-full {
      grid-column: 1 / -1;
      padding: 18px 20px;
      gap: 8px;
    }

    .stats-card-standalone {
      margin-top: 16px;
    }

    .stats-card-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
    }

    .stats-card-value {
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
      letter-spacing: -0.02em;
      font-variant-numeric: tabular-nums;
      line-height: 1.2;
    }

    .stats-card-value.stats-trend-positive { color: #16a34a; }
    .stats-card-value.stats-trend-negative { color: #dc2626; }
    [data-theme="dark"] .stats-card-value.stats-trend-positive { color: #4ade80; }
    [data-theme="dark"] .stats-card-value.stats-trend-negative { color: #f87171; }

    .stats-card-full .stats-card-label { font-size: 11px; }

    .stats-card-meta {
      font-size: 11px;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      font-variant-numeric: tabular-nums;
    }

    .chart-container {
      margin-top: 16px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      position: relative;
    }

    .chart-title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin: 0 0 16px;
    }

    #stat-chart {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      height: 200px;
      gap: 8px;
    }

    #stat-chart .chart-bar {
      flex: 1;
      min-width: 0;
      background: var(--accent);
      opacity: 0.85;
      border-radius: 4px 4px 0 0;
      transition: opacity 0.15s ease, transform 0.15s ease, height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      transform-origin: bottom;
      cursor: default;
      min-height: 2px;
    }

    #stat-chart .chart-bar:hover {
      opacity: 1;
      transform: scaleY(1.02);
    }

    #stat-chart .chart-bar.is-empty {
      background: var(--border);
      opacity: 0.6;
      min-height: 2px;
    }

    #stat-chart .chart-bar.is-empty:hover {
      opacity: 0.8;
      transform: scaleY(1.02);
    }

    .chart-tooltip {
      position: absolute;
      pointer-events: none;
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 12px;
      color: var(--text);
      letter-spacing: -0.005em;
      white-space: nowrap;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.55) 100%);
      border: 1px solid rgba(255, 255, 255, 0.85);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 0 1px rgba(255, 255, 255, 0.35),
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 16px 40px -12px rgba(15, 23, 42, 0.10);
      -webkit-backdrop-filter: blur(32px) saturate(180%);
      backdrop-filter: blur(32px) saturate(180%);
      opacity: 0;
      transition: opacity 0.15s ease;
      z-index: 5;
    }
    .chart-tooltip.is-visible { opacity: 1; }
    .chart-tooltip-title {
      font-weight: 600;
      margin-bottom: 2px;
    }
    .chart-tooltip-amount {
      font-variant-numeric: tabular-nums;
    }
    .chart-tooltip-count {
      color: var(--text-muted);
      font-size: 11px;
      margin-top: 2px;
      font-variant-numeric: tabular-nums;
    }
    .heatmap-tooltip .chart-tooltip-amount {
      font-weight: 600;
      color: var(--accent);
    }
    [data-theme="dark"] .chart-tooltip {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.3);
    }

    #stat-chart-labels {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-top: 8px;
    }

    #stat-chart-labels > div {
      flex: 1;
      text-align: center;
      font-size: 11px;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      min-width: 0;
      text-transform: capitalize;
    }

    .stats-card-list {
      list-style: none;
      margin: 4px 0 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .stats-card-list li {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      font-size: 13px;
      color: var(--text);
      letter-spacing: -0.005em;
      min-width: 0;
    }

    .stats-card-list .name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      min-width: 0;
    }

    .stats-card-list .count {
      font-variant-numeric: tabular-nums;
      color: var(--text-muted);
      font-size: 12px;
      white-space: nowrap;
    }

    .stats-empty {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 32px 20px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
      letter-spacing: -0.005em;
    }

    .stats-klienci-wrap {
      overflow-x: auto;
      margin-top: 4px;
    }

    .stats-klienci-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }

    .stats-klienci-table thead th {
      text-align: left;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      padding: 0 10px 10px;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }
    .stats-klienci-table thead th:first-child { padding-left: 0; }
    .stats-klienci-table thead th:last-child { padding-right: 0; }

    .stats-klienci-table tbody td {
      padding: 9px 10px;
      border-bottom: 1px solid var(--border);
      color: var(--text);
      vertical-align: middle;
    }
    .stats-klienci-table tbody td:first-child { padding-left: 0; }
    .stats-klienci-table tbody td:last-child { padding-right: 0; }
    .stats-klienci-table tbody tr:last-child td { border-bottom: none; }
    .stats-klienci-table tbody tr {
      transition: background-color 0.12s ease;
    }
    .stats-klienci-table tbody tr:hover { background: var(--bg-hover); }

    .stats-klienci-table .col-num {
      text-align: right;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
    .stats-klienci-table .col-klient {
      max-width: 320px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .stats-klienci-empty {
      color: var(--text-muted);
      font-size: 13px;
      padding: 4px 0 0;
    }

    .heatmap-card {
      gap: 10px;
      position: relative;
    }

    .heatmap-scroll {
      overflow-x: auto;
      margin: 4px -4px 0;
      padding: 0 4px 4px;
    }

    .heatmap-wrap {
      --hm-cell: 12px;
      --hm-gap: 3px;
      --hm-step: 15px;
      display: grid;
      grid-template-columns: 26px max-content;
      grid-template-rows: 14px auto;
      gap: 4px 6px;
      width: max-content;
      min-width: 100%;
    }

    .heatmap-month-labels {
      grid-column: 2;
      grid-row: 1;
      position: relative;
      height: 14px;
      font-size: 10px;
      color: var(--text-muted);
      letter-spacing: 0.02em;
      width: calc(52 * var(--hm-cell) + 51 * var(--hm-gap));
    }
    .heatmap-month-labels span {
      position: absolute;
      top: 0;
      left: calc(var(--hm-col, 0) * var(--hm-step));
      white-space: nowrap;
      pointer-events: none;
    }

    .heatmap-day-labels {
      grid-column: 1;
      grid-row: 2;
      display: grid;
      grid-template-rows: repeat(7, var(--hm-cell));
      gap: var(--hm-gap);
      font-size: 10px;
      color: var(--text-muted);
      align-content: start;
    }
    .heatmap-day-labels > span {
      line-height: var(--hm-cell);
      text-align: right;
      padding-right: 4px;
    }

    .heatmap-grid {
      grid-column: 2;
      grid-row: 2;
      display: grid;
      grid-template-columns: repeat(52, var(--hm-cell));
      grid-template-rows: repeat(7, var(--hm-cell));
      grid-auto-flow: column;
      gap: var(--hm-gap);
    }

    .heatmap-cell {
      width: var(--hm-cell);
      height: var(--hm-cell);
      border-radius: 2px;
      background: var(--border);
      transition: transform 0.12s ease;
    }
    .heatmap-cell.l1 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
    .heatmap-cell.l2 { background: color-mix(in srgb, var(--accent) 58%, transparent); }
    .heatmap-cell.l3 { background: var(--accent); }
    .heatmap-cell.is-future { opacity: 0.35; }
    .heatmap-cell.is-interactive {
      cursor: default;
    }
    .heatmap-cell.is-interactive:hover { transform: scale(1.35); }

    .heatmap-legend {
      display: flex;
      align-items: center;
      gap: 6px;
      justify-content: flex-end;
      font-size: 10px;
      color: var(--text-muted);
      letter-spacing: 0.02em;
      margin-top: 6px;
    }
    .heatmap-legend .heatmap-cell { transition: none; }
    .heatmap-legend .heatmap-cell:hover { transform: none; }

    .settings-form .row {
      margin-bottom: 16px;
    }
    .settings-form .row:last-child {
      margin-bottom: 0;
    }
    .settings-form .field-full {
      grid-column: 1 / -1;
    }
    .settings-form .logo-wrap {
      margin-top: 0;
      gap: 10px;
    }
    .settings-hint {
      margin: 0 0 16px;
      font-size: 12px;
      color: var(--text-muted);
      letter-spacing: -0.005em;
    }
    .settings-section {
      margin-bottom: 24px;
    }
    .settings-section:last-child {
      margin-bottom: 0;
    }
    .settings-section-title {
      margin: 0 0 10px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      letter-spacing: -0.01em;
    }
    .settings-section .settings-hint {
      margin: -4px 0 10px;
    }
    .settings-section .settings-hint-gap {
      margin-top: 14px;
    }
    .settings-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .settings-chips .chip[aria-pressed="true"],
    .settings-chips .chip.is-active {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }
    .settings-link-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .settings-link-btn {
      width: 100%;
      justify-content: center;
      text-align: center;
    }
    .settings-section-danger .settings-section-title {
      color: var(--text);
    }
    .settings-card .modal-footer {
      justify-content: space-between;
    }
    .settings-card .modal-footer .btn-clear { margin-top: 0; }

    .settings-mobile-actions {
      display: none;
    }

    .btn-import,
    .btn-export {
      display: inline-flex;
      align-items: baseline;
      gap: 6px;
      padding: 6px 12px;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text-muted);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      letter-spacing: -0.005em;
      cursor: pointer;
      transition: border-color 0.15s ease, color 0.15s ease;
    }
    .btn-import:hover,
    .btn-export:hover {
      border-color: var(--text);
      color: var(--text);
    }
    .btn-import .hint,
    .btn-export .hint {
      font-weight: 400;
      font-size: 11px;
      color: var(--text-muted);
    }
    .btn-import:hover .hint,
    .btn-export:hover .hint { color: var(--text-muted); }

    .catalog-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .catalog-search {
      width: 100%;
      margin-bottom: 12px;
    }

    .catalog-categories {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 14px;
    }

    .catalog-categories .chip[aria-pressed="true"] {
      background: var(--accent);
      color: #ffffff;
      border-color: var(--accent);
    }

    .catalog-feedback {
      margin-bottom: 12px;
      padding: 10px 12px;
      border-radius: 6px;
      font-size: 12px;
      letter-spacing: -0.005em;
      border: 1px solid var(--border);
      color: var(--text);
      background: var(--bg);
    }
    .catalog-feedback[hidden] { display: none; }
    .catalog-feedback.error { border-color: var(--text); }

    .catalog-list {
      list-style: none;
      margin: 0;
      padding: 0;
      max-height: 50vh;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
    }

    .catalog-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .catalog-item:last-child { border-bottom: none; }
    .catalog-item:hover { background: var(--bg-hover); }
    .catalog-item:focus-visible {
      outline: none;
      background: var(--bg-hover);
    }

    .catalog-item-nazwa {
      font-size: 14px;
      color: var(--text);
      letter-spacing: -0.005em;
      flex: 1 1 auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .catalog-item-cena {
      font-size: 13px;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .catalog-empty {
      padding: 24px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
    }

    .card,
    .view-tabs,
    .header-actions,
    .stats-card,
    .stats-empty,
    .chart-container {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.55) 100%);
      border: 1px solid rgba(255, 255, 255, 0.85);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 0 0 1px rgba(255, 255, 255, 0.35),
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 16px 40px -12px rgba(15, 23, 42, 0.10);
      -webkit-backdrop-filter: blur(32px) saturate(180%);
      backdrop-filter: blur(32px) saturate(180%);
    }

    [data-theme="dark"] .card,
    [data-theme="dark"] .view-tabs,
    [data-theme="dark"] .header-actions,
    [data-theme="dark"] .stats-card,
    [data-theme="dark"] .stats-empty,
    [data-theme="dark"] .chart-container {
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .kreator-layout {
      display: block;
    }

    .live-preview-wrap { display: none; }

    @media (min-width: 1024px) {
      .mobile-chrome {
        position: static;
        background: transparent;
        border: none;
        backdrop-filter: none;
      }

      .header-sticky {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: auto;
        padding: 0;
        margin: 0;
        border: none;
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }

      .header-brand {
        grid-column: auto;
      }

      .mobile-chrome .tagline {
        display: block;
      }

      .page-signature--form {
        display: none !important;
      }

      #view-kreator > .page-signature {
        display: flex !important;
      }

      .page-nav-row.header-toolbar,
      .header-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--layout-cols-gap);
        width: 100%;
        align-items: center;
        margin-top: 4px;
        justify-self: stretch;
      }

      .page-nav-row .view-tabs,
      .header-toolbar .view-tabs {
        grid-column: 1;
        position: static;
        width: max-content;
        margin: 0;
        padding: 5px;
        justify-self: center;
        border: none;
        border-radius: 10px;
      }

      .page-nav-row .header-actions,
      .header-toolbar .header-actions {
        grid-column: 2;
        justify-self: center;
        width: auto;
      }

      .header-actions .btn-settings {
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 0;
        padding: 10px 22px;
        background: transparent !important;
      }

      .header-actions .btn-settings-label {
        display: inline;
      }

      /* Pozycje: przyciski → panel AI (zwijany) → tabela */
      #accordion-body-pozycje .manual-items .manual-items-body {
        display: flex;
        flex-direction: column;
      }

      #oferta-form .accordion-section[data-accordion-id="pozycje"] .ai-sheet-modal {
        margin: 0 0 12px;
      }

      .manual-items-body .items-actions {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 3px;
        width: max-content;
        max-width: 100%;
        margin: 0 0 16px;
        padding: 4px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--bg-chip);
      }

      [data-theme="dark"] .manual-items-body .items-actions {
        background: var(--bg-soft);
      }

      .manual-items-body .items-actions::before {
        display: none;
      }

      .manual-items-body .items-actions > .btn-add {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex: 0 0 auto;
        height: 40px;
        min-height: 40px;
        padding: 0 16px;
        margin: 0 !important;
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
        letter-spacing: -0.005em;
        white-space: nowrap;
        color: var(--text-muted);
        background: transparent !important;
        border: none !important;
        border-radius: 6px;
        box-shadow: none !important;
        cursor: pointer;
        transition: color 0.15s ease, background 0.15s ease;
      }

      .manual-items-body .items-actions > .btn-add:hover,
      .manual-items-body .items-actions > .btn-add:focus-visible {
        color: var(--text) !important;
        background: transparent !important;
      }

      .manual-items-body .items-actions > .btn-add-ai[aria-expanded="true"] {
        color: var(--text) !important;
        background: transparent !important;
        box-shadow: none !important;
      }

      .manual-items-body .items-actions > .btn-add:not(.btn-add-ai) .plus {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 24px;
        min-width: 24px;
        height: 24px;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 5px;
        background: var(--accent);
        font-size: 17px;
        font-weight: 500;
        line-height: 1;
        color: #ffffff;
        opacity: 1;
      }

      .manual-items-body .items-actions > .btn-add:not(.btn-add-ai):hover .plus,
      .manual-items-body .items-actions > .btn-add:not(.btn-add-ai):focus-visible .plus {
        opacity: 1;
        background: var(--accent);
        color: #ffffff;
      }

      .manual-items-body .items-actions > .btn-add-ai .btn-add-ai-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 24px;
        min-width: 24px;
        height: 24px;
        padding: 0;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.06em;
        background: var(--accent);
        color: #ffffff;
        border: none;
        border-radius: 5px;
      }

      .ai-sheet-card {
        margin: 0 !important;
      }

      #oferta-form .accordion-section + .accordion-section {
        margin-top: 0;
        padding-top: var(--section-stack);
        border-top: none;
      }

      .ai-sheet-modal.is-collapsed {
        display: none !important;
        margin: 0 !important;
      }

      /* AI — neutralny panel pod przyciskami */
      details.ai-quick-input {
        list-style: none;
      }

      details.ai-quick-input:not([open]) .ai-quick-input-body {
        display: flex;
      }

      details.ai-quick-input::-webkit-details-marker {
        display: none;
      }

      .ai-sheet-body .ai-quick-input-summary,
      .ai-quick-input-summary {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
      }

      .ai-quick-input-summary::after {
        display: none !important;
      }

      .ai-quick-input.card,
      [data-theme="dark"] .ai-quick-input.card {
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 10px;
        background: var(--bg-soft) !important;
        box-shadow: none !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
      }

      .ai-sheet-intro {
        display: none !important;
      }

      .ai-quick-input-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 12px 14px 14px;
      }

      .ai-quick-input-body textarea {
        width: 100%;
        min-height: 72px;
        max-height: 180px;
        margin: 0;
        resize: vertical;
      }

      .ai-quick-input-actions {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin: 0;
        padding: 0;
      }

      .ai-quick-input-actions .btn-primary {
        flex: 1;
        min-width: 0;
        min-height: 40px;
        padding: 10px 16px;
        font-size: 13px;
      }

      .ai-quick-input-actions .btn-ai-mic,
      .ai-quick-input-actions .btn-ai-photo {
        width: 40px;
        min-width: 40px;
        height: 40px;
        padding: 0;
        flex-shrink: 0;
      }

      .ai-parse-status {
        margin: 0;
        padding: 0;
        font-size: 12px;
      }

      .manual-items-body table {
        margin-top: 0;
      }

      .ai-sheet-modal {
        position: static !important;
        inset: auto !important;
        z-index: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        padding: 0 !important;
        align-items: stretch !important;
      }

      .ai-sheet-modal[hidden],
      .ai-sheet-modal.hidden {
        display: block !important;
      }

      .ai-sheet-modal .modal-backdrop,
      .ai-sheet-header,
      .btn-ai-sheet-close {
        display: none !important;
      }

      .ai-sheet-card {
        position: static !important;
        transform: none !important;
        max-height: none;
        width: 100%;
        border-radius: 0;
        border: none;
        background: transparent !important;
        box-shadow: none !important;
      }

      .ai-sheet-body {
        padding: 0;
        overflow: visible;
      }

      #oferta-form .submit-wrap {
        margin-top: 4px;
        padding-top: var(--section-stack);
        border-top: 1px solid var(--border);
      }

      .kreator-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--layout-cols-gap);
        align-items: start;
        justify-items: stretch;
        width: 100%;
      }

      .page:has(#view-firma:not(.hidden)) {
        display: flex;
        flex-direction: column;
        min-height: calc(100dvh - var(--body-pad-top) - var(--body-pad-bottom));
      }

      .page:has(#view-firma:not(.hidden)) #view-firma {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
      }

      .firma-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--layout-cols-gap);
        align-items: stretch;
        justify-items: stretch;
        width: 100%;
        max-width: none;
        margin: 0;
        flex: 1 1 auto;
        min-height: 0;
      }

      .firma-layout > .firma-section,
      .firma-layout > .firma-preview-wrap {
        width: 100%;
        min-width: 0;
        margin: 0;
        min-height: 100%;
      }

      #view-firma .firma-section.card {
        display: flex;
        flex-direction: column;
        min-height: 100%;
      }

      #view-firma .firma-form,
      #view-firma #settings-message,
      #view-firma .firma-footer-wrap {
        width: 100%;
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
      }

      #view-firma .firma-form {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
      }

      #view-firma .firma-group + .firma-group {
        margin-top: 0;
        border-top: none;
        padding-top: 28px;
      }

      #view-firma .firma-footer-wrap {
        margin-top: 0;
        padding-top: 24px;
        border-top: none;
        flex-shrink: 0;
      }

      .firma-preview-wrap {
        display: flex;
        flex-direction: column;
        position: sticky;
        top: var(--sticky-top);
        align-self: stretch;
        min-height: 100%;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
      }

      .firma-preview-wrap .firma-preview-frame {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
      }

      [data-theme="dark"] .firma-preview-wrap .firma-preview-frame {
        background: #ffffff;
      }

      .firma-preview-body {
        padding: 28px 32px;
      }

      .firma-preview-seller {
        gap: 20px;
        max-width: 420px;
      }

      .firma-preview-logo {
        width: 80px;
        height: 80px;
      }

      .firma-preview-name {
        font-size: 20px;
        margin-bottom: 8px;
      }

      .firma-preview-line {
        font-size: 15px;
      }

      .firma-preview-line + .firma-preview-line {
        margin-top: 3px;
      }

      .kreator-layout > .card,
      .kreator-layout > .live-preview-wrap {
        width: 100%;
        min-width: 0;
        margin: 0;
      }

      .live-preview-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: sticky;
        top: var(--sticky-top);
        align-self: start;
      }

      .live-preview-frame {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
        aspect-ratio: 1 / 1.414;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        flex-shrink: 0;
        background: #ffffff;
        cursor: default;
        transition: transform 0.2s ease;
      }
      .live-preview-frame.has-pdf {
        cursor: zoom-in;
      }
      .live-preview-frame.has-pdf:hover {
        transform: translateY(-2px);
      }
      .live-preview-frame iframe {
        position: absolute;
        top: -2%;
        left: -2%;
        width: 104%;
        height: 104%;
        border: none;
        outline: none;
        opacity: 0;
        transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
        background: #ffffff;
        will-change: opacity;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        pointer-events: none;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
      }
      .live-preview-frame iframe.active {
        opacity: 1;
      }
      .live-preview-empty {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        color: var(--text-muted);
        font-size: 13px;
        text-align: center;
        letter-spacing: -0.005em;
        background: #ffffff;
        z-index: 2;
        opacity: 1;
        transition: opacity 0.5s ease;
        pointer-events: none;
      }
      [data-theme="dark"] .live-preview-empty {
        background: var(--bg-soft);
      }
      .live-preview-empty[hidden] {
        display: none !important;
        opacity: 0;
      }
    }

    /* Responsive scale: compact laptop Ôćĺ FHD Ôćĺ 2K Ôćĺ 4K */
    @media (min-width: 1024px) and (max-width: 1365px) {
      :root {
        --page-max: 1120px;
        --body-pad-top: 10px;
        --body-pad-x: 20px;
        --body-pad-bottom: 48px;
        --card-pad: 26px;
        --layout-cols-gap: 12px;
        --logo-h: 76px;
        --section-stack: 20px;
        --sticky-top: 16px;
      }
    }

    @media (min-width: 1366px) and (max-width: 1919px) {
      :root {
        --page-max: 1200px;
      }
    }

    @media (min-width: 1920px) and (max-width: 2559px) {
      :root {
        --page-max: 1400px;
        --body-pad-top: 14px;
        --body-pad-x: 32px;
        --body-pad-bottom: 64px;
        --card-pad: 40px;
        --layout-cols-gap: 20px;
        --logo-h: 104px;
        --section-stack: 28px;
        --sticky-top: 28px;
        --lightbox-max-h: 1400px;
      }
    }

    @media (min-width: 2560px) {
      :root {
        --page-max: 1680px;
        --body-pad-top: 16px;
        --body-pad-x: 40px;
        --body-pad-bottom: 72px;
        --card-pad: 44px;
        --layout-cols-gap: 24px;
        --logo-h: 112px;
        --section-stack: 32px;
        --sticky-top: 32px;
        --lightbox-max-h: 1600px;
      }
    }

    /* ── Przycisk "Kopiuj link" w submit-actions ─────────────────────── */
    .btn-link-copy {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      margin-top: 0;
      padding: 0;
      font-size: 12px;
      font-weight: 400;
      color: var(--text-muted);
      letter-spacing: -0.005em;
      text-decoration: underline;
      text-underline-offset: 2px;
      transition: color 0.15s ease;
    }
    .btn-link-copy:hover { color: var(--text); }
    .btn-link-copy.is-copied { color: #16a34a; text-decoration: none; }
    [data-theme="dark"] .btn-link-copy.is-copied { color: #4ade80; }

    /* ── Nota KSeF w sekcji Szczegóły (faktura VAT) ─────────────────── */
    .ksef-hint {
      margin-top: 12px;
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .ksef-hint a {
      color: var(--text-muted);
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .ksef-hint a:hover { color: var(--text); }

    /* ── Viewer mode: ukryj elementy edytora ─────────────────────────── */
    .page.is-viewer-mode > .header,
    .page.is-viewer-mode > #view-kreator,
    .page.is-viewer-mode > #view-statystyki,
    .page.is-viewer-mode > #view-firma {
      display: none !important;
    }
    .page.is-viewer-mode {
      padding-top: 0;
    }

    /* ── Klient viewer layout ────────────────────────────────────────── */
    #view-klient {
      display: flex;
      flex-direction: column;
      align-items: center;
      min-height: 100vh;
      padding: 40px 16px 80px;
    }

    .klient-viewer {
      width: 100%;
      max-width: 720px;
    }

    .klient-viewer-brand {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 20px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .klient-viewer-brand::before {
      content: '';
      display: inline-block;
      width: 24px;
      height: 24px;
      background-color: var(--accent);
      -webkit-mask-image: url('/static/sumit-logo.png');
      mask-image: url('/static/sumit-logo.png');
      -webkit-mask-size: contain;
      mask-size: contain;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat;
      flex-shrink: 0;
    }
    .klient-viewer-brand-name { color: var(--text-muted); }
    .klient-viewer-brand-firma {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
    }

    .klient-viewer-card {
      width: 100%;
    }

    .klient-viewer-title-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 20px;
    }
    .klient-viewer-doc-title {
      font-size: 20px;
      font-weight: 700;
      letter-spacing: -0.025em;
      color: var(--text);
      margin: 0;
    }
    .klient-viewer-doc-num {
      font-size: 13px;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .klient-viewer-parties {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-bottom: 24px;
    }
    .klient-viewer-party {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .klient-viewer-party-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      margin-bottom: 4px;
    }
    .klient-viewer-party-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      display: block;
    }
    .klient-viewer-party-details {
      font-size: 12px;
      color: var(--text-muted);
      margin: 0;
    }

    .klient-viewer-table-wrap {
      overflow-x: auto;
      margin-bottom: 0;
    }
    .klient-viewer-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    .klient-viewer-table thead th {
      padding: 0 8px 10px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
      text-align: left;
    }
    .klient-viewer-table thead th.col-num,
    .klient-viewer-table tbody td.col-num { text-align: right; }
    .klient-viewer-table thead th.col-lp,
    .klient-viewer-table tbody td.col-lp { text-align: center; width: 36px; }
    .klient-viewer-table tbody td {
      padding: 9px 8px;
      border-bottom: 1px solid var(--border);
      color: var(--text);
      vertical-align: middle;
    }
    .klient-viewer-table tbody tr:last-child td {
      border-bottom: none;
    }

    .klient-viewer-total {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 8px;
      border-top: 2px solid var(--text);
      margin-top: 0;
    }
    .klient-viewer-total-label {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }
    .klient-viewer-total-value {
      font-size: 18px;
      font-weight: 700;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }

    .klient-viewer-notes {
      margin-top: 20px;
      padding: 14px;
      background: var(--bg-soft);
      border-radius: 8px;
      border: 1px solid var(--border);
    }
    .klient-viewer-notes-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      margin: 0 0 6px;
    }
    .klient-viewer-notes-text {
      font-size: 13px;
      color: var(--text);
      white-space: pre-wrap;
      margin: 0;
    }

    .klient-viewer-validity {
      font-size: 12px;
      color: var(--text-muted);
      margin: 16px 0 0;
    }

    .klient-viewer-cta {
      margin-top: 24px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
    }
    .klient-viewer-cta .btn-primary {
      min-width: 160px;
    }
    .klient-viewer-hint {
      font-size: 11px;
      color: var(--text-muted);
      margin: 0;
    }

    .klient-viewer-footer {
      margin-top: 32px;
    }

    .klient-viewer-error {
      padding: 32px;
      text-align: center;
    }
    .klient-viewer-error-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--text);
      margin: 0 0 8px;
    }
    .klient-viewer-error-desc {
      font-size: 14px;
      color: var(--text-muted);
      margin: 0;
    }

    @media (max-width: 600px) {
      #view-klient { padding: 24px 16px 64px; }
      .klient-viewer-parties { grid-template-columns: 1fr; gap: 16px; }
      .klient-viewer-doc-title { font-size: 17px; }
      .klient-viewer-total-value { font-size: 16px; }
      .klient-viewer-cta .btn-primary { width: 100%; }
    }

    /* ── Sekcja akceptacji wyceny (F2) ──────────────────────────────── */
    .klient-viewer-sep {
      margin: 24px 0;
      border: none;
      border-top: 1px solid var(--border);
    }

    .akceptacja-box {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 20px;
      background: var(--bg-soft);
      border: 1px solid var(--border);
      border-radius: 10px;
    }
    .akceptacja-box.is-accepted {
      background: rgba(22, 163, 74, 0.06);
      border-color: rgba(22, 163, 74, 0.25);
      flex-direction: row;
      align-items: flex-start;
      gap: 14px;
    }
    [data-theme="dark"] .akceptacja-box.is-accepted {
      background: rgba(74, 222, 128, 0.08);
      border-color: rgba(74, 222, 128, 0.2);
    }

    .akceptacja-icon {
      color: #16a34a;
      flex-shrink: 0;
      margin-top: 2px;
    }
    [data-theme="dark"] .akceptacja-icon { color: #4ade80; }

    .akceptacja-txt strong {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
    }
    .akceptacja-meta {
      font-size: 12px;
      color: var(--text-muted);
      margin: 3px 0 0;
    }

    .akceptacja-label {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      margin: 0;
    }

    .akceptacja-imie {
      padding: 9px 12px;
      font-size: 14px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      color: var(--text);
      outline: none;
      width: 100%;
      box-sizing: border-box;
    }
    .akceptacja-imie:focus { border-color: var(--text); }

    .btn-akceptuj {
      align-self: flex-start;
    }

    /* Badge akceptacji w historii wycen */
    .badge-akceptacja {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 999px;
      font-weight: 500;
    }
    .badge-akceptacja.is-accepted {
      background: rgba(22, 163, 74, 0.1);
      color: #16a34a;
    }
    [data-theme="dark"] .badge-akceptacja.is-accepted {
      background: rgba(74, 222, 128, 0.12);
      color: #4ade80;
    }
    .badge-akceptacja.is-pending {
      background: var(--bg-chip);
      color: var(--text-muted);
    }

    /* ── Faktura: przełącznik typu dokumentu (jak segmented control w Pozycjach) ── */
    .doc-type-switcher {
      display: inline-flex;
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: center;
      gap: 5px;
      width: max-content;
      max-width: 100%;
      padding: 6px;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg-chip);
    }
    [data-theme="dark"] .doc-type-switcher {
      background: var(--bg-soft);
    }
    .doc-type-switcher .chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      height: 40px;
      min-height: 40px;
      padding: 0 16px;
      margin: 0;
      border-radius: 6px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      line-height: 1;
      letter-spacing: -0.005em;
      color: var(--text-muted);
      background: transparent;
      border: none;
      box-shadow: none;
      transition: color 0.15s ease, background 0.15s ease;
      cursor: pointer;
      white-space: nowrap;
    }
    .doc-type-switcher .chip.is-active {
      background: var(--accent);
      color: #ffffff;
    }
    .doc-type-switcher .chip:hover:not(.is-active),
    .doc-type-switcher .chip:focus-visible:not(.is-active) {
      color: var(--text);
      background: transparent;
    }

    /* Pola widoczne tylko przy typie faktura */
    .invoice-fields.hidden { display: none; }
    .invoice-fields { margin-top: 12px; }

    /* Kolumna VAT w tabeli pozycji */
    .vat-col-hidden { display: none; }
    .col-vat {
      width: 76px;
    }
    .col-vat .in-vat {
      width: 100%;
      padding: 9px 8px;
      font-size: 13px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg);
      color: var(--text);
      outline: none;
      cursor: pointer;
    }
    .col-vat .in-vat:focus { border-color: var(--text); }

    /* Badge typu dokumentu w historii (F3) */
    .historia-item-row { flex-wrap: wrap; }
    .badge-doc-type {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 999px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      order: -1;
      flex-shrink: 0;
    }
    .badge-doc-type.is-faktura {
      background: rgba(var(--text-rgb), 0.08);
      color: var(--text);
    }
    .badge-doc-type.is-proforma {
      background: var(--bg-chip);
      color: var(--text-muted);
    }
