/* Agent Base design system: warm sand surfaces, charcoal robots with white pill eyes,
   sea-teal accent, driftwood secondary. One font (Nunito), soft shadows, big radii. */
:root {
  --bg: #f3eee6;
  --surface: #fffdf9;
  --surface-2: #f6f1e9;
  --surface-3: #ece5d9;
  --line: #e7dfd2;
  --ink: #2b2a28;
  --ink-2: #776f64;
  --charcoal: #3e4247;
  --charcoal-2: #2d3034;
  --screen: #1c1e21;
  --eye: #f8f9fa;
  --accent: #159e9a;
  --accent-soft: rgba(21, 158, 154, 0.12);
  --wood: #a8743f;
  --working: #2fae63;
  --done: #159e9a;
  --ready: #5b7fd6;
  --blocked: #d9962b;
  --flagged: #d9534f;
  --idle: #a39b8f;
  --radius: 18px;
  --shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 10px 30px rgba(84, 66, 40, 0.10), 0 1px 3px rgba(84,66,40,.08);
  --shadow-lg: 0 24px 60px rgba(60, 46, 26, 0.22);
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 600 14px/1.5 "Nunito", ui-rounded, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.015em; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
a { color: inherit; }
code { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--ink-2); font-weight: 600; }
.lead { margin: -6px 0 18px; }
.hidden { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-2); }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link { font-size: 13px; font-weight: 800; color: var(--accent); text-decoration: none; }

