*{

    box-sizing: border-box;
    margin: 0;
    padding: 0;
   
  /* No custom layout wrapper or footer styles */
}
body {
 
    min-height: 100vh;
    background: #d7d0c4;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    padding: clamp(12px, 2vw, 24px);
}

.panel {
    position: relative; 
    
     min-height: 200vh;

    width: min(1800px, 100%);
    border: 3px solid #111;

    background: #d7d0c4;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

.top-row {
    position: relative; /* keep jsPlumb endpoints tied to this area when the viewport changes */
    display: grid;
 
    grid-template-columns: 1fr 2.6fr 1.2fr;
    gap: clamp(8px, 2vw, 16px);
    border-bottom: 3px solid #111;
}

.left-column,
.center-column,
.right-column {
    padding: clamp(12px, 2vw, 18px);
    border-right: 3px solid #111;
}
 
.right-column {
    border-right: none;
    /* border-left: 3px solid #111; */
    display: flex;
    justify-content: center;
    min-width: 240px; /* keep enough space so buttons don't clip */
}

.center-column {
  border-right: none;
    /* border-left: 3px solid #111; */
    border-right: 3px solid #111;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 3vw, 24px);
    position: relative;
    width: 100%;
    margin: 0 auto;
}
.obs-title {
   position: relative;
    top: -5px;
    text-align: center;
    left: 23px;
    font-size: 17px;
}
 
*::before, *::after {
  box-sizing: border-box;
}
/* 3D-styled headings */
h3 {
  margin: 4px;;
  font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2c1a0a;
  background: linear-gradient(135deg, #fdf7e7, #e8d6b8 55%, #d7bc90);
  padding: 4px 12px;
  border-radius: 4px;
  display: inline-block;
  box-shadow:
    0 2px 0 #b08a55,
    0 6px 12px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.25);
}

.mcb-starter-section {
  background-image: url(images/wooden-texture.jpg);
  background-size: cover;
  background-position: center;
  border: 4px solid var(--wood-border);
  border-radius: 6px;
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: 0 auto clamp(10px, 2vw, 18px);
  height: 35%;
  right: 10px;
}

.mcb-block {
  position: absolute;
  top: 1%;
  left: -5.125%;
  width: 46.875%;
}

.mcb-toggle {
  width: 100%;
  height: 201px;
  display: block;
}

.starter-block {
  position: absolute;
  top: -9.42%;
  right: -7.25%;
}

.starter-body {
  display: block;
  width: 100%;
  height: 290px;
}

.starter-handle {
  position: absolute;
  width: 16.67%;
  height: auto;
  top: 37.04%;
  left: 16.67%;
  transform: none;
  cursor: default;
  z-index: 5;
  pointer-events: auto;
}

.starter-handle:active {
  cursor: default;
}

.starter-handle.moved {
  left: 68%;
  top: 35%;
}

.led-row {
    display: flex;
    gap: clamp(6px, 1vw, 10px);
}

.led {
    width: clamp(14px, 2vw, 20px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffefe5, #ff4c4c 55%, #8f0000 90%);
    box-shadow: 0 0 10px rgba(255, 76, 76, 0.8);
}

.center-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.center-actions .pill-btn {
    max-width: 160px;
}




.labeld{
     position: absolute;
    top: 243px;
}


.meter-panel {
    --meter-panel-height: clamp(240px, 32vw, 280px);
    position: relative;
    width:100%;
    max-width: 900px;
    height: var(--meter-panel-height);
    aspect-ratio: 16 / 9;
    background-image: url(images/wooden-texture.jpg);
    background-size: cover;
    background-position: center;
    border: 4px solid #8c6a48;
    border-radius: 6px;
    padding: clamp(6px, 1vw, 10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    overflow: hidden;
    padding-bottom: clamp(2px, 0.2vw, 2px);
}
.meters {
    position: absolute;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: clamp(8px, 1.5vw, 12px);
    width: 100%;
    height: 80%;
    align-items: stretch;
    justify-content: space-around;
    margin-bottom: clamp(15px, 2.5vw, 20px);
}
.rpm-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}



.meter-card {
    position: relative;
    top: -10px;
    left: -10px;
    flex: 1;
    min-width: 120px;
    height: 100%;
    padding: clamp(4px, 0.8vw, 8px);
    border-radius: 6px;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.45), 0 6px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#ammter1-label{
    position: absolute;
    bottom: -44px;        /* distance below meter */
    left: 120px;
    transform: translateX(-50%);

    font-size: 12px;
    white-space: nowrap;
    text-align: center;
}
.table-title {
    text-align: center;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.08em;
     padding: 4px 10px;
    background: linear-gradient(135deg, #fff7e2, #e3cfa5);
    box-shadow:
        0 3px 0 #b18c58,
        0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.3);
}
#voltmeter1-label {
    position: absolute;
    bottom: -44px;        /* distance below meter */
    left: 49%;
    transform: translateX(-50%);

    font-size: 12px;
    white-space: nowrap;
    text-align: center;
}
#rpm1-label {
    position: absolute;
    bottom: -44px;
    left: 83%;
    transform: translateX(-50%);
    font-size: 12px;
    white-space: nowrap;
}


