:root{
  --sim-blue:#1A4FA3;
  --sim-blue-dark:#123A7A;
  --sim-bg:#f5f7fb;
  --sim-border:#dfe5ef;
  --sim-text:#1b1f24;
  --sim-muted:#5b6470;
  --sim-green:#1d6b34;
  --sim-green-bg:#eaf8ef;
  --sim-yellow:#8a5a00;
  --sim-yellow-bg:#fff6df;
  --sim-red:#9c1d1d;
  --sim-red-bg:#fdeaea;
  --sim-card:#ffffff;
}

*{box-sizing:border-box;}

.sim-page{
  background:linear-gradient(180deg,#ffffff 0%,#f7f9fc 100%);
  color:var(--sim-text);
  overflow-x:hidden;
}

.sim-page .page-container{
  width:min(100%,1180px);
  margin:0 auto;
  padding-left:18px;
  padding-right:18px;
}

.sim-hero{
  padding:72px 0 40px;
  text-align:center;
  background:linear-gradient(180deg,#ffffff 0%,#f3f6fb 100%);
}

.sim-kicker{
  margin:0 0 10px;
  color:var(--sim-blue);
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  font-size:.95rem;
}

.sim-hero h1{
  margin:0 0 12px;
  font-size:clamp(2rem,4vw,3.3rem);
  line-height:1.15;
  font-weight:700;
}

.sim-subtitle{
  max-width:900px;
  margin:0 auto 22px;
  font-size:1.12rem;
  line-height:1.65;
  color:#2c3440;
}

.sim-note{
  max-width:920px;
  margin:0 auto;
  background:#eef4ff;
  border:1px solid #d8e4ff;
  color:#20314f;
  border-radius:12px;
  padding:16px 18px;
  line-height:1.6;
}

.sim-section{
  padding:28px 0;
}

.sim-section-head{
  margin-bottom:18px;
}

.sim-section-head h2{
  margin:0 0 8px;
  font-size:1.8rem;
}

.sim-section-head p{
  margin:0;
  color:var(--sim-muted);
  line-height:1.65;
}

.sim-card{
  background:var(--sim-card);
  border:1px solid var(--sim-border);
  border-radius:14px;
  padding:20px;
  box-shadow:0 4px 16px rgba(0,0,0,.04);
  min-width:0;
}

.sim-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:10px;
}

.sim-lead{
  margin:0 0 16px;
  line-height:1.6;
  color:#29313a;
}

.sim-grid{
  display:grid;
  gap:18px;
}

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

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

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

.sim-grid-tight{
  gap:12px 18px;
}

.sim-card h3,
.sim-section-head h2,
.sim-prose h2{
  overflow-wrap:anywhere;
}

.sim-lead,
.sim-muted,
.sim-prose p,
.sim-section-head p,
.sim-note{
  overflow-wrap:anywhere;
}

.sim-field label,
.sim-card label{
  display:block;
  margin-bottom:8px;
  font-weight:600;
}

.sim-field input,
.sim-field select,
.sim-card select{
  width:100%;
  height:46px;
  border:1px solid #cfd8e6;
  border-radius:10px;
  padding:0 12px;
  background:#fff;
  font:inherit;
  color:inherit;
  font-size:16px;
}

.sim-field input:focus,
.sim-field select:focus,
.sim-card select:focus{
  outline:none;
  border-color:var(--sim-blue);
  box-shadow:0 0 0 3px rgba(26,79,163,.12);
}

.sim-btn-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}

.sim-btn-row-center{
  justify-content:center;
}

.sim-btn{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid #cbd5e4;
  background:#fff;
  color:#213042;
  border-radius:10px;
  padding:11px 16px;
  font:inherit;
  font-weight:600;
  font-size:16px;
  min-height:46px;
  cursor:pointer;
  transition:.2s ease;
}

.sim-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(0,0,0,.08);
}

.sim-btn-primary{
  background:var(--sim-blue);
  border-color:var(--sim-blue);
  color:#fff;
}

.sim-btn-large{
  padding:13px 20px;
  font-size:1.05rem;
}

.sim-actions{
  padding-top:8px;
  padding-bottom:8px;
}

