:root {
  --bg: #0d1117; --panel: #161b22; --panel2: #1f2733; --line: #2a3543;
  --txt: #e6edf3; --dim: #8b97a6; --accent: #ffd000; --green: #33d06a; --red: #ff4b3e;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: system-ui, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg); color: var(--txt); }
header { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
h1 { font-size: 18px; margin: 0; letter-spacing: 1px; }
h1 .sub { color: var(--accent); font-size: 12px; margin-left: 6px; }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.off { background: #555; box-shadow: none; }

main { display: flex; gap: 16px; padding: 16px; flex-wrap: wrap; align-items: flex-start; }
.preview-pane { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
#preview { image-rendering: pixelated; width: 192px; height: 288px; background: #000;
  border: 2px solid var(--line); border-radius: 6px; }
.bright { width: 192px; font-size: 12px; color: var(--dim); }
.bright input { width: 100%; }

.controls { flex: 1 1 320px; min-width: 300px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { flex: 1; padding: 10px; background: var(--panel); color: var(--dim); border: 1px solid var(--line);
  border-radius: 6px; font-size: 14px; cursor: pointer; }
.tab.active { background: var(--accent); color: #1a1a1a; border-color: var(--accent); font-weight: 700; }
.panel { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.panel.active { display: block; }
.hint { font-size: 12px; color: var(--dim); margin: 0 0 12px; }

label { display: flex; flex-direction: column; font-size: 12px; color: var(--dim); gap: 4px; margin-bottom: 10px; }
input, select { background: var(--panel2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.row input { flex: 1; }
.row button, .big { background: var(--accent); color: #1a1a1a; border: none; border-radius: 6px;
  font-weight: 700; font-size: 15px; padding: 12px 16px; cursor: pointer; }
.big { width: 100%; margin-top: 6px; }
.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--txt); }
.chk input { width: auto; }

.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.signs button { padding: 16px 4px; font-size: 15px; font-weight: 700; background: var(--panel2);
  color: var(--txt); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.signs button:active { background: var(--accent); color: #1a1a1a; }

.msgline { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.msgline input[type=text] { flex: 1; }
.msgline input[type=color] { width: 42px; height: 42px; padding: 2px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #000a;
  color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; }
