/* RF_STYLES_VERSION: 001 */
:root{
  --bg:#0b0f14;
  --panel:#101824;
  --panel2:#0e1620;
  --text:#e8eef7;
  --muted:#a6b3c4;
  --line:rgba(255,255,255,.10);
  --accent:#58a6ff;
  --accent2:#7ee787;
  --warn:#ffd479;
  --danger:#ff7b72;
  --shadow:0 10px 24px rgba(0,0,0,.35);
  --radius:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background-image: url("../assets/images/blueprint-bg.png");
  background-repeat: no-repeat; /* Prevents the image from repeating */
  background-size: cover;      /* Ensures the image covers the entire element */
  background-position: center;   /* Centers the image in the viewport */
  background-attachment: fixed;  /* Fixes the image position during scrolling (optional) */
  color:var(--text);
}

.wrap{max-width:1120px;margin:0 auto;padding:0 18px}
.site-header{
  border-bottom:1px solid var(--line);
  background:rgba(7,11,16,.75);
  position:sticky;top:0;backdrop-filter: blur(10px);
  z-index:10;
}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;padding:14px 18px}
.brand{display:flex;gap:12px;align-items:center}
.logo{
  width:50px;height:50px;border-radius:10px;
  background-image: url('../images/RF_Profile_800x800_NoBorder.png');
  background-size: contain; /* Ensures the whole logo fits within the 36x36 area */
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: var(--shadow);
}
.title{font-weight:700}
.subtitle{color:var(--muted);font-size:13px;margin-top:2px}

.header-actions{display:flex;gap:14px}
.link{color:var(--muted);text-decoration:none;font-size:14px}
.link:hover{color:var(--text)}

.main{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
  padding:18px;
}

.panel{
  background:linear-gradient(180deg,var(--panel) 0%, var(--panel2) 100%);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
}

.panel h2{margin:0 0 12px 0;font-size:18px}
.sep{border:none;border-top:1px solid var(--line);margin:14px 0}

.row{margin:10px 0}
.row label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
.row input,.row select{
  width:100%;
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:12px;
  padding:10px 11px;
  font-size:14px;
  outline:none;
}
.row input:focus,.row select:focus{border-color:rgba(88,166,255,.55);box-shadow:0 0 0 4px rgba(88,166,255,.14)}
.hint{margin-top:6px;color:var(--muted);font-size:12px;line-height:1.35}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.inline{display:flex;gap:10px;align-items:center}
.inline input{flex:1}

.actions{display:flex;gap:10px;align-items:center;justify-content:flex-start}
.btn{
  appearance:none;border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;border-radius:12px;
  cursor:pointer;font-size:14px;
}
.btn:hover{border-color:rgba(255,255,255,.25)}
.btn.primary{border-color:rgba(88,166,255,.55);background:rgba(88,166,255,.12)}
.btn.primary:hover{background:rgba(88,166,255,.18)}

.kpis{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.kpi{
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  border-radius:14px;padding:12px;
}
.kpi-label{color:var(--muted);font-size:12px}
.kpi-value{font-size:28px;font-weight:750;margin-top:4px;font-family:var(--mono)}
.kpi-sub{color:var(--muted);font-size:12px;margin-top:2px}

.warnings{margin:8px 0 12px 0}
.warn{
  border:1px solid rgba(255,212,121,.35);
  background:rgba(255,212,121,.08);
  padding:10px 12px;border-radius:12px;
  margin:8px 0;color:var(--warn);font-size:13px
}
.danger{
  border:1px solid rgba(255,123,114,.35);
  background:rgba(255,123,114,.08);
  color:var(--danger);
}

.chart-wrap{
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:10px;
}

/* Keep the chart from stretching to infinity when surrounding layout changes */
.chart-title{
  font-size:13px;
  color:var(--muted);
  margin:2px 2px 8px 2px;
}
.chart-canvas{
  height:200px; /* fixed drawing area */
}
.chart-canvas canvas{
  display:block;
  width:100% !important;
  height:100% !important;
}

.table-wrap{margin-top:12px}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.table th,.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  font-size:13px;
}
.table th{color:var(--muted);text-align:left;background:rgba(255,255,255,.02)}
.table .num{text-align:right;font-family:var(--mono)}
.table tr:last-child td{border-bottom:none}
.table tr.strong td{font-weight:700}