.sim-chips{
  margin-top:16px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.sim-chips-label{
  color:var(--sim-muted);
  font-weight:600;
}

.sim-chip{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid #d4dcea;
  background:#fff;
  color:#223246;
  border-radius:999px;
  padding:8px 14px;
  font:inherit;
  font-size:16px;
  min-height:42px;
  cursor:pointer;
  transition:.2s ease;
}

.sim-chip:hover{
  background:#f3f7fc;
}

.sim-badge{
  display:inline-block;
  border-radius:999px;
  padding:7px 12px;
  font-size:.9rem;
  font-weight:700;
  white-space:nowrap;
}

.sim-badge-green{background:var(--sim-green-bg);color:var(--sim-green);}
.sim-badge-yellow{background:var(--sim-yellow-bg);color:var(--sim-yellow);}
.sim-badge-red{background:var(--sim-red-bg);color:var(--sim-red);}
.sim-badge-gray{background:#edf1f5;color:#4b5563;}

.sim-status{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.sim-status > div{
  background:#fff;
  border:1px solid var(--sim-border);
  border-radius:12px;
  padding:14px 16px;
  min-width:0;
}

.sim-status span{
  display:block;
  color:var(--sim-muted);
  font-size:.92rem;
  margin-bottom:4px;
}

.sim-status strong{
  font-size:1rem;
  overflow-wrap:anywhere;
}

.sim-details{
  border:1px solid var(--sim-border);
  border-radius:14px;
  background:#fff;
}

.sim-details > summary{
  cursor:pointer;
  list-style:none;
  padding:18px 20px;
  font-weight:700;
}

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

.sim-details-body{
  padding:0 20px 20px;
}

.sim-muted{
  color:var(--sim-muted);
  line-height:1.6;
}

.sim-list{
  margin:12px 0 0 18px;
  padding:0;
  line-height:1.7;
}

.sim-result-head{
  display:grid;
  grid-template-columns:1.1fr 1.4fr;
  gap:18px;
  margin-bottom:18px;
}

.sim-traffic{
  border-radius:14px;
  padding:20px;
  border:1px solid var(--sim-border);
  min-width:0;
}

.sim-traffic-green{
  background:var(--sim-green-bg);
  border-color:#cfe6d5;
  color:var(--sim-green);
}

.sim-traffic-yellow{
  background:var(--sim-yellow-bg);
  border-color:#f3dfae;
  color:var(--sim-yellow);
}

.sim-traffic-red{
  background:var(--sim-red-bg);
  border-color:#f0c7c7;
  color:var(--sim-red);
}

.sim-traffic-label{
  font-weight:700;
  margin-bottom:10px;
}

.sim-traffic-value{
  font-size:2rem;
  line-height:1;
  font-weight:800;
  margin-bottom:10px;
}

.sim-traffic p{
  margin:0;
  line-height:1.6;
}

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

.sim-metric{
  background:#fff;
  border:1px solid var(--sim-border);
  border-radius:12px;
  padding:14px 16px;
  box-shadow:0 2px 8px rgba(0,0,0,.03);
  min-width:0;
}

.sim-metric span{
  display:block;
  font-size:.92rem;
  color:var(--sim-muted);
  margin-bottom:5px;
}

.sim-metric strong{
  font-size:1.08rem;
  color:var(--sim-text);
  overflow-wrap:anywhere;
}

.sim-chart-wrap{
  position:relative;
  min-height:360px;
  margin-top:8px;
}

#phaseChart{
  width:100% !important;
  height:100% !important;
}

.sim-prose p{
  line-height:1.7;
  margin:0 0 12px;
}

.sim-prose p:last-child{
  margin-bottom:0;
}

.sim-table-card{
  padding:0;
}

.sim-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  padding-bottom:4px;
}

.sim-table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
}

.sim-table th,
.sim-table td{
  padding:12px 14px;
  border-bottom:1px solid #e5eaf2;
  text-align:left;
  vertical-align:top;
  white-space:nowrap;
}

.sim-table thead th{
  background:#f5f8fc;
  font-size:.95rem;
}

.sim-defs{
  margin:0;
}

.sim-defs div{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:12px;
  padding:9px 0;
  border-bottom:1px solid #edf1f5;
}

