/**
 * Broken Link Checker styling.
 *
 * Scoped under .usw-lc, with every colour in one custom-property block, so it
 * cannot leak into a host theme and re-skinning means overriding that block.
 * Defaults are the Unique Smartweb palette: amber #fcaf3b (a fill colour only,
 * ~1.8:1 on white, so it always carries dark text), dark #14171c, green
 * #77b978, coral #f37262, square corners.
 */

.usw-lc {
  --lc-text: #2b2b2b;
  --lc-muted: #6b6b6b;
  --lc-border: #e2e2e2;
  --lc-bg: #ffffff;
  --lc-bg-alt: #f5f5f5;
  --lc-dark: #14171c;
  --lc-accent: #fcaf3b;
  --lc-accent-text: #010101;
  --lc-accent-link: #ab641d;
  --lc-good: #77b978;
  --lc-good-text: #2f6b30;
  --lc-bad: #f37262;
  --lc-bad-text: #a3271b;
  --lc-bad-bg: #fdeceb;
  --lc-warn-bg: #fff3dc;
  --lc-warn-text: #7a4b00;
  --lc-redirect-bg: #eeeeee;
  --lc-radius: 0;

  color: var(--lc-text);
  font-size: 1rem;
  line-height: 1.6;
}

.usw-lc *,
.usw-lc *::before,
.usw-lc *::after {
  box-sizing: border-box;
}

/* Visibility is toggled with the hidden attribute; no display rule may win. */
.usw-lc [hidden] {
  display: none !important;
}

/* ---------- Form ---------- */

.usw-lc-form {
  border: 1px solid var(--lc-border);
  background: var(--lc-bg);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.usw-lc-label,
.usw-lc-eyebrow {
  display: block;
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.usw-lc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.usw-lc-input,
.usw-lc-search,
.usw-lc-select {
  min-width: 0;
  font: inherit;
  color: var(--lc-text);
  background: var(--lc-bg);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
}

.usw-lc-input {
  flex: 1 1 18rem;
  padding: 0.85rem 1rem;
}

.usw-lc-input:focus,
.usw-lc-search:focus,
.usw-lc-select:focus {
  outline: 2px solid var(--lc-dark);
  outline-offset: 1px;
  border-color: var(--lc-dark);
}

.usw-lc-submit,
.usw-lc-btn,
.usw-lc-cta-button {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  color: var(--lc-accent-text);
  background: var(--lc-accent);
  border: 1px solid var(--lc-accent);
  border-radius: var(--lc-radius);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.usw-lc-submit:hover:not([disabled]),
.usw-lc-submit:focus-visible:not([disabled]),
.usw-lc-btn:hover:not([disabled]),
.usw-lc-btn:focus-visible:not([disabled]) {
  background: var(--lc-dark);
  border-color: var(--lc-dark);
  color: #ffffff;
}

.usw-lc-submit[disabled],
.usw-lc-btn[disabled] {
  opacity: .55;
  cursor: default;
}

.usw-lc-btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}

.usw-lc-btn.is-stop {
  background: var(--lc-bg);
  border-color: var(--lc-dark);
  color: var(--lc-dark);
}

.usw-lc-btn.is-small {
  padding: 0.4rem 0.9rem;
}

.usw-lc-note,
.usw-lc-status {
  margin: 0.9rem 0 0;
  font-size: 0.875rem;
  color: var(--lc-muted);
}

.usw-lc-status:empty {
  display: none;
}

/* ---------- Live progress ---------- */

.usw-lc-app {
  margin-top: 2rem;
}

.usw-lc-progress {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--lc-dark);
  color: #e8e8e8;
}

.usw-lc-progress .usw-lc-eyebrow {
  color: var(--lc-accent);
  margin-bottom: 0.25rem;
}

.usw-lc-site {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.usw-lc-track {
  height: 8px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}

.usw-lc-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--lc-accent);
  transition: width .6s ease;
}

.usw-lc-progress.is-running .usw-lc-bar {
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .45) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: usw-lc-sheen 1.6s linear infinite;
}

