:root{
      --bg:#0b1020;
      --text:#e8ecff;
      --muted:#a9b3d6;
      --accent:#7aa2ff;
      --danger:#ff5a6b;
      --ok:#7dffb4;
    }
    *{ box-sizing:border-box; }
    body{
      margin:0;
      background:linear-gradient(180deg, #070b17, var(--bg));
      color:var(--text);
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    }
    header{
      padding:4px 14px 3px;
      border-bottom:1px solid rgba(255,255,255,.08);
      background:rgba(10,14,28,.65);
      backdrop-filter: blur(10px);
      position:sticky; top:0; z-index:10;
    }
    header h1{ margin:0; font-size:16px; font-weight:700; }
    header p{ display:none; }
    .wrap{
      display:grid;
      grid-template-columns: 420px 1fr;
      gap:14px;
      padding:14px;
      align-items:start;
    }
    @media (max-width: 980px){ .wrap{ grid-template-columns: 1fr; } }
    .card{
      background:linear-gradient(180deg, rgba(18,26,51,.92), rgba(12,18,40,.92));
      border:1px solid rgba(255,255,255,.08);
      border-radius:16px;
      box-shadow: 0 18px 40px rgba(0,0,0,.35);
      overflow:hidden;
    }
    .card .hd{
      padding:12px 14px;
      border-bottom:1px solid rgba(255,255,255,.08);
      background:rgba(255,255,255,.03);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
    }
    .card .hd b{ font-size:13px; }
    .btn{
      appearance:none;
      border:1px solid rgba(255,255,255,.14);
      background:rgba(255,255,255,.06);
      color:var(--text);
      padding:7px 10px;
      border-radius:10px;
      font-size:12px;
      cursor:pointer;
    }
    .btn:hover{ border-color:rgba(122,162,255,.6); }
    .card .bd{ padding:12px 14px; }
    .row{ display:grid; grid-template-columns: 1fr auto; gap:10px; align-items:center; margin:10px 0; }
    .row label{ font-size:12px; color:var(--muted); }
    input[type="number"]{
      width:140px;
      background:rgba(0,0,0,.25);
      border:1px solid rgba(255,255,255,.14);
      color:var(--text);
      padding:6px 8px;
      border-radius:10px;
      font-size:12px;
    }
    .hint{
      margin-top:10px;
      padding:10px 10px;
      border-radius:12px;
      border:1px dashed rgba(255,255,255,.16);
      color:var(--muted);
      font-size:12px;
      line-height:1.35;
      background:rgba(0,0,0,.15);
    }
    .kpi{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:10px;
      margin-top:12px;
    }
    .kpi .box{
      border:1px solid rgba(255,255,255,.10);
      background:rgba(0,0,0,.16);
      border-radius:12px;
      padding:10px;
    }
    .kpi .box .t{ color:var(--muted); font-size:11px; }
    .kpi .box .n{ font-size:14px; font-weight:700; margin-top:4px; font-variant-numeric: tabular-nums; }
    .bad{ color: var(--danger); }
    .good{ color: var(--ok); }
    .canvasWrap{
  position: relative;
  padding:10px;
  flex:1;
  min-height:0;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
}
    canvas{
      touch-action: none;
      width:100%;
      height:auto;
      aspect-ratio: 1200 / 650;
      max-height: 75vh;
      min-height: 280px;
      display:block;
      border-radius:14px;
      background: radial-gradient(900px 520px at 25% 15%, rgba(122,162,255,.11), rgba(0,0,0,0) 60%),
                  radial-gradient(1000px 600px at 85% 55%, rgba(255,90,107,.08), rgba(0,0,0,0) 65%),
                  rgba(0,0,0,.18);
      border:1px solid rgba(255,255,255,.08);
    }
    .legend{
      display:flex;
      gap:12px;
      align-items:center;
      flex-wrap:wrap;
      padding:8px 12px 12px;
      color:var(--muted);
      font-size:12px;
    }
    .chip{
      display:flex; align-items:center; gap:8px;
      padding:6px 10px;
      border-radius:999px;
      border:1px solid rgba(255,255,255,.10);
      background:rgba(0,0,0,.14);
    }
    .dot{ width:10px; height:10px; border-radius:50%; background:#ddd; }
    .dot.red{ background: var(--danger); }
    .dot.blue{ background: var(--accent); }
    .dot.green{ background: var(--ok); }
    .dot.white{ background: rgba(255,255,255,.9); }
    footer{
      padding:10px 14px 18px;
      color:var(--muted);
      font-size:11px;
      line-height:1.4;
      opacity:.9;
    }
  
    .anerkaBrand{ display:flex; align-items:center; gap:14px; min-width:0; }
    .anerkaLogo{ height:44px; width:auto; object-fit:contain; }
    .anerkaTitleWrap{ min-width:0; }
    header h1{ display:block; }
    

  /* Menu KPI: hide Ro box, show Rf in its place */
  .box[data-box="roHidden"]{ display:none !important; }

/* Footer credit */
.credit{
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
  font-size: 12px;
  opacity: .75;
  text-align: center;
}

/* Auto-zoom disabled: hide control */
#autoFit{ display:none; }
#autoFit + label{ display:none; }

/* Zoom All button (top-right of simulation area) */
.zoomAllBtn{
  position:absolute;
  top:10px;
  right:10px;
  z-index:6;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35);
  color:#eaf0ff;
  font-size:12px;
  cursor:pointer;
  backdrop-filter: blur(6px);
}
.zoomAllBtn:hover{ background: rgba(0,0,0,.48); }

/* Anerka logo in simulation area (top-left) */
.simLogo{
  position:absolute;
  top:10px;
  right:10px;
  height:64px; /* same height as Zoom All button */
  width:auto;
  z-index:6;
  }

.creditLink{
  color: rgba(234,240,255,0.9);
  text-decoration: none;
}
.creditLink:hover{
  text-decoration: underline;
}

/* Clickable simulator logo */
.simLogoLink{
  position:absolute;
  top:10px;
  right:10px;
  z-index:6;
  display:block;
  line-height:0;
}
.simLogoLink .simLogo{
  pointer-events:auto;
}

/* --- Adapts SVG as "canvas" --- */
.canvasWrap svg{
  width:100%;
  height:auto;
  aspect-ratio: 1200 / 650;
  max-height: 75vh;
  min-height: 280px;
  display:block;
  border-radius:14px;
  background: radial-gradient(900px 520px at 25% 15%, rgba(122,162,255,.11), rgba(0,0,0,0) 60%),
              radial-gradient(1000px 600px at 85% 55%, rgba(255,90,107,.08), rgba(0,0,0,0) 65%),
              rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.08);
}