.sim-defs div:last-child{
  border-bottom:none;
}

.sim-defs dt{
  font-weight:700;
}

.sim-defs dd{
  margin:0;
  color:#2e3742;
}

.sim-accordion{
  display:grid;
  gap:12px;
}

.sim-field-reference{
  grid-column:span 3;
}

.sim-ref-chips{
  margin-top:12px;
}

.sim-guidance{
  margin:0 0 18px;
  background:#f7faff;
  border:1px solid #dbe7fb;
  border-left:5px solid var(--sim-blue);
  border-radius:12px;
  padding:14px 16px;
  color:#243449;
  line-height:1.6;
}

.sim-guidance-compact{
  margin:12px 0 18px;
}

.sim-field-help{
  margin:7px 0 0;
  color:var(--sim-muted);
  font-size:.92rem;
  line-height:1.45;
}

.sim-tip{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  margin-left:6px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #cbdaf4;
  color:var(--sim-blue-dark);
  font-size:.78rem;
  font-weight:800;
  cursor:help;
  vertical-align:middle;
  user-select:none;
}

.sim-tip::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  bottom:calc(100% + 9px);
  transform:translateX(-50%);
  width:min(320px,80vw);
  background:#172033;
  color:#fff;
  border-radius:10px;
  padding:10px 12px;
  font-size:.88rem;
  font-weight:500;
  line-height:1.45;
  text-align:left;
  box-shadow:0 12px 26px rgba(0,0,0,.22);
  opacity:0;
  pointer-events:none;
  transition:.16s ease;
  z-index:30;
  white-space:normal;
}

.sim-tip::before{
  content:"";
  position:absolute;
  left:50%;
  bottom:calc(100% + 3px);
  transform:translateX(-50%);
  border:6px solid transparent;
  border-top-color:#172033;
  opacity:0;
  pointer-events:none;
  transition:.16s ease;
  z-index:31;
}

.sim-tip:hover::after,
.sim-tip:focus::after,
.sim-tip:hover::before,
.sim-tip:focus::before{
  opacity:1;
}

