:root {
  --bg: #f3f6f8;
  --panel: rgba(255, 255, 255, 0.9);
  --ink: #101827;
  --muted: #667085;
  --border: rgba(16, 24, 39, 0.1);
  --line: rgba(255, 255, 255, 0.44);
  --blue: #1d4ed8;
  --teal: #0f766e;
  --coral: #e85d4f;
  --gold: #b7791f;
  --green: #16845d;
  --shadow: 0 22px 58px rgba(16, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.15), transparent 28%),
    linear-gradient(225deg, rgba(232, 93, 79, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 39, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 62%);
}

a {
  color: inherit;
}

.brandBar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(22px, calc((100vw - 1180px) / 2 + 28px));
  background: rgba(9, 14, 23, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brandMark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #f7b733, #e85d4f 48%, #0f766e);
  color: white;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  margin-top: 2px;
}

.profileLink {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 28px 52px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.74)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(232, 93, 79, 0.12));
  box-shadow: var(--shadow);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

h1 {
  color: #0c1220;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.96;
  max-width: 760px;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.hero p:not(.eyebrow) {
  color: var(--muted);
  max-width: 820px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.55;
}

.status {
  min-height: 126px;
  display: grid;
  align-content: center;
  border: 1px solid rgba(16, 24, 39, 0.1);
  border-radius: 8px;
  padding: 18px;
  background: #0c1220;
  color: white;
  box-shadow: 0 18px 36px rgba(12, 18, 32, 0.18);
}

.statusLabel {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

#recordCount {
  font-size: 24px;
  font-weight: 900;
}

.controls {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 160px 160px 150px;
  gap: 12px;
  position: sticky;
  top: 74px;
  z-index: 12;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

input,
select,
button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--ink);
  font: inherit;
}

input,
select {
  padding: 0 13px;
}

input {
  border-color: rgba(29, 78, 216, 0.24);
  font-size: 16px;
  font-weight: 700;
}

input:focus,
select:focus,
button:focus,
.result:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(29, 78, 216, 0.18);
}

button {
  cursor: pointer;
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(16, 24, 39, 0.08);
}

.stats strong {
  display: block;
  color: #0c1220;
  font-size: 30px;
  line-height: 1;
}

.stats span {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 13px;
  font-weight: 800;
}

.resultsHeader {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 14px;
}

.resultActions {
  display: flex;
  gap: 10px;
}

#clear,
#copySearch {
  width: auto;
  min-width: 96px;
  min-height: 42px;
  padding: 0 14px;
}

#copySearch {
  border: 0;
  background: #0c1220;
  color: white;
}

#clear {
  background: rgba(255, 255, 255, 0.78);
}

.results {
  display: grid;
  gap: 14px;
}

.result {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, rgba(29, 78, 216, 0.08), rgba(15, 118, 110, 0.08));
  box-shadow: 0 16px 42px rgba(16, 24, 39, 0.09);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.result.clickable {
  cursor: pointer;
}

.result.clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 78, 216, 0.32);
  box-shadow: 0 24px 56px rgba(16, 24, 39, 0.14);
}

.result::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral), var(--gold));
}

.resultTop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.metaLine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  background: #eef3ff;
  color: var(--blue);
}

.badge.type {
  background: #e9fbf4;
  color: var(--green);
}

.date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.caption {
  max-width: 850px;
  font-size: clamp(18px, 2.3vw, 27px);
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: 0;
}

.caption mark {
  background: #fff1bc;
  border-radius: 4px;
  color: inherit;
  padding: 0 3px;
}

.url {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  pointer-events: none;
}

.url.hasUrl {
  border: 0;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  color: white;
  pointer-events: auto;
  box-shadow: 0 14px 28px rgba(29, 78, 216, 0.22);
}

dl {
  display: grid;
  grid-template-columns: 1fr 1.45fr 1fr;
  gap: 14px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 24, 39, 0.08);
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: #273248;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.empty {
  border: 1px dashed rgba(16, 24, 39, 0.18);
  border-radius: 8px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .brandBar {
    padding: 12px 16px;
  }

  .profileLink {
    display: none;
  }

  .shell {
    padding: 16px 14px 40px;
  }

  .hero,
  .resultTop {
    display: block;
  }

  .hero {
    padding: 24px 18px;
  }

  .status {
    min-height: auto;
    margin-top: 18px;
  }

  .controls {
    position: static;
  }

  .controls,
  .stats,
  dl {
    grid-template-columns: 1fr;
  }

  .resultsHeader {
    display: block;
  }

  .resultActions {
    margin-top: 12px;
  }

  #copySearch,
  #clear {
    flex: 1;
  }

  .url {
    width: 100%;
    margin-top: 14px;
  }
}