#ammter1-label,
#voltmeter1-label,
#rpm1-label {
    bottom: clamp(-38px, -6vw, -44px);
    font-size: clamp(11px, 1.6vw, 12px);
}

.meter-card img {
    position: relative; 
    width: 100%; 
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    max-height: 100%;
}

.meter-card::before,
.meter-card::after {
    content: "";
    position: absolute;
    width: clamp(14px, 1.5vw, 18px);
    aspect-ratio: 1;
    background: url(images/screw.png) center/contain no-repeat;
    opacity: 0.8;
}

.meter-card::before {
    top: 0;
    left: 0;
}

.meter-card::after {
    bottom: 0;
    right: 0;
}
.workspace {
    background: #d7d0c4;
    border: 3px solid #111;
    padding: clamp(48px, 2vw, 18px);
}

.equipment-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: clamp(6px, 1.2vw, 12px);
    
}

.assembly {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(81px, 1vw, 10px);
    min-width: clamp(360px, 55vw, 560px);
    position: relative; /* allow absolute connector positioning */
}

.motor-box,
.generator-box {
    width: clamp(180px, 24vw, 240px);
    aspect-ratio: 1;
    border: 3px solid #111;
    background: linear-gradient(180deg, #b7b2a6, #c5bfb2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2vw, 18px);
    position: relative;
    height: 100%;
}

.motor-box img
 {
  width: 200px;          /* any value */
  height: 203px;         /* SAME value */
  border-radius: 50%;
  object-fit: cover; 

}


.generator-body {
    width: 125%;
    height: 128%;
}

.generator-rotor {
    position: absolute;
    width: 55%;
    height: 55%;
   
}
.coupler {
    width: clamp(80px, 12vw, 140px);
    height: auto;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 clamp(-19px, -1.5vw, -6px);
}

.coupler img {
    width: 100%;
    height: auto;
}

.connector-strip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: clamp(14px, 3vw, 22px);
    align-items: center;
}

.connector-strip.top {
    top: -18px;
}

.connector-strip.bottom {
    bottom: -18px;
}

.connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}



.littledot {
    width: clamp(12px, 2vw, 18px);
    height: clamp(12px, 2vw, 18px);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fefefe, #111 70%);
    border: 2px solid #111;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    display: inline-block;
    cursor: pointer;
}

.connector .label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1b2a78;
    letter-spacing: 0.02em;
}

.table-container {
    width: min(560px, 100%);
    align-self: stretch;
    display: flex;
    justify-content: center;
}

.data-table {
    width: 100%;
    border: 3px solid #111;
    background: #e5dfd3;
    display: grid;
    grid-template-rows: auto repeat(5, 1fr);
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.2fr;
    border-bottom: 2px solid #111;
}

.table-header span {
    padding: 4px;
    border-right: 2px solid #111;
    font-size: 0.9rem;
    font-weight: 600;
}

.table-header span:last-child {
    border-right: none;
}

.table-row {
    min-height: 38px;
    align-items: stretch;
}

.table-row span {
    border-right: 2px solid #111;
}

.table-row span:last-child {
    border-right: none;
}
 
.right-column .pill-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 17px;
    height: 400px;
    width: 10%;
    max-width: 280px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px; /* For scrollbar space */
    align-items: center;
}