.footnote{color:var(--muted);font-size:12px;margin:12px 2px 0 2px;line-height:1.35}

.calibration{margin-top:12px;border:1px dashed rgba(255,255,255,.18);border-radius:14px;padding:10px}
.calibration summary{cursor:pointer;color:var(--muted);font-size:13px}
.calibration-body{margin-top:10px;color:var(--text);font-size:13px;line-height:1.45}
.calibration .note{color:var(--muted);font-size:12px}

@media (max-width: 980px){
  .main{grid-template-columns:1fr}
}


.muted { opacity: 0.45; }

#limitBreakdown{ color: var(--muted); }

/* Adhesion cap block */
.adhesion-box{
  margin-top:10px;
  padding:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
}
.check{
  display:flex;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:13px;
  cursor:pointer;
  user-select:none;
}
.check input{ width:auto; }
.grid2.tight{ gap:10px; margin-top:8px; }
#adhesionInfo{ margin-top:8px; }


/* Resistance share bar */
.sharebar{
  margin-top:10px;
  height:12px;
  border-radius:999px;
  overflow:hidden;
  display:flex;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
}
.sharebar .seg{ height:100%; }
.sharebar .seg.grade{ background:rgba(255,255,255,.35); }
.sharebar .seg.rolling{ background:rgba(255,255,255,.22); }
.sharebar .seg.curve{ background:rgba(255,255,255,.14); }

.sharebar-legend{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


.sharebar-label{
  margin-top:10px;
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  text-transform:uppercase;
}
.share-actions{
  margin-top:8px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}



.readonly{ padding:10px 12px; border-radius:12px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04); }

.grid3{ display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; }
@media (max-width: 900px){ .grid3{ grid-template-columns: 1fr; } }


.row select, .row input{ width:100%; }

#trackType{ width:100%; }


/* ===============================
   RailForge Themed Select Fields
   Matches input styling exactly
================================= */

.row select,
.presets-row select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #e6edf5;
  font-size: 14px;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

/* Hover state */
.row select:hover,
.presets-row select:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
}

/* Focus state */
.row select:focus,
.presets-row select:focus {
  outline: none;
  border-color: rgba(124, 180, 255, 0.6);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 2px rgba(124,180,255,0.15);
}

/* Dropdown options */
.row select option,
.presets-row select option {
  background: #1c1f26;
  color: #e6edf5;
}

