:root {
  --bg: #0b1118;
  --bg-soft: #101923;
  --panel: #141f2a;
  --panel-2: #192633;
  --line: #283746;
  --line-strong: #3a4b5c;
  --text: #eef6f1;
  --muted: #8fa39b;
  --green: #76d56d;
  --green-dark: #4da847;
  --cyan: #60c9d6;
  --yellow: #f2c45c;
  --red: #ed746d;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  --radius: 18px;
  --radius-sm: 11px;
  --container: 1480px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { min-width: 320px; margin: 0; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; padding: 12px 16px; color: #07100a; background: var(--green); border-radius: 8px; font-weight: 800; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.auth-screen { min-height: 100svh; display: grid; grid-template-columns: minmax(420px, .92fr) minmax(470px, 1.08fr); }
.auth-visual { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(32px, 5vw, 76px); color: #081009; background: var(--green); }
.voxel-grid { position: absolute; inset: 0; opacity: .28; background-image: linear-gradient(rgba(5,20,10,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(5,20,10,.25) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(140deg, #000, transparent 74%); }
.auth-brand, .brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; font-size: .76rem; font-weight: 900; line-height: 1.05; letter-spacing: .1em; }
.brand-cube { position: relative; width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; background: currentColor; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.brand-cube::before, .brand-cube::after, .brand-cube i { content: ""; width: 7px; height: 7px; position: absolute; background: var(--green); }
.brand-cube::before { left: 10px; top: 12px; }
.brand-cube::after { right: 10px; top: 12px; }
.brand-cube i { width: 20px; height: 6px; left: 11px; bottom: 10px; }
.auth-copy { position: relative; z-index: 1; }
.auth-copy p, .overline { margin: 0 0 15px; font-size: .7rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.auth-copy strong { display: block; max-width: 720px; font-size: clamp(3.4rem, 7.6vw, 8.3rem); line-height: .84; letter-spacing: -.075em; }
.auth-visual ul { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-size: .72rem; font-weight: 800; }
.auth-visual li::before { content: "■"; margin-right: 8px; font-size: .55rem; }
.auth-panel { display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 80% 20%, rgba(96,201,214,.08), transparent 26%), var(--bg); }
.auth-card { width: min(460px, 100%); padding: clamp(28px, 5vw, 52px); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-card .overline, .hero-copy .overline { color: var(--green); }
.auth-card h1 { margin: 0 0 14px; font-size: clamp(2.4rem, 5vw, 4.1rem); line-height: .95; letter-spacing: -.055em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.auth-card label, .config-form > label { display: grid; gap: 8px; margin: 16px 0; color: #cbd8d2; font-size: .72rem; font-weight: 800; }
.form-error { min-height: 22px; margin: 14px 0 0 !important; color: var(--red) !important; font-size: .75rem !important; }

input, select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  color: var(--text);
  background: #0f1821;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sr-only { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
input::placeholder { color: #617168; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(118,213,109,.12); }
code { color: #b9efe4; font: 600 .9em ui-monospace, SFMono-Regular, Consolas, monospace; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: .76rem; font-weight: 900; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button-primary { color: #07110a; background: var(--green); }
.button-primary:hover:not(:disabled) { background: #91e48a; }
.button-secondary { color: var(--text); background: #1b2b37; border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { border-color: var(--cyan); }
.button-danger { color: #ffd9d6; background: rgba(237,116,109,.12); border-color: rgba(237,116,109,.35); }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button-wide { width: 100%; margin-top: 10px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.text-button { padding: 0; color: var(--muted); background: none; border: 0; font-size: .68rem; cursor: pointer; }

.app-shell { min-height: 100svh; background: var(--bg); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(24px, calc((100vw - var(--container)) / 2)); border-bottom: 1px solid var(--line); background: rgba(11,17,24,.9); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 40; }
.brand { letter-spacing: 0; }
.brand .brand-cube { width: 38px; height: 38px; color: var(--green); }
.brand .brand-cube::before, .brand .brand-cube::after, .brand .brand-cube i { background: #07110a; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: .85rem; }
.brand small { color: var(--muted); font-size: .6rem; font-weight: 700; }
.topbar-status { display: flex; align-items: center; gap: 10px; }
.network-lock, .status-pill { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: .65rem; font-weight: 800; }
.network-lock i { width: 7px; height: 9px; border: 1px solid var(--green); border-radius: 2px; position: relative; }
.network-lock i::before { content: ""; position: absolute; width: 5px; height: 5px; left: 0; top: -6px; border: 1px solid var(--green); border-bottom: 0; border-radius: 5px 5px 0 0; }
.status-pill i, .live-badge i, .console-heading i, .console-footer i { width: 7px; height: 7px; border-radius: 50%; background: #66747b; }
.status-online i, .live-badge i, .console-footer i { background: var(--green); box-shadow: 0 0 0 4px rgba(118,213,109,.1); }
.status-running i { background: var(--yellow); animation: pulse 1.2s infinite; }
.status-error i { background: var(--red); }
@keyframes pulse { 50% { opacity: .45; } }

.workspace { width: min(calc(100% - 40px), var(--container)); margin: auto; padding: clamp(38px, 6vw, 84px) 0 70px; }
.control-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(520px, .86fr); align-items: end; gap: clamp(40px, 7vw, 100px); }
.hero-copy h1 { margin: 0; font-size: clamp(3.4rem, 6.8vw, 7.1rem); line-height: .88; letter-spacing: -.07em; }
.hero-copy h1 em { color: var(--green); font-style: normal; }
.hero-copy p { max-width: 680px; margin: 25px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.75; }
.connection-card { padding: 25px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.connection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.connection-heading > div { display: grid; gap: 4px; }
.connection-heading span { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.connection-heading strong { font-size: 1.75rem; letter-spacing: -.04em; }
.connection-heading > span { padding: 7px 9px; color: #bce6db; background: rgba(96,201,214,.08); border-radius: 7px; font: 700 .65rem ui-monospace, monospace; text-transform: none; letter-spacing: 0; }
.connection-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0; }
.connection-facts > span { display: grid; gap: 5px; padding: 0 14px; border-left: 1px solid var(--line); }
.connection-facts > span:first-child { padding-left: 0; border-left: 0; }
.connection-facts small { color: var(--muted); font-size: .6rem; }
.connection-facts strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.control-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tabs { display: flex; gap: 2px; margin-top: 70px; border-bottom: 1px solid var(--line); }
.tab { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 20px; color: #81969b; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: .68rem; font-weight: 900; cursor: pointer; }
.tab span { color: var(--muted); font-size: .78rem; }
.tab b { min-width: 22px; padding: 3px 6px; color: var(--bg); background: var(--muted); border-radius: 999px; font-size: .6rem; }
.tab.is-active { color: var(--green); border-bottom-color: var(--green); }
.tab.is-active span { color: var(--text); }
.tab.is-active b { background: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; padding-top: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: panelIn .25s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } }
.panel-heading { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.panel-heading > div:first-child { display: flex; align-items: center; gap: 15px; }
.panel-index { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: rgba(118,213,109,.08); border: 1px solid rgba(118,213,109,.18); border-radius: 11px; font-size: .68rem; font-weight: 900; }
.panel-heading h2 { margin: 0; font-size: 1.1rem; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: .68rem; }
.saved-badge, .live-badge { padding: 7px 10px; color: var(--yellow); background: rgba(242,196,92,.08); border-radius: 999px; font-size: .6rem; font-weight: 900; }
.saved-badge.is-saved { color: var(--green); background: rgba(118,213,109,.08); }
.live-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); }

.config-form { display: grid; gap: 23px; padding: 25px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field-grid-3 { grid-template-columns: 1.5fr .65fr .85fr; }
.field-grid label { display: grid; gap: 8px; color: #ced9d3; font-size: .7rem; font-weight: 800; }
.field-grid label small { color: var(--muted); font-size: .61rem; font-weight: 600; }
.field-hint { float: right; color: var(--green); font-size: .6rem; }
.subpanel { padding: 20px; background: #101923; border: 1px solid var(--line); border-radius: 14px; }
.subpanel-title { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.subpanel-title > div { display: grid; gap: 4px; }
.subpanel-title strong { font-size: .77rem; }
.subpanel-title span { color: var(--muted); font-size: .63rem; }
.switch { position: relative; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 45px; height: 25px; display: block; padding: 0; background: #36444e; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; width: 17px; height: 17px; position: absolute; left: 4px; top: 4px; background: #d7e0dc; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green-dark); }
.switch input:checked + span::after { transform: translateX(20px); background: white; }
.toggles-grid { gap: 12px; }
.toggle-card { min-height: 76px; display: flex !important; grid-template-columns: none !important; align-items: center; gap: 13px !important; padding: 14px; background: #101923; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.toggle-card > input { width: 17px; min-height: 17px; accent-color: var(--green); }
.toggle-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green); background: rgba(118,213,109,.08); border-radius: 9px; }
.toggle-card > span:last-child { display: grid; gap: 4px; }
.toggle-card small { color: var(--muted); font-size: .6rem; font-weight: 600; }
.form-footer, .sequence-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 21px; border-top: 1px solid var(--line); }
.form-footer p, .sequence-footer p { margin: 0; color: var(--muted); font-size: .63rem; line-height: 1.5; }
.lock-dot { width: 7px; height: 7px; display: inline-block; margin-right: 6px; background: var(--green); border-radius: 50%; }

.add-action { display: flex; gap: 8px; }
.add-action select { width: 190px; min-height: 42px; }
.recipe-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 20px 20px 0; padding: 16px; background: linear-gradient(100deg, rgba(118,213,109,.11), rgba(96,201,214,.05)); border: 1px solid rgba(118,213,109,.24); border-radius: 14px; }
.recipe-card > div { display: flex; align-items: center; gap: 13px; }
.recipe-card strong { display: block; margin-bottom: 4px; font-size: .78rem; }
.recipe-card p { margin: 0; color: var(--muted); font-size: .63rem; line-height: 1.5; }
.recipe-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: #07110a; background: var(--green); border-radius: 10px; font: 900 .85rem ui-monospace, monospace; box-shadow: 0 0 0 5px rgba(118,213,109,.08); }
.action-list { display: grid; gap: 10px; padding: 20px; counter-reset: actions; }
.action-card { display: grid; grid-template-columns: 44px minmax(150px, .75fr) minmax(280px, 1.4fr) auto; gap: 14px; align-items: center; padding: 14px; background: #101923; border: 1px solid var(--line); border-radius: 13px; transition: border-color .15s, opacity .15s; }
.action-card.is-running { border-color: var(--yellow); box-shadow: inset 3px 0 0 var(--yellow); }
.action-card.is-disabled { opacity: .52; }
.action-order { width: 38px; height: 38px; display: grid; place-items: center; color: var(--green); background: rgba(118,213,109,.08); border-radius: 9px; font: 800 .65rem ui-monospace, monospace; }
.action-meta { min-width: 0; display: grid; gap: 6px; }
.action-meta input { min-height: 38px; padding: 0 9px; font-size: .7rem; }
.action-meta span { color: var(--muted); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.action-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-fields label { display: grid; gap: 5px; color: var(--muted); font-size: .58rem; font-weight: 800; }
.action-fields input, .action-fields select { min-height: 38px; padding: 0 9px; font-size: .68rem; }
.action-options { display: flex; align-items: center; gap: 7px; }
.mini-button { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.mini-button:hover { color: var(--text); border-color: var(--line-strong); }
.mini-button.delete:hover { color: var(--red); border-color: rgba(237,116,109,.4); }
.action-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .58rem; }
.action-check input { width: 14px; min-height: 14px; accent-color: var(--green); }
.sequence-footer { margin: 0 20px; padding: 20px 0; }
.empty-actions { padding: 48px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 13px; }

.inspector-section { padding: 24px; border-bottom: 1px solid var(--line); }
.inspector-help { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 24px; background: rgba(96,201,214,.035); border-bottom: 1px solid var(--line); }
.inspector-help span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .59rem; }
kbd { padding: 4px 6px; color: #c9f3e8; background: #0b131a; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font: 750 .56rem ui-monospace, monospace; }
.inspector-section:last-child { border-bottom: 0; }
.inspector-title { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.inspector-title h3 { margin: 0; font-size: .9rem; }
.inspector-title p { margin: 0; color: var(--muted); font-size: .62rem; }
.slot-grid { display: grid; gap: 7px; }
.hotbar-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.window-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.slot { aspect-ratio: 1; min-width: 0; position: relative; display: grid; place-items: center; padding: 6px; color: var(--muted); background: #101923; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.slot:hover { transform: translateY(-2px); border-color: var(--cyan); background: #162632; }
.slot.is-selected { border-color: var(--green); box-shadow: inset 0 0 0 2px rgba(118,213,109,.2); }
.slot-number { position: absolute; left: 5px; top: 4px; color: #64747a; font: 700 .53rem ui-monospace, monospace; }
.slot-count { position: absolute; right: 5px; bottom: 4px; color: var(--text); font: 800 .55rem ui-monospace, monospace; }
.slot-item { max-width: 100%; overflow: hidden; font-size: .52rem; font-weight: 700; text-align: center; text-overflow: ellipsis; }
.slot:not(.is-empty) .slot-item { color: #c4eee1; }
.empty-inspector { grid-column: 1 / -1; min-height: 210px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); border: 1px dashed var(--line); border-radius: 13px; }
.empty-inspector > span { font-size: 2rem; color: #495c64; }
.empty-inspector strong { color: #aebdb6; font-size: .8rem; }
.empty-inspector p { margin: 0; font-size: .65rem; }

.message-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.chat-composer { display: grid; gap: 14px; margin: 20px; padding: 18px; background: linear-gradient(110deg, rgba(118,213,109,.1), rgba(96,201,214,.04)); border: 1px solid rgba(118,213,109,.22); border-radius: 15px; }
.chat-composer-copy { display: flex; align-items: center; gap: 12px; }
.chat-composer-copy strong { display: block; margin-bottom: 3px; font-size: .8rem; }
.chat-composer-copy p { margin: 0; color: var(--muted); font-size: .63rem; }
.chat-composer-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green); background: rgba(118,213,109,.1); border-radius: 10px; font: 900 .75rem ui-monospace, monospace; }
.chat-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.chat-input-row input { min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.chat-shortcuts { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: .59rem; }
.chat-shortcuts button { padding: 5px 8px; color: #b9efe4; background: #111d26; border: 1px solid var(--line-strong); border-radius: 7px; font: 700 .58rem ui-monospace, monospace; cursor: pointer; }
.chat-shortcuts button:hover { border-color: var(--cyan); }
.chat-shortcuts small { margin-left: auto; color: var(--muted); font-size: .58rem; }
.message-guide > span { min-height: 54px; display: flex; align-items: center; gap: 8px; padding: 12px; color: var(--muted); background: #101923; border: 1px solid var(--line); border-radius: 11px; font-size: .62rem; line-height: 1.45; }
.message-guide strong { color: var(--text); }
.chat-dot, .bar-dot, .title-dot { width: 8px; height: 8px; flex: 0 0 auto; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(118,213,109,.08); }
.bar-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(96,201,214,.08); }
.title-dot { background: var(--yellow); box-shadow: 0 0 0 4px rgba(242,196,92,.08); }
.message-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px; }
.message-channel { min-width: 0; overflow: hidden; background: #0b1219; border: 1px solid var(--line); border-radius: 13px; }
.message-channel header { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.message-channel header span { display: flex; align-items: center; gap: 8px; font-size: .68rem; font-weight: 850; }
.message-channel header b { min-width: 24px; padding: 3px 6px; color: var(--muted); background: var(--panel-2); border-radius: 999px; font-size: .58rem; text-align: center; }
.message-stream { height: 430px; overflow-y: auto; padding: 10px; scrollbar-width: thin; scrollbar-color: #31404b transparent; }
.server-message { margin-bottom: 8px; padding: 10px; background: #101923; border: 1px solid var(--line); border-left: 2px solid var(--green); border-radius: 9px; }
.server-message.is-actionbar { border-left-color: var(--cyan); }
.server-message.is-title, .server-message.is-subtitle { border-left-color: var(--yellow); }
.server-message.is-outgoing { border-left-color: #b889ff; background: rgba(184,137,255,.06); }
.server-message > div { display: flex; justify-content: space-between; gap: 8px; color: #61747b; font: 700 .53rem ui-monospace, monospace; text-transform: uppercase; }
.server-message p { margin: 7px 0 0; overflow-wrap: anywhere; color: #c8d5cf; font-size: .65rem; line-height: 1.5; }
.message-empty { min-height: 160px; display: grid; place-items: center; padding: 20px; color: #71838a; font-size: .62rem; line-height: 1.5; text-align: center; }

.console-panel { position: sticky; top: 94px; overflow: hidden; background: #080d12; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.console-heading, .console-footer { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 17px; border-bottom: 1px solid #1d2933; }
.console-heading > div { display: flex; align-items: center; gap: 8px; font: 800 .7rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.console-heading i { background: var(--red); box-shadow: 13px 0 var(--yellow), 26px 0 var(--green); margin-right: 28px; }
.console-log { height: 600px; overflow-y: auto; padding: 15px; scrollbar-width: thin; scrollbar-color: #31404b transparent; }
.log-entry { display: grid; grid-template-columns: 62px 1fr; gap: 9px; padding: 8px 0; color: #93a59d; border-bottom: 1px solid rgba(40,55,70,.46); font: 500 .66rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.log-entry time { color: #52636a; }
.log-entry.is-success span { color: #a9e7ae; }
.log-entry.is-warning span { color: #e8cf91; }
.log-entry.is-error span { color: #f1a19d; }
.console-empty { padding: 50px 15px; color: #87999d; font: .68rem/1.7 ui-monospace, monospace; text-align: center; }
.console-footer { min-height: 44px; color: #87999d; border-top: 1px solid #1d2933; border-bottom: 0; font: 600 .58rem ui-monospace, monospace; }
.console-footer > span { display: flex; align-items: center; gap: 7px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(420px, calc(100% - 44px)); padding: 14px 17px; color: #07100a; background: var(--green); border-radius: 12px; box-shadow: var(--shadow); font-size: .75rem; font-weight: 850; opacity: 0; transform: translateY(15px); pointer-events: none; transition: .22s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast.is-error { color: #fff; background: var(--red); }

@media (max-width: 1180px) {
  .control-hero { grid-template-columns: 1fr; }
  .connection-card { max-width: 760px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .console-panel { position: static; }
  .console-log { height: 380px; }
}

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { min-height: 46svh; padding: 28px; }
  .auth-copy strong { font-size: clamp(3.5rem, 14vw, 6.5rem); }
  .auth-panel { min-height: 54svh; }
  .hero-copy h1 { font-size: clamp(3.4rem, 11vw, 6rem); }
  .action-card { grid-template-columns: 42px 1fr auto; }
  .action-fields { grid-column: 2 / -1; }
  .hotbar-grid, .window-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .message-columns { grid-template-columns: 1fr; }
  .message-stream { height: 230px; }
}

@media (max-width: 680px) {
  .topbar { padding: 12px 14px; }
  .network-lock { display: none; }
  .workspace { width: min(calc(100% - 24px), var(--container)); padding-top: 42px; }
  .hero-copy h1 { font-size: clamp(3.1rem, 16vw, 5rem); }
  .connection-card { padding: 18px; }
  .connection-heading { flex-direction: column; }
  .connection-facts { grid-template-columns: 1fr 1fr; gap: 16px 0; }
  .connection-facts > span:nth-child(odd) { padding-left: 0; border-left: 0; }
  .control-actions, .control-actions .button { width: 100%; }
  .tabs { overflow-x: auto; margin-top: 50px; }
  .tab { flex: 0 0 auto; padding: 0 14px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .add-action { width: 100%; }
  .add-action select { width: 100%; }
  .recipe-card { align-items: stretch; flex-direction: column; }
  .recipe-card .button { width: 100%; }
  .config-form { padding: 17px; }
  .field-grid, .field-grid-3 { grid-template-columns: 1fr; }
  .form-footer, .sequence-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button, .sequence-footer .button { width: 100%; }
  .action-card { grid-template-columns: 38px 1fr; }
  .action-fields, .action-options { grid-column: 1 / -1; }
  .action-options { justify-content: flex-end; }
  .inspector-title { align-items: flex-start; flex-direction: column; gap: 6px; }
  .hotbar-grid, .window-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .message-guide { grid-template-columns: 1fr; }
  .chat-input-row { grid-template-columns: 1fr; }
  .chat-input-row .button { width: 100%; }
  .chat-shortcuts small { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