.pill-btn,
.pill {
    position: relative;
    width: 100%;
    max-width: 260px;
    height: clamp(36px, 4vw, 46px);
    padding: 0 38px;
    border: none;
    border-radius: 50px;
    background-image: linear-gradient(to right, #232526 0%, #414345 51%, #232526 100%);
    background-size: 200% auto;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    font-size: clamp(0.8rem, 1.3vw, 0.95rem);
}

.pill-btn::before,
.pill::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transition: left 0.3s ease;
}

.pill-btn:hover,
.pill:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.pill-btn:active,
.pill:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.pill-btn:hover::before,
.pill:hover::before {
    left: 0;
}

.bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(10px, 2vw, 16px);
    margin-top: auto;
    flex-shrink: 0;
}

.bottom-row .pill.wide {
    width: clamp(120px, 16vw, 220px);
    margin-left: auto;
}

.mascot {
    position: relative;
    width: clamp(60px, 8vw, 80px);
    aspect-ratio: 1;
    margin-left: clamp(12px, 2vw, 24px);
    background: #f4f7fb;
    border: 3px solid #111;
    border-radius: 50% 50% 45% 45%;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}

.mascot .visor {
    width: 70%;
    height: 40%;
    background: linear-gradient(180deg, #1a9bf0, #012d49);
    border: 2px solid #111;
    border-radius: 50% 50% 40% 40%;
}

.mascot .body {
    position: absolute;
    bottom: -10%;
    width: 48%;
    height: 28%;
    background: #f4f7fb;
    border: 3px solid #111;
    border-radius: 12px 12px 10px 10px;
}

img {
    max-width: 124%;
    height: auto;
    display: block;
}

@media (max-width: 1100px) {
    .top-row {
        grid-template-columns: 1fr 2fr;
    }

.right-column {
    grid-column: span 2;
    border-left: none;
    border-top: 3px solid #111;
}
}

.graph-section {
    width: 100%;
    background: #d7d0c4;
    padding: clamp(12px, 2vw, 18px);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);
}

.graph-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: clamp(10px, 1.5vw, 16px);
}

.graph-header h3 {
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: #222;
}

.graph-caption {
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #444;
}

.graph-canvas {
    position: relative;
    height: clamp(200px, 28vw, 320px);
    /* border: 3px solid #111;
    background: linear-gradient(180deg, #f3efe6, #e5dfd3); */
    background-image:
        repeating-linear-gradient(to right, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(to top, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 60px);
    overflow: hidden;
}


.graph-canvas::before {
    left: 42px;
    top: 0;
    width: 2px;
    height: 100%;
}

.graph-canvas::after {
    left: 0;
    bottom: 36px;
    height: 2px;
    width: 100%;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 0;
    min-width: 70px;
}

.bar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.graph-bar {
    width: clamp(20px, 4vw, 28px);
    height: calc(var(--h) * 100%);
    border-radius: 6px 6px 3px 3px;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.35), 0 4px 8px rgba(0, 0, 0, 0.18);
}

