/* Kyverum RUNT Control Center — AURA 2026
   Capa visual del acceso y shell administrativo. Mantiene intactos los
   componentes funcionales y contratos definidos en los estilos base. */

:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --surface-3: #dce8e5;
  --ink: #10231f;
  --muted: #5b6f69;
  --line: #d9e4e1;
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-d: #115e59;
  --brand-fg: #ffffff;
  --brand-tint: #e7f5f2;
  --ring: rgb(13 148 136 / .28);
  --shadow-sm: 0 1px 2px rgb(16 35 31 / .05);
  --shadow: 0 18px 50px rgb(16 35 31 / .10);
  --r: 14px;
  --r-sm: 9px;
  --ok: #047857;
  --ok-tint: #ecfdf5;
  --warn: #a84c08;
  --warn-tint: #fff8e7;
  --err: #be123c;
  --err-tint: #fff1f2;
  --sidebar-width: 264px;
  --aura-story: #0b302c;
  --aura-story-soft: #155e56;
  --aura-story-ink: #f3fffc;
  --aura-story-muted: #b7d6d0;
}

[data-theme="dark"] {
  --bg: #07110f;
  --surface: #0d1a18;
  --surface-2: #132421;
  --surface-3: #1c312d;
  --ink: #edf8f5;
  --muted: #9bb2ac;
  --line: #233a35;
  --brand: #4fd1c5;
  --brand-2: #2dd4bf;
  --brand-d: #7be3d8;
  --brand-fg: #07211e;
  --brand-tint: rgb(45 212 191 / .12);
  --ring: rgb(79 209 197 / .34);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .30);
  --shadow: 0 20px 56px rgb(0 0 0 / .35);
  --ok: #34d399;
  --ok-tint: rgb(52 211 153 / .13);
  --warn: #fbbf24;
  --warn-tint: rgb(251 191 36 / .13);
  --err: #fb7185;
  --err-tint: rgb(251 113 133 / .13);
  --aura-story: #061c19;
  --aura-story-soft: #0d403a;
}

html {
  scroll-padding-top: 92px;
  overflow-x: hidden;
}

body {
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
}

button,
.btn,
input,
select {
  min-height: 42px;
}

button,
.btn {
  border-radius: var(--r-sm);
}

button:not(.ghost):not(.icon-btn):not(.pw-toggle):not(.access-focus):not(.danger) {
  background: var(--brand);
}

button:not(.ghost):not(.icon-btn):not(.pw-toggle):not(.access-focus):not(.danger):hover {
  background: var(--brand-d);
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .16s ease;
}

.skip-link:focus {
  transform: none;
}

/* ── Acceso ─────────────────────────────────────────────────────────────── */

#login {
  min-height: 100dvh;
  background: var(--surface);
}

.access-shell {
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(440px, .92fr);
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: 0;
  animation: none;
}

.access-story {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px) clamp(34px, 6vw, 88px);
  overflow: hidden;
  color: var(--aura-story-ink);
  background:
    radial-gradient(circle at 12% 85%, rgb(45 212 191 / .20), transparent 31%),
    radial-gradient(circle at 92% 9%, rgb(94 234 212 / .12), transparent 27%),
    linear-gradient(145deg, var(--aura-story), #092824 72%, #0b3732);
}

.access-story::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgb(255 255 255 / .09) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .09) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom right, #000, transparent 72%);
}

.access-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -140px;
  bottom: -190px;
  width: 460px;
  height: 460px;
  border: 1px solid rgb(153 246 228 / .22);
  border-radius: 50%;
  box-shadow: 0 0 0 72px rgb(153 246 228 / .035), 0 0 0 144px rgb(153 246 228 / .025);
}

.access-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.access-brand .brand-mark,
.sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / .24);
  border-radius: 12px;
  background: rgb(255 255 255 / .10);
  box-shadow: none;
  color: #fff;
  font-size: 19px;
}

.access-brand strong,
.access-brand span {
  display: block;
}

.access-brand strong {
  font-size: 16px;
  letter-spacing: -.01em;
}

