/* Zasady (regulaminy, taryfikator), huby i formularz podania */

/* ---------- dokumenty zasad ---------- */
.doc__text { max-width: 840px; }
.rules { display: grid; border-top: 1px solid var(--line-2); }
.rules > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); transition: background-color 0.4s; }
.rules > li:target { background: rgba(255, 255, 255, 0.06); }
.rules__no { color: var(--fg-3); padding-top: 5px; letter-spacing: 0.08em; white-space: nowrap; }
.rules p { color: var(--fg-2); line-height: 1.7; font-size: 16.5px; max-width: 66ch; }
.rules strong { color: var(--fg); }
.rules .muted { font-size: 14px; }
.doc__links { display: grid; gap: 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc__links > div { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- taryfikator ---------- */
.tariff__tools { position: sticky; top: var(--header-h); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 14px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.tariff__tools .search { flex: 1 1 320px; max-width: 520px; }
.tariff { display: grid; }
.tariff__row { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 220px); gap: 18px; align-items: start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.tariff__main h3 { font: 800 clamp(18px, 1.6vw, 22px)/1.15 var(--font-display); font-stretch: 78%; text-transform: uppercase; letter-spacing: 0.01em; }
.tariff__main p { margin-top: 6px; color: var(--fg-2); line-height: 1.65; font-size: 15.5px; max-width: 62ch; }
.tariff__penalty { justify-self: end; max-width: 100%; line-height: 1.35; text-align: right; white-space: normal; }
.tariff__penalty[data-level='warn'] { border-style: dashed; }
.tariff__empty { padding: 32px 0; color: var(--fg-3); }
.tariff__credit { margin-top: 28px; }

/* ---------- huby: zasady i podania ---------- */
.docs-hub { display: grid; gap: clamp(36px, 5vw, 64px); }
.apps-group { display: grid; gap: 20px; }
.apps-group__title { color: var(--fg-3); }
.docs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-left: 1px solid var(--line); }
.docs-card {
  position: relative; display: grid; gap: 14px; align-content: start; min-height: 210px; padding: clamp(22px, 2.6vw, 38px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out);
}
.docs-card .mono { color: var(--fg-3); transition: color 0.5s; }
.docs-card h2, .docs-card h3 { font: 800 clamp(24px, 2.6vw, 38px)/1 var(--font-display); font-stretch: 70%; text-transform: uppercase; padding-right: 36px; }
.docs-card p { color: var(--fg-2); line-height: 1.6; max-width: 46ch; transition: color 0.5s; }
.docs-card .icon { position: absolute; top: 24px; right: 24px; transition: transform 0.5s var(--ease-out); }
.docs-card:hover { background: var(--fg); color: #050505; }
.docs-card:hover .mono, .docs-card:hover p { color: rgba(0, 0, 0, 0.66); }
.docs-card:hover .icon { transform: translate(4px, -4px); }
.docs-card--accent { background: repeating-linear-gradient(135deg, transparent 0 9px, var(--line) 9px 10px); }
.docs-card.is-closed { opacity: 0.6; }
.docs-card__meta { align-self: end; }
.docs-hub__note { max-width: 62ch; }

/* ---------- formularz podania ---------- */
.apply { display: grid; justify-items: center; gap: 28px; }
.apply__box, .apply__back { width: min(100%, 760px); }
.apply__form { display: grid; gap: clamp(28px, 3vw, 40px); }
.apply__q { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start; }
.apply__no { color: var(--fg-4); padding-top: 4px; }
.apply__req { color: var(--fg); }
.apply__count { text-align: right; font-size: 11px; }
.apply__actions { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.apply__notice { display: grid; gap: 18px; padding: clamp(24px, 3.4vw, 48px); border: 1px solid var(--line-2); background: var(--bg-2); }
.apply .field > label { line-height: 1.55; text-transform: none; letter-spacing: 0.02em; font-size: 14px; color: var(--fg); }

@media (max-width: 639px) {
  .docs-grid { grid-template-columns: 1fr; }
  .docs-card { min-height: 0; }
  .rules > li { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .tariff__row { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .tariff__penalty { grid-column: 2; justify-self: start; text-align: left; }
  .apply__q { grid-template-columns: 1fr; gap: 6px; }
}

/* pole wyszukiwania (taryfikator); ten sam wygląd co w panelach */
.search { position: relative; display: block; }
.search .icon { position: absolute; left: 0; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--fg-3); }
.search .input { padding-left: 30px; font-size: 16px; }

/* punkt rozwijany po kliknięciu (np. lista akcji z limitami) */
.rules__li--more { cursor: pointer; }
.rules__more > summary { display: grid; gap: 8px; list-style: none; cursor: pointer; }
.rules__more > summary::-webkit-details-marker { display: none; }
.rules__hint { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--fg-4); transition: text-decoration-color 0.3s; }
.rules__hint::before { content: '+'; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-2); font-size: 13px; line-height: 1; text-decoration: none; transition: transform 0.4s var(--ease-out); }
.rules__more > summary:hover .rules__hint { text-decoration-color: var(--fg); }
.rules__more[open] .rules__hint::before { content: '−'; }
.rules__detail { display: grid; gap: 16px; margin-top: 18px; padding: clamp(16px, 2vw, 24px); border: 1px solid var(--line-2); background: var(--bg-2); animation: rules-open 0.45s var(--ease-out); }
@keyframes rules-open { from { opacity: 0; transform: translateY(-6px); } }
.rules__detail p { font-size: 15px; }
.rules__note { color: var(--fg-3); }
.table-wrap { overflow-x: auto; }
.rtable { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 15px; }
.rtable th, .rtable td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.rtable thead th { color: var(--fg-3); font: 500 10px/1.3 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; border-bottom-color: var(--line-2); }
.rtable tbody th { font-weight: 600; color: var(--fg); }
.rtable td { font-variant-numeric: tabular-nums; color: var(--fg); }
.rtable tbody tr:last-child th, .rtable tbody tr:last-child td { border-bottom: 0; }
.rtable th:not(:first-child), .rtable td { text-align: center; }

/* katalogi czynów (prawo stanowe): tabele szerokie, wyrównane do lewej */
.rtable--list { min-width: 540px; }
.rtable--list th, .rtable--list td { padding: 10px 8px; text-align: left; vertical-align: top; }
.rtable--list td:nth-child(n + 3) { white-space: nowrap; }
.cell-note { display: block; margin-top: 3px; color: var(--fg-3); font: 400 12.5px/1.4 var(--font-display); }
.rtable--list tbody th { font: 600 11px/1.5 var(--font-mono); letter-spacing: 0.02em; color: var(--fg-2); white-space: nowrap; }
.rtable--list td:nth-child(2) { font-weight: 600; min-width: 150px; }
.rtable--list td { font-size: 14px; color: var(--fg-2); }
.rtable--list td:nth-child(2) { color: var(--fg); }
.rtable-block, .rules__detail { grid-template-columns: minmax(0, 1fr); }
.rtable-block { display: grid; gap: 14px; margin-top: clamp(28px, 4vw, 44px); }
.rtable-block__title { font: 800 clamp(18px, 1.8vw, 24px)/1.15 var(--font-display); font-stretch: 78%; text-transform: uppercase; letter-spacing: 0.01em; }
.rtable-block__intro { color: var(--fg-2); line-height: 1.65; max-width: 66ch; font-size: 15.5px; }
.rtable-block .table-wrap { border: 1px solid var(--line); background: var(--bg-2); }
.chapter__intro { color: var(--fg-2); line-height: 1.7; max-width: 66ch; font-size: 17px; }

/* wyjątki i przykłady pod punktem regulaminu */
.rules__body { display: grid; gap: 12px; }
.rules__except { display: grid; gap: 8px; padding: 12px 16px; border-left: 2px solid var(--fg); background: var(--bg-2); }
.rules__except > .mono, .rules__example > .mono { color: var(--fg-3); }
.rules__except ul { display: grid; gap: 6px; }
.rules__except li { color: var(--fg-2); line-height: 1.6; font-size: 15px; padding-left: 16px; position: relative; }
.rules__except li::before { content: ''; position: absolute; left: 0; top: 0.8em; width: 8px; height: 1px; background: var(--fg-3); }
.rules__example { color: var(--fg-3); font-size: 15px; line-height: 1.6; font-style: italic; max-width: 66ch; }
.rules__example > .mono { font-style: normal; margin-right: 6px; }

/* karta wyłączonych podań i szeroka karta w hubie */
.docs-card.is-closed { opacity: 1; cursor: not-allowed; background: repeating-linear-gradient(135deg, transparent 0 9px, var(--line) 9px 10px); }
.docs-card.is-closed h3, .docs-card.is-closed p { color: var(--fg-3); }
.docs-card.is-closed:hover { background: repeating-linear-gradient(135deg, transparent 0 9px, var(--line) 9px 10px); color: inherit; }
.docs-card.is-closed:hover .mono { color: var(--fg-3); }
.docs-card.is-closed:hover p { color: var(--fg-3); }
.docs-card__off { justify-self: start; padding: 6px 10px; border: 1px solid var(--fg); color: var(--fg) !important; letter-spacing: 0.18em; }
.docs-card--wide { grid-column: 1 / -1; min-height: 0; }