.graph-bar.current {
    background: linear-gradient(180deg, #7ec3ff, #1b6fb8);
    border: 2px solid #0e3b64;
}

.graph-bar.voltage {
    background: linear-gradient(180deg, #ffc36c, #ff7d36);
    border: 2px solid #b35518;
}

.bar-label {
    font-size: 0.9rem;
    color: #1f1f1f;
    letter-spacing: 0.02em;
}

.mcb-label,
.starter-label,
#ammter1-label,
#ammter2-label,
#voltmeter1-label,
#voltmeter2-label {
    padding: 4px 10px;
    background: linear-gradient(135deg, #fff7e2, #e3cfa5);
   
    box-shadow:
        0 3px 0 #b18c58,
        0 6px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 780px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .left-column,
    .center-column,
    .right-column {
        border: none;
        border-bottom: 3px solid #111;
    }

    .right-column {
        border-left: none;
    }

    .equipment-row {
        justify-content: center;
    }
}

.meter-needle1 {
    position: absolute;
    width: 29px;
    height: auto;
    left: 53%;
    top: 50%;
    transform-origin: 50% 90%;
    transform: rotate(0deg);
}

/* =============================
   VOLTMETER NEEDLE (FIXED BASE)
============================= */
.meter-needle3 {
  position: absolute;
  width: 35px;
  height: auto;

  /* true center of the meter */
  left: 50%;
  top: 50%;

  /* base of needle stays fixed */
  transform: translate(-50%, -90%) rotate(-70deg);

  /* rotation pivot near bottom */
  transform-origin: 50% 90%;

  pointer-events: none;
}






.mcb-label {
  position: absolute;

  /* Fixed reference */
  left: 50%;
  bottom: -76px;

  transform: translateX(-50%);

  font-size: 14px;        /* FIXED size */
  line-height: 1;
  white-space: nowrap;

  padding: 4px 10px;
}

.starter-label {
  position: absolute;

  /* FIXED pixel reference */
  top: 288px;
  left: 47%;

  transform: translateX(-50%);

  font-size: 14px;        /* FIXED */
  line-height: 1;
  white-space: nowrap;
}


/* Slot markers: fixed pixel positions relative to the center column to avoid drift on resize */
#s1,#s2,#s3,#s4,#s5,#s6,#s7,#s8,#s9,#s10,#s11,#s12{
    position:absolute;
    width:33px;
  
}

 
/* second row */
#s5  { left: 60px;  top: 170px;  z-index: 10; }
#s6  { left: 130px; top: 170px; z-index: 10; }
#s7  { left: 235px; top: 170px;   z-index: 10; }
#s8  { left: 305px; top: 170px;  z-index: 10; }
#s9  { left: 405px; top: 170px;   z-index: 10; }
#s10 { left: 485px; top: 170px;   z-index: 10; }
#s11 { left: 580px; top: 170px;   z-index: 10; }
#s12 { left: 655px;top: 170px;  z-index: 10; }

/* bottom row near mcb/starter */
#s1 { left: 64px; top: 150px; }
#s2 { left: 94px; top: 150px; }
#s3 { left: 170px; top: 150px; }
#s4 { left: 220px; top: 150px; }
 
 .Rheostat{
    position: absolute;
    top: 400px;

}
.rheostat {
    position: relative; /* keeps knobs anchored to this element */
    width: 280px;
    min-height: 230px;
    margin: 10px auto 0;
    padding-bottom: 32px;
}
.rheostat-img-1{
   position: relative;
    width: 260px;
    margin-top:-100px;
}

.rheostat-img-2{
    position: relative;
    width: 260px;
    bottom:165px;
}
.nob1{
  position: absolute;
  top: 11%;
  left:23px;
  width: 31px;      
  height: 30px;
  cursor: grab;
  pointer-events: auto;
  transition:none;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.nob2{
  position: absolute;
  top: 62%;
  left: 23px;
  width: 31px;      
  top:-43px;
  aspect-ratio: 1 / 1;
  object-fit: contain; 
}

.rheostat-label1{
    position: relative;
    top: 125px;
    text-align: center;
    left:15px;
}
.rheostat-label2{
    position: relative;
    top: 75px;
    text-align: center;
    font-size: 17px;
}

/* Instructions hover panel */
.instructions-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Hidden by default */
.instructions-panel {
  position: absolute;
  right: 100%;
  top: 0;
  width: 520px;
  
  background: #f8f2e7;
  border: 3px solid #111;
  padding: 14px;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  display: none;
  z-index: 9999;
}

/* Show on hover */
.instructions-wrapper:hover .instructions-panel {
  display: block;
}

/* Table styling */
.conn-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 14px;
}

.conn-table th,
.conn-table td {
  border: 2px solid #111;
  padding: 4px 6px;
  text-align: center;
}

/* Steps list */
.steps-list {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 14px;
}

.steps-list li {
  margin-bottom: 6px;
}
/* Allow instruction popup to escape sidebar */
.right-column,
.right-column .pill-stack {
  overflow: visible !important;
}

.starter-handle {
  transform-origin: 50% 100%; /* pivot at bottom center */
  transition: transform 0.4s ease-in-out;
}


.starter-handle.disabled {
  cursor: not-allowed;
  opacity: 1;
}
.starter-block {
  position: absolute;
  top: -13.42%;
  right: -2.25%;
    
  
}

 

.starter-handle {
  position: absolute;
  width: 16.67%;
  height: auto;
  top: 2.04px;
  left: 11.67px;
  transform: none;
  cursor: default;
  z-index: 10;
  pointer-events: auto;
}

.starter-handle:active {
  cursor: default;
}

.starter-handle.moved {
  left: 68%;
  top: 15%;
}
#nob2 {
  transition: left 0.2s ease;
}

