/* Braza Business Console: blue on black and white (Owner decision 2026-11-17: #1f6bff, #5b93ff, white, black;
   no orange, no red as brand colour). Red survives only as the failure status colour (--danger). Not brand Canon. */
:root {
  --bg: #050608;
  --surface: #0E1117;
  --surface-2: #171C25;
  --line: #262D3A;
  --line-soft: #191F29;
  --text: #FFFFFF;
  --text-2: #A9B3C4;
  --text-3: #6F7A8C;
  --brand: #1F6BFF;
  --accent: #5B93FF;
  --cyan: #53AFC5;
  --ok: #35C48F;
  --warn: #EBD35B;
  --danger: #FF5C6C;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --sidebar: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----- shell */
.shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar { width: var(--sidebar); flex: 0 0 var(--sidebar); background: linear-gradient(180deg, #0A0D13, #050608); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: radial-gradient(circle at 30% 25%, var(--accent) 0%, var(--brand) 50%, #0A2A73 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset, 0 6px 20px rgba(31,107,255,.35); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 8px 9px; border: 2px solid rgba(255,255,255,.85); border-radius: 3px; border-right-color: transparent; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { letter-spacing: .04em; font-size: 17px; }
.brand-text small { color: var(--text-2); font-size: 11.5px; letter-spacing: .04em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); font-weight: 520; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }
.env-chip { align-self: flex-start; font-size: 11.5px; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(91,147,255,.5); color: var(--accent); }
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--line-soft); background: rgba(5,6,8,.85); backdrop-filter: blur(8px); }
.cmdbar { flex: 1; min-width: 0; max-width: 640px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: text; text-align: left; }
.cmdbar:hover { border-color: #3a414d; }
.cmdbar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-3); }
.top-meta { min-width: 0; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.head-chip { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12px; color: var(--text-2); padding: 5px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-soft); white-space: nowrap; }
.content { flex: 1; overflow: auto; padding: 26px; outline: none; }
.content.full { padding: 0; overflow: hidden; display: flex; }

