:root {
  --bg: #e8edf0;
  --ink: #101419;
  --surface: #ffffff;
  --surface-2: #f3f6f7;
  --text: #171d22;
  --muted: #5d6872;
  --line: #d3dce2;
  --blue: #1769aa;
  --teal: #0b8f82;
  --amber: #b66a00;
  --red: #c2410c;
  --shadow: 0 18px 45px rgba(20, 29, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select,
input,
textarea {
  outline-color: #0b8f82;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(16, 20, 25, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
}

.brand-mark svg {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 10px 18px rgba(11, 143, 130, 0.24));
}

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

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: #9aa7b4;
  font-size: 0.78rem;
}

.nav {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.nav a {
  min-width: 86px;
  padding: 9px 14px;
  border-radius: 6px;
  color: #cbd5e1;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.nav a.active {
  background: #f8fafc;
  color: #111827;
}

main {
  padding: 24px clamp(18px, 4vw, 48px) 56px;
}

.hero {
  position: relative;
  display: grid;
  min-height: 330px;
  max-width: 1320px;
  margin: 0 auto 24px;
  overflow: hidden;
  border-radius: 8px;
  background: #111827;
  box-shadow: var(--shadow);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(9, 13, 18, 0.92) 0%, rgba(9, 13, 18, 0.72) 34%, rgba(9, 13, 18, 0.14) 72%),
    linear-gradient(180deg, transparent 62%, rgba(9, 13, 18, 0.76));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 670px;
  align-self: center;
  padding: clamp(28px, 6vw, 64px);
  color: #fff;
}

.hero-copy h1,
.config-heading h1,
.login-card h1 {
  margin: 8px 0 0;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 690px;
  font-size: clamp(2.1rem, 5vw, 4.7rem);
  line-height: 0.96;
}

.hero-copy p {
  max-width: 560px;
  margin-top: 18px;
  color: #d4dde6;
  font-size: 1.04rem;
  line-height: 1.6;
}

.hero-stats {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-stats span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(16, 20, 25, 0.7);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel,
.results-shell,
.json-card,
.schema-panel,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel.compact {
  display: grid;
  gap: 18px;
  background: #101419;
  color: #f8fafc;
}

.eyebrow {
  color: #13b8a6;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

.panel h2 {
  margin: 8px 0 0;
  font-size: 1.35rem;
  line-height: 1.12;
}

.panel p,
.config-heading p,
.schema-panel p,
.login-card p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.scan-card p {
  color: #aab7c4;
}

.scan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.scan-grid span {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(19, 184, 166, 0.3), transparent),
    rgba(255, 255, 255, 0.05);
}

.scan-grid span:nth-child(2),
.scan-grid span:nth-child(7) {
  background:
    linear-gradient(135deg, rgba(182, 106, 0, 0.36), transparent),
    rgba(255, 255, 255, 0.05);
}

.controls {
  display: grid;
  gap: 12px;
}

label,
.field-label {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

select,
.tag-editor,
textarea {
  width: 100%;
  border: 1px solid #bcc9d5;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

select {
  height: 44px;
  padding: 0 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segmented label {
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
}

.segmented input:checked + span {
  background: #101419;
  color: #fff;
  box-shadow: 0 8px 18px rgba(16, 20, 25, 0.16);
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 108px;
  padding: 12px;
}

.tags {
  display: contents;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d8e0e6;
  border-radius: 6px;
  background: #eef3f4;
  color: #1f2937;
  font-weight: 600;
}

.tag button {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #d3dbe1;
  color: #64748b;
  cursor: pointer;
}

.tag-editor input {
  min-width: 165px;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 8px 4px;
}

.tag-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #101419;
  color: #fff;
  box-shadow: 0 12px 24px rgba(16, 20, 25, 0.2);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #334155;
}

.results-shell {
  min-height: 720px;
  padding: 18px;
}

.analytics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.analytics-strip > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(19, 184, 166, 0.06), transparent),
    #fbfcfd;
}

.metric-value,
.metric-label {
  display: block;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.results-header,
.config-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.results-header h2 {
  margin-top: 6px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.8rem;
  font-weight: 800;
}

.matched-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
  margin: 18px 0 14px;
}

.match-chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.82rem;
  font-weight: 800;
}

.results-list {
  display: grid;
  gap: 12px;
}

