/* =============================================================================
   BillGrid public site: freelance payment laws (/freelance-payment-laws, its law pages) and the late fee
   calculator. Loads after outer/site.css and outer/pages.css and uses only their tokens.
   Design source: docs/mocks/site/payment-laws-spec.html (mock CSS: docs/mocks/site/payment-laws/payment-laws.css).
   ============================================================================= */

/* ---------- the three facts under the page head ---------- */
.pl-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; max-width: 980px; margin-top: 36px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pl-facts li { padding: 18px 24px 0 0; }
.pl-facts li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.pl-facts b { display: block; font-family: var(--font-serif); font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.pl-facts span { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.pl-facts a { color: var(--caption); font-size: var(--fs-xs); text-underline-offset: 3px; }
@media (max-width: 720px) {
  .pl-facts { grid-template-columns: minmax(0, 1fr); }
  .pl-facts li, .pl-facts li + li { padding: 14px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- the checker: three questions in a row, the answer below ---------- */
.pl-check { margin-top: 8px; }
.pl-ask { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: end; }
.pl-ask .field select { width: 100%; padding: 12px 38px 12px 14px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff; font: inherit; font-size: var(--fs-body); color: var(--ink); appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--caption) 50%), linear-gradient(135deg, var(--caption) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.pl-ask .field select:focus { outline: none; border-color: var(--ink); box-shadow: var(--field-focus); }
.pl-money { position: relative; }
.pl-money::before { content: "$"; position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--caption); pointer-events: none; }
.pl-ask .pl-money input { padding-left: 26px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .pl-ask { grid-template-columns: minmax(0, 1fr); } }

.pl-answer { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.pl-verdict { display: flex; gap: 14px; align-items: flex-start; }
.pl-verdict__icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--paid-bg); color: var(--paid-fg); }
.pl-verdict--muted .pl-verdict__icon { background: var(--paper); color: var(--caption); box-shadow: inset 0 0 0 1px var(--line); }
.pl-verdict h3 { font-size: var(--fs-lg); line-height: 1.25; letter-spacing: -.02em; }
.pl-verdict p { margin-top: 4px; color: var(--text-muted); }

/* one card per law; two laws (a city inside a state) sit side by side, so where they differ shows */
.pl-laws { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 22px; }
.pl-law { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.pl-law.is-under { background: #fff; }
.pl-law__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pl-law__head h3 { margin: 0; font-size: var(--fs-md); letter-spacing: -.01em; color: var(--ink); }
.pl-law__meta { margin-top: 2px; font-size: var(--fs-sm); color: var(--caption); }
.pl-law dl { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 10px 14px; margin: 16px 0 0; }
.pl-law dt { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.pl-law dd { margin: 0; font-size: var(--fs-sm); color: var(--text); }
.pl-law dd ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-muted); }
.pl-law dd a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.pl-law__flag { display: inline-flex; align-items: center; gap: var(--icon-gap-xs); padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; }
.pl-law__flag--on { background: var(--paid-bg); color: var(--paid-fg); }
.pl-law__flag--off { background: #fff; color: var(--caption); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 560px) { .pl-law dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .pl-law dd + dt { margin-top: 10px; } }

/* two laws for one place: aligned rows, so the differences show; on phones each row stacks, each value named */
.pl-pair { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.pl-pair table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.pl-pair :is(th, td) { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pl-pair tbody tr:last-child > * { border-bottom: 0; }
.pl-pair thead th { width: 40%; border-bottom-color: var(--sand-300); }
.pl-pair__place { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--fs-md); color: var(--ink); }
.pl-pair thead small { display: block; margin-top: 2px; font-weight: 400; color: var(--caption); }
.pl-pair tbody th { width: 20%; font-weight: 600; color: var(--ink); }
.pl-pair td { color: var(--text); }
.pl-pair td ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.pl-pair td a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
@media (max-width: 640px) {
  .pl-pair thead { display: none; }
  .pl-pair :is(table, tbody, tr, th, td) { display: block; width: auto; }
  .pl-pair tbody th { padding-bottom: 0; border: 0; }
  .pl-pair td { padding-top: 6px; border: 0; }
  .pl-pair td::before { content: attr(data-place); display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--gold-deep); }
  .pl-pair tbody tr { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
}

.pl-answer__tools { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: var(--fs-sm); }
.pl-link { display: inline-flex; align-items: center; gap: var(--icon-gap-sm); padding: 0; border: 0; background: none; color: var(--text-muted); font-size: var(--fs-sm); text-decoration: none; cursor: pointer; }
.pl-link:hover { color: var(--ink); }
.pl-note { margin-top: 14px; font-size: var(--fs-sm); color: var(--caption); }
.pl-note a { color: var(--ink); text-underline-offset: 3px; }

/* no law where you are: what still protects you */
.pl-still { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.pl-still li { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.pl-still .bg-icon { flex: none; margin-top: 4px; color: var(--gold-deep); }
.pl-still a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* ---------- "the law sets the deadline, BillGrid keeps it": the one sign-up offer on the page ---------- */
.pl-offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; margin-top: 24px; padding: 22px 24px; border-left: 3px solid var(--gold); border-radius: 0 16px 16px 0; background: var(--paper); }
.pl-offer h3 { font-size: var(--fs-md); letter-spacing: -.01em; }
.pl-offer ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--text-muted); }
.pl-offer li { display: inline-flex; align-items: center; gap: var(--icon-gap-sm); }
.pl-offer li .bg-icon { color: var(--paid-fg); }
.pl-offer__fine { grid-column: 1 / -1; margin: -6px 0 0; font-size: var(--fs-xs); color: var(--caption); }
@media (max-width: 720px) { .pl-offer { grid-template-columns: minmax(0, 1fr); } .pl-offer .btn { justify-self: start; } }

/* ---------- the table: every law at a glance; first column stays put while it scrolls on phones ---------- */
.pl-table { min-width: 980px; }
.pl-table th:first-child, .pl-table td:first-child { position: sticky; left: 0; background: #fff; }
.pl-table tbody th { width: auto; }
.pl-table td { width: auto; font-size: var(--fs-sm); }
.pl-table thead th, .pl-table td:nth-of-type(1) { white-space: nowrap; }
.pl-table td:first-of-type { color: var(--text-muted); }
.pl-table tbody th a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.pl-table small { display: block; color: var(--caption); font-size: var(--fs-xs); }
.pl-table tr:target > * { background: var(--gold-wash); }
.pl-table__tools { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }

/* cite this: a quiet box that opens in place */
.pl-cite { max-width: 680px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: var(--fs-sm); }
.pl-cite code { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink); white-space: normal; word-break: break-word; }

/* ---------- method and watch list ---------- */
.pl-method { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 40px; margin: 24px 0 0; padding: 0; list-style: none; }
.pl-method b { display: block; color: var(--ink); }
.pl-method span { display: block; margin-top: 4px; color: var(--text-muted); font-size: var(--fs-sm); }
@media (max-width: 860px) { .pl-method { grid-template-columns: minmax(0, 1fr); } }
.pl-watch { max-width: 780px; margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pl-watch li { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.pl-watch b { color: var(--ink); }
.pl-watch a { color: var(--text-muted); text-underline-offset: 3px; }
@media (max-width: 560px) { .pl-watch li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* "not legal advice": said once, plainly, near the top and again at the foot */
.pl-disclaimer { display: flex; gap: 10px; align-items: flex-start; max-width: 780px; margin-top: 22px; font-size: var(--fs-sm); color: var(--caption); }
.pl-disclaimer .bg-icon { flex: none; margin-top: 3px; }

/* ---------- a law's own page: timeline of what happens when ---------- */
.pl-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; max-width: 980px; margin: 26px 0 0; padding: 0; list-style: none; counter-reset: step; }
.pl-timeline li { position: relative; padding: 26px 18px 0 0; border-top: 2px solid var(--line); }
.pl-timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--gold); }
.pl-timeline li.is-due::before { background: var(--gold); }
.pl-timeline li.is-late { border-top-color: var(--overdue-bg); }
.pl-timeline li.is-late::before { box-shadow: inset 0 0 0 2px var(--overdue-fg); }
.pl-timeline b { display: block; font-size: var(--fs-xs); font-family: var(--font-mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }
.pl-timeline li.is-late b { color: var(--overdue-fg); }
.pl-timeline strong { display: block; margin-top: 6px; color: var(--ink); }
.pl-timeline span { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 720px) {
  .pl-timeline { grid-template-columns: minmax(0, 1fr); }
  .pl-timeline li { padding: 0 0 22px 26px; border-top: 0; border-left: 2px solid var(--line); }
  .pl-timeline li::before { top: 0; left: -7px; }
  .pl-timeline li.is-late { border-left-color: var(--overdue-bg); }
}

/* ---------- the calculator ---------- */
.lf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .lf { grid-template-columns: minmax(0, 1fr); } }
.lf__inputs { display: grid; gap: 18px; }
.lf__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 480px) { .lf__row { grid-template-columns: minmax(0, 1fr); } }
.lf .field input[type="date"] { min-height: 48px; }
.lf__money { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 6px; }
.lf__money select { width: 100%; padding: 12px 10px; border: 1px solid var(--field-border); border-radius: 10px; background: #fff; font: inherit; font-size: var(--fs-body); color: var(--ink); }

/* term presets: one picks exactly one, like the app's seg-tabs */
.lf__presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.lf__presets legend { width: 100%; margin-bottom: 6px; padding: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.lf__preset { position: relative; }
.lf__preset input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lf__preset span { display: inline-block; padding: 8px 14px; border: 1px solid var(--field-border); border-radius: var(--r-pill); background: #fff; font-size: var(--fs-sm); color: var(--text); }
.lf__preset input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.lf__preset input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* "your own" terms read as a sentence with inline fields */
.lf__own { padding: 16px 18px; border: 1px dashed var(--field-border); border-radius: 12px; line-height: 2.6; color: var(--text); }
.lf__own input, .lf__own select { display: inline-block; width: auto; padding: 6px 8px; border: 1px solid var(--field-border); border-radius: 8px; background: #fff; font: inherit; font-size: var(--fs-body); color: var(--ink); line-height: 1.3; }
.lf__own input { width: 4.6em; text-align: right; font-variant-numeric: tabular-nums; }

.lf__result { position: sticky; top: 96px; }
.lf__total { font-size: var(--fs-sm); color: var(--text-muted); }
.lf__total b { display: block; margin-top: 4px; font-family: var(--font-serif); font-size: clamp(36px, 4vw, 52px); font-weight: 600; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.lf__yearly { margin-top: 6px; color: var(--text-muted); }
.lf__fees { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.lf__fees li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lf__fees li.is-later { color: var(--caption); }
.lf__fees li.is-later b { font-weight: 500; color: var(--caption); }
.lf__fees time { color: var(--text-muted); }
.lf__fees b { color: var(--ink); }
.lf__fees em { font-style: normal; color: var(--caption); }
.lf__more { padding: 8px 0 0; font-size: var(--fs-xs); color: var(--caption); }
.lf__warn { display: flex; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--overdue-bg); color: var(--overdue-fg); font-size: var(--fs-sm); }
.lf__warn .bg-icon { flex: none; margin-top: 3px; }
.lf__terms { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: var(--fs-sm); }
.lf__terms p { margin-top: 6px; font-family: var(--font-serif); font-size: var(--fs-body); color: var(--ink); }
.lf__terms .pl-link { margin-top: 8px; }
.lf__law { margin-top: 14px; font-size: var(--fs-sm); color: var(--text-muted); }

/* print the answer, not the site around it */
@media print {
  .site-header, .site-footer, .pl-offer, .pl-answer__tools, .pl-ask, .skip-link { display: none !important; }
  .panel { box-shadow: none; border: 0; padding: 0; }
}

/* "your own" terms show only while picked (no script needed) */
.lf:not(:has(input[name="terms"][value="own"]:checked)) .lf__own { display: none; }
