:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --accent: #2f2d80;
  --accent-ink: #fff;
  --shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --gap: 24px;
  --gap-lg: 40px;
  --h1: clamp(1.8rem, 2.2vw + 1rem, 3rem);
  --h1-detail: clamp(2rem, 2.8vw + 1rem, 3.25rem);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

.not-in-iframe {
  overflow: auto !important;
}
.in-iframe {
  overflow: hidden !important;
}

html,
body {
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Inter,
    Arial,
    sans-serif;
  overflow: hidden;
}
a {
  color: var(--accent);
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
.wrap {
  max-width: 1160px;
  margin-inline: auto;
  padding: 24px 16px 64px;
}
.head {
  margin-bottom: 16px;
}
h1 {
  margin: 0 0 8px;
  font-size: var(--h1);
}
.sub {
  color: var(--muted);
  margin: 0 0 18px;
}

/* Cards + utilities */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad {
  padding: 18px;
}
.logo-box {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
  padding: 8px;
}
.logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.name {
  font-weight: 800;
  margin: 4px 0 2px;
}
.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}
.cta {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}
.btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}
.btn.outline {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  position: relative;
  overflow: hidden;
  transition: color 0.6s ease;
  z-index: 1;
}

.btn.outline::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transition: left 0.6s ease;
  z-index: -1;
}

.btn.outline:hover::before {
  left: 0;
}

.btn.outline:hover {
  color: #ffffff;
}

.btn.outline * {
  position: relative;
  z-index: 1;
}
.muted {
  color: var(--muted);
}
.mono {
  font-variant-numeric: tabular-nums;
}

/* Grid (list view) */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  color: inherit;
}
.card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.12);
}

.name {
  font-weight: 800;
  margin: 4px 0 2px;
}
.meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Detail view layout */
.page-head {
  padding: 6px 0 8px;
}
.kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}
.h1-detail {
  font-size: var(--h1-detail);
  line-height: 1.15;
  margin: 0 0 8px;
}
.grid-detail {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--gap-lg);
}
@media (max-width: 900px) {
  .grid-detail {
    grid-template-columns: 1fr;
  }
}

/* Left sidebar spacing */
#d-left {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Mobile: Move back button to top */
@media (max-width: 900px) {
  #d-left {
    flex-direction: column;
  }

  #d-left .btn.outline {
    order: -1;
    margin-bottom: var(--gap);
  }
}
.logo-card {
  display: grid;
  place-items: center;
  min-height: 200px;
  background: #f8fafc;
}
.section-title {
  font-weight: 800;
  margin: 0 0 8px;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.row {
  display: flex;
  gap: 10px;
  align-items: start;
}
.label {
  color: var(--muted);
  min-width: 120px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Email handling for long addresses */
#d-email {
  word-break: break-all;
  overflow-wrap: break-word;
  flex: 1;
  min-width: 0;
}

.pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.12);
}

.pill h4 {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill p {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 900px) {
  .pills {
    grid-template-columns: 1fr;
  }
}

.content > section {
  margin-bottom: 26px;
}

/* Topbar (search/filter) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
.input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 220px;
}
.select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
}
.spacer {
  flex: 1;
}