/* ----- icons (CSS masks) */
.ico { width: 18px; height: 18px; flex: 0 0 18px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-home { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-7 9 7v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-map { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='5' cy='6' r='2.5'/%3E%3Ccircle cx='19' cy='6' r='2.5'/%3E%3Ccircle cx='12' cy='18' r='2.5'/%3E%3Cpath d='M7 7l4 9M17 7l-4 9M7.5 6h9'/%3E%3C/svg%3E"); }
.ico-flow { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='2.5' y='4' width='7' height='6' rx='1.5'/%3E%3Crect x='14.5' y='14' width='7' height='6' rx='1.5'/%3E%3Cpath d='M9.5 7h4a2 2 0 0 1 2 2v5'/%3E%3C/svg%3E"); }
.ico-mission { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 6h16M4 12h10M4 18h7'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E"); }
.ico-cap { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M12 12l8-4.5M12 12v9M12 12L4 7.5'/%3E%3C/svg%3E"); }
.ico-plug { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 3v5M15 3v5M6 8h12v3a6 6 0 0 1-12 0zM12 17v4'/%3E%3C/svg%3E"); }
.ico-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E"); }

/* ----- primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 560; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #444c58; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.outline { background: transparent; border-color: rgba(91,147,255,.6); color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.preview-tag { font-size: 10.5px; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--text-3); color: var(--text-3); text-transform: uppercase; }
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.click { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.click:hover { border-color: #3a414d; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.big { font-size: 28px; font-weight: 680; letter-spacing: -.02em; overflow-wrap: anywhere; }
.big.txt { font-size: 19px; letter-spacing: 0; }
.prov { font-size: 11.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.prov b { color: var(--text-2); font-weight: 500; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 2px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin-top: 4px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list-plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); cursor: default; }
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.empty { padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--text-2); text-align: center; }
input.field, textarea.field, select.field { width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: #0F1216; color: var(--text); }
textarea.field { min-height: 70px; resize: vertical; }
label.lbl { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
pre.result { white-space: pre-wrap; overflow-wrap: anywhere; background: #0F1216; border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; font-family: var(--mono); font-size: 12.5px; max-height: 420px; overflow: auto; margin: 0; }
.notice { border: 1px solid rgba(235,211,91,.35); background: rgba(235,211,91,.06); color: #F3E6A6; border-radius: 10px; padding: 10px 13px; font-size: 13px; }
.notice.info { border-color: rgba(83,175,197,.35); background: rgba(83,175,197,.06); color: #a6dbe8; }
.notice.err { border-color: rgba(255,92,108,.45); background: rgba(255,92,108,.08); color: #FFB3BB; }

/* ----- state badges (Blueprint §5 estados) */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 640; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; text-transform: uppercase; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-VALIDADO, .badge.s-PASS, .badge.s-LIDO { color: var(--ok); border-color: rgba(53,196,143,.4); }
.badge.s-INVENTARIADO, .badge.s-CONFIGURED, .badge.s-RASCUNHO, .badge.s-MISSION_COMPLETE { color: var(--cyan); border-color: rgba(83,175,197,.4); }
.badge.s-BLOQUEADO, .badge.s-MISSION_BLOCKED, .badge.s-MISSION_FAILED, .badge.s-FAIL { color: var(--danger); border-color: rgba(255,92,108,.5); }
.badge.s-MISSION_PARTIAL, .badge.s-WAITING_FOR_DEPENDENCY, .badge.s-WAITING_FOR_BACKGROUND_COMPLETION, .badge.s-PREVIEW { color: var(--warn); border-color: rgba(235,211,91,.45); }
.badge.s-NAO_VERIFICADO { color: var(--text-3); border-style: dashed; }
.badge.s-EM_EXECUCAO { color: var(--accent); border-color: rgba(91,147,255,.5); }

/* ----- home */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 30px; background: radial-gradient(120% 140% at 100% 0%, rgba(31,107,255,.32) 0%, rgba(31,107,255,0) 55%), linear-gradient(160deg, #10141C, #07090D); border: 1px solid var(--line-soft); display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; }
.hero h1 { font-size: 30px; }
.hero .eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.command { display: flex; gap: 10px; margin-top: 18px; }
.command input { flex: 1; padding: 14px 16px; font-size: 16px; border-radius: 12px; border: 1px solid #343b46; background: rgba(5,6,8,.75); color: var(--text); }
.command input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(91,147,255,.18); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mini-map { border-radius: 14px; background: rgba(5,6,8,.55); border: 1px solid var(--line-soft); min-height: 220px; cursor: pointer; position: relative; }
.mini-map svg { width: 100%; height: 100%; display: block; }
.mini-map .cap { position: absolute; left: 12px; bottom: 10px; font-size: 11.5px; color: var(--text-3); }
.commit { display: grid; grid-template-columns: 64px 1fr; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.commit:last-child { border-bottom: 0; }
.commit .mono { color: var(--accent); }

/* ----- company map */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 560; }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); }
.map-wrap { background: radial-gradient(80% 80% at 50% 0%, rgba(83,175,197,.06), rgba(0,0,0,0)), var(--surface); border: 1px solid var(--line-soft); border-radius: 18px; overflow: auto; }
.graph svg { display: block; min-width: 900px; width: 100%; }
.gnode { cursor: pointer; }
.gnode rect { fill: #1B2027; stroke: #333b47; stroke-width: 1; transition: stroke .15s; }
.gnode:hover rect, .gnode.sel rect { stroke: var(--accent); stroke-width: 1.6; }
.gnode text { fill: var(--text); font-size: 12.5px; font-family: var(--font); }
.gnode text.sub { fill: var(--text-3); font-size: 10.5px; letter-spacing: .05em; }
.gnode .dot-VALIDADO { fill: var(--ok); }
.gnode .dot-INVENTARIADO { fill: var(--cyan); }
.gnode .dot-NAO_VERIFICADO { fill: var(--text-3); }
.gedge { fill: none; stroke: #3a4250; stroke-width: 1.2; }
.gedge.skill { stroke-dasharray: 4 4; stroke: #2f5f6b; }
.gedge.hot { stroke: var(--accent); stroke-width: 1.8; }
.gcol { fill: var(--text-3); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font); }
.building { padding: 34px 26px 40px; display: flex; flex-direction: column; align-items: center; gap: 0; perspective: 1400px; }
.floor { width: min(860px, 100%); transform: rotateX(18deg); transform-origin: center bottom; margin-top: -2px; background: linear-gradient(180deg, #1D2229, #161A20); border: 1px solid #2C333D; border-bottom: 3px solid #0A0C0F; border-radius: 6px; padding: 12px 14px 14px; display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; box-shadow: 0 14px 24px rgba(0,0,0,.35); }
.floor.top { border-top: 2px solid var(--brand); }
.floor-name { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.floor-name small { display: block; color: var(--text-3); text-transform: none; letter-spacing: 0; font-size: 11px; margin-top: 2px; }
.rooms { display: flex; flex-wrap: wrap; gap: 8px; }
.room { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 7px; background: #0F1216; border: 1px solid #2A313B; cursor: pointer; font-size: 12.5px; }
.room:hover { border-color: var(--accent); }
.room .lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.room .lamp.VALIDADO { background: var(--ok); box-shadow: 0 0 8px rgba(53,196,143,.55); }
.room .lamp.INVENTARIADO { background: var(--cyan); }
.ground { width: min(900px, 100%); height: 14px; border-radius: 0 0 50% 50%; background: radial-gradient(60% 100% at 50% 0%, rgba(31,107,255,.3), rgba(0,0,0,0)); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 560; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #191E25; }

/* ----- capabilities */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input.field { max-width: 360px; }
.cap-card h3 { display: flex; align-items: center; gap: 8px; }
.cap-card .purpose { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ----- missions */
.mission-row td:first-child { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* ----- flow builder */
.builder { flex: 1; display: grid; grid-template-columns: 270px 1fr 300px; min-height: 0; }
.b-palette, .b-inspector { background: var(--surface); border-right: 1px solid var(--line-soft); overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.b-inspector { border-right: 0; border-left: 1px solid var(--line-soft); }
.b-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.b-top { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); background: #101318; flex-wrap: wrap; }
.b-top input.title { flex: 1; min-width: 160px; font-size: 16px; font-weight: 600; background: transparent; border: 1px solid transparent; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.b-top input.title:hover, .b-top input.title:focus { border-color: var(--line); outline: none; }
.canvas { flex: 1; position: relative; overflow: auto; background-color: #0D1014; background-image: radial-gradient(circle, #232a33 1px, transparent 1.2px); background-size: 22px 22px; touch-action: none; }
.canvas-inner { position: relative; width: 2000px; height: 1400px; }
.canvas svg.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.canvas svg.edges path { fill: none; stroke: #4a5361; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
.canvas svg.edges path.sel { stroke: var(--accent); stroke-width: 3; }
.canvas svg.edges path.ghost { stroke: var(--accent); stroke-dasharray: 5 5; pointer-events: none; }
.fnode { position: absolute; width: 200px; background: #171B21; border: 1px solid #2E3540; border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.35); user-select: none; touch-action: none; }
.fnode.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91,147,255,.25), 0 8px 22px rgba(0,0,0,.35); }
.fnode .fhead { display: flex; align-items: center; gap: 8px; padding: 9px 11px 4px; cursor: grab; }
.fnode .fkind { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.fnode .flabel { padding: 0 11px 10px; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.fnode .ffoot { padding: 0 11px 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.fnode .stripe { width: 4px; height: 16px; border-radius: 3px; background: var(--text-3); }
.fnode.k-entrada .stripe { background: var(--cyan); }
.fnode.k-saida .stripe { background: var(--ok); }
.fnode.k-aprovacao .stripe { background: var(--warn); }
.fnode.k-condicao .stripe { background: #9b8cff; }
.fnode.k-capacidade .stripe, .fnode.k-skill .stripe { background: var(--brand); }
.port { position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #0D1014; border: 2px solid #5a6472; cursor: crosshair; }
.port.in { left: -9px; }
.port.out { right: -9px; }
.port:hover, .port.armed { border-color: var(--accent); background: var(--accent); }
.pal-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 7px; font-weight: 600; }
.pal-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-soft); background: #11151A; cursor: grab; font-size: 13px; text-align: left; margin-bottom: 6px; }
.pal-item:hover { border-color: #3a414d; }
.pal-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.validation { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }
.validation .ok { color: var(--ok); }
.validation .bad { color: var(--danger); }
.drafts-list .card { gap: 6px; }
.b-mobile-toggle { display: none; }

/* ----- drawer, palette, toasts */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop, .palette-backdrop { position: absolute; inset: 0; background: rgba(5,6,8,.6); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); gap: 10px; }
.drawer-body { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.palette { position: fixed; inset: 0; z-index: 50; }
.palette-panel { position: relative; margin: 12vh auto 0; width: min(640px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
#palette-input { width: 100%; padding: 17px 18px; font-size: 16px; background: transparent; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); outline: none; }
#palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#palette-list li { padding: 10px 12px; border-radius: 9px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; }
#palette-list li .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; min-width: 78px; }
#palette-list li[aria-selected="true"] { background: var(--surface-2); }
.palette-hint { padding: 9px 16px 12px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 360px; }
.toast.err { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }

/* ----- responsive */
@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder { grid-template-columns: 240px 1fr; }
  .b-inspector { display: none; }
  .b-inspector.open { display: flex; position: absolute; right: 0; top: 0; bottom: 0; width: 300px; z-index: 5; box-shadow: var(--shadow); }
  .b-main { position: relative; }
}
@media (max-width: 860px) {
  body { font-size: 14.5px; }
  .shell { flex-direction: column; }
  .sidebar { order: 2; width: 100%; flex: 0 0 auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-soft); gap: 0; }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10.5px; flex: 1; text-align: center; border-radius: 8px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--brand); }
  .main-col { order: 1; min-height: 0; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .cmdbar kbd, #refresh { display: none; }
  .head-chip { font-size: 11px; padding: 4px 7px; }
  .content { padding: 16px 14px 24px; }
  .g4, .g3, .g2 { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero h1 { font-size: 23px; }
  .command { flex-direction: column; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .floor { grid-template-columns: 1fr; transform: none; }
  .tbl .hide-m { display: none; }
  .builder { grid-template-columns: 1fr; position: relative; }
  .b-palette { display: none; }
  .b-palette.open { display: flex; position: absolute; inset: 0 auto 0 0; width: 86%; z-index: 6; box-shadow: var(--shadow); }
  .b-inspector.open { width: 100%; }
  .b-top { gap: 6px; padding: 8px 10px; }
  .b-top .btn { padding: 6px 9px; font-size: 12.5px; }
  .b-top input.title { order: -1; flex-basis: 100%; font-size: 15px; }
  .b-top select.field { padding: 5px 8px; font-size: 12.5px; width: auto; }
  .b-top #b-save-state { display: none; }
  .b-mobile-toggle { display: inline-flex; }
  .drawer-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .floor { transform: none; }
}
@media (min-width: 1201px) { #b-inspector-toggle, .b-close-insp { display: none; } }

/* ----- seal for anything that is not real data */
.seal { display: inline-flex; align-items: center; align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; padding: 3px 8px; border-radius: 6px; border: 1px dashed var(--accent); color: var(--accent); background: rgba(31,107,255,.08); white-space: nowrap; text-transform: uppercase; }
.notice .seal { margin-right: 6px; }

/* ----- login */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.login-body { overflow: auto; background: radial-gradient(90% 70% at 50% 0%, rgba(31,107,255,.22), rgba(31,107,255,0) 60%), var(--bg); }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.login-card .brand { padding: 0; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { width: 100%; padding: 12px 15px; }
.login-msg { min-height: 1.3em; font-size: 13px; color: var(--danger); }
