:root{
  --bg:#e9eef6;
  --panel:rgba(255,255,255,.74);
  --panel-strong:#ffffff;
  --line:rgba(75, 95, 130, 0.16);
  --text:#0f172a;
  --muted:#64748b;
  --blue:#0f62fe;
  --blue2:#3b82f6;
  --green:#059669;
  --green2:#10b981;
  --red:#ef4444;
  --amber:#f59e0b;
  --navy:#0f172a;
  --cream:#f8fbff;
  --shadow:0 20px 50px rgba(15, 23, 42, 0.10);
  --shadow-strong:0 28px 70px rgba(15, 23, 42, 0.16);
  --radius:22px;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  height:100%;
  font-family:"Avenir Next","SF Pro Display","Segoe UI",Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow:hidden;
  user-select:auto;
}

body{
  background:
    radial-gradient(circle at 12% 8%, rgba(15,98,254,.18), transparent 20%),
    radial-gradient(circle at 88% 14%, rgba(14,165,233,.14), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(99,102,241,.10), transparent 26%),
    linear-gradient(180deg,#f7faff,#edf2f9 44%,#e7edf6);
}

.hidden{display:none !important}

.app-shell{
  height:100vh;
  width:100vw;
  display:flex;
  flex-direction:column;
}

.no-select {
  user-select: none;
  -webkit-user-select: none;
}

.component-card,
.example-item,
.canvas-item,
.item-head,
.item-body,
.logic-chip,
.pill,
.topbar,
.panel-header{
  user-select:none;
  -webkit-user-select:none;
}

.project-item{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:8px;
  background:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.project-info{
  display:flex;
  flex-direction:column;
}

.project-name{
  font-weight:700;
}

.project-date{
  font-size:12px;
  color:var(--muted);
}

.project-actions{
  display:flex;
  gap:6px;
}

.ai-teacher-page{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(circle at top left, rgba(15,98,254,.18), transparent 24%),
    radial-gradient(circle at top right, rgba(14,165,233,.16), transparent 22%),
    linear-gradient(180deg,#f8fbff,#eef4fb);
}

.ai-topbar{
  height:76px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:rgba(247,250,255,.78);
  backdrop-filter:blur(18px);
  box-shadow:0 14px 30px rgba(15,23,42,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.ai-topbar-title{
  display:flex;
  align-items:center;
  gap:14px;
}

.ai-topbar-title h2{
  margin:0;
  font-size:24px;
  letter-spacing:-.4px;
}

.ai-topbar-title p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.ai-shell{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns:300px 1fr;
  gap:16px;
  padding:16px;
}

.ai-sidebar,
.ai-chat-panel{
  background:linear-gradient(180deg,rgba(255,255,255,.82),rgba(242,247,255,.74));
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--shadow-strong);
  min-height:0;
  overflow:hidden;
}

.ai-sidebar{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:16px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

.ai-sidebar h3{
  margin:0 0 8px;
  font-size:16px;
}

.ai-card{
  border:1px solid rgba(75,95,130,.12);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(243,248,255,.82));
  padding:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 10px 22px rgba(15,23,42,.04);
  flex:0 0 auto;
}

.ai-card p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.ai-chip-list{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.ai-chip{
  border:1px solid rgba(15,98,254,.16);
  background:linear-gradient(180deg,#f5f9ff,#eaf2ff);
  color:#1d4ed8;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}

.ai-chat-panel{
  display:flex;
  flex-direction:column;
}

.ai-chat-head{
  padding:18px 20px 12px;
  border-bottom:1px solid #eef2f8;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(241,246,255,.92));
}

.ai-chat-head h3{
  margin:0;
  font-size:18px;
}

.ai-chat-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:13px;
}

.ai-messages{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
  background:
    linear-gradient(180deg,rgba(249,251,255,.74),rgba(238,244,252,.96)),
    radial-gradient(circle at top, rgba(15,98,254,.06), transparent 34%);
}

.ai-message{
  max-width:min(760px,82%);
  padding:14px 16px;
  border-radius:20px;
  line-height:1.55;
  font-size:14px;
  white-space:pre-wrap;
  animation:messageRise .22s ease;
}

.ai-message.teacher{
  align-self:flex-start;
  background:linear-gradient(180deg,#ffffff,#f3f8ff);
  border:1px solid rgba(75,95,130,.12);
  box-shadow:0 14px 28px rgba(15,23,42,.06);
}

.ai-message.student{
  align-self:flex-end;
  background:linear-gradient(135deg,#0f62fe,#3b82f6);
  color:#fff;
  box-shadow:0 18px 34px rgba(15,98,254,.22);
}

.ai-inputbar{
  padding:16px 18px 18px;
  border-top:1px solid #eef2f8;
  background:rgba(250,252,255,.92);
  display:flex;
  gap:12px;
  align-items:flex-end;
}

.ai-inputbar textarea{
  min-height:56px;
  max-height:160px;
  resize:vertical;
  border-radius:18px;
}

.ai-quick-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

@keyframes messageRise{
  from{opacity:0; transform:translateY(10px)}
  to{opacity:1; transform:translateY(0)}
}

.topbar{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  background:rgba(248,251,255,.72);
  backdrop-filter: blur(18px);
  border-bottom:1px solid var(--line);
  z-index:20;
  box-shadow:0 14px 34px rgba(15,23,42,.08);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}


.brand-logo{
  width:56px;
  height:56px;
  object-fit:contain;
}

.brand-text h1{
  margin:0;
  font-size:28px;
  letter-spacing:-.8px;
  font-weight:900;
}

.brand-text p{
  opacity:0.7;
}

.brand-text p{
  margin:3px 0 0;
  color:var(--muted);
  font-size:13px;
  letter-spacing:.02em;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap; /* 🔥 FIX */
}

button, .btn{
  border:none;
  border-radius:14px;
  background:var(--blue);
  color:#fff;
  padding:10px 14px;
  cursor:pointer;
  font-weight:700;

  height:40px;              /* 🔥 ADD THIS */
  display:flex;             /* 🔥 ADD */
  align-items:center;       /* 🔥 ADD */
  justify-content:center;   /* 🔥 ADD */

  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .18s ease, border-color .18s ease;
  box-shadow:0 14px 28px rgba(15,98,254,.18);
}

button:hover, .btn:hover{
  transform:translateY(-1px);
  background:var(--blue2);
  box-shadow:0 18px 32px rgba(15,98,254,.22);
}

button.secondary{
  background:rgba(255,255,255,.82);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:0 10px 22px rgba(15,23,42,.05);
}

button.green{
  background:var(--green);
  box-shadow:0 8px 18px rgba(34,197,94,.14);
}

button.red{
  background:var(--red);
  box-shadow:0 8px 18px rgba(239,68,68,.14);
}

button.amber{
  background:var(--amber);
  box-shadow:0 8px 18px rgba(245,158,11,.14);
}

.layout{
  flex:1;
  display:grid;
  grid-template-columns: 300px 1fr 320px;
  gap:18px;
  padding:18px;
  min-height:0;
}

.panel{
  background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(243,248,255,.76));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-strong);
  min-height:0;
  overflow:hidden;
  backdrop-filter:blur(18px);
}

.panel-header{
  padding:16px 16px 10px;
  border-bottom:1px solid rgba(75,95,130,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background:linear-gradient(180deg,rgba(255,255,255,.84),rgba(240,246,255,.38));
}

.panel-header h2{
  margin:0;
  font-size:22px;
  letter-spacing:-.5px;
}

.panel-header small{
  color:var(--muted);
  display:block;
  margin-top:3px;
  font-size:12px;
}

.panel-body{
  padding:16px;
  overflow:auto;
  height:calc(100% - 68px);
}

.left-section-title{
  margin:10px 0 12px;
  font-size:14px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
}

.component-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.component-card{
  background:linear-gradient(180deg,#ffffff,#f2f7ff);
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  padding:14px;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position:relative;
  overflow:hidden;
  min-height:98px;
  box-shadow:0 12px 24px rgba(15,23,42,.05);
}

.component-card:hover{
  transform:translateY(-3px);
  box-shadow:0 18px 30px rgba(15,23,42,.10);
  border-color:rgba(15,98,254,.18);
}

.component-card::after{
  content:"";
  position:absolute;
  right:-18px;
  top:-18px;
  width:72px;
  height:72px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(15,98,254,.12), rgba(15,98,254,0));
}

.component-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#ffffff,#edf5ff);
  border:1px solid rgba(15,98,254,.12);
  color:var(--blue);
  font-size:20px;
  margin-bottom:10px;
  box-shadow:0 10px 20px rgba(15,98,254,.10);
}

.component-name{
  font-weight:800;
  font-size:14px;
  margin-bottom:4px;
}

.component-meta{
  color:var(--muted);
  font-size:12px;
}

.example-list{
  display:grid;
  gap:10px;
}

.example-item{
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  padding:14px;
  background:linear-gradient(180deg,#ffffff,#f3f8ff);
  cursor:pointer;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  box-shadow:0 10px 22px rgba(15,23,42,.04);
}

.example-item:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 26px rgba(15,23,42,.08);
  border-color:rgba(15,98,254,.18);
}

.example-item b{
  display:block;
  margin-bottom:6px;
}

.canvas-panel{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  overflow:hidden;
}

.canvas-toolbar{
  padding:12px 14px;
  border-bottom:1px solid rgba(75,95,130,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(241,246,255,.60));
  z-index:3;
}

.toolbar-group{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.zoom-display{
  padding:8px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.82);
  font-weight:700;
  color:var(--muted);
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

.workspace-area{
  position:relative;
  flex:1;
  min-height:0;
  overflow:hidden;
  background:
    linear-gradient(to right, rgba(148,163,184,.10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148,163,184,.10) 1px, transparent 1px),
    radial-gradient(circle at top, rgba(255,255,255,.74), rgba(237,244,253,.30)),
    linear-gradient(180deg,#fdfefe,#eef4fb);
  background-size: 24px 24px, 24px 24px, auto;
}

.workspace-area.grid-hidden{
  background-size:0 0, 0 0, auto;
}

.canvas-world{
  position:absolute;
  inset:0;
  transform-origin:0 0;
}

.wire-layer{
  position:absolute;
  inset:0;
  pointer-events:auto;
  overflow:visible;
}

.items-layer{
  position:absolute;
  inset:0;
}

.logic-dock{
  position:absolute;
  left:16px;
  right:16px;
  bottom:16px;
  min-height:148px;
  border:1px solid rgba(75,95,130,.12);
  border-radius:26px;
  background:rgba(250,252,255,.78);
  backdrop-filter: blur(8px);
  box-shadow:0 22px 36px rgba(15,23,42,.10);
  padding:16px;
  z-index:4;
}

.logic-dock h3{
  margin:0 0 10px;
  font-size:18px;
}

.logic-list{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  min-height:70px;
  align-items:flex-start;
}

.logic-chip{
  background:linear-gradient(180deg,#f5f9ff,#e9f1ff);
  color:#1d4ed8;
  border:1px solid rgba(15,98,254,.12);
  border-radius:16px;
  padding:10px 12px;
  font-weight:800;
  font-size:13px;
  display:flex;
  align-items:center;
  gap:8px;
  animation:popIn .22s ease;
}

.logic-chip button{
  box-shadow:none;
  padding:5px 8px;
  border-radius:8px;
  font-size:12px;
  background:#fff;
  color:#1e3a8a;
  border:1px solid #bfdbfe;
}

@keyframes popIn{
  from{transform:scale(.92);opacity:0}
  to{transform:scale(1);opacity:1}
}

.canvas-item{
  position:absolute;
  width:120px;
  min-height:78px;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff,#f3f8ff);
  border:1px solid rgba(75,95,130,.12);
  box-shadow:0 18px 34px rgba(15,23,42,.10);
  cursor:grab;
  transition:box-shadow .18s ease, transform .18s ease;
  overflow:hidden;
  animation:itemAppear .22s ease;
}

@keyframes itemAppear{
  from{opacity:0; transform:translateY(8px) scale(.96)}
  to{opacity:1; transform:translateY(0) scale(1)}
}

.canvas-item.dragging{
  cursor:grabbing;
  box-shadow:0 30px 48px rgba(15,23,42,.18);
  z-index:10;
}

.item-head{
  padding:10px 12px 8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-bottom:1px solid rgba(75,95,130,.10);
  background:linear-gradient(180deg,#ffffff,#f2f7ff);
}

.item-head b{
  font-size:13px;
  letter-spacing:-.2px;
}

.item-body{
  padding:10px 12px 14px;
  font-size:12px;
  color:var(--muted);
}

.terminal-hint{
  display:block;
  margin-top:6px;
  font-size:11px;
  font-weight:700;
  color:#64748b;
}

.port{
  position:absolute;
  width:16px;
  height:16px;
  border-radius:50%;
  background:var(--blue);
  border:3px solid #fff;
  box-shadow:0 6px 10px rgba(37,99,235,.22);
  cursor:pointer;
  transition:transform .14s ease;
}

.port:hover{
  transform:scale(1.12);
}

.port.left{left:-8px; top:50%; transform:translateY(-50%)}
.port.right{right:-8px; top:50%; transform:translateY(-50%)}
.port.top{top:-8px; left:50%; transform:translateX(-50%)}
.port.bottom{bottom:-8px; left:50%; transform:translateX(-50%)}
.port.negative{
  left:-8px;
  top:50%;
  transform:translateY(-50%);
  background:#0f172a;
  box-shadow:0 6px 10px rgba(15,23,42,.24);
}
.port.positive{
  right:-8px;
  top:50%;
  transform:translateY(-50%);
  background:#ef4444;
  box-shadow:0 6px 10px rgba(239,68,68,.24);
}

.port-label{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  font-size:12px;
  font-weight:900;
  color:#0f172a;
  pointer-events:none;
}

.port-label.negative{left:10px;}
.port-label.positive{right:10px; color:#b91c1c;}

.canvas-item.bursting{
  border-color:#fb7185;
  box-shadow:0 0 0 4px rgba(251,113,133,.18), 0 24px 42px rgba(239,68,68,.18);
  animation:burstShake .28s ease infinite alternate;
}

.burst-indicator{
  font-size:20px;
  filter:drop-shadow(0 8px 16px rgba(239,68,68,.35));
  animation:burstPop .45s ease infinite alternate;
}

.led-indicator{
  width:18px;
  height:18px;
  border-radius:50%;
  background:#141414;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.2);
  transition:background .18s ease, box-shadow .18s ease;
}

.led-indicator.on{
  background:#ff3b30;
  box-shadow:0 0 0 6px rgba(255,59,48,.12), 0 0 18px rgba(255,59,48,.45);
}

.motor-wheel{
  width:22px;
  height:22px;
  border-radius:50%;
  border:4px solid #475569;
  border-top-color:#94a3b8;
  transition:transform .2s linear;
}

.motor-wheel.on{
  animation:spin .8s linear infinite;
}

@keyframes spin{
  from{transform:rotate(0)}
  to{transform:rotate(360deg)}
}

.buzzer-wave{
  width:18px;
  height:18px;
  border-radius:50%;
  background:#1e293b;
  position:relative;
}

.buzzer-wave.on::before,
.buzzer-wave.on::after{
  content:"";
  position:absolute;
  inset:-4px;
  border:2px solid rgba(245,158,11,.6);
  border-radius:50%;
  animation:pulse 1s infinite;
}

.buzzer-wave.on::after{
  animation-delay:.3s;
}

@keyframes pulse{
  from{transform:scale(.8);opacity:1}
  to{transform:scale(1.8);opacity:0}
}

@keyframes burstPop{
  from{transform:scale(.95) rotate(-6deg)}
  to{transform:scale(1.1) rotate(6deg)}
}

@keyframes burstShake{
  from{transform:translateX(-2px)}
  to{transform:translateX(2px)}
}

.dashboard-card{
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  padding:16px;
  background:linear-gradient(180deg,#ffffff,#f3f8ff);
  margin-bottom:12px;
  box-shadow:0 12px 24px rgba(15,23,42,.05);
}

.stat{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin:8px 0;
  color:var(--muted);
  font-size:14px;
}

.stat b{
  color:var(--text);
}

.leaderboard{
  display:grid;
  gap:8px;
}

.leader-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  background:#fff;
}

.login-screen{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 20% 15%, rgba(201,107,44,.22), transparent 20%),
    radial-gradient(circle at 80% 20%, rgba(23,128,93,.12), transparent 18%),
    linear-gradient(180deg,#fff9f2,#f4ebe1);
}

.login-logo{
  width:65px;
  height:65px;
  object-fit:contain;
  border-radius:14px;
}

.login-card{
  width:min(520px,92vw);
  background:rgba(255,253,249,.88);
  backdrop-filter: blur(18px);
  border:1px solid rgba(181,149,121,.18);
  border-radius:32px;
  box-shadow:0 34px 90px rgba(61,40,22,.16);
  padding:30px;
  animation:rise .28s ease;
}

@keyframes rise{
  from{transform:translateY(18px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

.login-top{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:18px;
}

.login-badge{
  width:54px;
  height:54px;
  border-radius:18px;
  background:linear-gradient(135deg,var(--blue),var(--green2));
  display:grid;
  place-items:center;
  color:#fff;
  font-size:24px;
  font-weight:900;
  box-shadow:0 12px 24px rgba(37,99,235,.18);
}

.login-top h2{
  margin:0;
  font-size:28px;
  letter-spacing:-.6px;
}

.login-top p{
  margin:5px 0 0;
  color:var(--muted);
}

.field-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}

.guide-page{
  position:fixed;
  inset:0;
  z-index:300;
  display:flex;
  align-items:center;
  justify-content:center;
  background:radial-gradient(circle at top, #1e293b, #020617);
}

.guide-close-btn{
  padding:12px 20px;
  border:none;
  border-radius:12px;
  background:#f97316;
  color:white;
  font-weight:bold;
  cursor:pointer;
}

.project-page{
  display:flex;
  flex-direction:column;
  position:fixed;
  inset:0;
  background:#f5f7fb;
  z-index:9999;
  padding:20px;
  overflow:auto;
}

.project-page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}

.project-page-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:14px;
}

.project-page-card{
  background:white;
  border:1px solid #dbe3f0;
  border-radius:14px;
  padding:14px;
  box-shadow:0 10px 20px rgba(0,0,0,0.05);
}

.project-card-meta{
  color:gray;
  font-size:12px;
  margin:0 0 6px;
}

.project-card-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}

.project-card-grade{
  font-size:12px;
  margin:0;
  color:#16a34a;
  font-weight:700;
}

.card-title{
  margin:0 0 10px;
}

.output-state{
  display:flex;
  align-items:center;
  gap:8px;
}

.coach-fix-text{
  margin-top:10px;
  color:var(--text);
  font-weight:700;
}

.field-spaced{
  margin-top:12px;
}

.compact-pill{
  padding:4px 8px;
  font-size:11px;
}

.component-status-icon{
  font-size:18px;
}

#guidePage div {
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.field label{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.field input, .field select, textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
  color:var(--text);
  outline:none;
  font-size:14px;
  transition:border-color .16s ease, box-shadow .16s ease;
}

.field input:focus, .field select:focus, textarea:focus{
  border-color:#9ec0ff;
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}

.password-input-wrap{
  position:relative;
  display:flex;
  align-items:center;
}

.password-input-wrap input{
  padding-right:78px;
}

.password-toggle-btn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  min-width:58px;
  height:32px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(75,95,130,.18);
  background:rgba(255,255,255,.9);
  color:var(--text);
  box-shadow:none;
  font-size:12px;
}

.password-toggle-btn:hover{
  transform:translateY(-50%);
  background:#eff6ff;
  box-shadow:none;
}

.login-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top:18px;
  flex-wrap:wrap;
}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:120;
  background:#111827;
  color:#fff;
  padding:12px 14px;
  border-radius:14px;
  box-shadow:0 20px 40px rgba(17,24,39,.25);
  opacity:0;
  transform:translateY(8px);
  pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

.small-note{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
  line-height:1.45;
}

.mini-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}

.teacher-area textarea{
  min-height:90px;
  resize:vertical;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
  font-size:12px;
  font-weight:800;
}

@media (max-width: 1200px){
  .layout{
    grid-template-columns:280px 1fr 300px;
  }
}

@media (max-width: 1000px){
  .layout{
    grid-template-columns:1fr;
  }
  .panel{
    min-height:260px;
  }
  html,body{
    overflow:auto;
  }
  .app-shell{
    height:auto;
    min-height:100vh;
  }
  .workspace-area{
    height:70vh;
  }
}
#deleteBin{
  position:absolute;
  right:20px;
  bottom:20px;
  width:70px;
  height:70px;
  background:#111827;
  color:#fff;
  font-size:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:15px;
  z-index:999; /* 🔥 ADD THIS */
}

#deleteBin.active{
  background:red;
}

input.error {
border-color: red !important;
box-shadow: 0 0 0 2px rgba(255,0,0,0.1);
  }

  .guide-shell{
width:min(980px, 92vw);
max-height:min(90vh, 860px);
overflow:auto;
background:linear-gradient(180deg, rgba(15,23,42,0.96), rgba(2,6,23,0.98));
backdrop-filter: blur(20px);
border:1px solid rgba(255,255,255,0.12);
border-radius:28px;
padding:30px;
color:white;
box-shadow:0 30px 80px rgba(2,6,23,0.45);
  }

  .guide-header{
display:flex;
align-items:center;
justify-content:space-between;
gap:18px;
margin-bottom:22px;
  }

  .guide-title{
display:flex;
align-items:center;
gap:16px;
  }

  .guide-title img{
width:60px;
  }

  .guide-title h1{
margin:0;
font-size:32px;
  }

  .guide-title p{
margin:4px 0 0;
color:rgba(255,255,255,0.7);
  }

  .guide-intro{
padding:16px 18px;
border-radius:18px;
background:rgba(255,255,255,0.06);
border:1px solid rgba(255,255,255,0.08);
color:rgba(255,255,255,0.84);
line-height:1.6;
margin-bottom:20px;
  }

  .guide-media{
margin-bottom:22px;
border-radius:22px;
overflow:hidden;
background:#000;
border:1px solid rgba(255,255,255,0.08);
box-shadow:0 18px 40px rgba(0,0,0,0.28);
  }

  .guide-media video{
width:100%;
max-height:320px;
display:block;
object-fit:cover;
  }

  .guide-grid{
display:grid;
grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
gap:16px;
  }

  .guide-step{
background:linear-gradient(180deg, rgba(15,23,42,0.92), rgba(17,24,39,0.85));
padding:18px;
border-radius:18px;
border:1px solid rgba(255,255,255,0.08);
  }

  .guide-step .step-number{
display:inline-flex;
align-items:center;
justify-content:center;
width:34px;
height:34px;
border-radius:999px;
background:#f97316;
color:white;
font-weight:800;
margin-bottom:12px;
  }

  .guide-step h3{
margin:0 0 8px;
font-size:18px;
  }

  .guide-step p{
margin:0;
color:rgba(255,255,255,0.72);
line-height:1.55;
  }

  .guide-footer{
display:flex;
align-items:center;
justify-content:space-between;
gap:16px;
margin-top:24px;
flex-wrap:wrap;
  }

.guide-footer-note{
  color:rgba(255,255,255,0.66);
  font-size:14px;
}

.voltage-input{
  width:100%;
  accent-color:#f97316;
  margin-top:8px;
}

.voltage-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:72px;
  padding:8px 12px;
  border-radius:999px;
  background:#fff7ed;
  color:#c2410c;
  border:1px solid #fdba74;
  font-weight:800;
}

.voltage-guide{
  display:grid;
  gap:8px;
}

.voltage-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  background:#fff;
}

.voltage-row span{
  color:var(--muted);
  font-size:13px;
}
