/* ============================================================
   TaxPilot — dokumenty pokładowe (strona prawna)
   Sygnatura: blok rewizyjny — jak metryczka na rysunku technicznym.
   ============================================================ */

.lg-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lg-top__brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.lg-top__brand svg { width: 30px; height: 30px; }
.lg-top__name { font-family: var(--f-display); font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.lg-top__actions { display: flex; align-items: center; gap: 14px; }
.lg-top__link { font-size: 13.5px; font-weight: 600; color: var(--text-soft); text-decoration: none; }
.lg-top__link:hover { color: var(--orange-deep); }

.lg-wrap {
  max-width: 1180px; margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 40px) 90px;
  display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

/* --- spis dokumentów (lewa szyna) --- */
.lg-rail { position: sticky; top: 88px; display: grid; gap: 6px; }
.lg-rail__label { margin-bottom: 4px; }
.lg-rail__item {
  display: block; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: var(--text-soft);
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.lg-rail__item:hover { background: #EDEFF2; color: var(--text); }
.lg-rail__item[aria-current="page"] {
  background: var(--orange-soft); color: var(--orange-deep);
  border-left-color: var(--orange);
}
.lg-rail__name { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.lg-rail__ver { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.lg-rail__item[aria-current="page"] .lg-rail__ver { color: var(--orange-deep); opacity: .75; }
.lg-rail__sep { height: 1px; background: var(--line); margin: 10px 2px; }

/* --- treść dokumentu --- */
.lg-doc { max-width: 74ch; }
.lg-doc__kind { margin-bottom: 10px; }
.lg-doc__title {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.08;
  letter-spacing: -.025em; font-variation-settings: "wdth" 112;
}
.lg-doc__summary { font-size: 16px; line-height: 1.6; color: var(--text-soft); margin-top: 14px; }

/* SYGNATURA — blok rewizyjny */
.lg-rev {
  margin: 26px 0 34px;
  border: 1.5px solid var(--ink-900);
  border-radius: 4px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--card);
  overflow: hidden;
}
.lg-rev__cell { padding: 10px 14px; border-right: 1px solid var(--line); }
.lg-rev__cell:last-child { border-right: 0; }
.lg-rev__k {
  display: block; font-family: var(--f-display);
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); font-variation-settings: "wdth" 84;
}
.lg-rev__v { display: block; font-family: var(--f-mono); font-size: 13px; font-weight: 500; margin-top: 3px; }
.lg-rev__basis {
  grid-column: 1 / -1; border-top: 1px solid var(--line); border-right: 0;
  background: #F9FAFB;
}

/* sekcje */
.lg-sec { margin-bottom: 34px; scroll-margin-top: 90px; }
.lg-sec__head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.lg-sec__n {
  font-family: var(--f-mono); font-size: 13px; font-weight: 600;
  color: var(--orange-deep); background: var(--orange-soft);
  border-radius: 6px; padding: 2px 8px; flex: none;
}
.lg-sec__title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; font-variation-settings: "wdth" 104; }
.lg-sec p { font-size: 15px; line-height: 1.68; color: var(--text); margin-bottom: 12px; }
.lg-sec ul, .lg-sec ol { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 7px; }
.lg-sec li { font-size: 15px; line-height: 1.6; }
.lg-sec li::marker { color: var(--orange); }
.lg-sec b { font-weight: 600; }

.lg-table-wrap { overflow-x: auto; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.lg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--card); }
.lg-table th {
  text-align: left; font-family: var(--f-display); font-size: 10.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint);
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: #F9FAFB;
  white-space: nowrap;
}
.lg-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.lg-table tr:last-child td { border-bottom: 0; }

.lg-note {
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 13px 16px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.6; color: #7A3300;
}

/* pole do uzupełnienia */
.lg-ph {
  font-family: var(--f-mono); font-size: .92em;
  background: #FFEDDF; color: var(--orange-deep);
  border-bottom: 1.5px dashed var(--orange);
  padding: 1px 4px; border-radius: 3px;
}

/* pasek roboczy dla właściciela */
.lg-draft {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--ink-900); color: #fff;
  border-radius: var(--r-lg); padding: 15px 20px; margin-bottom: 26px;
}
.lg-draft__count {
  font-family: var(--f-mono); font-size: 19px; font-weight: 600;
  color: var(--orange-hi);
}
.lg-draft__text { font-size: 13.5px; color: var(--ink-100); line-height: 1.55; flex: 1; min-width: 240px; }

/* strona główna dokumentów */
.lg-index__title { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.025em; font-variation-settings: "wdth" 114; }
.lg-index__lead { font-size: 16.5px; line-height: 1.6; color: var(--text-soft); max-width: 64ch; margin-top: 14px; }
.lg-cards { display: grid; gap: 12px; margin-top: 28px; }
.lg-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1);
  transition: border-color .15s, transform .15s;
}
.lg-card:hover { border-color: var(--orange); transform: translateY(-1px); }
.lg-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lg-card__name { font-family: var(--f-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.lg-card__meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.lg-card__sum { font-size: 14px; line-height: 1.55; color: var(--text-soft); margin-top: 6px; max-width: 68ch; }

.lg-foot {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-faint);
}
.lg-foot a { color: var(--text-soft); text-decoration: none; font-weight: 600; }
.lg-foot--operator { flex-direction: column; align-items: flex-start; gap: 8px; }
.lg-foot--operator span:first-child { font-size: 12.5px; line-height: 1.55; color: var(--text-soft); }
.lg-foot a:hover { color: var(--orange-deep); }

@media (max-width: 900px) {
  .lg-wrap { grid-template-columns: minmax(0, 1fr); }
  .lg-rail { position: static; }
  .lg-rev { grid-template-columns: 1fr 1fr; }
  .lg-rev__cell:nth-child(2n) { border-right: 0; }
  .lg-rev__cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* wersja do druku — regulaminy się drukuje */
@media print {
  .lg-top, .lg-rail, .lg-draft, .cc, .lg-foot { display: none !important; }
  .lg-wrap { display: block; max-width: none; padding: 0; }
  .lg-doc { max-width: none; }
  .lg-rev { break-inside: avoid; }
  .lg-sec { break-inside: avoid-page; margin-bottom: 22px; }
  .lg-sec p, .lg-sec li { font-size: 11pt; }
  body { background: #fff; }
  a[href^="/"]::after { content: " (taxpilot.pl" attr(href) ")"; font-size: 9pt; color: #555; }
}