/* ---------------- shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand b { display: block; font-size: 17px; font-weight: 900; } .brand small { color: var(--ink-2); font-size: 12px; }
.campaign-switch { background: var(--surface-2); border-radius: 14px; padding: 10px; display: grid; gap: 6px; }
.select { font: inherit; font-weight: 800; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; border-radius: 10px; width: 100%; cursor: pointer; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 11px; text-decoration: none; font-weight: 800; color: var(--ink-2); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--charcoal); color: #fff; }
.nav .ic { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.mode { font-size: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.mode b { color: var(--ink); }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 800; color: var(--ink-2); font-size: 13px; }
.switch input { display: none; }
.track { width: 36px; height: 21px; border-radius: 999px; background: var(--surface-3); position: relative; transition: .2s; }
.thumb { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: .2s; }
.switch input:checked + .track { background: var(--blocked); }
.switch input:checked + .track .thumb { left: 18px; }

.main { position: relative; overflow: hidden; }
.view { display: none; position: absolute; inset: 0; }
.view.active { display: block; }
.page { overflow-y: auto; padding: 28px 32px 48px; }
.page > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.head-meta { color: var(--ink-2); font-size: 13px; text-align: right; }
.demo-flag { position: absolute; top: 14px; right: 14px; z-index: 6; background: var(--blocked); color: #fff; font-weight: 900; padding: 6px 14px; border-radius: 999px; font-size: 12px; box-shadow: var(--shadow); }

/* ---------------- cards & controls */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.btn { font: inherit; font-weight: 900; border: 0; cursor: pointer; color: #fff; background: var(--charcoal); padding: 10px 18px; border-radius: 999px; box-shadow: 0 4px 12px rgba(45,48,52,.25); transition: .15s; white-space: nowrap; }
.btn:hover { background: var(--charcoal-2); transform: translateY(-1px); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.ghost { background: var(--surface-2); color: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.teal { background: var(--accent); box-shadow: 0 4px 12px rgba(21,158,154,.3); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-weight: 900; color: var(--ink-2); flex: none; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 900; background: var(--surface-3); color: var(--ink-2); }
.pill.working { background: rgba(47,174,99,.14); color: #1f7f46; }
.pill.done, .pill.ok { background: rgba(21,158,154,.13); color: #0d7470; }
.pill.ready { background: rgba(91,127,214,.14); color: #3d5fb0; }
.pill.blocked, .pill.incomplete { background: rgba(217,150,43,.16); color: #95630f; }
.pill.flagged, .pill.revise { background: rgba(217,83,79,.14); color: #a8322f; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 900; color: var(--flagged); letter-spacing: .1em; }
.live b { width: 8px; height: 8px; border-radius: 50%; background: var(--flagged); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* faces: the robot motif everywhere */
.face { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 34px; height: 28px; border-radius: 10px; background: var(--screen); box-shadow: inset 0 0 0 3px var(--charcoal); flex: none; }
.face i { width: 6px; height: 8px; border-radius: 3px; background: var(--eye); display: block; transition: .2s; }
.face.sm { width: 36px; height: 30px; }
.face.lg { width: 64px; height: 52px; border-radius: 17px; gap: 8px; box-shadow: inset 0 0 0 5px var(--charcoal); }
.face.lg i { width: 11px; height: 14px; border-radius: 4px; }
.face.working i { height: 4px; transform: translateY(2px); }
.face.done i { height: 3px; border-radius: 3px 3px 1px 1px; transform: translateY(-1px); }
.face.blocked i { height: 3px; transform: translateY(2px); }
.face.flagged i { background: #ff8a87; }
.face-wrap { position: relative; display: inline-flex; padding: 4px; border-radius: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); display: inline-block; flex: none; }
.dot.working { background: var(--working); animation: pulse 1.3s infinite; }
.dot.done { background: var(--done); } .dot.ready { background: var(--ready); }
.dot.blocked { background: var(--blocked); } .dot.flagged { background: var(--flagged); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(47,174,99,.5); } 50% { box-shadow: 0 0 0 6px rgba(47,174,99,0); } }

/* ---------------- overview */
.onboarding h2 { margin-bottom: 4px; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; font-weight: 900; flex: none; }
.checklist li.done .tick { background: var(--accent); color: #fff; }
.checklist li.done span:not(.tick) { color: var(--ink-2); text-decoration: line-through; }
.checklist .btn { margin-left: auto; }
.next-card h2 { margin: 6px 0 4px; font-size: 21px; }
.prompt { display: flex; gap: 10px; align-items: center; background: var(--screen); color: #e9ecef; border-radius: 12px; padding: 10px 10px 10px 14px; margin-top: 12px; }
.prompt code { background: none; color: inherit; padding: 0; flex: 1; white-space: normal; font-size: 12.5px; }
.prompt .btn { background: var(--accent); box-shadow: none; }
#next-actions { margin-top: 12px; }
.big-progress { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.big-progress b { font-size: 34px; font-weight: 900; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .6s; }
.stepper { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.stepper li { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.stepper li.ok { background: rgba(21,158,154,.13); color: #0d7470; }
.stepper li.incomplete { background: rgba(217,150,43,.16); color: #95630f; }
.stepper li.revise { background: rgba(217,83,79,.14); color: #a8322f; }
.crew { display: grid; gap: 6px; }
.crew-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; border: 0; background: none; font: inherit; text-align: left; color: inherit; }
.crew-row:hover { background: var(--surface-2); }
.crew-row b { display: block; } .crew-row small { color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }

/* feeds */
.feed { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.feed.tall { max-height: 330px; }
.feed li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed li.empty { display: block; border: 0; color: var(--ink-2); }
.feed .ic { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; }
.feed .who { font-weight: 900; }
.feed .t { color: var(--ink-2); font-size: 11px; white-space: nowrap; }
.feed li.fresh { animation: pop .6s; }
@keyframes pop { from { background: var(--accent-soft); } to { background: transparent; } }

/* ---------------- world */
/* World: bright casual-game look (sky blue, puffy clouds, chunky type, sticker icons) */
.world { background: linear-gradient(180deg, #4fd2f7 0%, #7fe3fb 55%, #b8f1ff 100%); --game: "Lilita One", "Nunito", system-ui, sans-serif; }
#scene { position: absolute; inset: 0; }
#scene canvas { display: block; outline: none; }
.hud { position: absolute; top: 14px; left: 14px; z-index: 5; }
.hud-chip { display: flex; flex-direction: column; background: #fff; padding: 10px 16px; border-radius: 18px; box-shadow: 0 6px 0 rgba(30,40,90,.15), 0 12px 24px rgba(30,40,90,.15); max-width: 360px; border: 3px solid #fff; }
.hud-chip b { font-family: var(--game); font-weight: 400; font-size: 22px; letter-spacing: .01em; background: linear-gradient(90deg, #ff4f8b, #ff9a3c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hud-chip span { color: var(--ink-2); font-size: 13px; }
.hud-chip span.active { color: var(--working); }
.dock { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 6; display: flex; gap: 8px; padding: 8px; border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: 0 6px 0 rgba(30,40,90,.15), 0 14px 30px rgba(30,40,90,.18); max-width: calc(100% - 28px); overflow-x: auto; }
.dock-item { position: relative; border: 0; background: #eefaff; border-radius: 16px; cursor: pointer; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 8px 7px; min-width: 76px; transition: transform .15s; box-shadow: 0 4px 0 #cfe9f5; }
.dock-item:hover { transform: translateY(-3px); }
.dock-item:active { transform: translateY(2px); box-shadow: 0 1px 0 #cfe9f5; }
.dock-item.selected { background: linear-gradient(180deg, #ff6f9c, #ff4f7b); color: #fff; box-shadow: 0 4px 0 #d23a63; }
.world .dock-item .n { font-family: var(--game); font-weight: 400; font-size: 13px; letter-spacing: .02em; }
.dock-item .face { width: 40px; height: 32px; gap: 5px; }
.dock-item .face i { width: 7px; height: 9px; }
.dock-item .key { position: absolute; top: 4px; left: 7px; font-size: 10px; opacity: .6; font-weight: 900; }
.dock-item .dot { position: absolute; top: 6px; right: 7px; box-shadow: 0 0 0 2px var(--surface-2); }
.dock-item .n { font-size: 11px; font-weight: 900; white-space: nowrap; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
.hint { position: absolute; left: 14px; bottom: 6px; margin: 0; font-size: 11.5px; color: var(--ink-2); z-index: 4; }
.drawer { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 390px; z-index: 7; background: rgba(255,253,249,.96); backdrop-filter: blur(12px); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 18px; overflow-y: auto; transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2,.9,.3,1.1); }
.drawer.open { transform: none; }
.drawer .close { position: absolute; top: 14px; right: 14px; }
.world .drawer h2 { font-family: var(--game); font-weight: 400; font-size: 24px; letter-spacing: .01em; }
.drawer-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.soft { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.now { font-size: 15px; font-weight: 800; margin: 6px 0 2px; }
.issues { margin: 6px 0 0; padding-left: 18px; color: #a8322f; font-size: 12px; }
.nameplate { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translateY(-6px); }
.nameplate .plate { display: flex; align-items: center; gap: 6px; background: #fff; padding: 3px 11px 3px 8px; border-radius: 999px; box-shadow: 0 3px 0 rgba(30,40,90,.18); font-family: "Lilita One", "Nunito", sans-serif; font-weight: 400; font-size: 14px; letter-spacing: .02em; white-space: nowrap; color: #2d2a4a; }
.nameplate .sticker { width: 40px; height: 40px; border-radius: 12px; background: var(--c, #3b3f4a); border: 3px solid #fff; display: grid; place-items: center; font-size: 20px; color: #fff; font-family: "Lilita One", sans-serif; box-shadow: 0 5px 10px rgba(30,40,90,.25); animation: bob 2.4s ease-in-out infinite; position: relative; }
.nameplate .sticker::after { content: ""; position: absolute; bottom: -9px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
.nameplate .bubble { max-width: 230px; background: var(--screen); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 10px; border-radius: 12px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 14px rgba(0,0,0,.2); }
.nameplate.selected .plate { outline: 3px solid var(--charcoal); }
.sign { pointer-events: none; background: #ffcf4a; color: #6b3c00; border: 3px solid #fff; padding: 3px 12px; border-radius: 12px; font-family: "Lilita One", "Nunito", sans-serif; font-size: 13px; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 4px 0 rgba(30,40,90,.18); }

/* ---------------- campaign page */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .owner { display: flex; gap: 8px; align-items: center; }
.table .issues-cell { color: #a8322f; font-size: 12px; }
.check-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.check-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------------- agents page */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.agent-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px; border-top: 5px solid var(--c, var(--charcoal)); }
.agent-card .top { display: flex; gap: 12px; align-items: center; }
.agent-card .top b { font-size: 16px; display: block; }
.agent-card p { margin: 0; color: var(--ink-2); font-size: 13px; }
.agent-card .tools { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-card .tools span { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.agent-card .actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }

/* ---------------- forms */
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-weight: 900; font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
legend .count { font-size: 11px; color: var(--ink-2); font-weight: 800; background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.field input, .field textarea, .search { font: inherit; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; resize: vertical; transition: .15s; width: 100%; }
.field textarea { min-height: 72px; }
.field input:focus, .field textarea:focus, .search:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.field input:disabled, .field textarea:disabled { opacity: .65; cursor: not-allowed; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.form-foot.sticky { position: sticky; bottom: -48px; background: var(--surface); padding: 12px 0 4px; }
.meter { position: relative; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--accent) var(--p, 0%), var(--surface-3) 0); }
.meter::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--bg); }
.meter b { position: relative; font-size: 15px; font-weight: 900; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--line); cursor: pointer; font-size: 12.5px; font-weight: 800; }
.chips input { accent-color: var(--accent); }
.chips small { color: var(--ink-2); font-weight: 600; }
.swatches { display: flex; gap: 8px; padding: 6px 0; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--ink); }

/* ---------------- outputs */
.outputs { display: grid; grid-template-columns: 300px 1fr; gap: 18px; height: calc(100vh - 76px); }
.outputs .card { margin: 0; }
.file-list { overflow-y: auto; }
.search { margin-bottom: 6px; }
.file-group { margin-top: 14px; }
.file-group h3 { font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.file-group h3 small { color: var(--ink-2); font-weight: 700; }
.file { width: 100%; text-align: left; border: 0; font: inherit; background: transparent; padding: 7px 10px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; color: var(--ink); }
.file:hover { background: var(--surface-2); }
.file.active { background: var(--charcoal); color: #fff; }
.file .todo { font-size: 10px; font-weight: 900; padding: 1px 7px; border-radius: 999px; background: rgba(217,150,43,.2); color: #95630f; }
.viewer { overflow-y: auto; }
.viewer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.viewer-head h2 { margin: 2px 0; overflow-wrap: anywhere; }

/* rendered docs */
.doc { font-weight: 500; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.doc.small { font-size: 12.5px; max-height: 320px; overflow-y: auto; margin-top: 6px; }
.doc h1 { font-size: 22px; margin: 14px 0 8px; } .doc h2 { font-size: 17px; margin: 18px 0 6px; } .doc h3 { font-size: 15px; margin: 14px 0 4px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 12.5px; display: block; overflow-x: auto; }
.doc th, .doc td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); font-weight: 800; }
.doc pre { background: var(--screen); color: #e8ecef; padding: 12px; border-radius: 12px; overflow-x: auto; font-size: 12px; }
.doc pre code { background: none; padding: 0; color: inherit; }
.doc blockquote { margin: 8px 0; padding: 4px 12px; border-left: 4px solid var(--accent); color: var(--ink-2); }
.doc .todo-mark { background: rgba(217,150,43,.25); border-radius: 4px; padding: 0 3px; font-weight: 800; }

/* ---------------- modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(43,42,40,.35); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-card.wide { width: min(860px, 100%); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--charcoal-2); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); }
.toast.error { background: var(--flagged); }

/* ---------------- small screens: sidebar becomes a bottom bar */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .sidebar { flex-direction: row; align-items: center; padding: 8px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand div, .sidebar-foot .mode { display: none; }
  .campaign-switch { flex: 1; padding: 0; background: none; grid-template-columns: 1fr auto; }
  .campaign-switch .eyebrow { display: none; }
  .sidebar-foot { margin: 0; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; grid-auto-flow: column; background: var(--surface); border-top: 1px solid var(--line); padding: 6px; }
  .nav a { flex-direction: column; gap: 0; font-size: 10px; padding: 6px 2px; text-align: center; }
  .main { padding-bottom: 60px; }
  .page { padding: 18px 16px 90px; }
  .grid-2, .fields, .outputs { grid-template-columns: 1fr; }
  .outputs { height: auto; }
  .drawer { left: 10px; right: 10px; width: auto; top: 70px; bottom: 10px; }
  .hint { display: none; }
  .dock { bottom: 10px; }
  .dock-item { min-width: 62px; }
  h1 { font-size: 22px; }
  .page-head { flex-wrap: wrap; }
}

/* collapsible sidebar */
.app { transition: grid-template-columns .25s ease; }
.collapse-btn { margin-left: auto; }
.sidebar-open { display: none; position: absolute; top: 14px; left: 14px; z-index: 35; width: 40px; height: 40px; background: #fff; box-shadow: var(--shadow); font-size: 16px; }
.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .sidebar { visibility: hidden; padding: 0; border: 0; overflow: hidden; }
.app.collapsed .sidebar-open { display: block; }
.app.collapsed .hud { left: 64px; }
.app.collapsed .page { padding-top: 64px; }
@media (max-width: 860px) { .collapse-btn, .sidebar-open { display: none !important; } .app.collapsed .sidebar { visibility: visible; } }
.nowrap { flex-wrap: nowrap; }
.campaign-switch .icon-btn { width: 34px; height: 34px; background: var(--surface); border: 1px solid var(--line); }
.door-sign { pointer-events: none; background: #fff; color: #2d2a4a; border-bottom: 4px solid var(--c, #ff6f9c); padding: 3px 12px; border-radius: 10px; font-family: "Lilita One", "Nunito", sans-serif; font-size: 13px; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 3px 0 rgba(30,40,90,.15); }
/* labels appear on hover (or for the selected agent); stickers stay so you can spot each agent */
.nameplate .plate, .nameplate .bubble, .door-sign, .world .sign { opacity: 0; transform: translateY(4px) scale(.96); transition: opacity .15s, transform .15s; }
.nameplate.show .plate, .nameplate.selected .plate, .nameplate.show .bubble, .nameplate.selected .bubble,
.door-sign.show, .world .sign.show { opacity: 1; transform: none; }
.pop { pointer-events: none; font-family: "Lilita One", "Nunito", sans-serif; font-size: 15px; color: #fff; background: #ff4f7b; padding: 3px 10px; border-radius: 12px; white-space: nowrap; box-shadow: 0 3px 0 rgba(30,40,90,.2); animation: popin .25s ease-out, wobble .6s ease-in-out infinite .25s; }
.pop.hidden { display: none; }
@keyframes popin { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes wobble { 0%,100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.panic-banner { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); z-index: 8; background: #ff4f7b; color: #fff; font-family: "Lilita One", sans-serif; font-size: 20px; padding: 8px 18px; border-radius: 16px; box-shadow: 0 5px 0 #c7355a; animation: wobble .4s infinite; }