/* Observation table */
.observation-section {
    background:#d7d0c4;
    border:none;
    border-radius: 6px;
    padding: clamp(12px, 2vw, 16px);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vw, 14px);
    margin-top: clamp(12px, 2vw, 18px);
}

.observation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.observation-caption {
    margin-top: 4px;
    color: #3c3227;
    font-size: 0.95rem;
}

.observation-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.observation-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: #2f241a;
    letter-spacing: 0.03em;
}

.observation-controls input {
    padding: 10px 12px;
    min-width: 160px;
    background: transparent;
    border: 2px solid rgba(17, 17, 17, 0.3);
    border-radius: 10px;
    box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, 0.6),
        inset 0 -3px 8px rgba(0, 0, 0, 0.08),
        0 6px 12px rgba(0, 0, 0, 0.12);
    font-weight: 600;
    color: #2f241a;
}

.instructions-btn {
  position: relative;
  left: -10px;   /* adjust: -6px to -14px as needed */
}
.obs-add-btn {
    width: 100%;
    max-width: 260px;          /* same as other pill buttons */
    height: clamp(36px, 4vw, 46px);
    padding: 0 38px;           /* same padding as .pill-btn */
}

.observation-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

#observationTable {
    width: 100%;
    border-collapse: collapse;
    background:transparent;
    border:none;
}

#observationTable th,
#observationTable td {
    border: 1px solid #111;
    padding: 8px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

#observationTable thead {
    background: linear-gradient(135deg, #f7efde, #e2d5c2 50%, #cdb9a0);
    color: #2c1a0a;
}

#observationTable tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}

#observationTable .placeholder-row td {
    color: #6b5e4e;
    font-weight: 600;
}
.nob1 {
  transition: none;
}

.meter-needle1 {
  transform: translate(-60%, -90%) rotate(-71deg);
}
.meter-needle1 {
  transform-origin: 50% 90%;
}
.observation-header h3 {
  white-space: nowrap;      /* 🚫 no line break */
  overflow: visible;         /* prevent overflow */
  text-overflow: ellipsis;  /* safety */
}
.generator-rotor {
  transform-origin: 50% 50%;
  will-change: transform;
}
/* RPM digital display – FINAL (perfect center, zoom safe) */
.rpm-card {
  position: relative;
}
/* RPM DIGITAL DISPLAY – FIXED SIZE (ZOOM PROOF) */
.rpm-display {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -62%);
  width: 120px;
  height: 38px;
  min-width: 120px;
  min-height: 38px;
  max-width: 120px;
  max-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #d20a1b;
  font-family: "Digital-7", monospace;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 2px;
  border-radius: 4px;
  box-shadow:
    inset 0 0 6px rgba(0, 255, 204, 0.3),
    inset 0 0 2px rgba(255, 255, 255, 0.2);
  pointer-events: none;
  /* Prevent scaling on zoom and screen resize */
  box-sizing: content-box;
  /* Use absolute units for font and border */
  font-size: 26px !important;
  border: 2px solid #222;
  /* Prevent layout shifts */
  flex-shrink: 0;
  flex-grow: 0;
  /* Prevent inherited scaling */
  zoom: 1;
}




#auto {
  margin-bottom: 6px;
}

.observation-section {
  margin-top: 0;
}

#outputGraph {
  width: 100%;
  height: 100%;
}


.speak-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  flex-shrink: 0;
}

.speak-btn__svg {
  width: 100%;
  height: 100%;
}

/* Animated wave parts inside SVG */
.speak-btn__wave {
  opacity: 0.35;
}

/* Active (speaking) animation triggers */
.speak-btn[aria-pressed="true"] .speak-btn__wave {
  animation: speakWave 1.2s ease-in-out infinite;
}

.speak-btn[aria-pressed="true"] .speak-btn__wave.wave-2 {
  animation-delay: 0.15s;
}

.speak-btn[aria-pressed="true"] .speak-btn__wave.wave-3 {
  animation-delay: 0.3s;
}

.speak-btn[aria-pressed="true"] .speak-btn__icon {
  animation: speakIcon 0.9s ease-in-out infinite;
}

/* =========================
   SVG ICON ANIMATIONS
=========================  */

