* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
#app { display: flex; height: 100vh; background: #0c0d10; color: #f4f5f7; }
#view { flex: 1; display: block; min-width: 0; background: radial-gradient(120% 100% at 70% 10%, #16181e, #0a0b0d); }

#panel {
  width: 336px; padding: 22px 20px 28px; overflow-y: auto;
  background: #101217; border-left: 1px solid rgba(255,255,255,.08); box-shadow: -8px 0 26px rgba(0,0,0,.5);
}
#panel h1 { font-family: "Space Grotesk", "Inter", sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 16px; }
#panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #ff6a1a; font-weight: 700; margin: 20px 0 8px; }
#panel section { border-top: 1px solid rgba(255,255,255,.07); padding-top: 6px; }
#panel section:first-of-type { border-top: 0; }

label { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 9px 0; }
label.chk { justify-content: flex-start; }
select, input[type=text] {
  flex: 1; background: #1c1f26; color: #f4f5f7; border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: 7px 9px; font-size: 13px; font: inherit; font-size: 13px;
}
select:focus, input[type=text]:focus { outline: none; border-color: #ff6a1a; box-shadow: 0 0 0 3px rgba(255,106,26,.18); }
input[type=color] { width: 34px; height: 26px; border: none; background: none; padding: 0; cursor: pointer; margin-left: auto; }
input[type=range] { flex: 1; accent-color: #ff6a1a; }
label span[data-for] { width: 34px; text-align: right; color: #9aa1ad; font-variant-numeric: tabular-nums; }

#edges .edge { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
#edges .edge > b { width: 16px; color: #9aa1ad; font-weight: 600; font-size: 12px; }
#edges .edge input[type=text] { flex: 1; }
#edges .edge button {
  width: 28px; height: 30px; border: 1px solid rgba(255,255,255,.14); background: #1c1f26; color: #f4f5f7;
  border-radius: 8px; cursor: pointer;
}
#edges .edge button.on { background: #ff6a1a; border-color: #ff6a1a; color: #1a1206; }

.hint { color: #6c7480; font-size: 11px; margin-top: 18px; }

/* mobile drawer controls — hidden on desktop */
#panel-toggle, #panel-close { display: none; }

@media (max-width: 760px) {
  #app { position: relative; display: block; }
  #view { width: 100%; height: 100%; }

  /* floating button opens the settings sheet */
  #panel-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed;
    right: 16px; bottom: 16px; z-index: 40;
    padding: 13px 18px 13px 16px; border: none; border-radius: 999px;
    background: #ff6a1a; color: #1a1206; font: 600 15px/1 "Inter", sans-serif;
    box-shadow: 0 12px 30px rgba(255, 106, 26, .5); cursor: pointer;
  }
  #panel-toggle span { font-weight: 700; }
  #panel-toggle.hidden { display: none; }

  /* panel becomes a bottom sheet */
  #panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 80vh; border-left: none; border-top: 1px solid rgba(255,255,255,.1);
    border-radius: 20px 20px 0 0; z-index: 45;
    transform: translateY(102%); transition: transform .3s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 -14px 40px rgba(0,0,0,.55); padding-bottom: 28px;
  }
  #panel.open { transform: translateY(0); }
  #panel::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25);
  }
  #panel h1 { margin-top: 10px; padding-right: 40px; }

  #panel-close {
    display: grid; place-items: center; position: absolute; top: 12px; right: 12px;
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
    background: #1c1f26; color: #f4f5f7; font-size: 15px; cursor: pointer; z-index: 2;
  }
}
