/* KWIT — koncept automatu do faktur (Studio WWW). Mobile-first, ciemny motyw, bez frameworków. */
:root {
  --ink: #07090D;
  --s1: #0C1117;
  --s2: #111821;
  --s3: #17212C;
  --line: #1E2A36;
  --line2: #2A3B49;
  --tx: #E9EEF2;
  --tx2: #A9B6C2;
  --tx3: #8595A4;
  --mint: #3DF5C8;
  --mint-d: #1FB892;
  --mint-ink: #04241C;
  --amber: #FFB547;
  --red: #FF7A7A;
  --blue: #7CC4FF;
  --r: 14px;
  --r-s: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -24px rgba(0,0,0,.8);
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--ink); color: var(--tx); font: 400 16px/1.55 var(--sans); min-height: 100vh; overflow-x: hidden; }
img, svg, canvas { display: block; }
a { color: var(--mint); text-underline-offset: 3px; }
a:hover { color: #8FFBE0; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--mint); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--tx3); }
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--mint); color: var(--mint-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* tło: WebGL2 albo CSS */
.bg, .bg-fallback { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.bg { opacity: 0; transition: opacity .8s; }
.gl-on .bg { opacity: 1; }
.gl-on .bg-fallback { display: none; }
.bg-fallback {
  background:
    radial-gradient(900px 500px at 78% -10%, rgba(61,245,200,.10), transparent 60%),
    radial-gradient(700px 500px at 0% 30%, rgba(124,196,255,.06), transparent 60%),
    linear-gradient(rgba(61,245,200,.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(61,245,200,.035) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--ink);
}

/* przyciski */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; font-weight: 650; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .2s, border-color .2s, transform .15s, box-shadow .2s, color .2s; }
.btn svg { flex: none; }
.btn--sm { min-height: 38px; padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn--primary { background: var(--mint); color: var(--mint-ink); box-shadow: 0 0 0 0 rgba(61,245,200,.0), 0 8px 24px -10px rgba(61,245,200,.6); }
.btn--primary:hover { background: #7DFADB; color: var(--mint-ink); }
.btn--ghost { background: rgba(255,255,255,.03); border-color: var(--line2); color: var(--tx); }
.btn--ghost:hover { border-color: #3D5366; background: rgba(255,255,255,.06); color: var(--tx); }
.btn--danger { background: transparent; border-color: rgba(255,122,122,.4); color: var(--red); }
.btn--danger:hover { background: rgba(255,122,122,.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line2); background: transparent; color: var(--tx); cursor: pointer; }
.iconbtn:hover { background: rgba(255,255,255,.06); }

/* nagłówek */
.top { position: sticky; top: 0; z-index: 30; background: rgba(7,9,13,.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid rgba(30,42,54,.7); }
.top__in { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; font-weight: 800; letter-spacing: .14em; font-size: 17px; }
.brand:hover { color: var(--tx); }
.top__tag { display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--tx2); padding: 5px 11px; border: 1px solid var(--line2); border-radius: 999px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.top__nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top__nav a:not(.btn) { display: none; color: var(--tx2); text-decoration: none; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.top__nav a:not(.btn):hover { color: var(--tx); }
@media (min-width: 560px) { .top__tag { display: inline-flex; } }
@media (min-width: 900px) { .top__nav a:not(.btn) { display: inline-block; } }

/* hero */
.hero { padding-top: 34px; padding-bottom: 22px; }
.eyebrow { font: 600 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mint); margin-bottom: 12px; }
.hero h1 { font-size: clamp(32px, 9vw, 64px); font-weight: 800; letter-spacing: -.035em; max-width: 15ch; }
.hl-text { background: linear-gradient(92deg, var(--mint), #B9FFF0 60%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 16px; font-size: clamp(16px, 2.2vw, 19px); color: var(--tx2); max-width: 62ch; }
.hero__facts { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.hero__facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--tx2); }
.hero__facts svg { flex: none; margin-top: 2px; color: var(--mint); }
.hero__facts li + li svg { color: var(--amber); }
.hero__facts strong { color: var(--tx); font-weight: 650; }
@media (min-width: 900px) {
  .hero { padding-top: 54px; padding-bottom: 34px; display: grid; grid-template-columns: 1.25fr 1fr; column-gap: 48px; align-items: end; }
  .hero .eyebrow, .hero h1 { grid-column: 1; }
  .hero h1 { grid-row: 2 / span 2; }
  .hero .lead { grid-column: 2; grid-row: 2; margin-top: 0; }
  .hero__facts { grid-column: 2; grid-row: 3; }
}

/* panele */
.panel { background: linear-gradient(180deg, rgba(17,24,33,.92), rgba(12,17,23,.92)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
@media (min-width: 640px) { .panel { padding: 18px; } }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 38px; }
.panel__head--wrap { flex-wrap: wrap; }
.panel__title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(61,245,200,.12); color: var(--mint); font: 600 12px var(--mono); }
.count { font: 500 12.5px var(--mono); color: var(--tx2); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line2); }
.count--warn { color: var(--amber); border-color: rgba(255,181,71,.4); }

[hidden] { display: none !important; }
html.fwait body { visibility: hidden; }

/* układ narzędzia */
.app { display: grid; gap: 16px; padding-bottom: 40px; outline: none; }
.stage { display: grid; gap: 16px; align-content: start; min-width: 0; }
.results { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 1100px) {
  .app { grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); grid-template-areas: "stage tray" "stage results"; gap: 20px; align-items: start; }
  .stage { grid-area: stage; position: sticky; top: 76px; }
  .tray { grid-area: tray; min-width: 0; }
  .results { grid-area: results; }
}
.duo { display: grid; gap: 16px; }
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; } }

/* podgląd dokumentu */
.viewer { --vh: min(52vh, 460px); position: relative; height: var(--vh); min-height: 300px; border-radius: 12px; background: radial-gradient(120% 80% at 50% 0%, #121B25, #090D12); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
@media (min-width: 1100px) { .viewer { --vh: min(56vh, 560px); } }
.drop { position: absolute; inset: 10px; border: 1.5px dashed #2D4152; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; gap: 8px; transition: border-color .2s, background .2s; }
.drop.is-over, .viewer.is-over .drop { border-color: var(--mint); background: rgba(61,245,200,.05); }
.drop__art { position: relative; width: 104px; height: 110px; margin-bottom: 8px; }
.drop__sheet { position: absolute; width: 68px; height: 88px; border-radius: 6px; background: #E7ECEF; box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); }
.drop__sheet--b { left: 30px; top: 6px; transform: rotate(9deg); background: #9DAAB5; opacity: .5; }
.drop__sheet--a { left: 16px; top: 14px; transform: rotate(-5deg); padding: 12px 10px; display: grid; gap: 7px; align-content: start; }
.drop__sheet--a i { display: block; height: 5px; border-radius: 3px; background: #B9C4CC; }
.drop__sheet--a i:nth-child(1) { width: 60%; background: #7E8C97; }
.drop__sheet--a i:nth-child(3) { width: 75%; }
.drop__sheet--a i:nth-child(5) { width: 45%; margin-top: 8px; background: var(--mint-d); }
.drop__beam { position: absolute; left: -6px; right: -6px; top: 20px; height: 2px; background: var(--mint); box-shadow: 0 0 14px 2px rgba(61,245,200,.7); animation: beam 2.6s var(--ease) infinite alternate; }
@keyframes beam { from { transform: translateY(0); } to { transform: translateY(84px); } }
.drop__title { font-weight: 700; font-size: 17px; }
.drop__sub { font-size: 14px; color: var(--tx2); margin-bottom: 8px; max-width: 30ch; }
.drop__note { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--tx3); margin-top: 4px; }

.sheet { --ar: .707; position: relative; height: calc(var(--vh) - 28px); max-height: 100%; aspect-ratio: var(--ar); max-width: calc(100% - 24px); border-radius: 4px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04); transform-origin: 50% 60%; }
.sheet[hidden] { display: none; }
.sheet.is-in { animation: sheetIn .55s var(--ease); }
@keyframes sheetIn { from { opacity: 0; transform: perspective(900px) rotateX(18deg) translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
.sheet__paper { position: absolute; inset: 0; border-radius: 4px; overflow: hidden; background: #F3F4F1; }
.sheet__paper img, .sheet__paper canvas { width: 100%; height: 100%; object-fit: fill; }
.sheet__grid { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; border-radius: 4px;
  background: linear-gradient(rgba(61,245,200,.16) 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, rgba(61,245,200,.16) 1px, transparent 1px) 0 0 / 22px 100%;
  -webkit-mask: linear-gradient(180deg, transparent, #000 calc(var(--p, 0) * 100% - 18%), #000 calc(var(--p, 0) * 100%), transparent calc(var(--p, 0) * 100% + 1%));
          mask: linear-gradient(180deg, transparent, #000 calc(var(--p, 0) * 100% - 18%), #000 calc(var(--p, 0) * 100%), transparent calc(var(--p, 0) * 100% + 1%)); }
.sheet__laser { position: absolute; left: -10px; right: -10px; top: calc(var(--p, 0) * 100%); height: 3px; margin-top: -1.5px; opacity: 0; pointer-events: none; background: linear-gradient(90deg, transparent, var(--mint) 12%, #E6FFF8 50%, var(--mint) 88%, transparent); box-shadow: 0 0 18px 4px rgba(61,245,200,.55), 0 0 60px 10px rgba(61,245,200,.25); }
.sheet__laser::before { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 70px; background: linear-gradient(0deg, rgba(61,245,200,.22), transparent); }
.sheet.is-scanning .sheet__laser, .sheet.is-scanning .sheet__grid { opacity: 1; }
.sheet.is-scanning .sheet__paper { filter: saturate(.8) brightness(.96); }
.sheet__boxes { position: absolute; inset: 0; pointer-events: none; }
.box { position: absolute; border: 1.5px solid var(--mint); border-radius: 3px; background: rgba(61,245,200,.13); box-shadow: 0 0 0 3px rgba(61,245,200,.12), 0 0 16px rgba(61,245,200,.35); animation: boxIn .35s var(--ease) both; }
.box--warn { border-color: var(--amber); background: rgba(255,181,71,.16); box-shadow: 0 0 0 3px rgba(255,181,71,.14), 0 0 16px rgba(255,181,71,.4); }
.box--err { border-color: #FF5C5C; background: rgba(255,92,92,.16); box-shadow: 0 0 0 3px rgba(255,92,92,.16), 0 0 16px rgba(255,92,92,.45); }
.box__tag { position: absolute; left: -1.5px; bottom: 100%; margin-bottom: 3px; font: 600 9.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; background: var(--mint); color: var(--mint-ink); padding: 3px 5px; border-radius: 3px; white-space: nowrap; }
.box--warn .box__tag { background: var(--amber); color: #2B1A00; }
.box--err .box__tag { background: #FF5C5C; color: #2B0000; }
.box.is-dim { opacity: .35; animation: none; }
.box.is-dim .box__tag { visibility: hidden; }
.box.is-focus { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
@keyframes boxIn { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
.sheet__msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 330px); background: rgba(9,13,18,.95); border: 1px solid var(--line2); border-radius: 12px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.7); font-size: 14px; color: var(--tx2); display: grid; gap: 10px; animation: boxIn .35s var(--ease); }
.sheet__msg[hidden] { display: none; }
.sheet__msg h4 { margin: 0; font-size: 16px; color: var(--tx); display: flex; gap: 8px; align-items: center; }
.sheet__msg h4 svg { color: var(--amber); flex: none; }
.sheet__msg .row { display: flex; flex-wrap: wrap; gap: 8px; }
.dropveil { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,20,16,.82); border: 2px dashed var(--mint); border-radius: 12px; color: var(--mint); font-weight: 700; font-size: 18px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.viewer.is-over .dropveil { opacity: 1; }
.scanline { display: flex; align-items: center; gap: 10px; margin-top: 12px; font: 500 13px/1.4 var(--mono); color: var(--tx2); min-height: 20px; }
.scanline__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tx3); flex: none; }
.is-busy .scanline__dot { background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.strip { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 8px !important; gap: 5px !important; z-index: 3; display: flex; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); background: rgba(7,9,13,.88) !important; animation: boxIn .3s var(--ease); flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); }
.strip[hidden] { display: none; }
.strip__t { width: 100%; font-size: 12.5px; color: var(--tx3); display: flex; justify-content: space-between; gap: 8px; }
.strip__t a { color: var(--mint); }
.pill { display: inline-flex; gap: 6px; align-items: baseline; font: 500 12.5px var(--mono); padding: 4px 8px; border-radius: 7px; background: rgba(61,245,200,.08); border: 1px solid rgba(61,245,200,.25); color: var(--tx); }
.pill b { font: 600 10px var(--mono); color: var(--mint); text-transform: uppercase; letter-spacing: .05em; }

/* tacka z przykładami */
.tray__hint { font-size: 13.5px; color: var(--tx2); margin: -4px 0 12px; }
.tray__list { list-style: none; margin: 0 -14px; padding: 4px 14px 10px; display: grid; grid-auto-flow: column; grid-auto-columns: 136px; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
@media (min-width: 640px) { .tray__list { margin: 0 -18px; padding: 4px 18px 10px; } }
@media (min-width: 1100px) { .tray__list { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; } }
.card { position: relative; width: 100%; display: grid; gap: 6px; text-align: left; padding: 8px; border-radius: 11px; border: 1px solid var(--line2); background: var(--s2); cursor: grab; scroll-snap-align: start; transition: border-color .2s, transform .2s, background .2s; color: var(--tx); }
.card:hover { border-color: #3D5366; transform: translateY(-2px); background: var(--s3); }
.card:active { cursor: grabbing; }
.card.is-drag { opacity: .5; }
.card__img { position: relative; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: #DADFE2; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__kind { position: absolute; left: 5px; top: 5px; font: 600 9.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(7,9,13,.86); color: var(--tx); text-transform: uppercase; letter-spacing: .05em; }
.card__bad { position: absolute; right: 5px; top: 5px; font: 600 9.5px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: var(--amber); color: #2B1A00; text-transform: uppercase; }
.card__name { font-weight: 650; font-size: 13px; line-height: 1.25; }
.card__desc { font-size: 11.5px; color: var(--tx2); line-height: 1.3; }
.card__n { position: absolute; right: 8px; bottom: 8px; font: 600 10px var(--mono); color: var(--mint); }
.tray__more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13.5px; color: var(--tx2); }
.tray__more summary { cursor: pointer; color: var(--tx); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.tray__more p { margin: 6px 0 8px; }
.tray__dl { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.tray__dl a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; font-family: var(--mono); font-size: 12.5px; }

/* filtry */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--tx2); letter-spacing: .02em; }
.field--search { grid-column: 1 / -1; }
@media (min-width: 700px) { .filters { grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(120px, 1fr)); } .field--search { grid-column: auto; } }
input[type="search"], input[type="text"], input[type="date"], select { width: 100%; min-height: 42px; border-radius: 10px; border: 1px solid var(--line2); background: #0A0F14; padding: 8px 12px; color: var(--tx); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--tx2) 50%), linear-gradient(135deg, var(--tx2) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:hover, select:hover { border-color: #3D5366; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; border-color: transparent; }
.input-ic { position: relative; }
.input-ic svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx3); pointer-events: none; }
.input-ic input { padding-left: 36px; }
::placeholder { color: #6F7F8D; }

/* tabela */
.tablewrap { position: relative; min-height: 180px; }
@media (min-width: 760px) { .tablewrap { min-height: 430px; } .empty { min-height: 400px; } }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.grid thead { display: none; }
.grid tbody { display: grid; gap: 10px; }
.grid tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--s2); position: relative; }
.grid td { display: grid; gap: 2px; min-width: 0; }
.grid td::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; }
.grid td.c-doc, .grid td.c-st { grid-column: 1 / -1; }
.grid td.c-doc::before { display: none; }
.grid td.c-st { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.grid td.c-st::before { display: none; }
.grid tr.is-new { animation: rowIn .5s var(--ease); }
.grid tr.is-flash { box-shadow: 0 0 0 2px var(--mint); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); background: rgba(61,245,200,.12); } to { opacity: 1; transform: none; } }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.v { display: inline-block; border-radius: 4px; transition: background .4s, box-shadow .4s; max-width: 100%; overflow-wrap: anywhere; }
.v.is-pending { color: transparent; background: linear-gradient(90deg, #1A2530, #24323F, #1A2530); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; min-width: 5ch; }
.v.is-landed { background: rgba(61,245,200,.25); box-shadow: 0 0 0 3px rgba(61,245,200,.25); }
@keyframes shimmer { to { background-position: -200% 0; } }
.v.c-mid { text-decoration: underline dotted rgba(255,181,71,.8) 1.5px; text-underline-offset: 4px; }
.v.c-lo { text-decoration: underline wavy rgba(255,122,122,.9) 1.2px; text-underline-offset: 4px; }
.doc { display: grid; gap: 3px; min-width: 0; }
.doc__top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font: 600 10.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: rgba(124,196,255,.12); color: var(--blue); }
.tag--korekta { background: rgba(196,160,255,.14); color: #CDB2FF; }
.tag--paragon { background: rgba(255,181,71,.12); color: var(--amber); }
.doc__no { font: 500 13px var(--mono); color: var(--tx); }
.doc__seller { font-weight: 650; font-size: 15px; line-height: 1.3; background: none; border: 0; padding: 0; text-align: left; color: var(--tx); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.doc__seller:hover { text-decoration-color: var(--mint); }
.doc__file { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nip { display: inline-flex; gap: 6px; align-items: center; }
.ok { color: var(--mint); } .bad { color: var(--red); } .warn { color: var(--amber); }
.sub { font-size: 12px; color: var(--tx3); }
.ratechips { display: flex; gap: 4px; flex-wrap: wrap; }
.rc { font: 500 10.5px var(--mono); color: var(--tx2); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 4px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 13px; padding: 4px 9px 4px 7px; border-radius: 999px; }
.status--ok { background: rgba(61,245,200,.1); color: var(--mint); }
.status--warn { background: rgba(255,181,71,.12); color: var(--amber); }
.status--err { background: rgba(255,122,122,.12); color: var(--red); }
.confbar { display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); color: var(--tx2); }
.confbar i { display: block; width: 46px; height: 5px; border-radius: 3px; background: var(--line2); overflow: hidden; }
.confbar i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--cc, var(--mint)); }
.more { margin-left: auto; }
.empty { display: grid; place-items: center; text-align: center; gap: 6px; padding: 34px 12px; border: 1px dashed var(--line2); border-radius: 12px; color: var(--tx2); background: repeating-linear-gradient(180deg, transparent 0 43px, rgba(30,42,54,.5) 43px 44px); }
.empty[hidden] { display: none; }
.empty__t { font-weight: 700; color: var(--tx); }
.empty__s { font-size: 14px; max-width: 40ch; }
.nomatch { padding: 18px; text-align: center; color: var(--tx2); }
.nomatch[hidden] { display: none; }

@media (min-width: 760px) {
  .grid { display: table; }
  .grid thead { display: table-header-group; }
  .grid tbody { display: table-row-group; }
  .grid tr { display: table-row; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .grid td, .grid th { display: table-cell; padding: 11px 10px; vertical-align: top; border-bottom: 1px solid var(--line); text-align: left; }
  .grid td::before { display: none; }
  .grid td.c-st { display: table-cell; border-top: 0; padding-top: 11px; }
  .grid th { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--tx2); border-bottom-color: var(--line2); white-space: nowrap; padding-top: 6px; padding-bottom: 8px; }
  .grid th button { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 2px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
  .grid th button:hover { color: var(--tx); }
  .grid th button svg { opacity: .45; }
  .grid th[aria-sort="ascending"] button, .grid th[aria-sort="descending"] button { color: var(--mint); }
  .grid th[aria-sort="ascending"] svg, .grid th[aria-sort="descending"] svg { opacity: 1; }
  .grid .num { text-align: right; }
  .grid th.num button { flex-direction: row-reverse; }
  .grid tbody tr:hover td { background: rgba(255,255,255,.02); }
  .grid tr.is-flash td { background: rgba(61,245,200,.06); box-shadow: none; }
  .grid tr.is-flash { box-shadow: none; }
  .grid td.c-doc { min-width: 190px; max-width: 280px; }
  .grid td.num .v, .grid td.c-date .v, .grid td.c-nip .v { white-space: nowrap; overflow-wrap: normal; }
  .grid td.c-date .sub, .grid td.c-nip .sub { display: block; white-space: nowrap; }
  .grid td, .grid th { padding-left: 8px; padding-right: 8px; }
  .grid td.num .ratechips { justify-content: flex-end; margin-top: 4px; }
  .st-wrap { display: grid; gap: 6px; justify-items: start; }
  .more { margin-left: 0; }
}
@media (min-width: 1100px) and (max-width: 1279px) { .grid td.c-nip .sub { display: none; } }

/* podsumowanie */
.sum__big { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sum__big div { padding: 12px; border-radius: 11px; background: rgba(0,0,0,.22); border: 1px solid var(--line); min-width: 0; }
.sum__big dt { font-size: 12px; color: var(--tx2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.sum__big dd { margin: 4px 0 0; font: 600 clamp(17px, 2vw, 21px)/1.2 var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sum__total { grid-column: 1 / -1; border-color: rgba(61,245,200,.3) !important; background: rgba(61,245,200,.06) !important; }
.sum__total dd { color: var(--mint); font-size: clamp(22px, 3vw, 28px); }
.rates { margin-top: 14px; display: grid; gap: 10px; }
.rate { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; align-items: center; font-size: 13px; }
.rate__k { font: 600 13px var(--mono); }
.rate__bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rate__bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--mint-d), var(--mint)); width: var(--w); transition: width .8s var(--ease); }
.rate__v { grid-column: 2; display: flex; justify-content: space-between; gap: 8px; font: 500 12px var(--mono); color: var(--tx2); flex-wrap: wrap; }
.sum__foot { margin-top: 12px; font-size: 12.5px; color: var(--tx3); }
.flaglist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flaglist__none { font-size: 14px; }
.flag { display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; padding: 10px; border-radius: 10px; border: 1px solid rgba(255,181,71,.25); background: rgba(255,181,71,.05); font-size: 13.5px; animation: rowIn .4s var(--ease); }
.flag--err { border-color: rgba(255,122,122,.3); background: rgba(255,122,122,.05); }
.flag svg { color: var(--amber); margin-top: 2px; }
.flag--err svg { color: var(--red); }
.flag__doc { grid-column: 2; background: none; border: 0; padding: 0; text-align: left; font-weight: 650; color: var(--tx); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(233,238,242,.3); text-underline-offset: 3px; min-height: 24px; }
.flag__doc:hover { text-decoration-color: var(--mint); }
.flag p { grid-column: 2; color: var(--tx2); }

/* sekcje informacyjne */
.info { padding-top: 48px; padding-bottom: 16px; }
.info h2, .cta h2 { font-size: clamp(26px, 4.5vw, 38px); font-weight: 800; margin-bottom: 20px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(12,17,23,.75); }
.steps__n { font: 600 13px var(--mono); color: var(--mint); }
.steps h3 { font-size: 18px; margin: 8px 0 6px; }
.steps p { font-size: 14.5px; color: var(--tx2); }
.truth { display: grid; gap: 12px; }
@media (min-width: 800px) { .truth { grid-template-columns: 1fr 1fr; } }
.truth__col { padding: 18px; border-radius: var(--r); border: 1px solid rgba(255,181,71,.25); background: rgba(12,17,23,.75); }
.truth__col--real { border-color: rgba(61,245,200,.25); }
.truth h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin-bottom: 10px; }
.truth h3 svg { color: var(--amber); }
.truth__col--real h3 svg { color: var(--mint); }
.truth ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--tx2); font-size: 14.5px; }
.cta { padding-top: 48px; padding-bottom: 40px; }
.cta__in { position: relative; overflow: hidden; padding: 28px 20px; border-radius: 20px; border: 1px solid rgba(61,245,200,.25); background: radial-gradient(600px 300px at 90% 0%, rgba(61,245,200,.14), transparent 70%), linear-gradient(180deg, #0F1720, #0A0F14); }
@media (min-width: 640px) { .cta__in { padding: 44px; } }
.cta__in p:not(.eyebrow) { color: var(--tx2); max-width: 62ch; }
.cta h2 { margin-bottom: 12px; }
.cta__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.cta__btns .btn { white-space: normal; overflow-wrap: anywhere; }
.foot { padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--tx2); display: grid; gap: 6px; }

/* dialog szczegółów */
.dlg { width: min(1040px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 0; border: 1px solid var(--line2); border-radius: 16px; background: #0B1016; color: var(--tx); box-shadow: 0 40px 100px rgba(0,0,0,.8); }
.dlg::backdrop { background: rgba(3,5,8,.72); backdrop-filter: blur(4px); }
.dlg[open] { animation: dlgIn .3s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.dlg__form { display: flex; flex-direction: column; max-height: calc(100dvh - 18px); }
.dlg__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.dlg__head .eyebrow { margin-bottom: 4px; }
.dlg__head h2 { font-size: 20px; overflow-wrap: anywhere; }
.dlg__body { overflow: auto; padding: 16px; display: grid; gap: 18px; }
@media (min-width: 860px) { .dlg__body { grid-template-columns: 340px 1fr; } }
.dlg__doc { position: relative; align-self: start; border-radius: 6px; overflow: hidden; background: #F3F4F1; display: none; }
@media (min-width: 860px) { .dlg__doc { display: block; position: sticky; top: 0; } }
.dlg__doc img { width: 100%; height: auto; }
.dlg__legend { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.conf { display: inline-flex; align-items: center; gap: 5px; font: 500 11px var(--mono); padding: 3px 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.conf::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.conf--hi { color: var(--mint); } .conf--mid { color: var(--amber); } .conf--lo { color: var(--red); } .conf--man { color: var(--blue); } .conf--none { color: var(--tx3); }
.dlg__flags { display: grid; gap: 6px; margin-bottom: 12px; }
.dlg__flags:empty { display: none; }
.fgrid { display: grid; gap: 12px; }
@media (min-width: 560px) { .fgrid { grid-template-columns: 1fr 1fr; } }
.fgrid .wide { grid-column: 1 / -1; }
.ff { display: grid; gap: 5px; min-width: 0; }
.ff__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ff label { font-size: 12.5px; font-weight: 650; color: var(--tx2); }
.ff input, .ff select { font-family: var(--mono); font-size: 14px; }
.ff.is-bad input { border-color: rgba(255,122,122,.6); }
.ff__why { font-size: 11.5px; color: var(--tx3); min-height: 1em; }
.ff__err { font-size: 12px; color: var(--red); }
.dlg__items { margin-top: 16px; }
.dlg__items h3 { font-size: 14px; margin-bottom: 8px; color: var(--tx2); }
.items { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.items th, .items td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.items th { color: var(--tx3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.items td.num, .items th.num { text-align: right; white-space: nowrap; }
.itemsWrap { overflow-x: auto; }
.dlg__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }

/* lecące pola */
.fly { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.chip { position: fixed; left: 0; top: 0; font: 600 12px/1 var(--mono); padding: 5px 8px; border-radius: 6px; background: var(--mint); color: var(--mint-ink); white-space: nowrap; box-shadow: 0 6px 20px rgba(61,245,200,.45); will-change: transform, opacity; }
.chip--warn { background: var(--amber); color: #2B1A00; box-shadow: 0 6px 20px rgba(255,181,71,.45); }
.chip--err { background: #FF5C5C; color: #2B0000; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%); z-index: 80; display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 24px); padding: 10px 12px 10px 16px; border-radius: 12px; background: #E9EEF2; color: #0A0F14; font-weight: 600; font-size: 14px; box-shadow: 0 20px 40px rgba(0,0,0,.6); transition: transform .35s var(--ease); }
.toast.is-on { transform: translate(-50%, 0); }
.toast:empty { display: none; }
.toast button { background: #0A0F14; color: #E9EEF2; border: 0; border-radius: 8px; padding: 6px 10px; min-height: 32px; font-weight: 700; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .drop__beam { animation: none; transform: translateY(42px); }
}
@media (forced-colors: active) { .sheet__laser, .chip { forced-color-adjust: none; } }

/* wąskie ekrany: pasek „Dodano do tabeli” w siatce 2×2, żeby nie zasłaniał dokumentu */
@media (max-width: 479px) {
  .strip { display: grid; grid-template-columns: 1fr 1fr; padding: 6px !important; gap: 4px !important; }
  .strip__t { grid-column: 1 / -1; font-size: 11.5px; }
  .strip .pill { flex-direction: column; gap: 1px; padding: 3px 6px; font-size: 11.5px; min-width: 0; }
  .strip .pill b { font-size: 9px; }
  .strip .pill .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
