:root {
  color-scheme: dark;
  --bg: #07120f;
  --bg-soft: #0a1814;
  --surface: #0d1f19;
  --surface-raised: #122820;
  --surface-hover: #173329;
  --line: #27453a;
  --line-strong: #3d6555;
  --text: #f2f8f5;
  --muted: #a5b9b1;
  --subtle: #8fa49b;
  --accent: #bcf45a;
  --accent-strong: #d3ff7e;
  --mint: #5edcb1;
  --danger: #ff987f;
  --shadow: 0 24px 72px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% -8%, rgba(63, 154, 117, .23), transparent 30rem),
    radial-gradient(circle at -10% 35%, rgba(188, 244, 90, .07), transparent 28rem),
    var(--bg);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, input, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: var(--accent);
  color: #07120f;
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(61, 101, 85, .58);
  background: rgba(7, 18, 15, .88);
  backdrop-filter: blur(18px) saturate(135%);
}
.header-inner {
  width: min(1180px, calc(100% - 2rem));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  border-radius: .75rem;
  text-decoration: none;
}
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font-size: .83rem; letter-spacing: .13em; }
.brand-copy small { margin-top: .1rem; color: var(--muted); font-size: .68rem; letter-spacing: .11em; text-transform: uppercase; }
.brand-mark { width: 30px; height: 30px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; }
.brand-mark i { display: block; border-radius: 3px 3px 1px 1px; background: linear-gradient(to top, var(--mint), var(--accent)); box-shadow: 0 0 18px rgba(188, 244, 90, .18); }
.brand-mark i:nth-child(1) { height: 42%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 68%; }