.access-brand span {
  margin-top: 1px;
  color: var(--aura-story-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.access-copy {
  max-width: 650px;
  margin: auto 0 44px;
  padding-top: 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.access-story .eyebrow {
  color: #75e3d7;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: currentColor;
}

.access-copy h1 {
  max-width: 740px;
  margin: 18px 0 20px;
  color: #fff;
  font-size: clamp(43px, 5vw, 72px);
  font-weight: 650;
  letter-spacing: -.052em;
  line-height: .99;
}

.access-copy h1 em {
  color: #72dacc;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.access-copy p {
  max-width: 52ch;
  margin: 0;
  color: var(--aura-story-muted);
  font-size: 16px;
  line-height: 1.7;
}

.access-capabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 42px;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 14px;
  overflow: hidden;
  background: rgb(255 255 255 / .12);
}

.access-capabilities > div {
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 17px 16px;
  background: rgb(6 28 25 / .72);
}

.access-capabilities b,
.access-capabilities small {
  display: block;
}

.access-capabilities b {
  margin-bottom: 4px;
  color: #f5fffd;
  font-size: 12px;
}

.access-capabilities small {
  color: #9fc2bb;
  font-size: 10.5px;
  line-height: 1.45;
}

.cap-icon {
  color: #5eead4;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.access-assurance {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #a9c9c3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.access-assurance span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.access-assurance i,
.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgb(52 211 153 / .12);
}

.access-focus {
  position: absolute;
  left: -9999px;
}

.access-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(38px, 6vw, 84px);
  background:
    radial-gradient(circle at 100% 0, var(--brand-tint), transparent 38%),
    var(--surface);
}

.access-theme {
  position: absolute;
  top: 24px;
  right: 24px;
}

#login-dlg[open] {
  position: relative;
  inset: auto;
  display: block;
  width: min(100%, 440px);
  max-width: 440px;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#login-dlg::backdrop {
  display: none;
}

#login .box {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#login .login-title {
  margin: 15px 0 8px;
  color: var(--ink);
  font-size: clamp(29px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1.12;
}

#login .login-sub {
  margin-bottom: 32px;
  font-size: 14px;
}

#login .field {
  margin-bottom: 18px;
}

#login label {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

#login input {
  min-height: 48px;
  padding: 12px 14px;
  border-color: color-mix(in srgb, var(--muted) 32%, var(--line));
  border-radius: 10px;
  background: var(--surface);
}

#login input:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
}

#login .pw-toggle {
  min-height: 36px;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 3px;
  box-shadow: 0 10px 24px rgb(15 118 110 / .18);
}

.access-help {
  margin: 19px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.access-foot {
  position: absolute;
  right: clamp(38px, 6vw, 84px);
  bottom: 26px;
  left: clamp(38px, 6vw, 84px);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Consola ────────────────────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--bg);
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100dvh;
  min-width: 0;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar-brand {
  padding: 0 8px 28px;
}

.sidebar-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-color: transparent;
  background: var(--brand);
  color: var(--brand-fg);
  font-size: 17px;
}

.sidebar-brand .wordmark b {
  font-size: 14px;
}

.sidebar-brand .wordmark span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar-label {
  padding: 0 11px 9px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#nav {
  display: flex;
  order: 0;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: visible;
  overflow-y: auto;
  border: 0;
}

#nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

#nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: .62;
  transform: rotate(45deg);
}

#nav a::after {
  display: none;
}

#nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

#nav a.active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 750;
}

#nav a.active::before {
  border-color: var(--brand);
  background: var(--brand);
  opacity: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 11%, transparent);
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 8px 2px;
  border-top: 1px solid var(--line);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 11px;
}

.service-state span,
.service-state b,
.service-state small {
  display: block;
}

.service-state b {
  color: var(--ink);
  font-size: 11px;
}

.service-state small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.sidebar-version {
  display: block;
  margin: 17px 0 0 18px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.app-stage {
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.15) blur(12px);
}

.app-context span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.app-context h1 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-left: auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
}

.chip {
  min-height: 42px;
  padding-left: 13px;
  background: var(--surface-2);
}

.logout-btn {
  min-height: 42px;
}

#view {
  width: 100%;
  max-width: 1440px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 38px) clamp(18px, 3.5vw, 44px) 64px;
  animation: rise .18s ease both;
}

.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  position: relative;
  min-width: 0;
  padding: 20px;
  border-radius: 13px;
  box-shadow: none;
}

.stat::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .30;
}

.stat:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.stat .k {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .075em;
}

.stat .v {
  margin-top: 13px;
  color: var(--ink);
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 650;
}

.panel {
  min-width: 0;
  padding: 22px;
  border-radius: 14px;
  box-shadow: none;
}

.panel h3 {
  font-size: 15px;
}

.bento {
  gap: 16px;
}

.toolbar {
  align-items: end;
}

.panel:has(> table),
.panel:has(> #c-body) {
  overflow-x: auto;
}

#c-body {
  min-width: 0;
  overflow-x: auto;
}

thead th {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .08em;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--brand-tint) 56%, transparent);
}

.hero {
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-tint), var(--surface) 70%);
}

dialog:not(#login-dlg) {
  max-height: calc(100dvh - 36px);
  overflow: auto;
}