.result-item {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.result-item:not(.locked):hover {
  border-color: #9bb6c8;
  box-shadow: 0 10px 24px rgba(23, 35, 48, 0.08);
  transform: translateY(-1px);
}

.result-item.locked .result-content {
  filter: blur(4px);
  opacity: 0.58;
  user-select: none;
}

.lock-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

.result-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.result-favicon {
  width: 30px;
  height: 30px;
  border: 1px solid #d8e0e6;
  border-radius: 7px;
  background: #f8fafc;
  object-fit: cover;
}

.result-copy {
  min-width: 0;
}
.result-title {
  display: inline-flex;
  max-width: 100%;
  color: #1d4ed8;
  font-size: 1.03rem;
  font-weight: 800;
  text-decoration: none;
}

.result-title:hover,
.result-url:hover {
  text-decoration: underline;
}

.result-url {
  display: inline-block;
  margin-top: 5px;
  color: #047857;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.result-description {
  margin-top: 8px;
  color: #475569;
  line-height: 1.55;
}

mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #fff2b8;
  color: inherit;
  font-weight: 800;
}

.signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.signal {
  padding: 6px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 800;
}

.ai-searching {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  min-height: 180px;
  padding: 24px;
  border: 1px solid #bfd2dc;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(11, 143, 130, 0.12), transparent 45%),
    linear-gradient(180deg, #fbfdfe, #eef5f6);
}

.ai-searching::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(11, 143, 130, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 143, 130, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  animation: grid-drift 1.6s linear infinite;
}

.ai-searching::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(19, 184, 166, 0.22), transparent);
  transform: translateX(-100%);
  animation: scan-sweep 1.35s ease-in-out infinite;
}

.ai-orbit {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(11, 143, 130, 0.34);
  border-radius: 50%;
  background: #101419;
  box-shadow: inset 0 0 22px rgba(19, 184, 166, 0.18), 0 16px 28px rgba(16, 20, 25, 0.18);
}

.ai-orbit::before {
  position: absolute;
  inset: 17px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.ai-orbit span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: #13b8a6;
  transform-origin: 4px 4px;
  animation: orbit 1.35s linear infinite;
}

.ai-orbit span:nth-child(2) {
  background: #b66a00;
  animation-delay: -0.45s;
}

.ai-orbit span:nth-child(3) {
  background: #f8fafc;
  animation-delay: -0.9s;
}

.ai-search-copy {
  position: relative;
  z-index: 1;
}

.ai-search-copy strong {
  display: block;
  color: #101419;
  font-size: 1.12rem;
}

.ai-search-copy p {
  margin-top: 7px;
  color: #52606b;
  line-height: 1.55;
}

.ai-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.ai-steps span {
  padding: 7px 9px;
  border-radius: 999px;
  background: #e6f3f1;
  color: #075f58;
  font-size: 0.76rem;
  font-weight: 800;
  animation: step-pulse 1.4s ease-in-out infinite;
}

.ai-steps span:nth-child(2) {
  animation-delay: 0.18s;
}

.ai-steps span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(27px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(27px) rotate(-360deg); }
}

@keyframes grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 26px 26px, 26px 26px; }
}

@keyframes scan-sweep {
  0% { transform: translateX(-100%); opacity: 0; }
  22% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes step-pulse {
  0%, 100% { transform: translateY(0); opacity: 0.58; }
  50% { transform: translateY(-2px); opacity: 1; }
}
.empty {
  padding: 34px;
  border: 1px dashed #b7c3ce;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
}

.config-view {
  max-width: 1320px;
  margin: 0 auto;
}

.login-panel {
  display: grid;
  min-height: calc(100vh - 170px);
  place-items: center;
}

.login-card {
  width: min(100%, 440px);
  padding: 28px;
}

.login-card h1 {
  font-size: 2.15rem;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.login-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #bcc9d5;
  border-radius: 6px;
}

.login-status {
  min-height: 20px;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 800;
}

.config-heading {
  margin-bottom: 20px;
}

.config-heading h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.config-actions .ghost-button,
.config-actions .primary-button {
  padding: 0 16px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}

.json-card {
  overflow: hidden;
}

.json-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

textarea {
  display: block;
  min-height: 650px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
}

.schema-panel {
  align-self: start;
  padding: 20px;
}

.schema-panel h2 {
  font-size: 1.15rem;
}

pre {
  overflow: auto;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 0.78rem;
  line-height: 1.55;
}

@media (max-width: 920px) {
  .workspace,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .results-shell {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .topbar,
  .results-header,
  .config-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1;
  }

  .analytics-strip {
    grid-template-columns: 1fr;
  }

  .panel h2 {
    font-size: 1.8rem;
  }

  .hero {
    min-height: 430px;
  }

  .hero-stats {
    right: auto;
    left: 24px;
    justify-content: flex-start;
  }
}