/* Make <details> match card style */
details{
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 10px;
  margin:10px 0;
  background:rgba(0,0,0,.12);
}
summary{
  cursor:pointer;
  font-size:13px;
  font-weight:700;
  color:rgba(232,236,255,.95);
  list-style:none;
}
summary::-webkit-details-marker{ display:none; }
details > summary::before{
  content:"▾";
  display:inline-block;
  margin-right:8px;
  opacity:.7;
}
details[open] > summary::before{ content:"▴"; }

/* Compact rows */
.row{ margin:10px 0; }
.row input[type="range"]{ width: 100%; }

/* Hide any leftover helper text if exists */
.hint, .kpi, footer{ display:none !important; }


/* --- Layout: sidebar + full-height simulation (revert simulation area) --- */
.page{
  display:flex;
  flex-direction:column;
  height:100vh;
}
.app{
  display:flex;
  flex:1;
  min-height:0; /* allow children to shrink */
}
.sidebar{
  width:420px;
  max-width:92vw;
  padding:10px;
  overflow:auto;
}
.main{
  flex:1;
  min-width:0;
  padding:10px 10px 10px 0;
  display:flex;
  flex-direction:column;
  min-height:0;
}
@media (max-width: 980px){
  /* Mobile-first: avoid split-screen fixed heights; allow normal page scrolling */
  .page{ height:auto; min-height:100vh; }
  .app{ flex-direction:column; }
  .sidebar{
    width:100%;
    height:auto;
    max-height:none;
    overflow:visible;
    padding:14px;
  }
  .main{
    height:auto;
    padding:0 14px 14px;
    min-height:0;
  }
  /* Keep simulator readable: responsive height from width (plus a sensible floor) */
  .canvasWrap{
    height:auto;
    min-height: 52vh;
    aspect-ratio: 1200 / 650;
  }
}

/* Make SVG behave like full-height canvas (override card-style sizing) */
.canvasWrap{ height:100%; }
.canvasWrap svg, #svg{
  width:100% !important;
  height:100% !important;
  display:block;
  flex:1;
  min-width:0;
  min-height:0;
  background: radial-gradient(130% 90% at 0% 0%, rgba(89,90,107,.08), rgba(0,0,0,0) 65%),
              rgba(0,0,0,.18);
  border-radius:14px;
}

/* Hide all internal messages */

/* --- Hide helper geometry & labels (as requested previously) --- */
#pivotO, #pivotLabel,
#linkOL,
#baseB, #baseLabel,
#cylBL, #mlLabel,
#pt1, #pt2, #pt3,
#pt1Label, #pt2Label, #pt3Label,
#aLabel{
  display:none !important;
}

#btnAxes{display:none !important;}


/* Logo placements */
header h1{ display:flex; align-items:center; gap:12px; }
 .titleLogo{ width:108px; height:108px; object-fit:contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.simLogo{
  position:absolute;
  top:12px;
  right:14px;
  width:72px;
  height:72px;
  object-fit:contain;
  opacity:0.9;
  pointer-events:none;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}

.credits{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 12px;
  color: rgba(230,238,252,0.82);
}
.credits .creditLine{ margin-bottom: 6px; }

.credits .buildTag{
  margin-top: 8px;
  opacity: 0.65;
  font-size: 11px;
}


/* Utility */
.is-hidden{display:none !important;}


.subhead{margin:10px 0 6px; font-weight:700; opacity:0.9; font-size:12px; letter-spacing:0.3px;}

/* Legal notice under simulation area */
.legalNotice{
  margin: 4px 6px 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}


.anerkaTitleWrap h1{ display:flex; align-items:center; gap:12px; }
.logoLink{ display:inline-flex; align-items:center; justify-content:center; }
.logoLink:focus{ outline:2px solid rgba(122,162,255,.7); outline-offset:3px; border-radius:12px; }
.logoLink:hover{ filter:brightness(1.05); }


/* Status (only shows on error) */
.status{
  display:none;
  margin: 10px 0;
  padding: 10px 12px;
  border:1px solid rgba(255,90,107,.35);
  background: rgba(255,90,107,.10);
  border-radius: 12px;
  color: rgba(255,230,235,.95);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.status.show{ display:block; }


/* Hide thickness label in simulation view */
#tDim, #tText { display: none !important; }


/* Select Machine Type (HR-4 / HMR-4 / HRR-4) */
.machineTypeRow{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin:10px 0;
}
.mtOpt{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:12px;
  user-select:none;
}
.mtOpt input[type="checkbox"]{
  width:14px;
  height:14px;
  accent-color: var(--accent);
}

/* Read-only numeric inputs should look locked but still readable */
input[readonly]{
  opacity:0.88;
  cursor:not-allowed;
}
