/* Internal Link Analyzer — tool-specific styles (loaded on this tool only). */
.la { position: relative; }
.la [hidden] { display: none !important; }
.la-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--ti-border);
}
.la-privacy { margin: 0; color: var(--ti-muted-color); font-weight: var(--ti-fw-semi); }
.la-privacy::before { content: "\1F512\00A0"; }
.la-panel { padding: 20px; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-lg); background: var(--ti-white); }
.la-panel .ti-app-panel__title { margin-bottom: 14px; }

/* ---------- Input ---------- */
.la-modes { flex-wrap: wrap; margin-bottom: 18px; }
.la-inrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 16px; }
.la-site { flex: 1 1 420px; }
.la-max { flex: 0 1 220px; }
.la-checks { margin: 4px 0 12px; padding: 0; border: 0; }
.la-checks legend { margin-bottom: 8px; padding: 0; }
.la-checks .ti-check { display: flex; margin-bottom: 6px; }
.la-adv { margin: 0 0 4px; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-md); background: var(--ti-bg); }
.la-adv > summary { padding: 10px 14px; font-weight: var(--ti-fw-semi); cursor: pointer; border-radius: var(--ti-radius-md); }
.la-adv > summary:focus-visible { outline: none; box-shadow: var(--ti-focus); }
.la-adv__body { padding: 4px 14px 2px; }
.la-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px; text-align: center;
  border: 2px dashed var(--ti-border-strong); border-radius: var(--ti-radius-lg); background: var(--ti-bg); transition: border-color 0.15s ease, background 0.15s ease;
}
.la-drop.is-over { border-color: var(--ti-primary); background: var(--ti-primary-tint); }
.la-drop__title { margin: 0; font-size: 18px; font-weight: var(--ti-fw-bold); }
.la-drop__text { max-width: 620px; margin: 0 0 8px; color: var(--ti-muted-color); }
.la-file-btn { position: relative; cursor: pointer; }
.la-file-btn:focus-within { box-shadow: var(--ti-focus); }
.la-go-row { margin-top: 16px; }
.la-go { min-width: 220px; }
.la-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; }
.la-progress__bar { flex: 1 1 100%; height: 8px; border-radius: 4px; background: #E2E8F0; overflow: hidden; }
.la-progress__bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--ti-primary); transition: width 0.2s ease; }
.la-progress__text { flex: 1 1 auto; margin: 0; color: var(--ti-muted-color); font-variant-numeric: tabular-nums; }
#la-status:not(:empty) { margin-top: 14px; }

/* ---------- Results ---------- */
.la-results { margin-top: 24px; }
.la-results:focus { outline: none; }
.la-results__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 14px; }
.la-results__title { margin: 0; font-size: 24px; }
.la-results__meta { margin: 0; color: var(--ti-muted-color); overflow-wrap: anywhere; }
.la-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.la-kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: 100%; padding: 12px 14px;
  border: 1px solid var(--ti-border); border-radius: var(--ti-radius-md); background: var(--ti-white);
  font-family: var(--ti-font); font-size: 16px; color: var(--ti-text-color); text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