@keyframes speakWave {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@keyframes speakIcon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .speak-btn[aria-pressed="true"] .speak-btn__wave,
  .speak-btn[aria-pressed="true"] .speak-btn__icon {
    animation: none;
  }
}
/* =========================
   GRAPH SECTION (FINAL)
========================= */
.graph-section {
  width: 100%;
  background: #d7d0c4; /* same lab background */
  padding: clamp(12px, 2vw, 18px);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* =========================
   GRAPH HEADER
========================= */
.graph-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(10px, 1.5vw, 16px);
}

.graph-header h3 {
  text-align: left;
  justify-self: start;   /* ⬅ moves label to left */
  margin-left: 12px;     /* adjust spacing if needed */
}


/* Buttons on right */
.graph-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* =========================
   GRAPH CANVAS AREA
========================= */
.graph-canvas {
  position: relative;
  height: clamp(200px, 28vw, 320px);
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(0, 0, 0, 0.07) 0 1px,
      transparent 1px 60px
    ),
    repeating-linear-gradient(
      to top,
      rgba(0, 0, 0, 0.07) 0 1px,
      transparent 1px 60px
    );
  overflow: hidden;
  border-radius: 4px;
}

.graph-bars {
  position: absolute;
  inset: clamp(16px, 2vw, 22px)
         clamp(16px, 2vw, 22px)
         clamp(28px, 3vw, 36px)
         clamp(48px, 5vw, 60px);
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2vw, 20px);
}

/* Placeholder bars (optional visual) */
.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bar-wrap {
  display: flex;
  gap: 8px;
}

.graph-bar {
  width: clamp(20px, 4vw, 28px);
  height: calc(var(--h, 0.5) * 100%);
  border-radius: 6px 6px 3px 3px;
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    0 4px 8px rgba(0, 0, 0, 0.18);
}

.graph-bar.current {
  background: linear-gradient(180deg, #7ec3ff, #1b6fb8);
  border: 2px solid #0e3b64;
}

.graph-bar.voltage {
  background: linear-gradient(180deg, #ffc36c, #ff7d36);
  border: 2px solid #b35518;
}

.bar-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f1f1f;
}

/* =========================
   PLOTLY GRAPH CONTAINER
========================= */
.graph-plot {
  position: absolute;
  inset: clamp(12px, 2vw, 16px);
  display: none; /* visible only after clicking Graph */
}

/* Ensure Plotly fills container fully */
.graph-plot > div {
  width: 100% !important;
  height: 100% !important;
}

/* =========================
   PRINT OPTIMIZATION
========================= */
@media print {
  .graph-bars {
    display: none !important;
  }

  .graph-plot {
    display: block !important;
  }

  .graph-actions {
    display: none;
  }
}


/* STEP 3: Increase ammeter size safely */
.ammeter-card .ammeter-inner {
  position: relative;
  width: 260px;
  height: 260px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transform: none;
}


.components-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.components-overlay.hidden {
  display: none;
}

.components-dialog {
  width: min(1100px, 92vw);
  height: min(680px, 90vh);
  background: #f7f1e6;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.components-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #efe5d3;
  border-bottom: 1px solid #d6c7b1;
}

.components-title {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.components-actions {
  display: flex;
  gap: 8px;
}

.comp-btn {
  background: #2f5a78;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.comp-close {
  background: #444;
  color: #fff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

#componentsFrame {
  flex: 1;
  border: none;
}
/* COMPONENTS LAUNCHER BUTTON */
.components-launcher {
  position: fixed;
  bottom: 28px;
  right: 110px; /* keeps distance from other floating buttons */
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(99, 68, 68, 0.55);
  background: radial-gradient(
    circle at 30% 25%,
    rgba(39, 35, 35, 0.95),
    rgba(92, 87, 81, 0.85) 45%,
    rgba(97, 86, 77, 0.95) 100%
  );
  box-shadow:
    0 18px 32px rgba(8, 10, 15, 0.28),
    inset 0 2px 6px rgba(255, 255, 255, 0.65),
    inset 0 -6px 12px rgba(112, 84, 56, 0.12);
  cursor: pointer;
  z-index: 5000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.components-launcher:hover {
  transform: translateY(-3px);
  box-shadow:
    0 24px 40px rgba(8, 10, 15, 0.35),
    inset 0 2px 8px rgba(255, 255, 255, 0.7);
}

.components-launcher__icon {
  width: 68px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(47, 90, 120, 0.4));
}
/* =========================
   FLOATING CHATBOT WIDGET
========================= */

.chatbot-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;

  display: flex;
  flex-direction: row;    
  align-items: center;
  gap: 14px;               
  z-index: 6000;
}


/* CHATBOT BUTTON */
.chatbot-launcher {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.5);
  background: radial-gradient(circle at 30% 30%, #ffffff, #dbeafe);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(15, 23, 42, 0.45);
}

.chatbot-launcher__icon {
  width: 69px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.6));
  
  animation: chatbotIconFloat 2.4s ease-in-out infinite;
  will-change: transform;
}