.primary-nav {
  display: flex;
  gap: .25rem;
  padding: .28rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 31, 25, .72);
}
.primary-nav a {
  min-height: 40px;
  padding: .63rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .83rem;
  font-weight: 750;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a.active { color: #07120f; background: var(--accent); box-shadow: 0 5px 20px rgba(188, 244, 90, .14); }

.language-control { justify-self: end; position: relative; }
.language-control select {
  min-height: 44px;
  max-width: 160px;
  padding: .6rem 2rem .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  color: var(--text);
}
.service-alert {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto .75rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(255, 152, 127, .45);
  border-radius: .8rem;
  background: rgba(111, 35, 28, .35);
  color: #ffd6cc;
  font-size: .9rem;
}

main, footer { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.view { min-height: calc(100vh - 150px); padding: clamp(3rem, 7vw, 6.5rem) 0 5rem; }
.view-intro { max-width: 800px; margin-bottom: 2rem; }
.view-intro.compact { max-width: 720px; }
.eyebrow { margin: 0 0 .75rem; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .9rem; font-size: clamp(2.45rem, 6vw, 5rem); line-height: 1; letter-spacing: -.052em; }
.view-intro > p:last-child { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.6; }

.lookup-panel {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(18, 40, 32, .96), rgba(10, 24, 20, .96));
  box-shadow: var(--shadow);
}
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; padding: .75rem; }
.query-field { display: block; min-width: 0; }
.query-field input {
  width: 100%;
  min-height: 58px;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  outline: 0;
  background: rgba(5, 15, 12, .72);
  color: var(--text);
  font-size: 1.02rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: var(--subtle); }
.query-field input:focus { border-color: var(--accent); background: rgba(5, 15, 12, .95); box-shadow: 0 0 0 4px rgba(188, 244, 90, .12); }
.primary-button {
  min-width: 120px;
  min-height: 58px;
  padding: 0 1.35rem;
  border: 0;
  border-radius: .9rem;
  background: var(--accent);
  color: #07120f;
  font-weight: 850;
  box-shadow: 0 9px 28px rgba(188, 244, 90, .13);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.primary-button:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(188, 244, 90, .2); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .58; transform: none; }

.filter-disclosure { border-top: 1px solid var(--line); }
.filter-disclosure summary {
  min-height: 48px;
  padding: .85rem 1rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 720;
  list-style-position: inside;
}
.filter-disclosure summary:hover { color: var(--text); }
.filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding-top: 1px; background: var(--line); }
.filter-grid.one-column { grid-template-columns: minmax(0, 1fr); }
.filter-grid label { min-width: 0; padding: .85rem 1rem; background: var(--surface); }
.filter-grid label > span { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.filter-grid select {
  width: 100%;
  min-height: 42px;
  padding: .5rem .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  outline: 0;
  background: var(--bg-soft);
  color: var(--text);
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.finder-status, .result-bar {
  min-height: 64px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .9rem;
}
.result-bar p { margin: 0; }
.result-bar strong { color: var(--text); font-variant-numeric: tabular-nums; }

.skeleton-stack { display: grid; gap: .7rem; padding-top: 1.25rem; }
.skeleton-stack span { height: 96px; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); }
.skeleton-stack span::after { display: block; width: 45%; height: 100%; content: ""; background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.15s linear infinite; }
.skeleton-stack.compact span { height: 72px; }

.enclosure-results { display: grid; gap: 1.5rem; }
.finder-overview {
  position: relative;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem;
  background: linear-gradient(130deg, #17362b, #0d211b 65%);
  box-shadow: var(--shadow);
  animation: rise-in .28s ease both;
}
.finder-overview::after { position: absolute; right: -4rem; bottom: -7rem; width: 16rem; height: 16rem; border-radius: 50%; background: rgba(188, 244, 90, .06); content: ""; }
.finder-overview h2 { position: relative; margin-bottom: .65rem; overflow-wrap: anywhere; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1; letter-spacing: -.04em; }
.overview-meta { position: relative; display: flex; flex-wrap: wrap; gap: .45rem; }
.overview-meta span, .enclosure-tag, .related-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .28rem .58rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: .74rem;
}
.enclosure-tag { max-width: 100%; color: var(--accent); white-space: normal; overflow-wrap: anywhere; }
.related-tag { margin-top: .35rem; color: #f4cf84; border-color: #765f36; }

.history-section, .technical-analysis {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(13, 31, 25, .88);
  animation: rise-in .32s .04s ease both;
}
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.2rem; border-bottom: 1px solid var(--line); }
.section-title h3 { margin: 0; font-size: 1.08rem; }
.section-title p { margin: .25rem 0 0; color: var(--muted); font-size: .82rem; }
.section-title > span { color: var(--accent); font-variant-numeric: tabular-nums; }

.table-shell { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: .8rem .9rem; color: var(--muted); font-size: .7rem; font-weight: 760; letter-spacing: .06em; text-align: left; text-transform: uppercase; background: rgba(6, 18, 14, .7); }
td { padding: 1rem .9rem; border-top: 1px solid var(--line); font-size: .88rem; line-height: 1.48; vertical-align: top; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: var(--surface-hover); }
.date-cell { width: 118px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.service-cell { min-width: 145px; }
.service-cell strong { display: block; color: var(--text); overflow-wrap: anywhere; }
.secondary-line { display: block; margin-top: .25rem; color: var(--subtle); font-size: .75rem; overflow-wrap: anywhere; }
.secondary-line, .location-text, .performed-text { overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; }
.secondary-line { -webkit-line-clamp: 2; }
.location-text { -webkit-line-clamp: 3; }
.performed-text { -webkit-line-clamp: 4; }
.location-cell { min-width: 180px; }
.performed-cell { min-width: 260px; max-width: 480px; overflow-wrap: anywhere; }
.action-cell { width: 60px; text-align: right; }
.detail-button {
  min-width: 44px;
  min-height: 44px;
  padding: .55rem .72rem;
  border: 1px solid var(--line-strong);
  border-radius: .7rem;
  background: var(--surface-raised);
  color: var(--text);
  font-size: .78rem;
  font-weight: 750;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.detail-button:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.empty-cell { height: 150px; text-align: center; color: var(--muted); }
.show-more-wrap { padding: 1rem; border-top: 1px solid var(--line); text-align: center; }
.secondary-button, .pagination button {
  min-height: 44px;
  padding: .6rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: .7rem;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 720;
}
.secondary-button:hover, .pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.technical-analysis { overflow: hidden; }
.technical-analysis > summary { min-height: 58px; padding: 1.15rem 1.2rem; color: var(--text); font-weight: 780; }
.technical-body { display: grid; gap: 1.5rem; padding: 0 1.2rem 1.2rem; }
.technical-note { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.subheading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.subheading h3 { margin: 0; font-size: 1rem; }
.subheading span { color: var(--accent); font-variant-numeric: tabular-nums; }
.cable-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .65rem; }
.cable-card { min-height: 145px; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--bg-soft); }
.cable-card > span, .cable-card small { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.cable-card strong { display: block; margin: .55rem 0 .8rem; color: var(--accent); font-size: 1.08rem; }
.cable-card p { margin-bottom: .8rem; font-size: .84rem; line-height: 1.45; }
.empty-card { margin: 0; padding: 1.25rem; border: 1px dashed var(--line); border-radius: .85rem; color: var(--muted); }
.splice-table td:nth-child(4) { color: var(--accent); }

.pagination { display: flex; justify-content: flex-end; align-items: center; gap: .75rem; padding-top: 1rem; }
.pagination button:disabled { cursor: default; opacity: .35; }
.pagination span { min-width: 74px; text-align: center; color: var(--muted); font-size: .84rem; }

dialog {
  width: min(820px, calc(100% - 1.25rem));
  max-height: 88vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 1.1rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.62);
}
dialog[open] { animation: dialog-in .2s ease both; }
dialog::backdrop { background: rgba(1, 7, 5, .8); backdrop-filter: blur(5px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: start; padding: 1.2rem; border-bottom: 1px solid var(--line); background: rgba(13,31,25,.96); backdrop-filter: blur(12px); }
.dialog-head > div { min-width: 0; }
.dialog-head h2 { margin: 0; overflow-wrap: anywhere; font-size: 1.55rem; }
.dialog-head button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: .7rem; background: var(--bg-soft); color: var(--text); font-size: 1.4rem; }
.record-detail { padding: 1.15rem; }
.detail-priority { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.detail-field { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--bg-soft); }
.detail-field.wide { grid-column: 1 / -1; }
.detail-field dt, .technical-fields dt { color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.detail-field dd, .technical-fields dd { margin: .45rem 0 0; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.5; }
.technical-detail { margin-top: .9rem; border-top: 1px solid var(--line); }
.technical-detail summary { min-height: 50px; padding: 1rem 0; color: var(--muted); font-weight: 720; }
.technical-fields { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.technical-fields > div { min-width: 0; padding: .9rem; background: var(--surface); }

footer { padding: 1.8rem 0 2.5rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: var(--subtle); font-size: .76rem; }

@keyframes shimmer { from { transform: translateX(-120%); } to { transform: translateX(260%); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 840px) {
  .header-inner { grid-template-columns: 1fr auto; padding: .65rem 0; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .primary-nav a { flex: 1; text-align: center; }
  .view { padding-top: 3.5rem; }

  .responsive-table { overflow: visible; border: 0; background: transparent; }
  .responsive-table table, .responsive-table tbody { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .responsive-table tr { display: grid; gap: .75rem; margin-bottom: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: .95rem; background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
  .responsive-table td { display: block; width: auto; min-width: 0; max-width: none; padding: 0; border: 0; white-space: normal; }
  .responsive-table td:not(.action-cell):not(.empty-cell)::before { display: block; margin-bottom: .2rem; color: var(--subtle); content: attr(data-label); font-size: .67rem; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
  .responsive-table .date-cell { grid-column: 1; }
  .responsive-table .action-cell { grid-column: 1; text-align: left; }
  .responsive-table .detail-button { width: 100%; }
  .responsive-table .empty-cell { display: flex; min-height: 130px; align-items: center; justify-content: center; }
  .history-section .table-shell { padding: .75rem; }
  .history-section .show-more-wrap { border-top: 0; padding-top: .25rem; }
}

@media (max-width: 720px) {
  main, footer, .header-inner, .service-alert { width: min(100% - 1rem, 1180px); }
  .brand-copy small { display: none; }
  .language-control select { max-width: 135px; }
  h1 { font-size: clamp(2.25rem, 12vw, 3.5rem); }
  .view-intro { margin-bottom: 1.4rem; }
  .lookup-row { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .filter-grid { grid-template-columns: 1fr; }
  .finder-status, .result-bar { min-height: 58px; font-size: .84rem; }
  .section-title { align-items: start; }

  .detail-priority, .technical-fields { grid-template-columns: 1fr; }
  .detail-field.wide { grid-column: auto; }
  .pagination { justify-content: space-between; }
  footer { flex-direction: column; }
}

@media (max-width: 390px) {
  .brand-mark { width: 27px; height: 27px; }
  .brand-copy strong { font-size: .76rem; }
  .language-control select { width: 118px; padding-left: .55rem; font-size: .8rem; }
  .primary-nav a { padding-inline: .5rem; }
  .view { padding-top: 2.75rem; }
  .finder-overview, .section-title, .technical-analysis > summary { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