button.la-kpi:hover { border-color: var(--ti-primary); }
.la-kpi:focus-visible { outline: none; box-shadow: var(--ti-focus); }
.la-kpi--static { background: var(--ti-bg); cursor: default; }
.la-kpi__n { font-size: 26px; font-weight: var(--ti-fw-bold); line-height: 1.2; font-variant-numeric: tabular-nums; }
.la-kpi__l { color: var(--ti-muted-color); font-weight: var(--ti-fw-semi); }
.la-kpi--good .la-kpi__n { color: #166534; }
.la-kpi--warning .la-kpi__n { color: #92400E; }
.la-kpi--error .la-kpi__n { color: #B91C1C; }
.la-kpi--zero .la-kpi__n { color: var(--ti-muted-color); }
.la-tabs { flex-wrap: wrap; margin-bottom: 14px; }
.la-tab-n { color: var(--ti-muted-color); font-weight: var(--ti-fw-regular); }
.la-tab-n:empty { display: none; }
.la-view { padding: 18px; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-lg); background: var(--ti-white); }
.la-intro { margin: 0 0 14px; color: var(--ti-muted-color); }
.la-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 14px; margin-bottom: 4px; }
.la-filters .ti-field { flex: 1 1 220px; }
.la-filters .ti-field:first-child { flex: 2 1 300px; }
.la-shown { margin: 0 0 10px; color: var(--ti-muted-color); }
.la-shown:empty { display: none; }
.la-empty { margin: 0; padding: 16px; border: 1px dashed var(--ti-border-strong); border-radius: var(--ti-radius-md); color: var(--ti-muted-color); }
.la-muted { color: var(--ti-muted-color); font-weight: var(--ti-fw-regular); }
.la-sub { display: block; margin-top: 2px; color: var(--ti-muted-color); overflow-wrap: break-word; }
.la-block { display: block; }
.la-h3 { margin: 0 0 8px; font-size: 20px; }

/* Depth chart */
.la-depth:not(:empty) { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--ti-border); }
.la-bars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.la-bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 120px; align-items: center; gap: 12px; }
.la-bar__l { font-weight: var(--ti-fw-semi); }
.la-bar__t { height: 18px; border-radius: 0 4px 4px 0; background: #F1F5F9; overflow: hidden; }
.la-bar__t span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: #2563EB; }
.la-bar--warn .la-bar__t span { background: #D97706; }
.la-bar__n { font-variant-numeric: tabular-nums; }

/* Tables */
.la-table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-md); }
.la-table-wrap:empty { border: 0; }
.la-table-wrap:focus-visible { outline: none; box-shadow: var(--ti-focus); }
.la-table { width: 100%; border-collapse: collapse; }
.la-table th, .la-table td { padding: 10px 12px; border-bottom: 1px solid var(--ti-border); text-align: left; vertical-align: top; }
.la-table thead th { background: var(--ti-bg); font-weight: var(--ti-fw-semi); }
.la-table tbody th { font-weight: normal; min-width: 220px; }
.la-table tbody tr:last-child > th, .la-table tbody tr:last-child > td { border-bottom: 0; }
.la-table .la-num { text-align: right; font-variant-numeric: tabular-nums; }
.la-url { overflow-wrap: break-word; }
.la-row.is-open > th, .la-row.is-open > td { border-bottom-color: transparent; background: var(--ti-bg); }
.la-exp {
  display: flex; align-items: flex-start; gap: 8px; width: 100%; padding: 0; border: 0; background: none;
  font-family: var(--ti-font); font-size: 16px; font-weight: var(--ti-fw-semi); color: var(--ti-text-color); text-align: left; cursor: pointer;
}
.la-exp::before {
  content: ""; flex-shrink: 0; width: 8px; height: 8px; margin: 7px 2px 0 0;
  border-right: 2px solid var(--ti-primary); border-bottom: 2px solid var(--ti-primary); transform: rotate(-45deg); transition: transform 0.15s ease;
}
.la-exp[aria-expanded="true"]::before { transform: rotate(45deg); margin-top: 5px; }
.la-exp:hover .la-url { color: var(--ti-primary); text-decoration: underline; text-underline-offset: 3px; }
.la-exp:focus-visible { outline: none; box-shadow: var(--ti-focus); border-radius: 4px; }
.la-exp + .la-sub { padding-left: 18px; }
.la-detrow > td { background: var(--ti-bg); }
.la-table--plain { background: var(--ti-white); }
.la-scroll { max-height: 420px; overflow: auto; }