/* ── Consulta y reporte en pantalla ────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.query-workbench {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 18px;
}

.query-head,
.integration-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 2px 4px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.query-head h2,
.integration-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 680;
  letter-spacing: -.035em;
}

.query-head p,
.integration-hero p {
  max-width: 68ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.query-source-list,
.result-meta,
.result-state-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.query-source-list span,
.result-meta span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.query-panel {
  margin: 0;
  padding: 24px;
  border-top: 3px solid var(--brand);
}

.query-panel-title p {
  margin: 4px 0 0;
}

.query-context {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(200px, .85fr);
  max-width: 720px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.query-context > div {
  min-width: 0 !important;
}

.query-submit {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.result-stage {
  position: static !important;
  min-height: 250px;
  margin: 0 !important;
  padding: 0;
  overflow: clip;
}

.result-stage:has(.result-empty) {
  padding: 22px;
}

.result-stage .result-empty {
  min-height: 210px;
}

.result {
  min-width: 0;
}

.result-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 54%, var(--surface));
}

.result-toolbar h2 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -.02em;
}

.result-toolbar-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 12px;
}

.result-actions {
  margin: 0;
}

.result > .hero,
.result > .result-section,
.result > .result-disclosure,
.result > .empty-sections,
.result > details:not(.result-disclosure) {
  margin-right: 24px;
  margin-left: 24px;
}

.result > .hero {
  margin-top: 24px;
}

.result-section {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-field {
  min-width: 0;
  padding: 12px;
  border-radius: 9px;
  background: var(--surface-2);
}

.summary-field > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.summary-field > b {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.technical-detail {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.technical-detail > summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.technical-detail-body {
  margin-top: 10px;
}

.lic-card {
  align-items: flex-start;
}

.lic-cat {
  min-width: 72px;
  flex-direction: column;
  gap: 2px;
}

.lic-cat small {
  color: color-mix(in srgb, var(--brand) 72%, var(--muted));
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.license-validity {
  color: var(--muted);
  font-size: 12px;
}

.clean-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--ok) 36%, var(--line));
  border-radius: 10px;
  color: var(--ok);
  background: var(--ok-tint);
}

.clean-state > span {
  font-size: 22px;
  font-weight: 800;
}

.clean-state p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-disclosure {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.result-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 16px;
  padding: 14px 17px;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.result-disclosure > summary::-webkit-details-marker {
  display: none;
}

.result-disclosure > summary small {
  color: var(--brand);
  font-size: 11px;
}

.result-disclosure-body {
  padding: 2px 17px 18px;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.result-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.record-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.record-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.record-card h4 {
  margin: 10px 0 0;
}

.section-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* ── Integración: onboarding técnico ───────────────────────────────────── */

.integration-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.integration-hero,
.quickstart,
.integration-resources,
.integration-endpoints {
  grid-column: 1 / -1;
}

.integration-hero {
  margin-bottom: 4px;
}

.integration-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.integration-hero .btn,
.quickstart .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.quickstart {
  order: 1;
  position: relative;
  padding: 28px;
  overflow: hidden;
  border-top: 3px solid var(--brand);
}

.quickstart .kit-ic {
  position: absolute;
  top: 24px;
  right: 26px;
  opacity: .14;
}

.quickstart > p {
  max-width: 72ch;
  margin: 7px 0 18px !important;
  font-size: 14px;
  line-height: 1.65;
}

.quickstart .kit-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quickstart .kit-meta > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.quickstart .kit-meta code {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.security-note,
.integration-caveat {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--warn);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: var(--warn-tint);
  font-size: 12px;
  line-height: 1.55;
}

.integration-sdk {
  order: 2;
}

.integration-curl {
  order: 3;
}

