.tools-live-v0 {
  --tools-header-bottom: 69px;
  --live-navy: #0f367a;
  --live-blue: #044bc7;
  --live-orange: #c8161d;
  --live-ink: #10264a;
  --live-muted: #637188;
  --live-line: #d4dce7;
  --live-soft: #f2f3f5;
  padding: 28px 0 92px;
  background: #f0f1f3;
}

.live-tools-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 28px;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  align-items: start;
}

.live-tools-sidebar {
  position: sticky;
  top: calc(var(--tools-header-bottom) + 17px);
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(4, 75, 199, 0.22), transparent 46%), var(--live-navy);
  box-shadow: 0 18px 42px rgba(15, 54, 122, 0.16);
}

.live-side-details > summary {
  display: none;
}

.live-side-body {
  display: grid;
  gap: 26px;
  padding: 22px;
}

.live-side-qr h2,
.live-side-services h2 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 16px;
  line-height: 1.4;
}

.live-side-qr img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: #fff;
}

.live-side-qr p {
  margin: 10px 0 0;
  color: #dce5f2;
  font-size: 12px;
  line-height: 1.6;
}

.live-side-services {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.live-side-services ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-side-services a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 0;
  color: #e0e7f1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.18s ease, padding 0.18s ease;
}

.live-side-services a:hover,
.live-side-services a:focus-visible {
  padding-left: 5px;
  color: #fff;
}

.live-side-services a svg {
  flex: 0 0 auto;
  color: var(--live-orange);
}

.live-tools-content {
  min-width: 0;
  padding: 42px 44px 56px;
  border: 1px solid #d8dfe8;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 54, 122, 0.07);
}

.live-tools-title {
  padding-bottom: 28px;
}

.live-tools-title p {
  margin: 0 0 10px;
  color: var(--live-orange);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.live-tools-title h1 {
  max-width: none;
  margin: 0;
  color: var(--live-navy);
  font-size: clamp(38px, 4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.live-category-nav {
  position: sticky;
  z-index: 8;
  top: var(--tools-header-bottom);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 14px;
  border-top: 1px solid var(--live-line);
  border-bottom: 1px solid var(--live-line);
  background: rgba(255, 255, 255, 0.94);
  scrollbar-width: none;
  backdrop-filter: blur(14px);
}

.live-category-nav::-webkit-scrollbar {
  display: none;
}

.live-category-nav a {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 14px;
  color: var(--live-navy);
  border: 1px solid #c7d1df;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.live-category-nav a:hover,
.live-category-nav a:focus-visible {
  color: #fff;
  border-color: var(--live-blue);
  background: var(--live-blue);
  transform: translateY(-1px);
}

.live-tool-section {
  padding: 48px 0 10px;
  scroll-margin-top: var(--tools-anchor-offset, 132px);
}

.live-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.live-section-head::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 28px;
  border-radius: 999px;
  background: var(--live-orange);
}

.live-section-head h2 {
  margin: 0;
  color: var(--live-navy);
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.live-section-head p {
  margin: 0;
  color: var(--live-muted);
  font-size: 13px;
  line-height: 1.6;
}

.live-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 22px;
}

.live-tool-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  gap: 12px;
  align-items: start;
  min-height: 112px;
  padding: 18px 8px;
  border-bottom: 1px solid var(--live-line);
  border-radius: 10px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.live-tool-item:hover,
.live-tool-item:focus-visible {
  color: inherit;
  background: #eef2f7;
  transform: translateX(3px);
}

.live-tool-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid #d4dce7;
  border-radius: 9px;
  background: #fff;
}

.live-tool-logo img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.live-tool-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.live-tool-copy strong {
  color: var(--live-ink);
  font-size: 15px;
  line-height: 1.4;
  text-wrap: pretty;
}

.live-tool-copy > span {
  color: var(--live-muted);
  font-size: 13px;
  line-height: 1.6;
  text-wrap: pretty;
}

.live-tool-arrow {
  color: #8a99ad;
  font-size: 15px;
  line-height: 1.4;
  transition: color 0.18s ease, transform 0.18s ease;
}

.live-tool-item:hover .live-tool-arrow,
.live-tool-item:focus-visible .live-tool-arrow {
  color: var(--live-blue);
  transform: translate(2px, -2px);
}

@media (max-width: 1240px) {
  .live-tools-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .live-tools-content {
    padding-right: 32px;
    padding-left: 32px;
  }

  .live-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .live-tools-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
    width: min(100% - 24px, 960px);
  }

  .live-side-body {
    padding: 16px;
  }

  .live-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tools-live-v0 {
    padding-top: 14px;
  }

  .live-tools-shell {
    display: flex;
    flex-direction: column;
    width: calc(100% - 20px);
  }

  .live-tools-sidebar {
    position: static;
    order: 2;
    width: 100%;
  }

  .live-side-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 14px 18px;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
  }

  .live-side-details > summary::after {
    content: "+";
    color: var(--live-orange);
    font-size: 22px;
  }

  .live-side-details[open] > summary::after {
    content: "−";
  }

  .live-side-details:not([open]) .live-side-body {
    display: none;
  }

  .live-side-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }

  .live-side-services {
    grid-column: 1 / -1;
  }

  .live-tools-content {
    order: 1;
    width: 100%;
    padding: 28px 18px 36px;
    border-radius: 18px;
  }

  .live-tools-title h1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .live-category-nav {
    margin: 0 -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .live-category-nav a,
  .live-side-services a { min-height: 44px; }

  .live-tool-section {
    padding-top: 38px;
  }

  .live-section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .live-section-head p {
    flex-basis: 100%;
    padding-left: 19px;
  }

  .live-tool-grid {
    grid-template-columns: 1fr;
  }

  .live-tool-item {
    min-height: 96px;
    padding: 16px 6px;
  }
}

/* CSS fallback while the tools page measures the actual sticky header. */
body.admin-bar .tools-live-v0 { --tools-header-bottom: 101px; }
@media (max-width: 782px) {
  body.admin-bar .tools-live-v0 { --tools-header-bottom: 115px; }
}
@media (max-width: 959px) {
  .no-js .tools-live-v0 { --tools-header-bottom: 0px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-tool-item,
  .live-tool-arrow,
  .live-category-nav a,
  .live-side-services a {
    transition: none;
  }
}
