:root {
  --bg: #f6f6fb;
  --panel: #ffffff;
  --panel-2: #f1f0fa;
  --side: #fbfbfe;
  --text: #17162b;
  --muted: #6b6a86;
  --line: #e7e6f2;
  --brand: #e0701a;
  --brand-2: #f59e3b;
  --brand-soft: #fff1e3;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 1px 2px rgba(20, 16, 60, .05), 0 8px 24px rgba(20, 16, 60, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1424; --panel: #151d33; --panel-2: #1c2640; --side: #111a2e;
    --text: #edf1fa; --muted: #9aa6c0; --line: #26324f;
    --brand: #f59e3b; --brand-2: #fbbf6a; --brand-soft: #3a2512;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1424; --panel: #151d33; --panel-2: #1c2640; --side: #111a2e;
  --text: #edf1fa; --muted: #9aa6c0; --line: #26324f;
  --brand: #f59e3b; --brand-2: #fbbf6a; --brand-soft: #3a2512;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 14px; }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(224, 112, 26, .3); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
label.field { display: grid; gap: 6px; font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=url], textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; outline: none; transition: .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 90px; }
input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 3px; }

/* ---------- choice cards ---------- */
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; cursor: pointer; background: var(--panel); transition: .15s; }
.choice:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.choice.on { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 3px; accent-color: var(--brand); }
.choice b { display: block; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); margin-left: 6px; vertical-align: 1px; }
.tag.warn { background: #fef3c7; color: #b45309; }
.tag.ok { background: #d1fae5; color: #047857; }
.tag.bad { background: #fee2e2; color: #b91c1c; }

/* ---------- auth & wizard ---------- */
.center { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, rgba(245, 158, 59, .18), transparent 70%), var(--bg); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; width: 100%; max-width: 620px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; }
.brand .name { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.brand .v { font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 3px; }
.hero-logo { width: 96px; height: 96px; border-radius: 26px; box-shadow: 0 12px 40px rgba(31, 42, 68, .45); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.steps { display: flex; gap: 6px; margin: 18px 0 22px; }
.steps span { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.steps span.done { background: linear-gradient(90deg, var(--brand-2), var(--brand)); }
.wizard-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.wizard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 10px; }
.connect-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; background: var(--panel); }
.connect-box .head { display: flex; align-items: center; gap: 10px; }
.connect-box .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px; background: var(--panel-2); }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 500; }
.err { color: var(--bad); font-size: 13px; }
.okmsg { color: var(--ok); font-size: 13px; }

/* ---------- main layout ---------- */
.shell { display: grid; grid-template-columns: 280px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .top { padding: 16px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.side .scroll { flex: 1; overflow: auto; padding: 4px 10px 10px; }
.side .label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 8px 6px; display: flex; justify-content: space-between; align-items: center; }
.nav { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; transition: .12s; position: relative; }
.nav:hover { background: var(--panel-2); }
.nav.on { background: var(--brand-soft); }
.nav .t { flex: 1; min-width: 0; }
.nav .t b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .t span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); font-size: 16px; flex: none; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.badge.warn { background: var(--warn); }
.side .foot { border-top: 1px solid var(--line); padding: 10px; }

.avatar { width: 38px; height: 38px; border-radius: 13px 13px 13px 5px; display: grid; place-items: center; font-size: 19px; flex: none; position: relative; color: #fff; }
.avatar.lg { width: 52px; height: 52px; font-size: 26px; border-radius: 17px 17px 17px 6px; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--side); background: var(--ok); }
.avatar .dot.paused { background: var(--muted); }
.avatar .dot.busy { background: var(--warn); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.page-head { padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: var(--panel); }
.page-head h2 { font-size: 18px; }
.page { flex: 1; overflow: auto; padding: 32px 24px 32px; }
.page .inner { max-width: 880px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.grid2 > .panel, .grid3 > .panel, .stack > .panel { margin-top: 0; }
.panel h3 { font-size: 15.5px; margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- chat ---------- */
.chat { flex: 1; overflow: auto; padding: 24px; }
.chat .inner { max-width: 820px; margin: 0 auto; display: grid; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.me { flex-direction: row-reverse; }
.bubble { max-width: min(680px, 85%); padding: 12px 15px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg.me .bubble { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; border-bottom-right-radius: 5px; }
.msg.bot .bubble { border-bottom-left-radius: 5px; }
.msg.task .bubble { background: var(--brand-soft); border-style: dashed; }
.msg.error .bubble { border-color: var(--bad); color: var(--bad); }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.msg.me .bubble code { background: rgba(255,255,255,.18); }
.bubble pre { background: var(--panel-2); padding: 10px; border-radius: 8px; overflow: auto; font-size: 12.5px; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { font-size: 15px; margin: 8px 0 4px; }
.meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg.me .meta { color: rgba(255,255,255,.75); justify-content: flex-end; }
.chip { font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.composer { padding: 14px 24px 20px; background: linear-gradient(transparent, var(--bg) 30%); }
.composer .box { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); }
.composer textarea { border: 0; box-shadow: none !important; min-height: 24px; max-height: 200px; padding: 8px 0; resize: none; background: transparent; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .avatar { margin: 0 auto 14px; }

/* ---------- usage bars ---------- */
.bar { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.cols { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.cols .c i { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(var(--brand-2), var(--brand)); min-height: 2px; }
.cols .c span { font-size: 10.5px; color: var(--muted); }

/* ---------- misc ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.notif { position: absolute; left: 290px; bottom: 60px; width: 340px; max-height: 60vh; overflow: auto; z-index: 40; }
.notif .n { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.notif .n:last-child { border: 0; }
.mem { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 18px; cursor: pointer; }
.emoji-pick button.on { border-color: var(--brand); background: var(--brand-soft); }
.hamburger { display: none; }
.dock-tip { display: flex; gap: 14px; align-items: center; background: var(--brand-soft); border-radius: 14px; padding: 14px; }
.dock-tip img { width: 52px; height: 52px; border-radius: 14px; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 86%; max-width: 320px; z-index: 30; transform: translateX(-102%); transition: .2s; box-shadow: var(--shadow); }
  .shell.open .side { transform: none; }
  .hamburger { display: inline-flex; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .page, .chat { padding: 16px; }
  .page-head { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .page-head > .grow { flex: 1 1 calc(100% - 60px); }
  .page-head > .btn { flex: 1 1 auto; justify-content: center; }
  .composer { padding: 10px 16px 16px; }
  .card { padding: 20px; }
  .notif { left: 16px; right: 16px; width: auto; }
  .grid3:has(> .panel > .stat) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grid3:has(> .panel > .stat) > .panel { padding: 12px; }
  .stat { font-size: 20px; }
  .rule { flex-wrap: wrap; }
  .rule > .grow { flex: 1 1 calc(100% - 60px); }
}

/* ---------- Cat's Tail additions ---------- */
.tabs { scrollbar-width: none; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.rule { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rule:last-child { border: 0; }
.rule .grow b { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: none; }
.seg button { border: 0; background: var(--panel); padding: 6px 10px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--brand); color: #fff; }
.seg button.on.block { background: var(--bad); }
.seg button.on.ask { background: var(--warn); }
.seg button.on.off { background: var(--muted); }
.seg button:disabled { cursor: default; }
.rec { font-size: 11px; color: var(--muted); }
.stat { font-size: 26px; font-weight: 700; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.conn-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel); cursor: pointer; display: grid; gap: 6px; transition: .15s; }
.conn-card:hover { border-color: var(--brand-2); }
.conn-card .ico { font-size: 22px; }
ol.guide { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.pill .d { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill .d.ok { background: var(--ok); } .pill .d.bad { background: var(--bad); } .pill .d.warn { background: var(--warn); }
.kill { background: var(--bad) !important; color: #fff !important; border-color: transparent !important; }
.log-row { display: grid; grid-template-columns: 110px 140px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row .st-blocked, .log-row .st-error { color: var(--bad); } .log-row .st-pending, .log-row .st-warn { color: var(--warn); }
.copybox { font-family: ui-monospace, monospace; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; white-space: pre-wrap; max-height: 220px; overflow: auto; }
@media (max-width: 820px) { .log-row { grid-template-columns: 1fr; gap: 2px; } }

/* UI review 2026-10-31 */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.nav-img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.chip-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.chip-btn:hover { border-color: var(--brand); }

/* one-click Slack, sign-in apps, code fixes (2026-10-31) */
.guide li.done { color: var(--muted); text-decoration: line-through; }
.guide li.done::marker { content: '✓  '; color: var(--ok, #16a34a); }
pre.diff { white-space: pre-wrap; background: var(--panel-2); padding: 10px; border-radius: 8px; max-height: 360px; overflow: auto; font-size: 12px; }
details.more > summary { cursor: pointer; }
code.small { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.row.wrap { flex-wrap: wrap; }

/* company + private 2026-10-31 */
.rule.wrap { flex-wrap: wrap; }
@media (max-width: 820px) { .panel > .row:first-child { flex-wrap: wrap; } .panel > .row:first-child > .muted { width: 100%; } }
/* 11-03 connect wizard copy rows + teach recorder */
.copyrow { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.copyrow code { word-break: break-all; font-size: 12px; }
.teach-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.teach-frames img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }
.teach-steps textarea { width: 100%; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: ctspin 1s linear infinite; flex: none; }
@keyframes ctspin { to { transform: rotate(360deg); } }

/* Rey 11-03: neater sidebar: one-line text items, slim accent on the current page, small bot avatars. */
.side .label { padding: 16px 10px 6px; }
.nav.nav-plain, .nav.nav-bot { padding: 7px 10px; gap: 8px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text); min-height: 32px; }
.nav.nav-plain.on, .nav.nav-bot.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); font-weight: 600; }
.nav.nav-plain .grow, .nav.nav-bot .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar.xs { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; flex: none; }
.avatar.xs::after { display: none; }
.linkbtn { background: none; border: 0; color: var(--brand); font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: none; cursor: pointer; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

/* breadcrumb + back (Rey 11-03) */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.crumbs .linkbtn { font-size: 12px; padding: 0; }
.crumbs .sep { opacity: .6; }
.crumbs .crumb-back { margin-right: 8px; font-weight: 600; }

/* People page (Rey 11-03): clean rows, one Edit button */
details.dept > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details.dept > summary::-webkit-details-marker { display: none; }
details.dept > summary::before { content: '▸'; color: var(--muted); width: 12px; transition: transform .15s; }
details.dept[open] > summary::before { transform: rotate(90deg); }
details.dept[open] > summary { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.person { padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person.off { opacity: .55; }
.person-line { display: flex; align-items: center; gap: 12px; }
.person .initial { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; flex: none; }
.role-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.role-tag.owner, .role-tag.admin { color: var(--brand); }
.person-edit { margin: 10px 0 4px 46px; padding: 14px; border-radius: 10px; background: var(--panel-2); display: flex; flex-direction: column; gap: 12px; }
.person-access { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.person-add { margin: 10px 0 4px; gap: 8px; }
.person-add select { flex: 1; }
@media (max-width: 640px) { .person-edit { margin-left: 0; } }

.person-edit .grid2 { align-items: start; }

/* tab menu under the page title (Rey 11-03) */
.head-wrap { background: var(--panel); border-bottom: 1px solid var(--line); }
.head-wrap .page-head { border-bottom: 0; padding-bottom: 6px; }
.subnav { margin: 0; padding: 0 24px; border-bottom: 0; }
@media (max-width: 640px) { .page { padding: 24px 14px; } .subnav { padding: 0 8px; } }

/* view-only guardrails (Rey 11-03) */
.readonly { pointer-events: none; opacity: .75; }

/* sensitive guardrails locked for Users (Rey 11-03) */
.locked-rule { opacity: .5; }

/* server app settings (Rey 11-03) */
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: 0; }
.switch-row { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .setting-row { grid-template-columns: 1fr; gap: 6px; } }

/* collapsible sidebar sections + pins (Rey 11-03) */
.side .label.sec-toggle { cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none; }
.side .label.sec-toggle:hover { color: var(--text); }
.side .label .caret { width: 10px; display: inline-block; }
.nav .pin { background: none; border: 0; cursor: pointer; font-size: 11px; padding: 0 2px; opacity: 0; filter: grayscale(1); transition: opacity .15s; }
.nav:hover .pin { opacity: .7; }
.nav .pin.on { opacity: 1; filter: none; }
@media (hover: none) { .nav .pin { opacity: .5; } }

/* left menu + right panel (Rey 11-03) */
.page .inner.split-inner { max-width: 1080px; }
.split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.split-menu { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.split-menu button { text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 12px; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.split-menu button:hover { background: var(--panel-2); color: var(--text); }
.split-menu button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split-menu { flex-direction: row; overflow-x: auto; position: static; } .split-menu button { white-space: nowrap; } }

/* Company bots cards (Rey 11-03) */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bot-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 130px; }
.bot-card .does { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status-dot { font-size: 11px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .6; }
.status-dot.ok::before { background: var(--ok); opacity: 1; } .status-dot.bad::before { background: var(--bad); opacity: 1; } .status-dot.paused::before { background: var(--warn); opacity: 1; }
.status-dot.bad { color: var(--bad); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #1a1205; font-weight: 600; }
.modal-bg { position: fixed; inset: 0; background: rgba(5,8,18,.55); z-index: 59; display: grid; place-items: center; padding: 16px; }
@media (max-width: 760px) { .card-grid { grid-template-columns: 1fr; } }

/* New bot bottom bar (Rey 11-03) */
.create-bar { position: sticky; bottom: 0; background: var(--bg, #0b1220); padding: 12px 0; border-top: 1px solid var(--line); gap: 8px; }

.split-menu button { display: flex; align-items: center; gap: 6px; }
.split-menu button .badge { width: auto; flex: none; margin-left: auto !important; }

.person-name { cursor: pointer; }
.person-name:hover { text-decoration: underline; }

/* field help (Rey 11-03) */
.field-help { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; }

/* first-time tour (Rey 11-03) */
.tour-card { max-width: 440px; width: 100%; text-align: left; }
.tour-card h2 { margin: 0; }

/* tour spotlight (Rey 11-03) */
.tour-layer { position: fixed; inset: 0; z-index: 70; background: rgba(5,8,18,.35); }
.tour-spot { position: fixed; display: none; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(5,8,18,.55); outline: 2px solid var(--brand); pointer-events: none; transition: all .2s; }
.tour-layer:has(.tour-spot[style*="block"]) { background: transparent; }
.tour-card.pointing::before { content: ''; position: absolute; left: -8px; top: 26px; border: 8px solid transparent; border-right-color: var(--panel); border-left: 0; }

/* Knowledge rows (Rey 11-04) */
.kn-row a { color: var(--text); text-decoration: none; font-weight: 500; }
.kn-row a:hover { text-decoration: underline; }

/* model drop-up in the chat box (Rey 11-04) */
.model-wrap { position: relative; align-self: flex-end; }
.model-btn { white-space: nowrap; font-weight: 600; }
.model-menu { position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 30; display: flex; flex-direction: column; gap: 2px; }
.model-opt { display: grid; grid-template-columns: 1fr auto; text-align: left; background: none; border: 0; color: var(--text); padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.model-opt .muted { grid-column: 1; }
.model-opt .tick { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--brand); }
.model-opt:hover, .model-opt.on { background: var(--panel-2); }

.model-sep { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.model-menu { max-height: 70vh; overflow: auto; }
.model-opt:disabled { opacity: .45; cursor: default; }

/* Rey 11-05: health problems as a banner at the top of a bot's / server app's page (like a site status bar) */
.health-bar:empty { display: none; }
.health-bar { padding: 12px 24px 0; display: grid; gap: 8px; }
.hb-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--warn); border-left-width: 5px; background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-radius: 12px; padding: 12px 14px; }
.hb-item.high { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--panel)); }
.hb-item .hb-ico { font-size: 18px; line-height: 1.3; }
.hb-item .hb-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.hb-item .hb-title { font-weight: 600; font-size: 14px; }
.hb-item .hb-how { font-size: 13px; color: var(--muted); }
.hb-item .hb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hb-item .hb-x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; }
@media (max-width: 640px) { .health-bar { padding: 10px 16px 0; } }

/* Rey 11-05: apps used inside Cat's Tail */
.embed-wrap { padding: 12px 16px; }
@media (max-width: 640px) { .embed-wrap { padding: 8px; } }

/* Rey 11-05: "Use the app" fills the whole area to the right of the sidebar */
.page.page-full { padding: 0; overflow: hidden; display: flex; }
.page.page-full > .inner { max-width: none; width: 100%; margin: 0; display: flex; flex: 1; }
.page.page-full iframe { flex: 1; height: 100% !important; border-radius: 0 !important; }

/* Rey 11-06: custom apps (New → Custom app): neat, plain pages */
.statuspill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--panel-2); }
.statuspill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statuspill.good { color: var(--ok); } .statuspill.warn { color: var(--warn); } .statuspill.bad { color: var(--bad); }
.lead { font-size: 15px; line-height: 1.55; margin: 2px 0; }
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 18px; margin: 4px 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 14px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.todo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 13.5px; }
.preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
.preview-text { white-space: pre-wrap; font-size: 14px; line-height: 1.5; margin-top: 4px; }
.wiz-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.wiz-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand-2), var(--brand)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--panel-2); }
.tracker { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tracker span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.tracker span.done { color: var(--ok); } .tracker span.now { color: var(--brand); font-weight: 600; } .tracker span.bad { color: var(--bad); }

.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .kind-grid { grid-template-columns: 1fr; } }
.kind-card { text-align: left; display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.kind-card:hover { background: var(--panel-2); }
.kind-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; cursor: default; }
.sched-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-row > input, .sched-row > select { width: auto; min-width: 140px; flex: 0 1 auto; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tool-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; cursor: pointer; background: var(--panel); }
.tool-pick:has(input:checked) { border-color: var(--brand); background: var(--panel-2); }
