:root {
  --paper: #f5f0e7;
  --ink: #263129;
  --muted: #6c746e;
  --line: #d8d0c3;
  --green: #286a4b;
  --green-dark: #1e5039;
  --yellow: #efbd48;
  --red: #cf5c4d;
  --editor: #17211c;
  --editor-soft: #202d26;
  --editor-text: #e8eee9;
  --editor-muted: #a2b1a6;
  --radius: 9px;
  --radius-panel: calc(var(--radius) + 13px);
  --control-height: 44px;
  --compact-height: 36px;
  --ease: cubic-bezier(.2,.7,.25,1);
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button { font: inherit; }
button:disabled { opacity: .38; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.control {
  min-height: var(--control-height); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--ink); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.control:hover:not(:disabled) { background-color: #e8e2d7; }
.control:active:not(:disabled) { background-color: #ddd5c7; }
.control.compact { min-height: var(--compact-height); padding: 5px 8px; }
.control.icon-only { width: var(--compact-height); min-width: var(--compact-height); padding: 5px; }
.control.primary { background: var(--green); color: white; border-color: #448765; }
.control.primary:hover:not(:disabled) { background: var(--green-dark); }
.control.accent { background: var(--yellow); color: #293126; border-color: #e1ad36; }
.control.accent:hover:not(:disabled) { background: #e3af3b; }
.control.outline { border-color: var(--line); }
.control.danger { color: #f2a89b; }
.editor-shell { color: var(--editor-text); background: var(--editor); }
.editor-title { min-height: 45px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #ffffff10; }
.editor-title strong { font-size: 12px; }
.editor-tools { display: flex; gap: 2px; }
.editor-title .control { color: var(--editor-muted); }
.editor-shell .control:hover:not(:disabled) { background: #344b3c; }
.editor-shell .control:active:not(:disabled) { background: #3c5544; }
.editor-shell .control.primary:hover:not(:disabled) { background: #337c59; }
.editor-shell .control.accent:hover:not(:disabled) { background: #e3af3b; }
.editor-shell .control.outline { color: var(--editor-text); border-color: #ffffff24; }
.editor-content { min-height: 310px; padding: 15px 13px 10px; }
.repeat-block { padding: 0 0 0 12px; border-left: 3px solid var(--yellow); border-radius: 4px; }
.loop-header { min-height: 44px; display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.loop-header > .icon { color: var(--yellow); }
.loop-title { flex: 0 0 auto; font-size: 12px; font-weight: 750; }
.stepper { display: flex; align-items: center; gap: 2px; background: #ffffff07; border-radius: var(--radius); }
.stepper .control { color: #e8eee9; }
.stepper output { min-width: 22px; font-size: 15px; font-weight: 800; text-align: center; }
.times-label { font-size: 11px; color: var(--editor-muted); }
.iteration { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--yellow); }
.rows { display: grid; gap: 6px; }
.command-row { min-height: 47px; display: flex; align-items: center; gap: 7px; padding: 5px 5px 5px 9px; border: 1px solid transparent; border-radius: var(--radius); background: var(--editor-soft); color: #e0e9e2; transition: background-color .18s var(--ease), border-color .18s var(--ease); }
.command-row.is-selected { background: #324932; border-color: #8ea46a; }
.command-row.is-current { background: #3f4528; border-color: var(--yellow); }
.command-row.is-error { background: #50312b; border-color: var(--red); }
.row-number { color: #85958a; font: 10px ui-monospace,SFMono-Regular,Menlo,monospace; }
.command-row > .icon, .row-main > .icon { color: #b9d2c0; }
.row-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.row-label { font-size: 12px; font-weight: 650; }
.row-tools { margin-left: auto; display: flex; gap: 0; }
.row-tools .control { color: #a2b1a6; width: 29px; min-width: 29px; min-height: 34px; padding: 4px; }
.row-tools .icon { width: 16px; height: 16px; flex-basis: 16px; }
.row-tools .control.danger { color: #bb9184; }
.select-row { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.select-mark { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #7c9180; border-radius: 5px; color: #eef3dd; }
.select-mark .icon { width: 15px; height: 15px; }
.select-row.is-selected .select-mark { background: #78944e; border-color: #78944e; }
.add-command { width: 100%; justify-content: start; color: #a2b1a6; min-height: 40px; padding-left: 9px; margin-top: 7px; font-size: 11px; }
.add-command > .icon { width: 17px; height: 17px; flex-basis: 17px; }
.outside-command { margin-top: 14px; padding-top: 9px; border-top: 1px solid #ffffff10; }
.insert-palette { display: flex; gap: 6px; padding-top: 7px; }
.insert-palette .control { flex: 1; font-size: 11px; }
.block-empty { margin: 0; padding: 20px 8px; color: var(--editor-muted); font-size: 12px; }
.selection-note { margin: 11px 0; color: #b1bfac; font-size: 11px; line-height: 1.5; }
.selection-action { width: 100%; }
.record-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 12px; }
.record-title { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--editor-muted); }
.record-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.record-buttons { display: flex; gap: 8px; margin-top: 13px; }
.record-buttons .control { flex: 1; }
.recorded-summary { padding: 13px 0 0; display: flex; align-items: center; gap: 10px; }
.recorded-summary > .control { flex: 1; }
.recorded-summary .stepper { flex: 0 0 auto; }
.feedback { min-height: 46px; padding: 10px 16px; display: flex; align-items: center; gap: 8px; background: #ffffff04; border-top: 1px solid #ffffff0c; color: #a6b7a9; font-size: 11px; line-height: 1.45; }
.feedback .icon { width: 16px; height: 16px; flex-basis: 16px; }
.device[data-error="true"] .feedback { color: #fac1ad; background: #6c3b2a33; }
.device[data-phase="success"] .feedback { color: #bbdeb9; }
.playback { min-height: 66px; padding: 10px 13px 12px; display: flex; align-items: center; gap: 7px; border-top: 1px solid #ffffff10; }
.playback .control { color: var(--editor-text); }
.playback .run-button { flex: 1; }
.playback .step-button { padding-inline: 10px; }
.playback .reset-button { min-height: var(--control-height); width: var(--control-height); min-width: var(--control-height); }