/* COMPONENTS BUTTON – remove fixed positioning */
.components-launcher {
  position: static; /* IMPORTANT */
}

/* =========================
   CHATBOT ICON FLOAT ANIMATION
========================= */

@keyframes chatbotIconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px); /* move up */
  }
}
/* =========================
   CHATBOT REPEATING TEXT
========================= */

.chatbot-text {
  position: absolute;
  right: 100%;                     /* move text to LEFT of button */
  margin-right: 12px;              /* gap between text & button */
  top:25%;                        /* vertical centering */
  transform: translateY(-50%) translateX(12px);

  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;

  box-shadow: 0 10px 30px rgba(0,0,0,0.35);

  opacity: 0;
  animation: chatbotHintLoop 3s ease-in-out infinite;
}


/* Optional "Hi" badge */
.chatbot-text::before {
  content: "Hi";
  background: #38bdf8;
  color: #0f172a;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  margin-right: 8px;
}
@keyframes chatbotHintLoop {
  /* Hidden *
  0% {
    opacity: 0;
    transform: translateX(12px);
  }

  /* Slide in */
  10% {
    opacity: 1;
    transform: translateX(0);
  }

  /* Stay visible */
  40% {
    opacity: 1;
    transform: translateX(0);
  }

  /* Slide out */
  50% {
    opacity: 0;
    transform: translateX(12px);
  }

  /* Stay hidden (pause) */
  100% {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* =========================
   CHATBOT PANEL
========================= */

.chatbot-panel {
  position: fixed;
  right: 28px;
  bottom: 120px;

  width: min(420px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 160px));

  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);

  display: flex;
  flex-direction: column;

  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
  transition: all 0.28s ease;

  z-index: 7000;
}

.chatbot-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chatbot-panel-header {
  padding: 14px 16px;
  background: linear-gradient(120deg, #021a2c, #064073, #0b60a8);
  color: #fff;

  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.chatbot-panel-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.chatbot-panel-caption {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}

.chatbot-panel-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.chatbot-panel-body {
  flex: 1;
  position: relative;
  background: #f8fafc;
}

.chatbot-panel-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #475569;
}

.chatbot-panel iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}

.chatbot-panel iframe.visible {
  display: block;
}

/* Mobile */
@media (max-width: 640px) {
  .chatbot-panel {
    left: 12px;
    right: 12px;
    bottom: 100px;
    width: auto;
    height: 75vh;
  }
}
/* Main chatbot box */
.chatbot-panel {
  border-radius: 22px;          
  overflow: hidden;         
}

.chatbot-panel-header {
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.chatbot-panel iframe {
  border-radius: 0 0 22px 22px;  
}
/* ================================
   ENDPOINT GUIDANCE ANIMATION
================================ */

/* Base point container */
.point {
  position: relative;
  z-index: 10;
}

/* Active guidance state */
.point.endpoint-highlight::before {
  content: "";
  position: absolute;
  inset: -14px;               /* controls ring size */
  border-radius: 50%;
  border: 3px solid rgba(255, 0, 0, 0.85);
  animation: endpointPulse 1.3s ease-out infinite;
  pointer-events: none;
}

/* Secondary glow */
.point.endpoint-highlight::after {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.25);
  animation: endpointGlow 1.3s ease-out infinite;
  pointer-events: none;
}

/* Pulse ring */
@keyframes endpointPulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Soft glow */
@keyframes endpointGlow {
  0% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
  }
}
/* FORCE AMMETER SIZE INCREASE – FINAL FIX */
.ammeter-card .ammeter-inner {
  transform: scale(1.25);   /* 🔼 increase size here */
  transform-origin: center center;
}