/* Badges */
.la-code { display: inline-flex; align-items: center; min-width: 44px; justify-content: center; padding: 1px 8px; border-radius: 6px; font-weight: var(--ti-fw-bold); font-variant-numeric: tabular-nums; line-height: 1.5; white-space: nowrap; }
.la-code--2 { background: #DCFCE7; color: #14532D; }
.la-code--3 { background: #DBEAFE; color: #1E3A8A; }
.la-code--4 { background: #FEE2E2; color: #7F1D1D; }
.la-code--5 { background: #FFEDD5; color: #7C2D12; }
.la-code--x { background: #E2E8F0; color: #1E293B; }
.la-pill { display: inline-flex; padding: 1px 8px; border-radius: 999px; background: #E2E8F0; color: #1E293B; font-weight: var(--ti-fw-semi); white-space: nowrap; }
.la-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.la-tag {
  display: inline-flex; padding: 1px 10px; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--ti-font); font-size: 16px; font-weight: var(--ti-fw-semi); line-height: 1.5; text-align: left; cursor: pointer;
}
.la-tag--static { cursor: default; }
.la-tag--error { background: #FEE2E2; color: #7F1D1D; }
.la-tag--warning { background: #FEF3C7; color: #78350F; }
.la-tag--notice { background: #E0E7FF; color: #312E81; }
button.la-tag:hover { border-color: currentColor; }
.la-tag:focus-visible { outline: none; box-shadow: var(--ti-focus); }
.la-score { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.la-score__n { min-width: 28px; font-weight: var(--ti-fw-bold); font-variant-numeric: tabular-nums; text-align: right; }
.la-score__bar { flex: 1 1 auto; height: 8px; border-radius: 4px; background: #E2E8F0; overflow: hidden; }
.la-score__bar span { display: block; height: 100%; border-radius: 4px; background: #2563EB; }

/* Page detail */
.la-pd { display: grid; gap: 6px; }
.la-pd .la-h3 { margin-top: 10px; font-size: 18px; }
.la-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 18px; margin: 0 0 4px; }
.la-facts dt { color: var(--ti-muted-color); font-weight: var(--ti-fw-semi); }
.la-facts dd { margin: 0; overflow-wrap: anywhere; }
.la-opplist, .la-outlist { display: grid; gap: 8px; margin: 0; padding: 0 0 0 20px; }
.la-outlist { list-style: none; padding-left: 0; }
.la-outlist .la-code { margin-right: 4px; }
.la-snip { color: var(--ti-text-color); overflow-wrap: break-word; }
.la-snip mark { padding: 0 2px; border-radius: 3px; background: #FEF08A; color: #1E293B; font-weight: var(--ti-fw-semi); }

#la-opps tbody td:nth-child(2) { min-width: 210px; }
#la-opps .ti-btn { white-space: nowrap; }

/* Pager */
.la-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.la-pager:empty { display: none; }
.la-pager__pos { color: var(--ti-muted-color); font-variant-numeric: tabular-nums; }

/* Issues */
.la-split { display: grid; grid-template-columns: minmax(260px, 0.9fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.la-types { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.la-types:empty { display: none; }
.la-type {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--ti-border); border-radius: var(--ti-radius-md); background: var(--ti-white);
  font-family: var(--ti-font); font-size: 16px; color: var(--ti-text-color); text-align: left; cursor: pointer;
}
.la-type:hover { border-color: var(--ti-primary); }
.la-type:focus-visible { outline: none; box-shadow: var(--ti-focus); }
.la-type[aria-pressed="true"] { border-color: var(--ti-primary); background: var(--ti-primary-tint); box-shadow: inset 0 0 0 1px var(--ti-primary); }
.la-type__t { font-weight: var(--ti-fw-semi); }
.la-type__n { font-weight: var(--ti-fw-bold); font-variant-numeric: tabular-nums; }
.la-sev { display: inline-flex; padding: 0 8px; border-radius: 10px; font-weight: var(--ti-fw-semi); line-height: 1.5; white-space: nowrap; }
.la-sev--error { background: #FEE2E2; color: #7F1D1D; }
.la-sev--warning { background: #FEF3C7; color: #78350F; }
.la-sev--notice { background: #E0E7FF; color: #312E81; }
.la-detail { min-width: 0; }
.la-why { margin: 0 0 8px; color: var(--ti-muted-color); }
.la-how { margin: 0 0 8px; }
.la-src { margin: 0 0 12px; color: var(--ti-muted-color); }
.la-src a { color: var(--ti-primary); }
.la-table-wrap--issues { max-height: 620px; overflow: auto; }
.la-detail__actions { margin-top: 12px; }

/* Export */
.la-export { margin-top: 18px; padding: 18px; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-lg); background: var(--ti-bg); }
.la-export__title { margin: 0 0 12px; font-size: 18px; }

@media (max-width: 900px) {
  .la-split { grid-template-columns: minmax(0, 1fr); }
  .la-table-wrap { overflow: visible; border: 0; }
  .la-table-wrap--issues { max-height: none; }
  .la-table:not(.la-table--plain), .la-table:not(.la-table--plain) > tbody, .la-table:not(.la-table--plain) > tbody > tr { display: block; }
  .la-table:not(.la-table--plain) > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .la-table:not(.la-table--plain) > tbody > tr { margin-bottom: 12px; border: 1px solid var(--ti-border); border-radius: var(--ti-radius-md); }
  .la-table tr.la-row.is-open { margin-bottom: 0; border-bottom: 0; border-radius: var(--ti-radius-md) var(--ti-radius-md) 0 0; }
  .la-table tr.la-detrow { border-top: 0; border-radius: 0 0 var(--ti-radius-md) var(--ti-radius-md); }
  .la-table:not(.la-table--plain) > tbody > tr > th, .la-table:not(.la-table--plain) > tbody > tr > td { display: block; text-align: left; }
  .la-table:not(.la-table--plain) > tbody > tr > th { min-width: 0; }
  .la-table:not(.la-table--plain) > tbody > tr > td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--ti-muted-color); font-weight: var(--ti-fw-semi); }
  .la-table .la-detrow > td::before { content: none !important; }
  .la-table:not(.la-table--plain) > tbody > tr > :last-child { border-bottom: 0; }
  .la-table tr.la-row { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .la-table tr.la-row > * { grid-column: 1 / -1; }
  .la-table tr.la-row > td:nth-child(3), .la-table tr.la-row > td:nth-child(4), .la-table tr.la-row > td:nth-child(5), .la-table tr.la-row > td:nth-child(6) { grid-column: auto; }
  .la-table tr.la-row > td:nth-child(4), .la-table tr.la-row > td:nth-child(6) { border-left: 1px solid var(--ti-border); }
  .la-table--plain tbody th { min-width: 160px; }
  .la-scroll { overflow: auto; border: 1px solid var(--ti-border); }
  #la-opps tbody td:nth-child(2) { min-width: 0; }
}
@media (max-width: 760px) {
  .la-panel, .la-view, .la-export { padding: 16px; }
  .la-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .la-kpi__n { font-size: 24px; }
  .la-go, .la-export .ti-actions .ti-btn { width: 100%; }
  .la-max { flex: 1 1 100%; }
  .la-filters .ti-field { flex: 1 1 140px; }
  .la-filters .ti-field:first-child { flex: 1 1 100%; }
  .la-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .la-bar__t { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .la-progress__bar span, .la-exp::before, .la-kpi, .la-drop { transition: none; }
}
