/* License intelligence uses the site's surfaces, typography and semantic tokens. */
.license-page { display: grid; gap: 20px; min-width: 0; }
.license-page .page-head { margin-bottom: 0; }
.license-page h1 { overflow-wrap: anywhere; }
.license-search { display: flex; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.license-search input { flex: 1; min-width: 0; }
.license-page input[type="search"], .license-page input[type="number"], .license-page select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--field-line, var(--line)); border-radius: 8px; background: var(--raised); color: var(--ink); font: inherit; }
.license-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.license-facets, .license-facets form, .license-results { display: grid; gap: 14px; min-width: 0; }
.license-facets .link-row { align-items: center; }
.license-facets fieldset { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.license-facets legend { max-width: 100%; padding: 0 4px; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 700; }
.license-facets label { display: flex; gap: 8px; align-items: center; min-height: 30px; color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; }
.license-facets input[type="radio"] { flex: none; margin: 0; accent-color: var(--accent); }
.license-facets select, .license-facets input[type="number"] { width: 100%; box-sizing: border-box; min-width: 0; font-size: var(--fs-sm); }
.license-facets .sub { margin: 0; font-size: var(--fs-xs); line-height: 1.5; }
.license-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--fs-sm); }
.license-toolbar .seg { margin: 0; }
.license-change-panel { min-width: 0; overflow: hidden; }
.license-table-wrap { max-width: 100%; overflow-x: auto; }
.license-table { width: 100%; min-width: 800px; border-collapse: collapse; text-align: left; font-size: var(--fs-sm); }
.license-table th, .license-table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.license-table thead th { padding-top: 10px; padding-bottom: 10px; background: var(--raised); color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.license-table tbody tr:last-child > * { border-bottom: 0; }
.license-table tbody tr:hover { background: var(--raised); }
.license-table td:first-child, .license-table th:first-child { padding-left: 16px; }
.license-table td:last-child, .license-table th:last-child { padding-right: 16px; }
.license-package { display: block; font-weight: 700; overflow-wrap: anywhere; }
.license-meta { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; overflow-wrap: anywhere; }
.license-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.license-transition { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; color: var(--muted); }
.license-group { --license-tone: var(--muted); display: inline-flex; align-items: center; min-height: 24px; box-sizing: border-box; padding: 2px 10px; border-radius: 14px; background: color-mix(in srgb, var(--license-tone) var(--soft), var(--surface)); color: var(--license-tone); font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.license-permissive { --license-tone: var(--ok); }
.license-weak { --license-tone: var(--kb); }
.license-copyleft { --license-tone: var(--rm); }
.license-conditional { --license-tone: var(--warn); }
.license-noncommercial { --license-tone: var(--crit); }
.license-unknown { --license-tone: var(--muted); }
.license-expression { display: block; margin-top: 6px; color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.license-warning { display: block; color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.license-explainer, .license-storage { min-width: 0; padding: 14px 16px; }
.license-page summary, .license-storage summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.license-explainer p, .license-storage p { margin: 12px 0 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.license-glossary { display: grid; gap: 10px; margin: 16px 0; }
.license-glossary > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.license-glossary dd { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.license-detail-head { display: grid; gap: 12px; min-width: 0; }
.license-detail-head h1 { max-width: 40ch; margin: 0; font-family: var(--display); font-size: var(--fs-4xl); line-height: 1.2; letter-spacing: -.01em; }
.license-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 20px; }
.license-detail-main, .license-detail-aside { display: grid; gap: 20px; min-width: 0; }
.license-section { display: grid; gap: 10px; min-width: 0; padding: 20px; overflow-wrap: anywhere; }
.license-section h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.license-section p { max-width: 75ch; margin: 0; line-height: 1.6; }
.license-section .btn { justify-self: start; }
.license-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.license-runs { margin: 0; padding: 0; list-style: none; }
.license-runs > li { display: grid; gap: 8px; min-width: 0; padding: 16px 20px; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent; }
.license-runs > li.is-selected { border-left-color: var(--accent); background: var(--raised); }
.license-run-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.license-runs p { margin: 0; overflow-wrap: anywhere; }
.license-versions { display: grid; gap: 10px; max-height: 360px; margin: 12px 0 0; padding: 4px 0; overflow: auto; list-style: none; }
.license-versions li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; color: var(--ink-2); font-size: var(--fs-xs); }
.license-versions [aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: underline; }
.license-evidence { min-width: 540px; table-layout: fixed; }
.license-evidence th, .license-evidence td { overflow-wrap: anywhere; }
.license-evidence p { margin: 6px 0 0; }
.license-evidence thead th:first-child { width: 22%; }
.license-evidence thead th:nth-child(2) { width: 24%; }
.license-footnote { margin: 0; padding: 12px 20px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.license-text { max-height: 500px; max-width: 100%; margin: 12px 0 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.license-options, .license-findings { display: grid; gap: 8px; margin: 0; padding-left: 18px; font-size: var(--fs-sm); line-height: 1.6; }
.license-storage-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; margin: 16px 0; }
.license-storage-facts dt { color: var(--muted); font-size: var(--fs-xs); }
.license-storage-facts dd { margin: 3px 0 0; color: var(--ink); font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.license-page :is(a, button, input, select, summary):focus-visible, .license-storage summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 1100px) {
  .license-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
  .license-detail-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }
}
@media (max-width: 800px) {
  .license-desktop-filters { display: none; }
  .license-mobile-filters { display: block; }
  .license-layout, .license-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .license-facets form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .license-facets form > .link-row { grid-column: 1 / -1; }
  .license-facets .pref-fine { margin: 0; }
  .license-detail-head h1 { font-size: var(--fs-3xl); }
  .license-detail-aside { gap: 14px; }
}
@media (max-width: 480px) {
  .license-facets form { grid-template-columns: minmax(0, 1fr); }
  .license-glossary > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .license-section { padding: 16px; }
  .license-search { flex-wrap: wrap; }
  .license-search input { flex-basis: 100%; }
  .license-search button { width: 100%; }
  .license-detail-head h1 { font-size: var(--fs-3xl); }
}

/* Keep package identities readable when the app rail reduces the available table width. */
.license-table td:first-child { min-width: 150px; }
.license-table .license-package { overflow-wrap: break-word; }
.license-change-panel .license-table td:nth-child(3) { min-width: 280px; }
.license-change-panel .license-transition { flex-wrap: nowrap; width: max-content; }
.license-change-panel .license-table td:last-child { min-width: 150px; }
.dependency-form .license-table { min-width: 1080px; }
.dependency-form .license-table td:nth-child(2), .dependency-form .license-table td:nth-child(3), .dependency-form .license-table td:nth-child(4) { min-width: 110px; }
.dependency-form .license-table td:nth-child(5) { min-width: 240px; }
.dependency-form .license-table td:last-child { min-width: 210px; }
.dependency-form .license-table details { margin-top: 8px; }
.dependency-form .license-table p { margin: 6px 0 0; }
.dependency-clean { width: 100%; margin: 14px 0; }

.dependency-input > summary { padding: 14px 18px; font-weight: 600; cursor: pointer; }
.dependency-input > summary .sub { font-weight: 400; }
.dependency-input .check { min-width: 0; white-space: normal; align-items: flex-start; line-height: 1.5; }
.dependency-input .check input { flex: 0 0 auto; margin-top: 2px; }

.license-change-panel .license-table td:nth-child(2) .license-meta { white-space: nowrap; }

/* One set of result rows becomes cards when table columns no longer fit. */
.license-mobile-only, .license-card-label { display: none; }
@media (min-width: 801px) { .license-mobile-filters { display: none; } }
.license-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.license-active-filters .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.license-mobile-filters > summary { width: fit-content; list-style: none; }
.license-mobile-filters > summary::after { content: " ▾"; }
.license-mobile-filters[open] > summary::after { content: " ▴"; }
.license-mobile-filters > .license-facets { margin-top: 14px; }
@media (max-width: 720px) {
  .license-layout { display: block; }
  .license-desktop-filters { display: none; }
  .license-mobile-filters { display: block; }
  .license-mobile-only { display: inline; }
  .license-results { gap: 12px; }
  .license-toolbar { gap: 10px 12px; }
  .license-toolbar .seg { margin-left: auto; }
  .license-toolbar > a { font-size: var(--fs-xs); }
  .license-mobile-filters .license-facets form { grid-template-columns: minmax(0, 1fr); }
  .license-table-wrap:has(.license-change-table, .dependency-package-table, .license-evidence) { overflow: visible; }
  .license-change-table, .dependency-form .dependency-package-table, .license-evidence { display: block; width: 100%; min-width: 0; }
  :is(.license-change-table, .dependency-package-table, .license-evidence) thead { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; }
  :is(.license-change-table, .dependency-package-table, .license-evidence) tbody { display: block; }
  :is(.license-change-table, .dependency-package-table, .license-evidence) tbody tr { display: grid; gap: 10px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
  :is(.license-change-table, .dependency-package-table, .license-evidence) tbody tr:last-child { border-bottom: 0; }
  .license-change-panel .license-change-table td:nth-child(n),
  .dependency-form .dependency-package-table td:nth-child(n),
  .license-evidence :is(td, th):nth-child(n) { display: block; min-width: 0; width: auto; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .license-card-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
  .license-card-package { order: 0; position: relative; }
  .license-card-package > .license-package, .license-card-package > .license-meta { padding-right: 62px; }
  .license-card-package > .watch { position: absolute; top: 0; right: 0; margin: 0; }
  .license-card-transition { order: 1; }
  .license-change-panel .license-transition { width: auto; flex-wrap: wrap; gap: 6px; }
  .license-change-panel .license-group { padding-inline: 8px; font-size: var(--fs-2xs); }
  .license-card-version { order: 2; color: var(--ink-2); font-size: var(--fs-xs); }
  .license-change-panel .license-card-version .license-meta { display: inline; margin: 0; white-space: normal; }
  .license-card-downloads { order: 3; color: var(--ink-2); font-size: var(--fs-xs); }
  .license-card-downloads > .license-card-label { display: inline; margin-right: 8px; text-transform: none; letter-spacing: 0; font-size: var(--fs-xs); }
  .license-card-notes { order: 4; }
  .license-card-notes:empty, .license-change-panel .license-change-table td.license-card-downloads:empty { display: none; }
  .license-card-notes .license-meta:first-child { margin-top: 0; }
  .dependency-package-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .dependency-package-card > :is(.dependency-card-package, .dependency-card-license, .dependency-card-advisories, .dependency-card-upgrade) { grid-column: 1 / -1; }
  .dependency-card-license > .pill { margin-right: 6px; }
  .dependency-form .dependency-package-table p { margin-top: 4px; }
  .dependency-form .chips { flex-wrap: wrap; overflow: visible; white-space: normal; }
  .dependency-form .list-tools { flex-wrap: wrap; }
  .dependency-form .list-tools input { flex-basis: 100%; min-width: 0; }
  .dependency-form .link-row { flex-wrap: wrap; }
  .license-evidence tbody tr { gap: 6px; }
  .license-evidence td:nth-child(2) { color: var(--muted); font-size: var(--fs-xs); }
  .license-evidence .license-expression { margin-top: 0; font-family: inherit; font-size: var(--fs-sm); }
}
