/* =========================================================
   Devices v1.2 — Field Lookup Upgrade
========================================================= */
.devices-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 22px 70px;
  color: #111827;
}

.devices-page a { text-decoration: none; }
.devices-page a:hover { text-decoration: none; }

.devices-hero-panel,
.device-detail-hero,
.model-hero-v12 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  padding: 30px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #eef4fb);
  border: 1px solid #dbe3ee;
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
  margin-bottom: 24px;
}

.devices-hero-compact { grid-template-columns: 1fr; }

.devices-kicker {
  margin: 0 0 8px;
  color: #c92c2c;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.devices-page h1,
.devices-page h2,
.devices-page h3,
.devices-page p,
.devices-page li,
.devices-page span,
.devices-page td,
.devices-page th,
.devices-page summary {
  color: #111827;
}

.devices-page h1 {
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 4vw, 4.2rem);
  line-height: 1.05;
  color: #0b1f44;
}

.devices-lede,
.device-detail-hero p,
.model-hero-v12 p {
  margin: 0;
  max-width: 820px;
  color: #334155;
  font-size: 1.08rem;
  line-height: 1.65;
}

.devices-hero-card {
  border-radius: 18px;
  background: #0b1f44;
  color: #fff;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 5px;
}
.devices-hero-card strong { color: #fff; font-size: 2.4rem; line-height: 1; }
.devices-hero-card span { color: #cfe8ff; font-weight: 800; }
.devices-hero-card p { color: rgba(255,255,255,.78); margin: 12px 0 0; line-height: 1.5; }

.devices-search-bar {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  max-width: 860px;
}
.devices-search-bar input,
.devices-model-browser input,
.models-head-row input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 13px 16px;
  color: #111827;
  background: #fff;
}
.devices-search-bar button,
.devices-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: #c92c2c;
  color: #fff !important;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.devices-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}
.devices-quick-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #0b1f44 !important;
  border: 1px solid #dbe3ee;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}
.devices-quick-actions a:hover { border-color: #c92c2c; color: #c92c2c !important; }

.devices-section {
  margin: 34px 0;
}
.devices-section-head {
  margin-bottom: 18px;
}
.devices-section-head h2 {
  margin: 0 0 6px;
  color: #fff;
  font-size: clamp(1.7rem, 2.2vw, 2.6rem);
}
.devices-section-head p {
  margin: 0;
  color: rgba(255,255,255,.78);
}

.device-grid-v12 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.device-card-v12 {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 160px;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.device-card-v12:hover {
  transform: translateY(-3px);
  border-color: #c92c2c;
  box-shadow: 0 18px 42px rgba(0,0,0,.16);
}
.device-card-v12 .icon-figure {
  margin: 0;
  width: 86px;
  height: 86px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #eef4fb;
  border: 1px solid #dbe3ee;
}
.device-card-v12 .icon-figure img { max-width: 58px; max-height: 58px; }
.device-card-v12 h3 { margin: 0 0 8px; color: #0b1f44; font-size: 1.2rem; }
.device-card-v12 p { margin: 0; color: #475569; line-height: 1.45; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 13px 0 0; list-style: none; }
.badges li { color: #0b1f44; background: #eef4fb; border: 1px solid #dbe3ee; border-radius: 999px; padding: 5px 9px; font-size: .78rem; font-weight: 800; }

.devices-model-browser,
.devices-empty-state,
.device-pane-v12,
.model-pane-v12,
.model-field-summary > div {
  background: #ffffff;
  color: #111827;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.model-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.model-result-card {
  display: block;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}
.model-result-card:hover { border-color: #c92c2c; background: #fff; }
.model-result-id { display: block; color: #0b1f44 !important; font-weight: 900; font-size: 1.05rem; }
.model-result-meta { display: block; color: #c92c2c !important; font-weight: 800; font-size: .82rem; margin-top: 4px; }
.model-result-desc { display: block; color: #475569 !important; line-height: 1.45; margin-top: 8px; }
.devices-small-note { margin: 12px 0 0; color: #64748b !important; font-size: .9rem; }

.devices-crumbs { margin: 0 0 18px; color: rgba(255,255,255,.78); }
.devices-crumbs a { color: #fff; font-weight: 900; }
.device-detail-icon,
.model-figure-v12 {
  margin: 0;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dbe3ee;
  display: grid;
  place-items: center;
  padding: 18px;
}
.device-detail-icon img { max-width: 145px; max-height: 145px; }
.model-figure-v12 img { max-width: 190px; max-height: 190px; }
.model-figure-v12 figcaption { margin-top: 10px; color: #475569; font-weight: 800; }
.model-figure-v12 figcaption a { color: #c92c2c; }
.devices-stat-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.devices-stat-row span { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: #eef4fb; border: 1px solid #dbe3ee; color: #0b1f44; font-weight: 800; }

.device-layout-v12,
.model-layout-v12 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 22px;
  align-items: start;
}
.code-block {
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  margin: 12px 0;
  overflow: hidden;
  background: #f8fafc;
}
.code-block summary {
  padding: 13px 15px;
  font-weight: 900;
  color: #0b1f44;
  cursor: pointer;
}
.code-body { padding: 0 15px 15px; color: #334155; }
.code-body li, .refs li { color: #334155; line-height: 1.55; }
.refs { margin-top: 12px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; }

.models-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.models-head-row h2 { margin: 0; }
.models-head-row input { max-width: 230px; border-radius: 12px; padding: 9px 11px; }
.mfr-v12 { margin: 18px 0 0; }
.mfr-v12 h3 { color: #0b1f44; margin: 0 0 10px; }
.model-list-v12 { display: grid; gap: 9px; }
.model-pill-v12 { display: block; padding: 12px; border-radius: 13px; border: 1px solid #dbe3ee; background: #f8fafc; }
.model-pill-v12:hover { border-color: #c92c2c; background: #fff; }
.model-pill-v12 strong { display: block; color: #0b1f44; }
.model-pill-v12 span { display: block; color: #475569; margin-top: 4px; font-size: .92rem; line-height: 1.4; }

.model-field-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.model-field-summary h2 { margin: 0 0 8px; color: #0b1f44; font-size: 1rem; }
.model-field-summary p { color: #475569; line-height: 1.5; margin: 0; }
.model-tags-v12 { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #eef4fb; border: 1px solid #dbe3ee; color: #0b1f44 !important; font-weight: 800; font-size: .82rem; }
.tag-status { background: #fff7ed; border-color: #fed7aa; color: #9a3412 !important; }
.terminals-v12 { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 14px; }
.terminals-v12 th { background: #0b1f44; color: #fff; text-align: left; padding: 12px; }
.terminals-v12 td { padding: 12px; border-top: 1px solid #e2e8f0; color: #334155; }
.diagram-v12 { margin-top: 18px; border: 1px solid #dbe3ee; border-radius: 14px; padding: 14px; background: #f8fafc; }
.model-side-v12 ul { margin: 0 0 18px; padding-left: 20px; }
.model-side-v12 li { color: #334155; line-height: 1.55; }
.related-links-v12 a { color: #c92c2c; font-weight: 900; }
.devices-muted { color: #64748b !important; }

@media (max-width: 1050px) {
  .devices-hero-panel,
  .device-detail-hero,
  .model-hero-v12,
  .device-layout-v12,
  .model-layout-v12 { grid-template-columns: 1fr; }
  .device-grid-v12,
  .model-result-grid,
  .model-field-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .devices-page { padding: 24px 14px 50px; }
  .devices-hero-panel,
  .device-detail-hero,
  .model-hero-v12 { padding: 20px; }
  .devices-search-bar { flex-direction: column; }
  .device-grid-v12,
  .model-result-grid,
  .model-field-summary { grid-template-columns: 1fr; }
  .device-card-v12 { grid-template-columns: 1fr; text-align: center; }
  .device-card-v12 .icon-figure { margin: 0 auto; }
  .models-head-row { align-items: stretch; flex-direction: column; }
  .models-head-row input { max-width: none; }
}