.integration-resources {
  order: 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.integration-resources a {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.integration-resources a:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.integration-resources span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.integration-scopes {
  order: 5;
}

.integration-endpoints {
  order: 6;
}

.code-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.code-card-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.code-card .codeblock {
  max-width: 100%;
  max-height: 330px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.usecase-list {
  display: grid;
  gap: 8px;
}

.usecase-list > details {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.usecase-list > details > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  list-style: none;
  font-size: 13px;
  font-weight: 700;
}

.usecase-list > details > summary::-webkit-details-marker {
  display: none;
}

.usecase-list > details[open] > summary {
  color: var(--brand);
  background: var(--brand-tint);
}

.usecase-list .code-card {
  border-width: 1px 0 0;
  border-radius: 0;
}

.integration-scopes,
.integration-endpoints,
.integration-sdk,
.integration-curl {
  margin: 0;
  min-width: 0;
}

.integration-scopes table,
.integration-endpoints table {
  min-width: 680px;
}

@media (max-width: 800px) {
  .query-head,
  .integration-hero,
  .result-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .query-context,
  .quickstart .kit-meta,
  .summary-grid,
  .record-grid,
  .integration-shell,
  .integration-resources {
    grid-template-columns: minmax(0, 1fr);
  }

  .integration-sdk,
  .integration-curl {
    grid-column: 1 / -1;
  }

  .result-toolbar-side {
    width: 100%;
    align-items: flex-start;
  }

  .result > .hero,
  .result > .result-section,
  .result > .result-disclosure,
  .result > .empty-sections,
  .result > details:not(.result-disclosure) {
    margin-right: 16px;
    margin-left: 16px;
  }
}

@media (max-width: 520px) {
  .query-panel,
  .result-toolbar,
  .quickstart {
    padding: 18px;
  }

  .query-source-list {
    display: none;
  }

  .query-submit,
  .result-actions,
  .integration-hero-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .query-submit button,
  .result-actions button,
  .integration-hero-actions .btn {
    width: 100%;
  }

  .lic-card {
    flex-direction: column;
  }

  .lic-cat {
    width: 100%;
  }
}

/* ── Adaptación ─────────────────────────────────────────────────────────── */

@media (max-width: 1120px) {
  :root { --sidebar-width: 224px; }

  .access-shell {
    grid-template-columns: minmax(400px, 1fr) minmax(390px, .86fr);
  }

  .access-story {
    padding-right: 44px;
    padding-left: 44px;
  }

  .access-capabilities {
    grid-template-columns: 1fr;
  }

  .access-capabilities > div {
    padding: 12px 14px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  html { scroll-padding-top: 148px; }

  .access-shell {
    display: block;
  }

  .access-story {
    min-height: auto;
    padding: 26px 24px 30px;
  }

  .access-copy {
    margin: 52px 0 0;
    padding: 0;
  }

  .access-copy h1 {
    margin: 13px 0 14px;
    font-size: clamp(36px, 9vw, 50px);
  }

  .access-copy p {
    font-size: 14px;
  }

  .access-capabilities,
  .access-assurance {
    display: none;
  }

  .access-panel {
    min-height: 610px;
    padding: 62px 24px 76px;
  }

  .access-theme {
    top: 14px;
    right: 14px;
  }

  .access-foot {
    right: 24px;
    bottom: 18px;
    left: 24px;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    width: 100%;
    height: auto;
    padding: 12px 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    padding: 0 4px 10px;
  }

  .sidebar-brand .brand-mark {
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 9px;
    font-size: 15px;
  }

  .sidebar-label,
  .sidebar-foot {
    display: none;
  }

  #nav {
    flex-direction: row;
    gap: 3px;
    margin: 0 -14px;
    padding: 0 14px 9px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  #nav::-webkit-scrollbar {
    display: none;
  }

  #nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 11px;
    font-size: 11.5px;
  }

  #nav a::before {
    display: none;
  }

  .app-header {
    top: 101px;
    min-height: 62px;
    padding: 8px 16px;
  }

  .app-context span {
    display: none;
  }

  .app-context h1 {
    font-size: 16px;
  }

  .chip-mail {
    display: none;
  }

  .chip {
    min-height: 38px;
    padding: 4px;
  }

  .icon-btn,
  .logout-btn {
    min-height: 38px;
  }

  #view {
    padding: 22px 16px 52px;
  }

  table {
    min-width: 620px;
  }
}

@media (max-width: 520px) {
  .access-story {
    padding: 22px 18px 25px;
  }

  .access-copy {
    margin-top: 42px;
  }

  .access-copy h1 br {
    display: none;
  }

  .access-panel {
    min-height: 590px;
    padding: 58px 18px 72px;
  }

  #login .login-title {
    font-size: 29px;
  }

  .access-foot {
    right: 18px;
    left: 18px;
  }

  .app-header {
    gap: 10px;
    padding-right: 12px;
    padding-left: 14px;
  }

  .app-actions {
    gap: 5px;
  }

  .app-actions .chip {
    display: none;
  }

  button.logout-btn {
    width: 38px;
    min-width: 38px;
    flex: 0 0 38px;
    overflow: hidden;
    padding: 0;
    color: transparent;
    font-size: 0;
  }

  button.logout-btn::before {
    content: "↗";
    color: var(--ink);
    font-size: 16px;
    transform: rotate(45deg);
  }

  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .stat {
    padding: 15px;
  }

  .stat .v {
    font-size: 25px;
  }

  .panel {
    padding: 16px;
  }

  .row > * {
    min-width: 0;
    flex: 1 1 100%;
  }
}

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