.usw-lc-progress.is-done .usw-lc-bar {
  background: var(--lc-good);
}

@keyframes usw-lc-sheen {
  from { background-position: -200px 0; }
  to { background-position: calc(100% + 200px) 0; }
}

.usw-lc-headline {
  margin: 1rem 0 0.15rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
}

.usw-lc-detail {
  margin: 0;
  min-height: 1.5em;
  font-size: 0.875rem;
  color: #b4b4b4;
  overflow-wrap: anywhere;
}

.usw-lc-progress.is-failed .usw-lc-headline {
  color: var(--lc-bad);
}

.usw-lc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.usw-lc-progress .usw-lc-btn.is-stop {
  background: transparent;
  border-color: #6b6b6b;
  color: #ffffff;
}

.usw-lc-lost {
  font-size: 0.875rem;
  color: var(--lc-accent);
}

/* ---------- Summary cards ---------- */

.usw-lc-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1px;
  background: var(--lc-border);
  border: 1px solid var(--lc-border);
}

.usw-lc-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
  margin: 0;
  font: inherit;
  text-align: left;
  color: var(--lc-text);
  background: var(--lc-bg);
  border: 0;
  border-radius: 0;
}

button.usw-lc-card {
  cursor: pointer;
}

button.usw-lc-card:hover,
button.usw-lc-card:focus-visible {
  background: var(--lc-bg-alt);
}

/* The theme draws a 2px outline on every focused element, so a card or tab kept
   a black box after a mouse click and looked stuck "selected". Keyboard focus
   still gets a visible ring, drawn inside the card so the grid does not jump. */
.usw-lc button:focus:not(:focus-visible),
.usw-lc select:focus:not(:focus-visible) {
  outline: none;
}

.usw-lc button.usw-lc-card:focus-visible,
.usw-lc .usw-lc-tab:focus-visible {
  outline: 2px solid var(--lc-dark);
  outline-offset: -2px;
}

.usw-lc-card-num {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.usw-lc-card-label {
  font-size: 0.8125rem;
  color: var(--lc-muted);
}

.usw-lc-card.is-broken {
  box-shadow: inset 0 3px 0 var(--lc-bad);
}

.usw-lc-cards.has-broken .usw-lc-card.is-broken .usw-lc-card-num {
  color: var(--lc-bad-text);
}

.usw-lc-cards.is-final:not(.has-broken) .usw-lc-card.is-broken {
  box-shadow: inset 0 3px 0 var(--lc-good);
}

.usw-lc-cards.is-final:not(.has-broken) .usw-lc-card.is-broken .usw-lc-card-num {
  color: var(--lc-good-text);
}

.usw-lc-card.is-redirects {
  box-shadow: inset 0 3px 0 #9a9a9a;
}

.usw-lc-card.is-warns {
  box-shadow: inset 0 3px 0 var(--lc-accent);
}

/* ---------- Notices ---------- */

.usw-lc-notice,
.usw-lc-intro {
  margin: 1rem 0 0;
  padding: 0.9rem 1.1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--lc-border);
  border-left: 3px solid var(--lc-accent);
  background: var(--lc-bg);
}

.usw-lc-notice a {
  color: var(--lc-accent-link);
}

/* ---------- Toolbar ---------- */

.usw-lc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 2rem;
  border-bottom: 1px solid var(--lc-border);
}

.usw-lc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.usw-lc-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  margin: 0 0 -1px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--lc-muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  cursor: pointer;
}

.usw-lc-tab:hover,
.usw-lc-tab:focus-visible {
  color: var(--lc-dark);
}

.usw-lc-tab.is-active {
  color: var(--lc-dark);
  border-bottom-color: var(--lc-accent);
}

.usw-lc-tab-count {
  min-width: 1.6rem;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5rem;
  text-align: center;
  color: var(--lc-text);
  background: var(--lc-bg-alt);
}

.usw-lc-tab.is-active .usw-lc-tab-count {
  background: var(--lc-accent);
  color: var(--lc-accent-text);
}

.usw-lc-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
}

