/* =====================================================================
   design.css — Stable Version with aligned Questionary button
   + Inline popup for Button 5 (Option A)
   ===================================================================== */

/* Adjustable: Set panel width to match main content images */
:root{
  --panel-fit-width: 760px;
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; max-width: 100%;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background: #232c36 !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ---------- Superscription (blue header) ---------- */
#hero {
  background: #123a70;
  color: #fff;
  text-align: center;
  padding: 18px 12px;
  border-bottom: 2px solid #a51616;
}
#hero .hero-line{
  margin: 8px auto;
  max-width: 1100px;
  font-weight: 700;
  line-height: 1.35;
  font-size: clamp(16px, 3.6vw, 22px);
}

/* ---------- Outer Frame (red) ---------- */
.wrap-framed{
  display: grid;
  grid-template-columns: 260px minmax(0,1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 16px auto;
  padding: 14px;
  border: 2px solid #a51616;
  background: #2a323a;
}

/* ---------- LEFT MENU COLUMN ---------- */
#leftarea{
  background: #232c36;
  border: 2px solid #a51616;
  padding: 12px;
  position: relative;
}

#leftarea hr{
  height: 1px; border:0; margin:16px 0;
  background:#bfc7d1; opacity:.7;
}

#Adress{ color:#e7edf6; font-size:14px; line-height:1.35; }

.menu-note{ color:#cfd7e1; font-size:12px; margin:8px 0 6px; }

/* ---------- MENU BUTTON ROWS ---------- */
#mainmenu .menu-row,
.menu-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

/* ALL CHECKBOXES (including Questionary checkbox) */
#mainmenu input[type="checkbox"],
#qa_check {
  width:18px;
  height:18px;
  margin:0;
}

/* ALL BLUE MENU BUTTONS (including Questionary button) */
#mainmenu input[type="button"],
.menu-row input[type="button"] {
  cursor:pointer;
  font-size:12px;
  line-height:1.2;
  color:#fff;
  background:#0b2f84;
  border:2px solid #85a7ff;
  border-radius:8px;
  padding:6px 8px;
  text-align:left;
}
#mainmenu input[type="button"]:hover,
.menu-row input[type="button"]:hover {
  filter:brightness(1.15);
}

/* Counter */
.counter{ color:#cfd7e1; font-size:12px; margin-top:8px; }
.counter #count{ color:#fff; font-weight:bold; }

/* ---------- RIGHT COLUMN ---------- */
#content.content{
  background:#2a323a;
  padding:12px;
}

/* ---------- RIGHT PANELS ---------- */
.panel-red{
  width:100%;
  max-width:var(--panel-fit-width);
  border:2px solid #a51616;
  border-radius:2px;
  background:#2a323a;
  padding:10px;
}
.panel-red + .panel-red{ margin-top:12px; }

.panel-title{ margin:0 0 8px 0; font-weight:700; line-height:1.3; }
.panel-title.yellow{ color:#ffd400; }
.panel-title.white{ color:#ffffff; }

.default-figure{ margin:10px 0 12px; }
.default-figure img{
  display:block;
  width:100%;
  height:auto;
  border:1px solid #3a434e;
}

.legacy-text p{ margin:6px 0; }
.copy-line{ margin-top:8px; font-size:12px; color:#cfd7e1; }

/* ---------- Mobile ---------- */
@media(max-width:900px){
  .wrap-framed{ grid-template-columns:1fr; }
  .panel-red{ max-width:100%; }
}
@media(max-width:380px){
  .wrap-framed{ padding:10px; }
}

/* === Match Questionary checkbox to system-gray === */
#qa_check{
  width:18px;
  height:18px;
  margin:0;
  -webkit-appearance: none;
          appearance: none;
  display: inline-grid;
  place-content: center;
  background: #bdbdbd;
  border: 1px solid #6a6a6a;
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
}
#qa_check::before{
  content:"";
  width:10px; height:10px;
  transform: scale(0);
  transition: transform 120ms ease-in-out;
  box-shadow: inset 1em 1em #0b2f84;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
#qa_check:checked::before{ transform: scale(1); }
#qa_check:focus{
  outline: 2px solid #dadada;
  outline-offset: 2px;
}

/* ---------- Scroll-frame helpers kept ---------- */
#content .panel-red .scroll-frame .dash-list p{
  font-size: 12px !important;
  line-height: 1.35;
}
.scroll-frame img { display:block; margin-left:0; margin-right:auto; }
.scroll-frame { text-align:left; }
.scroll-frame { direction: rtl; text-align:left !important; }
.scroll-frame > *{ direction: ltr !important; }
.scroll-frame img, .scroll-frame figure {
  display:block !important; float:none !important;
  margin-left:0 !important; margin-right:auto !important;
  max-width:100% !important; height:auto !important;
}
.scroll-frame figure, .scroll-frame .default-figure { margin:0 0 12px 0 !important; text-align:left !important; }
.scroll-frame::after { content:""; display:block; clear:both; }