/* Custom subtle arrow */
.row select,
.presets-row select {
  background-image:
    linear-gradient(45deg, transparent 50%, #9fb3c8 50%),
    linear-gradient(135deg, #9fb3c8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}


.muted label, .muted .hint { opacity: 0.6; }
.muted select, .muted input { opacity: 0.5; }


/* Track-type sub-panels */
.panel-sub{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
  border-radius:14px;
  padding:12px;
}
.subhead{
  font-size:12px;
  letter-spacing:.02em;
  color:var(--muted);
  text-transform:uppercase;
  margin-bottom:8px;
}

/* Remove number input spin arrows (Chrome, Edge, Safari) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Remove number input arrows (Firefox) */
input[type="number"] {
  -moz-appearance: textfield;
}

/* ===============================
   Fix checkbox styling + alignment
   (prevents .row input styles from turning checkboxes into text fields)
================================= */
.row input[type="checkbox"],
.check input[type="checkbox"]{
  accent-color: var(--accent);
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  appearance: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
}

/* Keep checkbox + text left-aligned and side-by-side */
.check{
  justify-content: flex-start;
  align-items: center;
}

#primaryKpiLabel {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

/* SVG styling for Wheel/Rail Lab */
svg .gridLine {
  stroke: rgba(255,255,255,.06);
  stroke-width: .2;
}

/* SVG text + annotation styling (used by ui.js) */
svg .gridText{
  fill: rgba(232,238,247,.82);
  font-family: var(--mono);
  font-size: 11px; /* base; ui.js may override per-label */
  letter-spacing: .01em;
  paint-order: stroke;
  stroke: rgba(7,11,16,.55);      /* subtle halo for readability */
  stroke-width: 2.2px;
  stroke-linejoin: round;
}
svg .gridText.good{ fill: rgba(126,231,135,.92); }
svg .gridText.warn{ fill: rgba(255,212,121,.92); }
svg .gridText.bad{  fill: rgba(255,123,114,.92); }

/* Optional faint guide lines for labels -> features */
svg .guideLine{
  stroke: rgba(255,255,255,.08);
  stroke-width: .35;
  stroke-dasharray: 2 2;
}



svg .guideLine {
  stroke: rgba(255,255,255,.18);
  stroke-width: .32;
  opacity: 0.45;
}

svg .dimGood { stroke: rgba(126,231,135,.95); fill: rgba(126,231,135,.95); }
svg .dimWarn { stroke: rgba(255,212,121,.95); fill: rgba(255,212,121,.95); }
svg .dimBad  { stroke: rgba(255,123,114,.95); fill: rgba(255,123,114,.95); }
svg .gridText {
  fill: rgba(255,255,255,.36);
  font-size: 4.8px;
  letter-spacing: .02em;
}
svg .railFill {
  fill: rgba(255,255,255,.12);
  stroke: rgba(255,255,255,.6);
  stroke-width: .5;
}

svg .wheelFill {
  fill: rgba(88,166,255,.18);
  stroke: rgba(88,166,255,.85);
  stroke-width: .6;
}

svg .contactDot {
  fill: #7ee787;
  stroke: rgba(0,0,0,.4);
  stroke-width: .3;
}

/* ===============================
   RailGrade: mode segmented control + hint
================================= */
.mode-block{ margin: 4px 0 2px; }

.segmented{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:6px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.03);
}
.segmented .seg-btn{
  appearance:none;
  border:1px solid transparent;
  background:transparent;
  color:var(--muted);
  padding:9px 8px;
  border-radius:9px;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  line-height:1.1;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.segmented .seg-btn:hover{ color:var(--text); }
.segmented .seg-btn:focus-visible{
  outline:none;
  border-color:rgba(88,166,255,.55);
  box-shadow:0 0 0 3px rgba(88,166,255,.14);
}
.segmented .seg-btn.is-active{
  background:rgba(88,166,255,.14);
  border-color:rgba(88,166,255,.55);
  color:var(--text);
}

.mode-hint{
  margin:8px 2px 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

/* ===============================
   RailGrade: advanced <details> groups
================================= */
details.advanced{
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.02);
  padding:10px 12px;
}
details.advanced > summary{
  cursor:pointer;
  color:var(--text);
  font-size:13px;
  list-style:none;
}
details.advanced > summary::-webkit-details-marker{ display:none; }
details.advanced > summary::before{
  content:"\25B8"; /* right-pointing triangle */
  display:inline-block;
  margin-right:8px;
  color:var(--muted);
  transition:transform .15s ease;
}
details.advanced[open] > summary::before{ transform:rotate(90deg); }
details.advanced > summary:hover{ color:var(--text); }
.advanced-body{ margin-top:10px; }
.advanced-body .adhesion-box{ margin-top:0; }

/* Inline Export confirmation (sits next to the Export button in Results). */
.export-status{
  font-size:12px;
  color:var(--accent2);
  opacity:0;
  transition:opacity .2s ease;
  line-height:1.3;
}
.export-status.is-visible{ opacity:1; }

/* Lab tool <h1> — each tool page needs a real top-level heading for SEO/AEO +
   accessibility (H1 was missing). Styled to match the compact .eyebrow label it
   sits beside so the header layout is unchanged; it's a heading semantically,
   a label visually. The second .eyebrow span stays as supporting text.
   Scoped to the eyebrow container (+ element) so it beats the site-wide
   `h1 { font-size: clamp(2.7rem,6vw,4.4rem); max-width:10ch }` rule, which was
   rendering these as giant three-line headings. */
.wrap h1.lab-tool-h1{
  margin:0;
  max-width:none;
  font-size:0.82rem;
  font-weight:700;
  line-height:1.3;
  text-transform:uppercase;
  letter-spacing:0.16em;
  color:var(--muted);
}