.usw-lc-search {
  width: 15rem;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.usw-lc-select {
  padding: 0.5rem 0.6rem;
  font-size: 0.875rem;
}

.usw-lc-export {
  position: relative;
}

.usw-lc-btn.is-export {
  background: var(--lc-dark);
  border-color: var(--lc-dark);
  color: #ffffff;
}

.usw-lc-btn.is-export:hover,
.usw-lc-btn.is-export:focus-visible {
  background: var(--lc-accent);
  border-color: var(--lc-accent);
  color: var(--lc-accent-text);
}

.usw-lc-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 13rem;
  padding: 0.35rem 0;
  background: var(--lc-bg);
  border: 1px solid var(--lc-border);
  box-shadow: 0 10px 30px rgba(20, 23, 28, .14);
}

.usw-lc-export-item {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  color: var(--lc-text);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.usw-lc-export-item:hover,
.usw-lc-export-item:focus-visible {
  background: var(--lc-bg-alt);
}

/* ---------- Table ---------- */

.usw-lc-tablewrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--lc-border);
  background: var(--lc-bg);
}

.usw-lc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.usw-lc-table thead th {
  padding: 0;
  text-align: left;
  background: var(--lc-dark);
  white-space: nowrap;
}

.usw-lc-sort {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.usw-lc-sort::after {
  content: "\2195";
  margin-left: 0.35rem;
  opacity: .35;
}

.usw-lc-sort.is-asc::after {
  content: "\2191";
  opacity: 1;
  color: var(--lc-accent);
}

.usw-lc-sort.is-desc::after {
  content: "\2193";
  opacity: 1;
  color: var(--lc-accent);
}

.usw-lc-sort:hover,
.usw-lc-sort:focus-visible {
  color: var(--lc-accent);
}

.usw-lc-item td {
  padding: 0.75rem 0.9rem;
  vertical-align: top;
  border-top: 1px solid var(--lc-border);
}

.usw-lc-item:hover td {
  background: #fafafa;
}

.usw-lc-num {
  width: 3rem;
  color: var(--lc-muted);
  font-variant-numeric: tabular-nums;
}

.usw-lc-url {
  min-width: 16rem;
  max-width: 28rem;
  overflow-wrap: anywhere;
}

.usw-lc-out,
.usw-lc-plain {
  color: var(--lc-dark);
  text-decoration: underline;
  text-decoration-color: var(--lc-border);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.usw-lc-plain {
  text-decoration: none;
}

.usw-lc-out:hover,
.usw-lc-out:focus-visible {
  color: var(--lc-accent-link);
  text-decoration-color: currentColor;
}

.usw-lc-item.is-broken .usw-lc-url .usw-lc-out {
  font-weight: 600;
}

.usw-lc-final,
.usw-lc-region {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  color: var(--lc-muted);
}

.usw-lc-text {
  min-width: 9rem;
  max-width: 14rem;
  overflow-wrap: anywhere;
}

.usw-lc-text.is-empty {
  color: var(--lc-muted);
  font-style: italic;
}

.usw-lc-found {
  min-width: 13rem;
  max-width: 22rem;
  overflow-wrap: anywhere;
}

.usw-lc-more,
.usw-lc-details-btn {
  margin-top: 0.25rem;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--lc-accent-link);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.usw-lc-details-btn {
  margin: 0;
  white-space: nowrap;
}

.usw-lc-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  border-left: 3px solid transparent;
}

.usw-lc-badge.is-broken {
  color: var(--lc-bad-text);
  background: var(--lc-bad-bg);
  border-left-color: var(--lc-bad);
}

.usw-lc-badge.is-warn {
  color: var(--lc-warn-text);
  background: var(--lc-warn-bg);
  border-left-color: var(--lc-accent);
}

.usw-lc-badge.is-redirect {
  color: #3d3d3d;
  background: var(--lc-redirect-bg);
  border-left-color: #9a9a9a;
}

.usw-lc-badge.is-ok {
  color: var(--lc-good-text);
  background: #eef6ee;
  border-left-color: var(--lc-good);
}

.usw-lc-type {
  white-space: nowrap;
  color: var(--lc-muted);
}

.usw-lc-details td {
  padding: 0.9rem 1.1rem 1.2rem 3.9rem;
  background: var(--lc-bg-alt);
  border-top: 1px dashed var(--lc-border);
}

.usw-lc-meaning {
  margin: 0 0 0.75rem;
}

.usw-lc-subhead {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lc-muted);
}