/* Desktop fill height for NHTSA scroll */
@media (min-width: 901px) {
  #content.content .panel-red .scroll-frame {
    height: calc(100vh - 100px) !important;
    max-height: calc(100vh - 100px) !important;
    border: 2px solid #a51616 !important;
    border-radius: 2px !important;
  }
}
@media (max-width: 900px) {
  #content.content .panel-red .scroll-frame {
    height: 50vh !important;
    max-height: 50vh !important;
  }
}

/* ============================================================
   BUTTON 5 — Inline popup INSIDE Panel 2 (Option A)
   ============================================================ */

/* Grid for the 8 part-buttons (fits inside red panel) */
.wp-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 8px;
  margin: 10px 0 12px;
}
@media (max-width: 700px){
  .wp-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 420px){
  .wp-grid{ grid-template-columns: 1fr; }
}

/* Yellow-labelled buttons (match your style) */
.wp-btn{
  display: inline-block;
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.2;
  color: #ffd400;               /* yellow text */
  background: #0b2f84;          /* same button blue */
  border: 2px solid #85a7ff;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.wp-btn:hover{ filter: brightness(1.12); }

/* Inline popup container (inside panel) */
.wp-inline{
  margin-top: 10px;
}
.wp-inline.hidden{ display: none; }



/* === Button 5 inline popup: use full panel width on desktop === */
@media (min-width: 901px){
  /* Ensure the container spans the panel */
  .panel-red .wp-inline{
    width: 100%;
  }
  /* Make the popup card stretch edge-to-edge inside the red frame */
  .panel-red .wp-inline .wp-card{
    display: block;
    width: 100%;
    max-width: none;   /* in case a max-width is inherited anywhere */
    margin-left: 0;
    margin-right: 0;
  }
}




/* The card itself (red-framed box inside the panel) */
.wp-card{
  border: 2px solid #a51616;
  border-radius: 4px;
  background: #2a323a;
  color: #fff;
  padding: 12px;
}
.wp-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.wp-card h2{
  margin: 0;
  color: #ffd400;
  font-size: 16px;
  font-weight: 700;
}
.wp-body p{ margin: 6px 0; font-size: 14px; line-height: 1.35; }

/* Close “X” button (small, on the right) */
.wp-close{
  border: 2px solid #85a7ff;
  background: #0b2f84;
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.wp-close:hover{ filter: brightness(1.12); }



/* === Force Button 5 inline popup to full panel width on desktop === */
@media (min-width: 901px){
  #content.content .panel-red .wp-inline{
    width: 100% !important;
  }
  #content.content .panel-red .wp-inline .wp-card{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* === Highlight active Work-Product button (Button 5 area only) === */
.wp-btn.active{
  background: #a51616 !important; /* red */
  color: #ffffff !important;      /* white */
  border-color: #ffffff !important;
}

/* ========== ACTIVE STATE for ISO 26262 part buttons (Button 5 grid) ========== */
.wp-grid .wp-btn.active,
.wp-grid .wp-btn[aria-pressed="true"]{
  background: #a51616 !important;   /* red */
  color: #ffffff !important;         /* white text */
  border-color: #a51616 !important;
}

/* keep the same look on hover while active */
.wp-grid .wp-btn.active:hover {
  filter: none !important;
}


/* Active state for Work-Product buttons (red bg, white text) */
.wp-grid .wp-btn.active,
.wp-grid .wp-btn[aria-pressed="true"]{
  background: #a51616 !important;
  color: #ffffff !important;
  border-color: #a51616 !important;
}
.wp-grid .wp-btn.active:hover{ filter: none !important; }

/* Inline popup container (already styled); ensure full width on desktop */
@media (min-width: 901px){
  .panel-red .wp-inline{ width:100%; }
  .panel-red .wp-inline .wp-card{
    width:100%; max-width:none; box-sizing:border-box;
    margin-left:0; margin-right:0;
  }

}
.scrollable-table table td,
.scrollable-table table th {
    vertical-align: top !important;
}
