:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2129; --muted: #667085; --line: #e4e7ec;
  --accent: #128c4a; --accent-2: #25d366; --danger: #c0392b; --warn: #b26a00;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
body.center { min-height: 100vh; display: grid; place-items: center; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 0 0 .8em; }
h3 { font-size: 1rem; margin: 1.2em 0 .4em; }
code { font-size: .85em; background: #f0f2f5; padding: 1px 5px; border-radius: 4px; }
pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: .9em; }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #111b21; color: #fff; }
.top a { color: #e9edef; text-decoration: none; }
.top nav { display: flex; gap: 18px; flex: 1; }
.top .brand { font-weight: 700; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.login { width: min(380px, 92vw); display: grid; gap: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 20px; }
.grid { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.row > input { flex: 1; }
label { display: grid; gap: 4px; font-weight: 500; }
label small { font-weight: 400; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; width: 100%; }
label.check input { width: auto; }
button { font: inherit; font-weight: 600; padding: 9px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; justify-self: start; }
button:hover { filter: brightness(1.08); }
button.small { padding: 4px 10px; font-size: .85em; }
button.danger { background: var(--danger); }
button.link { background: none; color: #e9edef; font-weight: 400; padding: 0; }
form.inline { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .92em; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.ok { color: var(--accent); }
.warn { color: var(--warn); }
.tag { display: inline-block; font-size: .8em; padding: 1px 8px; border-radius: 999px; background: #eef0f3; color: #344054; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: #e7f6ec; color: #0b5d2a; }
.flash.error { background: #fdecea; color: #8a1c12; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat b { display: block; font-size: 1.8rem; }
.stat span { color: var(--muted); }
.files { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow: auto; }
.danger-zone { border-color: #f1c4bf; }
details > summary { cursor: pointer; padding: 6px 0; }
table.fields td:first-child { white-space: nowrap; font-weight: 600; }

/* Simulator */
.sim { display: grid; gap: 12px; max-width: 760px; }
.chat { background: #efeae2; border-radius: 10px; padding: 14px; height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.msg.in { background: #fff; align-self: flex-start; }
.msg.out { background: #d9fdd3; align-self: flex-end; }
.msg img { max-width: 220px; border-radius: 6px; display: block; }
.msg .btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .btns button { background: #fff; color: #027eb5; border: 1px solid #d1d7db; font-weight: 500; padding: 5px 12px; }
.file { cursor: pointer; font-size: 1.4rem; display: block; }
pre.log { background: #f6f7f9; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: .8em; }
a.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; }
.grow { flex: 1; }
.msg-head { font-weight: 700; margin-bottom: 4px; }
.msg-foot { color: #667781; font-size: .82em; margin-top: 6px; }
.msg .cta, .msg .list-open { display: block; width: 100%; margin-top: 8px; padding: 7px 12px; text-align: center; background: #fff; color: #027eb5; border: 0; border-top: 1px solid #e9edef; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.list-panel { margin-top: 6px; border: 1px solid #e9edef; border-radius: 8px; overflow: hidden; }
.list-sec { background: #f0f2f5; color: #008069; font-size: .8em; font-weight: 600; padding: 6px 12px; }
.list-row { display: grid; width: 100%; text-align: left; background: #fff; border: 0; border-top: 1px solid #f0f2f5; padding: 8px 12px; font: inherit; cursor: pointer; white-space: normal; }
.list-row:hover { background: #f5f6f6; }
.list-title { color: #111b21; }
.list-desc { color: #667781; font-size: .85em; }
