:root {
  --enterprise-font-sans: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --enterprise-font-display: "Space Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;
  --enterprise-bg: #ecf1f5;
  --enterprise-surface: #ffffff;
  --enterprise-surface-alt: #f6f9fb;
  --enterprise-border: #d8e0e8;
  --enterprise-text: #13212f;
  --enterprise-muted: #5f7387;
  --enterprise-accent: #0b57d0;
  --enterprise-accent-strong: #083b8a;
  --enterprise-accent-soft: #e9f1ff;
  --enterprise-positive: #0f766e;
  --enterprise-shadow: 0 22px 55px rgba(18, 33, 47, 0.08);
  --enterprise-radius: 24px;
  --enterprise-radius-sm: 14px;
}

body {
  background:
    radial-gradient(circle at top left, rgba(11, 87, 208, 0.12), transparent 28%),
    linear-gradient(180deg, #f5f8fb 0%, var(--enterprise-bg) 100%);
  color: var(--enterprise-text);
  font-family: var(--enterprise-font-sans);
}

h1,
h2,
h3,
h4 {
  color: var(--enterprise-text);
  font-family: var(--enterprise-font-display);
  letter-spacing: -0.03em;
}

.enterprise-site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.enterprise-topbar {
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.enterprise-brand {
  color: var(--enterprise-text);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
}

.enterprise-brand-wordmark {
  font-family: var(--enterprise-font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.enterprise-brand-subtitle {
  color: var(--enterprise-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.enterprise-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.enterprise-topbar-link,
.enterprise-logout-button {
  border: 1px solid var(--enterprise-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--enterprise-text);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.enterprise-topbar-user {
  color: var(--enterprise-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.enterprise-logout-form {
  margin: 0;
}

.enterprise-logout-button {
  cursor: pointer;
  font-family: inherit;
}

.enterprise-main {
  width: min(1560px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  flex: 1;
}

.enterprise-footer {
  color: var(--enterprise-muted);
  font-size: 0.92rem;
  margin-top: auto;
  padding: 0 1.5rem 1.5rem;
  text-align: center;
}

.enterprise-footer p {
  margin: 0 auto;
  max-width: 1100px;
}

.enterprise-home-hero,
.enterprise-results-shell,
.enterprise-auth-shell {
  display: grid;
  gap: 1.5rem;
}

.enterprise-home-hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: stretch;
}

.enterprise-home-copy,
.enterprise-home-panel,
.enterprise-auth-copy,
.enterprise-auth-panel,
.enterprise-rail-card,
.search_box {
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: var(--enterprise-radius);
  box-shadow: var(--enterprise-shadow);
}

.enterprise-home-copy,
.enterprise-home-panel,
.enterprise-auth-copy,
.enterprise-auth-panel,
.enterprise-rail-card {
  padding: 1.75rem;
}

.enterprise-home-copy,
.enterprise-auth-copy {
  background:
    linear-gradient(140deg, rgba(11, 87, 208, 0.92), rgba(8, 59, 138, 0.94)),
    linear-gradient(180deg, #102d57 0%, #0b2140 100%);
  color: #f5f9ff;
  overflow: hidden;
  position: relative;
}

.enterprise-home-copy::after,
.enterprise-auth-copy::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.enterprise-home-copy h1,
.enterprise-auth-copy h1 {
  color: #fff;
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 0.95;
  margin: 0.25rem 0 1rem;
}

.enterprise-home-lede,
.enterprise-auth-copy p {
  color: rgba(245, 249, 255, 0.88);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 34rem;
}

.enterprise-eyebrow,
.enterprise-card-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

.enterprise-eyebrow {
  color: rgba(245, 249, 255, 0.76);
}

.enterprise-card-eyebrow {
  color: var(--enterprise-muted);
}

.enterprise-home-pills,
.enterprise-auth-points {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0;
  padding: 0;
}

.enterprise-home-pills span,
.enterprise-auth-points li {
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #fff;
  font-size: 0.9rem;
  padding: 0.65rem 0.95rem;
}

.enterprise-home-panel-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.25rem;
}

.enterprise-home-panel-card {
  border: 1px solid var(--enterprise-border);
  border-radius: var(--enterprise-radius-sm);
  background: var(--enterprise-surface-alt);
  padding: 1rem;
}

.enterprise-panel-label {
  color: var(--enterprise-muted);
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.enterprise-panel-label + strong,
.enterprise-home-panel-card strong {
  display: block;
  margin-bottom: 0.5rem;
}

.enterprise-search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.enterprise-search-header {
  align-items: stretch;
}

.enterprise-search-form .search_box {
  box-shadow: none;
  margin: 0;
}

.enterprise-search-form .search_filters {
  background: transparent;
  border: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
}

.enterprise-results-shell {
  grid-template-columns: minmax(248px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 1.75rem;
}

.enterprise-results-rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.enterprise-topic-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.enterprise-topic-filter {
  background: var(--enterprise-surface-alt);
  border: 1px solid var(--enterprise-border);
  border-radius: var(--enterprise-radius-sm);
  color: var(--enterprise-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.enterprise-topic-filter:hover,
.enterprise-topic-filter.is-active {
  border-color: var(--enterprise-accent);
  background: var(--enterprise-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(11, 87, 208, 0.16);
  transform: none;
}

.enterprise-summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.enterprise-summary-grid span {
  color: var(--enterprise-muted);
  display: block;
  font-size: 0.84rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.enterprise-summary-grid strong {
  display: block;
  line-height: 1.4;
}

.enterprise-results-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

#main_results .enterprise-results-main #search,
#main_results .enterprise-results-main #search_header {
  width: 100%;
}

#main_results #results.enterprise-topic-results {
  background: transparent;
  box-shadow: none;
  column-count: 1;
  columns: auto;
  display: block;
  gap: 0;
  grid-template-columns: none;
  margin: 0;
  width: 100%;
}

#main_results #results.enterprise-topic-results > .enterprise-topic-group {
  break-inside: avoid;
  width: 100%;
}

#main_results #results.enterprise-topic-results > .enterprise-topic-group + .enterprise-topic-group {
  border-top: 1px solid var(--enterprise-border);
  margin-top: 1.75rem;
  padding-top: 1.75rem;
}

.enterprise-topic-group {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.enterprise-topic-group-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--enterprise-border);
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
}

.enterprise-topic-group-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.enterprise-topic-group-labelrow {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.enterprise-topic-group-header h2,
.enterprise-topic-group-labelrow h2 {
  margin: 0;
  font-family: var(--enterprise-font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.enterprise-topic-group-count {
  color: var(--enterprise-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.enterprise-topic-group-results {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.enterprise-topic-empty-state {
  background: var(--enterprise-surface);
  border: 1px dashed var(--enterprise-border);
  border-radius: var(--enterprise-radius);
  color: var(--enterprise-muted);
  padding: 2rem;
  text-align: center;
}

.enterprise-result-topic-badge {
  align-self: flex-start;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.34rem 0.72rem;
  text-transform: uppercase;
}

.enterprise-topic-hardware {
  background: #ecfdf5;
  color: #0f766e;
}

.enterprise-topic-software {
  background: #eff6ff;
  color: #1d4ed8;
}

.enterprise-topic-ai {
  background: #fff7ed;
  color: #c2410c;
}

.enterprise-topic-coding {
  background: #eef2ff;
  color: #4338ca;
}

.enterprise-topic-other {
  background: #f3f4f6;
  color: #4b5563;
}

.result-heading {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.enterprise-serp-result,
.result-keyvalue {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe4ec;
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(18, 33, 47, 0.04);
  padding: 1.25rem 1.35rem;
  position: relative;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.enterprise-serp-result:hover,
.result-keyvalue:hover {
  border-color: #c7d4e1;
  box-shadow: 0 14px 30px rgba(18, 33, 47, 0.07);
  transform: translateY(-1px);
}

.enterprise-serp-result::after {
  clear: both;
  content: "";
  display: block;
}

.enterprise-serp-result .url_header {
  align-items: center;
  color: var(--enterprise-muted);
  display: inline-flex;
  gap: 0.6rem;
  max-width: 100%;
  text-decoration: none;
}

.enterprise-serp-result .url_header:hover .url_wrapper,
.enterprise-serp-result .url_header:focus .url_wrapper {
  color: var(--enterprise-text);
}

.enterprise-serp-result .favicon {
  align-items: center;
  background: var(--enterprise-surface-alt);
  border-radius: 999px;
  display: inline-flex;
  height: 1.1rem;
  justify-content: center;
  overflow: hidden;
  width: 1.1rem;
}

.enterprise-serp-result .favicon img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.enterprise-serp-result .url_wrapper {
  color: var(--enterprise-muted);
  display: block;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enterprise-serp-result .thumbnail_link {
  float: right;
  margin: 0.15rem 0 0.85rem 1.1rem;
  max-width: 190px;
  width: min(26%, 190px);
}

.enterprise-serp-result .thumbnail {
  background: var(--enterprise-surface-alt);
  border-radius: 16px;
  display: block;
  height: auto;
  object-fit: cover;
  width: 100%;
}

.enterprise-serp-result .thumbnail_length {
  background: rgba(19, 33, 47, 0.78);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.enterprise-serp-result h3 {
  font-family: var(--enterprise-font-sans);
  font-size: clamp(1.2rem, 1.7vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin: 0;
}

.enterprise-serp-result h3 a {
  color: var(--enterprise-accent);
  text-decoration: none;
}

.enterprise-serp-result h3 a:hover,
.enterprise-serp-result h3 a:focus {
  color: var(--enterprise-accent-strong);
  text-decoration: underline;
}

.enterprise-serp-result .content {
  color: #24384b;
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0.7rem 0 0;
}

.enterprise-serp-result .published_date,
.enterprise-serp-result .result_length,
.enterprise-serp-result .result_views,
.enterprise-serp-result .result_author,
.enterprise-serp-result .highlight {
  color: var(--enterprise-muted);
  display: inline-flex;
  font-size: 0.87rem;
  line-height: 1.4;
  margin: 0.45rem 0.75rem 0 0;
}

.enterprise-serp-result .engines,
.result-keyvalue .engines {
  align-items: center;
  color: var(--enterprise-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 0.45rem;
  margin-top: 0.95rem;
}

.enterprise-serp-result .engines span,
.result-keyvalue .engines span {
  background: var(--enterprise-surface-alt);
  border: 1px solid var(--enterprise-border);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.enterprise-serp-result .cache_link,
.result-keyvalue .cache_link {
  color: var(--enterprise-accent-strong);
  text-decoration: none;
}

.enterprise-serp-result .cache_link:hover,
.enterprise-serp-result .cache_link:focus,
.result-keyvalue .cache_link:hover,
.result-keyvalue .cache_link:focus {
  text-decoration: underline;
}

.result-keyvalue table {
  border-collapse: collapse;
  width: 100%;
}

.result-keyvalue caption {
  color: var(--enterprise-text);
  font-family: var(--enterprise-font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  text-align: left;
}

.result-keyvalue th,
.result-keyvalue td {
  border-top: 1px solid var(--enterprise-border);
  padding: 0.8rem 0.9rem;
}

.result-keyvalue thead th {
  color: var(--enterprise-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-keyvalue tbody th {
  color: var(--enterprise-text);
  font-weight: 600;
}

.enterprise-keyvalue-heading {
  padding: 1rem 1rem 0;
}

.enterprise-auth-shell {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 420px);
  align-items: stretch;
  max-width: 1100px;
  margin: 2rem auto 0;
}

.enterprise-auth-panel h2 {
  margin-top: 0;
}

.enterprise-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.enterprise-auth-form label {
  color: var(--enterprise-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.enterprise-auth-form input {
  border: 1px solid var(--enterprise-border);
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.9rem 1rem;
}

.enterprise-auth-form button {
  margin-top: 0.6rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--enterprise-accent), var(--enterprise-accent-strong));
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.95rem 1rem;
}

.dialog-error {
  margin-bottom: 1rem;
}

@media (max-width: 1100px) {
  .enterprise-home-hero,
  .enterprise-results-shell,
  .enterprise-auth-shell {
    grid-template-columns: 1fr;
  }

  .enterprise-results-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  .enterprise-topbar,
  .enterprise-main,
  .enterprise-footer {
    width: min(100% - 1rem, 100%);
    padding-left: 0;
    padding-right: 0;
  }

  .enterprise-topbar {
    padding-top: 1rem;
  }

  .enterprise-home-copy,
  .enterprise-home-panel,
  .enterprise-auth-copy,
  .enterprise-auth-panel,
  .enterprise-rail-card {
    padding: 1.2rem;
  }

  .enterprise-serp-result,
  .result-keyvalue {
    padding: 1rem 1.05rem;
  }

  .enterprise-serp-result .thumbnail_link {
    float: none;
    margin: 0.85rem 0 0;
    max-width: 100%;
    width: 100%;
  }

  .enterprise-topic-group-header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
  }

  .enterprise-home-panel-grid,
  .enterprise-summary-grid {
    grid-template-columns: 1fr;
  }
}