.usw-lc-chain,
.usw-lc-refs {
  margin: 0;
  padding-left: 1.2rem;
}

.usw-lc-chain li,
.usw-lc-refs li {
  margin: 0 0 0.45rem;
  overflow-wrap: anywhere;
}

.usw-lc-hop-code {
  display: inline-block;
  min-width: 2.6rem;
  margin-right: 0.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.usw-lc-snippet {
  display: block;
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--lc-bg);
  border: 1px solid var(--lc-border);
}

.usw-lc-loading,
.usw-lc-empty {
  margin: 0;
  color: var(--lc-muted);
}

.usw-lc-empty {
  padding: 2rem 1.25rem;
  text-align: center;
}

.usw-lc-empty.is-good {
  color: var(--lc-good-text);
  font-weight: 600;
}

.usw-lc-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.usw-lc-pager:empty {
  display: none;
}

.usw-lc-pager-text,
.usw-lc-share {
  font-size: 0.875rem;
  color: var(--lc-muted);
}

.usw-lc-share {
  margin: 1rem 0 0;
}

/* ---------- Call to action ---------- */

.usw-lc-cta {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--lc-dark);
  color: #e8e8e8;
  text-align: center;
}

.usw-lc-cta-heading {
  margin: 0 0 0.6rem;
  font-size: 1.375rem;
  font-weight: 600;
  color: #ffffff;
}

.usw-lc-cta-body {
  margin: 0 0 1.4rem;
  color: #b4b4b4;
}

.usw-lc-cta-button:hover,
.usw-lc-cta-button:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--lc-dark);
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  .usw-lc-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .usw-lc-toolbar {
    align-items: stretch;
  }

  .usw-lc-filters {
    width: 100%;
  }

  .usw-lc-search {
    flex: 1 1 12rem;
    width: auto;
  }
}

/* Each result becomes a card: label on the left of every value. */
@media (max-width: 720px) {
  .usw-lc-submit {
    width: 100%;
  }

  .usw-lc-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .usw-lc-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .usw-lc-tab {
    flex: 0 0 auto;
    padding: 0.6rem 0.75rem;
  }

  .usw-lc-select,
  .usw-lc-export {
    flex: 1 1 45%;
  }

  .usw-lc-btn.is-export {
    width: 100%;
  }

  .usw-lc-tablewrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .usw-lc-table,
  .usw-lc-table tbody,
  .usw-lc-table tr,
  .usw-lc-table td {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .usw-lc-table thead {
    display: none;
  }

  .usw-lc-item {
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--lc-bg);
    border: 1px solid var(--lc-border);
  }

  .usw-lc-item.is-broken {
    border-left: 3px solid var(--lc-bad);
  }

  .usw-lc-item.is-warn {
    border-left: 3px solid var(--lc-accent);
  }

  .usw-lc-item td {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.3rem 0;
    border: 0;
  }

  .usw-lc-item td::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lc-muted);
    padding-top: 0.15rem;
  }

  .usw-lc-item td.usw-lc-num {
    display: none;
  }

  .usw-lc-item td.usw-lc-toggle::before {
    content: "";
  }

  .usw-lc-item:hover td {
    background: transparent;
  }

  .usw-lc-details {
    border: 1px solid var(--lc-border);
    border-top: 0;
  }

  .usw-lc-details td {
    padding: 0.75rem 0.9rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .usw-lc-bar,
  .usw-lc-submit,
  .usw-lc-btn {
    transition: none;
  }

  .usw-lc-progress.is-running .usw-lc-bar {
    animation: none;
    background-image: none;
  }
}

/* A menu or footer link found on many pages: one entry, one fix. */
.usw-lc-sitewide {
  display: block;
  font-weight: 600;
}