@media (max-width:1100px){
  .sim-grid-4{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

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

  .sim-result-head{
    grid-template-columns:1fr;
  }

  .sim-field-reference{
    grid-column:span 2;
  }
}

@media (max-width:980px){
  .sim-page .page-container{
    padding-left:16px;
    padding-right:16px;
  }

  .sim-hero{
    padding:56px 0 28px;
  }

  .sim-section{
    padding:22px 0;
  }

  .sim-card,
  .sim-traffic{
    padding:16px;
  }

  .sim-details > summary{
    padding:16px;
  }

  .sim-details-body{
    padding:0 16px 16px;
  }

  .sim-result-cards{
    grid-template-columns:1fr;
  }

  .sim-status{
    grid-template-columns:1fr;
  }

  .sim-grid-2,
  .sim-grid-3,
  .sim-grid-4{
    grid-template-columns:1fr;
  }

  .sim-card-top{
    flex-direction:column;
    align-items:stretch;
  }

  .sim-badge{
    white-space:normal;
    width:fit-content;
    max-width:100%;
  }

  .sim-btn-row,
  .sim-btn-row-center{
    flex-direction:column;
    align-items:stretch;
  }

  .sim-btn-row .sim-btn,
  .sim-btn-row-center .sim-btn{
    width:100%;
  }

  .sim-chips{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    align-items:stretch;
  }

  .sim-chips-label{
    grid-column:1 / -1;
    margin-bottom:2px;
  }

  .sim-chip{
    width:100%;
    text-align:center;
  }

  .sim-chart-wrap{
    min-height:280px;
  }

  .sim-table{
    min-width:640px;
  }
}

@media (max-width:780px){
  .sim-grid-2,
  .sim-grid-3,
  .sim-grid-4,
  .sim-status,
  .sim-result-cards{
    grid-template-columns:1fr;
  }

  .sim-card-top{
    flex-direction:column;
  }

  .sim-hero{
    padding:56px 0 28px;
  }

  .sim-section{
    padding:22px 0;
  }

  .sim-chart-wrap{
    min-height:300px;
  }

  .sim-defs div{
    grid-template-columns:1fr;
    gap:4px;
  }

  .sim-field-reference{
    grid-column:span 1;
  }
}

@media (max-width:640px){
  .sim-page .page-container{
    padding-left:14px;
    padding-right:14px;
  }

  .sim-kicker{
    font-size:.82rem;
    margin-bottom:8px;
  }

  .sim-hero h1{
    font-size:2rem;
    margin-bottom:10px;
  }

  .sim-subtitle{
    font-size:1rem;
    line-height:1.55;
    margin-bottom:18px;
  }

  .sim-note{
    padding:14px;
    font-size:.96rem;
  }

  .sim-section-head h2,
  .sim-prose h2{
    font-size:1.45rem;
    line-height:1.2;
  }

  .sim-section-head p,
  .sim-prose p,
  .sim-muted,
  .sim-lead{
    font-size:.98rem;
    line-height:1.6;
  }

  .sim-card,
  .sim-traffic,
  .sim-status > div,
  .sim-metric{
    border-radius:12px;
  }

  .sim-traffic-value{
    font-size:1.65rem;
  }

  .sim-metric{
    padding:12px 14px;
  }

  .sim-metric span{
    font-size:.85rem;
  }

  .sim-metric strong{
    font-size:1rem;
  }

  .sim-defs div{
    grid-template-columns:1fr;
    gap:4px;
  }

  .sim-table{
    min-width:560px;
    font-size:.9rem;
  }

  .sim-table th,
  .sim-table td{
    padding:10px 10px;
  }

  .sim-chart-wrap{
    min-height:240px;
  }
}

@media (max-width:420px){
  .sim-chips{
    grid-template-columns:1fr;
  }

  .sim-btn{
    padding:12px 14px;
  }

  .sim-chip{
    padding:10px 12px;
  }

  .sim-table{
    min-width:520px;
  }

  .sim-hero h1{
    font-size:1.8rem;
  }
}

.sim-learning-section{
  padding-top:34px;
}

.sim-learning-grid{
  margin-bottom:18px;
}

.sim-step-list{
  margin:12px 0 0 22px;
  padding:0;
  line-height:1.7;
}

.sim-step-list li{
  margin-bottom:6px;
}

.sim-step-list-horizontal{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin:14px 0 0;
  padding:0;
  list-style:none;
  counter-reset:simstep;
}

.sim-step-list-horizontal li{
  counter-increment:simstep;
  background:#f7f9fc;
  border:1px solid var(--sim-border);
  border-radius:12px;
  padding:12px 12px 12px 42px;
  position:relative;
  min-height:58px;
}

.sim-step-list-horizontal li::before{
  content:counter(simstep);
  position:absolute;
  left:12px;
  top:12px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:var(--sim-blue);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.82rem;
  font-weight:800;
}

.sim-mini-glossary{
  margin-bottom:18px;
}

.sim-mini-glossary h3,
.sim-howto-card h3{
  margin-top:0;
}

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

.sim-glossary-grid > div{
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:12px;
  padding:14px;
}

.sim-glossary-grid strong{
  display:block;
  margin-bottom:6px;
  color:var(--sim-blue-dark);
}

.sim-glossary-grid p{
  margin:0;
  color:#344052;
  line-height:1.55;
}

.sim-howto-card{
  margin-top:0;
}

@media (max-width:980px){
  .sim-step-list-horizontal,
  .sim-glossary-grid{
    grid-template-columns:1fr;
  }
}


.sim-hero-actions{
  margin-top:20px;
}

.sim-hero-actions .sim-btn{
  text-decoration:none;
}


.sim-author-line{
  margin:14px auto 0;
  max-width:920px;
  color:#334155;
  font-size:.96rem;
  line-height:1.55;
}

.sim-author-line-left{
  margin-left:0;
  margin-right:0;
  max-width:980px;
}

.sim-rights-grid .sim-card h3{
  margin-top:0;
}

.sim-quote-box{
  background:#f8fafc;
  border:1px dashed #b8c5d9;
  border-radius:10px;
  padding:12px 14px;
  color:#243449;
  overflow-wrap:anywhere;
}
