
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #07111f;
  --navy-soft: #0d1a2d;
  --blue: #2866f6;
  --blue-dark: #1d4ed8;
  --line: #dfe6f1;
  --muted: #68758a;
  --card: #ffffff;
  --success: #087a55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .68; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 76px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, #3478ff, #1448cc); box-shadow: 0 10px 25px rgba(28,92,234,.32); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: #aebbd0; font-size: 11px; }
.api-status { display: inline-flex; align-items: center; gap: 8px; color: #c8d4e5; font-size: 12px; }
.api-status > span { width: 8px; height: 8px; border-radius: 50%; background: #39d98a; box-shadow: 0 0 0 5px rgba(57,217,138,.12); }

main { flex: 1; }
.hero {
  position: relative;
  padding: clamp(62px, 8vw, 104px) clamp(20px, 5vw, 72px) 128px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 10%, rgba(49,104,246,.22), transparent 35%),
    linear-gradient(155deg, #07111f 0%, #0b1729 68%, #0b1d37 100%);
}
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-glow { position: absolute; inset: auto -90px -180px auto; width: 520px; height: 520px; border-radius: 50%; background: rgba(42,101,246,.12); filter: blur(60px); }
.hero-copy { position: relative; width: min(790px, 100%); margin: 0 auto; text-align: center; }
.eyebrow { display: inline-block; color: #4e7ffd; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 760px; margin: 14px auto 18px; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.hero-copy p { max-width: 680px; margin: 0 auto; color: #b8c5d8; font-size: clamp(15px, 2vw, 18px); line-height: 1.7; }

.search-card {
  position: relative;
  z-index: 2;
  width: min(850px, 100%);
  margin: 42px auto -198px;
  padding: clamp(20px, 4vw, 30px);
  color: #172033;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
}
.search-card label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.input-wrap { min-width: 0; position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 16px; color: #6b7890; pointer-events: none; }
.input-wrap input { width: 100%; min-height: 54px; padding: 0 16px 0 49px; border: 1px solid #cfd8e6; border-radius: 13px; outline: none; color: #132036; background: #fff; transition: .2s ease; }
.input-wrap input:focus { border-color: #4278f6; box-shadow: 0 0 0 4px rgba(40,102,246,.12); }
.input-wrap input::placeholder { color: #9aa6b8; }
.primary-button, .secondary-button, .icon-button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button { min-height: 54px; padding: 0 22px; color: #fff; background: var(--blue); border-radius: 13px; font-weight: 750; box-shadow: 0 10px 22px rgba(40,102,246,.24); transition: .18s ease; }
.primary-button:hover:not(:disabled) { background: var(--blue-dark); transform: translateY(-1px); }
.secondary-button { min-height: 40px; padding: 0 13px; color: #33415a; background: #fff; border: 1px solid #d8e0ec; border-radius: 10px; font-size: 12px; font-weight: 700; transition: .18s ease; }
.secondary-button:hover { color: #1748bc; border-color: #9db7fa; background: #f7f9ff; }
.icon-button { width: 40px; height: 40px; color: #66758d; background: transparent; border-radius: 10px; }
.icon-button:hover { background: #eef2f7; color: #132036; }
.text-button { padding: 0; color: #2b62db; background: none; border: 0; font-size: 12px; font-weight: 700; }
.search-footer { margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; color: #7a879b; font-size: 11px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.content-area { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 116px 0 70px; }
.error-banner { margin-bottom: 22px; padding: 17px 18px; display: flex; align-items: flex-start; gap: 12px; color: #8b2331; background: #fff3f4; border: 1px solid #ffd0d6; border-radius: 14px; }
.error-banner svg { flex: 0 0 auto; margin-top: 1px; }
.error-banner strong, .error-banner span { display: block; }
.error-banner strong { font-size: 13px; }
.error-banner span { margin-top: 3px; font-size: 12px; color: #9a4a55; }
.empty-state { padding: 72px 20px; text-align: center; color: #65728a; background: #fff; border: 1px dashed #cfdae9; border-radius: 20px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; color: #376de7; background: #edf3ff; border-radius: 18px; }
.empty-state h2 { margin: 0 0 8px; color: #172033; font-size: 22px; }
.empty-state p { max-width: 520px; margin: 0 auto; font-size: 13px; line-height: 1.65; }

.loading-layout { display: grid; gap: 18px; }
.skeleton { min-height: 150px; border-radius: 18px; background: linear-gradient(90deg,#eaf0f7 25%,#f6f8fb 50%,#eaf0f7 75%); background-size: 200% 100%; animation: shimmer 1.35s infinite; }
.skeleton-summary { min-height: 360px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.company-card, .data-section { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 12px 34px rgba(26,41,66,.06); }
.company-card { overflow: hidden; }
.company-heading { padding: 26px 28px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid #e8edf4; }
.company-avatar { width: 56px; height: 56px; display: grid; place-items: center; color: #2866f6; background: #edf3ff; border-radius: 17px; }
.company-title h2 { margin: 5px 0 4px; color: #142036; font-size: clamp(20px, 3vw, 27px); line-height: 1.15; letter-spacing: -.02em; }
.company-title p { margin: 0; color: #7a879b; font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-badge > span { width: 7px; height: 7px; border-radius: 50%; }
.status-active { color: #087a55; background: #e8faf2; }
.status-active > span { background: #10a873; }
.status-neutral { color: #8a6113; background: #fff5d9; }
.status-neutral > span { background: #d79a24; }
.summary-grid { padding: 26px 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.summary-grid article { min-width: 0; padding: 16px; background: #f8fafc; border: 1px solid #e8edf4; border-radius: 14px; }
.summary-grid article span, .section-label { display: block; margin-bottom: 7px; color: #7c899c; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.summary-grid article strong { display: block; color: #26344b; font-size: 13px; line-height: 1.55; }
.summary-wide { grid-column: span 2; }
.break-text { overflow-wrap: anywhere; }
.registrations-block { padding: 0 28px 26px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 9px; }
.data-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; color: #47546a; background: #f7f9fc; border: 1px solid #dfe6ef; border-radius: 9px; font-size: 11px; }
.data-chip strong { color: #275dd7; }
.data-chip svg { color: #11966b; }
.empty-value { color: #99a3b2; font-style: italic; font-size: 12px; }

.data-section { margin-top: 24px; padding: 28px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { margin: 5px 0 7px; color: #172033; font-size: 23px; letter-spacing: -.02em; }
.section-heading p { max-width: 650px; margin: 0; color: #78869a; font-size: 12px; line-height: 1.6; }
.section-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.field-counter { min-height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; color: #486079; background: #f3f6fa; border: 1px solid #e0e7f0; border-radius: 10px; font-size: 11px; font-weight: 700; }
.dynamic-data-card { padding: 16px; background: #f7f9fc; border: 1px solid #e4eaf2; border-radius: 15px; }
.json-object, .json-array { display: grid; gap: 9px; }
.json-field { min-width: 0; padding: 12px 13px; display: grid; grid-template-columns: minmax(140px, .8fr) minmax(0, 1.6fr); gap: 14px; align-items: start; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
.json-field-label { color: #718096; font-size: 11px; font-weight: 700; }
.primitive-value { min-width: 0; color: #25334a; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.primitive-boolean { color: #0b7f5c; font-weight: 750; }
.primitive-number { color: #7543a8; }
.json-group { background: #fff; border: 1px solid #dfe6ef; border-radius: 11px; overflow: hidden; }
.json-group > summary { padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #35435a; font-size: 12px; font-weight: 750; cursor: pointer; list-style: none; }
.json-group > summary::-webkit-details-marker { display: none; }
.json-group > summary::before { content: '›'; color: #4772d6; font-size: 18px; line-height: .8; transform: rotate(0deg); transition: .16s ease; }
.json-group[open] > summary::before { transform: rotate(90deg); }
.json-group > summary > span:first-child { flex: 1; }
.json-group[open] > summary { border-bottom: 1px solid #e5eaf1; background: #fbfcfe; }
.json-type-label { color: #8793a5; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.json-group-content { padding: 11px; }
.json-array-item { border-color: #e5eaf2; }

.drawer-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; justify-content: flex-end; background: rgba(3,10,20,.62); backdrop-filter: blur(3px); }
.json-drawer { width: min(720px, 94vw); height: 100%; padding: 24px; display: flex; flex-direction: column; background: #fff; box-shadow: -24px 0 70px rgba(0,0,0,.25); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: .5; } }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.drawer-header h2 { margin: 5px 0 0; font-size: 23px; }
.drawer-actions { margin: 18px 0 12px; }
.raw-json { flex: 1; min-height: 0; margin: 0; padding: 18px; overflow: auto; color: #dbe7fb; background: #091322; border-radius: 14px; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; padding: 12px 15px; display: flex; align-items: center; gap: 8px; color: #fff; background: #102039; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; box-shadow: 0 12px 32px rgba(0,0,0,.24); font-size: 12px; }
.toast svg { color: #4ee4a6; }

footer { padding: 24px clamp(20px, 5vw, 72px); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: #8290a4; background: #fff; border-top: 1px solid #e1e7ef; font-size: 10px; }
footer a { color: var(--blue-dark); text-decoration: none; font-weight: 600; }
footer a:hover, footer a:focus-visible { text-decoration: underline; }

@media (max-width: 860px) {
  .hero { padding-bottom: 118px; }
  .search-card { margin-bottom: -188px; }
  .content-area { padding-top: 106px; }
  .summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .summary-wide { grid-column: span 2; }
  .section-heading { flex-direction: column; }
  .section-tools { justify-content: flex-start; }
  .skeleton-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 68px; padding-inline: 17px; }
  .api-status { display: none; }
  .hero { padding: 50px 17px 115px; }
  .hero h1 { font-size: 36px; }
  .search-card { margin-top: 30px; padding: 18px; border-radius: 17px; }
  .search-row { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .search-footer { align-items: flex-start; }
  .content-area { width: calc(100% - 28px); padding-top: 102px; }
  .company-heading { padding: 21px; grid-template-columns: auto minmax(0,1fr); }
  .status-badge { grid-column: 1 / -1; justify-self: flex-start; }
  .summary-grid { padding: 20px; grid-template-columns: 1fr; }
  .summary-wide { grid-column: auto; }
  .registrations-block { padding: 0 20px 20px; }
  .data-section { padding: 20px; }
  .section-tools { width: 100%; }
  .field-counter { width: 100%; }
  .secondary-button { flex: 1; }
  .json-field { grid-template-columns: 1fr; gap: 5px; }
  footer { flex-direction: column; }
}

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

.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-24 { width: 24px; height: 24px; }
.icon-30 { width: 30px; height: 30px; }
.drawer-open { overflow: hidden; }
.clipboard-fallback { position: fixed; left: -9999px; top: 0; opacity: 0; }
