* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --leftnav-width: 64px;
  --footer-height: 28px;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
}

h1,h2,h3,h4,h5,h6,p,ul,li {
  color: #eee;
  font-family: sans-serif;
  margin: 8px;
}

#layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - var(--footer-height));
  margin-left: 0;
}

#top-row {
  display: flex;
  flex: 3;
  min-height: 0;
  width: 100%;
}

#bottom-row {
  display: flex;
  flex-shrink: 0;
  height: 40%;
  flex: 3;
}

.slot {
  flex: 1;
  min-width: 120px;
  min-height: 120px;
  position: relative;
}

#s1 {
  flex: 2;
}

#s2 {
  flex: 1;
}


.panel {
  position: absolute;
  inset: 0;
  background: #2d2d2d;
  border: 1px solid #3a3a3a;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.drag-handle {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: opacity 0.15s, background 0.15s;
}
.buttonbar img {
  width: 22px;
  height: 22px;
  cursor: pointer;
}
.buttonbar{
  margin-left: 8px;
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}
#theme-toggle-icon {
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 6px;
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.log-copy-btn {
  margin-left: 8px;
  min-width: 28px;
  height: 28px;
  padding: 4px 8px;
  margin-right: 8px;
  border-radius: 6px;
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ececec;
  font-family: sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.log-copy-btn.is-copied {
  border-color: #2ea043;
  color: #b7f6c2;
}

.log-copy-btn.is-error {
  border-color: #cf5a5a;
  color: #ffc5c5;
}

.log-copy-btn img {
  width: 24px;
  height: 24px;
}

.topbar{
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0 44px 0 8px;
  background-color:#353535;
  width: 100%;
  min-height: 42px;
  flex-shrink: 0;
}
.right-controls {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
}
#editor{
  flex: 1;
  min-height: 0;
  border: 1px solid #464646;
}
.topbar h2 {
  margin: 8px;
  color: #eee;
  font-family: sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.view-switcher {
  margin: 8px;
  min-height: 0;
  padding: 0 18px 0 0;
  border: 0;
  background-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #d6d6d6 50%),
    linear-gradient(135deg, #d6d6d6 50%, transparent 50%);
  background-position:
    calc(100% - 10px) calc(50% + 1px),
    calc(100% - 5px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: #eee;
  font-family: sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.view-switcher:focus {
  outline: none;
  text-decoration: underline;
  background-color:#353535
}

select {
  background: #2b2b2b;
  color: #eee;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  padding: 4px 8px 4px 8px;
  margin-left: 8px;
  font-size: 0.9rem;
}

.editor-language-text {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #eee;
  opacity: 0.7;
  font-family: sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}
.controlbuttons, #editor-language-text {
  display: inline-flex;
  align-items: center;
  text-align: right;
}
.controlbuttons {
  margin-left: 8px;
  order: 91;
}
#exampleslabel,
#examplesverlabel {
  color: #eee;
  font-family: sans-serif;
  font-size: 0.9rem;
  margin-left: 8px;
}

.panel-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.sim-log {
  width: 100%;
  height: 100%;
  color: #ff6b6b;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

#tablaswled {
  margin: 0px;
  padding: 0 4% 0 4%;
}

#tablaswled .table {
  margin-bottom: 0;
}

.sim-hidden {
  display: none !important;
}
.drag-handle:hover, .buttonbar:hover, #theme-toggle-icon:hover {
  opacity: 1;
  background: #444;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle svg {
  display: block;
  flex-shrink: 0;
}

.drag-handle img {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  filter: invert(72%);
}

/* ghost */
#ghost {
  position: fixed;
  pointer-events: none;
  border: 2px dashed #0078d4;
  background: rgba(0, 120, 212, 0.15);
  border-radius: 4px;
  z-index: 1000;
  display: none;
}

/* drop highlight */
.slot.over .panel {
  border-color: #0078d4;
  background: #2a3a4a;
}

/* gutters */
.gutter-h {
  height: 6px;
  background: #1a1a1a;
  cursor: ns-resize;
  flex-shrink: 0;
  z-index: 10;
}

.gutter-h:hover,
.gutter-h.resizing {
  background: #0078d4;
}

.gutter-v {
  width: 6px;
  background: #1a1a1a;
  cursor: ew-resize;
  flex-shrink: 0;
  z-index: 10;
}

.gutter-v:hover,
.gutter-v.resizing {
  background: #0078d4;
}
button{
  background:none;
  border: none;

}
button img{
  width: 40px;
  height: 40px;
}

#footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: #e6e6e6;
  font-family: sans-serif;
  font-size: 0.85rem;
  background: #111;
  border-top: 1px solid #333;
  z-index: 20;
}

#footer p {
  margin: 0;
  color: inherit;
}

.controlbuttons {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.controlbuttons:disabled {
  opacity: 0.35;
  pointer-events: none;
}
a {
  color: #f6fbff;
  margin-left: 8px;
}

#file-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(8, 12, 20, 0.45);
  backdrop-filter: blur(1px);
}

#file-drop-overlay.active {
  display: flex;
  pointer-events: auto;
}

#file-drop-overlay .drop-text {
  border: 2px dashed #6cc7ff;
  background: rgba(10, 26, 44, 0.9);
  color: #eaf7ff;
  padding: 18px 24px;
  border-radius: 10px;
  font-family: sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

body.wave-layout #wave-editors-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #262626;
}

body.wave-layout #wave-editor-tabs {
  display: flex;
  gap: 6px;
}

body.wave-layout .wave-editor-tab {
  border: 1px solid #4a4a4a;
  border-radius: 6px 6px 0 0;
  background: #2d2d2d;
  color: #d6d6d6;
  padding: 2px 4px;
  font-family: sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

body.wave-layout .wave-editor-tab.is-active {
  background: #1f1f1f;
  border-bottom-color: #1f1f1f;
  color: #ffffff;
}

body.wave-layout .wave-editor-pane {
  min-width: 0;
  min-height: 0;
  display: none;
  flex-direction: column;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  overflow: hidden;
  background: #1f1f1f;
}

body.wave-layout .wave-editor-pane.is-active {
  display: flex;
  flex: 1;
}

body.wave-layout .wave-editor {
  flex: 1;
  min-height: 0;
  border: 0;
}

body.wave-layout #editor {
  border: 0;
}

/* ── File name indicator ── */
#file-name-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-right: 8px;
  color: #eee;
  font-family: sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.7;
  transition: color 0.2s, opacity 0.2s;
}

#file-name-indicator.is-dirty {
  opacity: 1;
  color: #f0c060;
}