/* Roger app design. Three directions × light/dark, driven by CSS variables.
 * A = Telegram-style, B = Cord-style, C = blend.  Sizes are iOS points. */

.rdev {
  --font: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Inter Variable", Inter, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ok: #34C759; --warn: #FF9500; --danger: #FF3B30; --idle: #8E8E93;
  --r-card: 16px; --r-bub: 18px; --r-btn: 10px;
  position: relative; font-family: var(--font); font-size: 16px; line-height: 1.3; color: var(--text);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-align: left;
}
.rdev *, .rdev *::before, .rdev *::after { box-sizing: border-box; }
:where(.rdev) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.rdev input, .rdev textarea { font: inherit; color: inherit; }
.rdev .ic { width: 1em; height: 1em; flex: none; display: inline-block; }
.rdev h1, .rdev h2, .rdev h3, .rdev p { margin: 0; }

/* ---------- palettes ---------- */
.dir-a.light { --bg: #EFEFF4; --surface: #fff; --surface2: #F2F2F7; --text: #000; --sub: #8E8E93; --line: rgba(60,60,67,.2); --accent: #3390EC; --accent-on: #fff; --tint: rgba(51,144,236,.12);
  --me: #E1FFC7; --me-text: #000; --me-meta: #45A53C; --them: #fff; --them-text: #000; --them-meta: #A0A3A8; --bar: rgba(247,247,247,.94); --chip: #EEF3F8; --sheet: #F2F2F7;
  --wall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23577a3c' stroke-opacity='.16' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 30l6-10 6 10-6 10zM120 20a8 8 0 1 0 0 .1M70 60h20v14H76l-6 6zM30 110l10-4 4 10-10 4zM110 100c6-6 14 0 8 8M140 70l4 4M136 74l4-4M60 130a6 6 0 1 0 12 0 6 6 0 1 0-12 0M100 140l8-8 8 8M15 70c4-4 8 4 12 0'/%3E%3C/svg%3E"), linear-gradient(150deg, #D5E5B5 0%, #B9D59A 35%, #CFE2A6 65%, #E6EBB8 100%);
  --cardsh: 0 1px 1.5px rgba(0,0,0,.13); }
.dir-a.dark { --bg: #000; --surface: #1C1C1D; --surface2: #2C2C2E; --text: #fff; --sub: #8D8E93; --line: rgba(84,84,88,.55); --accent: #3E88F7; --accent-on: #fff; --tint: rgba(62,136,247,.18);
  --me: #2F5D8F; --me-text: #fff; --me-meta: #9CC4F0; --them: #262628; --them-text: #fff; --them-meta: #8D8E93; --bar: rgba(22,22,22,.94); --chip: #2C2C2E; --sheet: #1C1C1D;
  --wall: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160' fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 30l6-10 6 10-6 10zM120 20a8 8 0 1 0 0 .1M70 60h20v14H76l-6 6zM30 110l10-4 4 10-10 4zM110 100c6-6 14 0 8 8M140 70l4 4M136 74l4-4M60 130a6 6 0 1 0 12 0 6 6 0 1 0-12 0M100 140l8-8 8 8M15 70c4-4 8 4 12 0'/%3E%3C/svg%3E"), linear-gradient(150deg, #0E1A24 0%, #12202B 50%, #0C141B 100%);
  --cardsh: none; }
.dir-b.light { --bg: #F2F2F7; --surface: #fff; --surface2: #F2F2F7; --text: #000; --sub: #8A8A8E; --line: rgba(60,60,67,.16); --accent: #0A84FF; --accent-on: #fff; --tint: rgba(10,132,255,.12);
  --me: #0A84FF; --me-text: #fff; --me-meta: rgba(255,255,255,.72); --them: #E9E9EB; --them-text: #000; --them-meta: #8A8A8E; --bar: rgba(249,249,249,.94); --chip: #E9E9EE; --sheet: #F2F2F7;
  --wall: #fff; --cardsh: 0 1px 2px rgba(0,0,0,.06); --r-btn: 999px; }
.dir-b.dark { --bg: #000; --surface: #1C1C1E; --surface2: #2C2C2E; --text: #fff; --sub: #8E8E93; --line: rgba(84,84,88,.5); --accent: #0A84FF; --accent-on: #fff; --tint: rgba(10,132,255,.2);
  --me: #0A84FF; --me-text: #fff; --me-meta: rgba(255,255,255,.7); --them: #2C2C2E; --them-text: #fff; --them-meta: #8E8E93; --bar: rgba(22,22,24,.94); --chip: #2C2C2E; --sheet: #1C1C1E;
  --wall: #000; --cardsh: none; --r-btn: 999px; }
.dir-c.light { --bg: #F3F5F5; --surface: #fff; --surface2: #EEF2F1; --text: #0B1513; --sub: #7D8786; --line: rgba(20,40,38,.12); --accent: #0E9F9A; --accent-on: #fff; --tint: rgba(14,159,154,.12);
  --me: #0E9F9A; --me-text: #fff; --me-meta: rgba(255,255,255,.75); --them: #fff; --them-text: #0B1513; --them-meta: #9AA3A2; --bar: rgba(250,251,251,.92); --chip: #EAF0EF; --sheet: #F3F5F5;
  --wall: radial-gradient(circle at 1px 1px, rgba(14,90,86,.10) 1px, transparent 1.4px) 0 0/18px 18px, linear-gradient(180deg, #EEF4F3, #E7F0EE);
  --cardsh: 0 1px 2px rgba(10,40,38,.08), 0 0 0 .5px rgba(10,40,38,.06); --r-btn: 12px; }
.dir-c.dark { --bg: #0A0D0E; --surface: #161B1C; --surface2: #1E2526; --text: #EEF3F2; --sub: #8A9493; --line: rgba(255,255,255,.09); --accent: #2EC4B6; --accent-on: #04201D; --tint: rgba(46,196,182,.16);
  --me: #12827C; --me-text: #fff; --me-meta: rgba(255,255,255,.7); --them: #1C2324; --them-text: #EEF3F2; --them-meta: #7F8A89; --bar: rgba(16,20,21,.92); --chip: #1E2627; --sheet: #121718;
  --wall: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 1.4px) 0 0/18px 18px, #0A0D0E;
  --cardsh: 0 0 0 .5px rgba(255,255,255,.06); --r-btn: 12px; }

/* ---------- phone frame ---------- */
.rdev.k-phone.framed { width: 414px; height: 868px; padding: 12px; border-radius: 64px; background: #121214; box-shadow: 0 0 0 2px #4a4a4e, 0 0 0 5px #1c1c1e, 0 30px 70px rgba(0,0,0,.28); }
.rdev.k-phone.bare { width: 100%; height: 100%; }
.ph { position: relative; height: 100%; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.framed .ph { border-radius: 52px; }
.sbar { flex: none; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 46px; font-size: 16px; position: relative; z-index: 5; }
.sbar b { font-weight: 600; }
.sbar-r { display: flex; gap: 5px; align-items: center; }
.sbar-r .ic { width: 18px; height: 18px; }
.sbar-r .ic:last-child { width: 26px; height: 26px; }
.island { position: absolute; left: 50%; top: 11px; width: 122px; height: 35px; border-radius: 20px; background: #000; transform: translateX(-50%); }
.homebar { position: absolute; left: 50%; bottom: 8px; width: 134px; height: 5px; border-radius: 3px; background: var(--text); opacity: .85; transform: translateX(-50%); z-index: 40; pointer-events: none; }
.ph-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* the status bar sits over the chat header / page header colour */
.ph.chat .sbar, .ph.form .sbar, .ph.menu .sbar, .ph.slashing .sbar { background: var(--bar); }
.dir-a .ph .sbar { background: var(--bar); }

/* ---------- scroll pages ---------- */
.pagewrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.k-phone .scroll { scrollbar-width: none; }
.k-phone .scroll::-webkit-scrollbar { display: none; }
.lhead { padding: 6px 16px 10px; }
.lhead-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.lhead h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-right: auto; }
.lhead-r { display: flex; gap: 8px; }
.lsub { color: var(--sub); font-size: 15px; margin-top: -2px; }
.pagebody { padding: 0 16px 24px; }
/* A: Telegram uses small centred titles */
.dir-a .lhead { background: var(--bar); border-bottom: .5px solid var(--line); padding: 4px 12px 8px; text-align: center; margin-bottom: 14px; }
.dir-a .lhead-row { min-height: 36px; position: relative; justify-content: center; }
.dir-a .lhead h1 { font-size: 17px; font-weight: 600; margin: 0; }
.dir-a .lhead-r { position: absolute; right: 0; }
.dir-a .lsub { font-size: 13px; margin: 0; }

.rbtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--accent); flex: none; }
.rbtn .ic { width: 20px; height: 20px; }
.dir-a .rbtn { background: none; }
.dir-a .rbtn .ic { width: 24px; height: 24px; }

.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--cardsh); }
.gh { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--sub); margin: 22px 4px 8px; display: flex; align-items: center; gap: 6px; }
.gh small { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: auto; }
.gh .ic { width: 15px; height: 15px; color: var(--accent); }
.dir-b .gh, .dir-c .gh { text-transform: none; font-size: 15px; color: var(--text); letter-spacing: -.01em; font-weight: 650; margin: 22px 4px 8px; }
.hint, .fine { color: var(--sub); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; margin: 10px 4px; }
.hint .ic, .fine .ic { width: 15px; height: 15px; margin-top: 1px; color: var(--accent); }
.fine.center { justify-content: center; text-align: center; margin-top: 18px; }
.search { display: flex; align-items: center; gap: 8px; height: 36px; border-radius: 10px; background: var(--chip); color: var(--sub); padding: 0 10px; margin: 0 0 12px; font-size: 16px; }
.search .ic { width: 17px; height: 17px; }
.seg { display: flex; background: var(--chip); border-radius: 9px; padding: 2px; margin: 0 0 12px; }
.seg button { flex: 1; height: 30px; border-radius: 7px; font-size: 14px; font-weight: 500; text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--text); }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.dark .seg button.on { background: #636366; }
.dir-c.dark .seg button.on { background: #2A3435; }

.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 600; font-style: normal; display: inline-grid; place-items: center; line-height: 1; }
.dir-a .trow .badge, .dir-c .trow .badge { background: var(--accent); }
.badge.run { background: var(--accent); }

/* ---------- buttons ---------- */
.btn { height: 36px; padding: 0 14px; border-radius: var(--r-btn); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; white-space: nowrap; transition: transform .1s, opacity .1s; }
.btn:active { transform: scale(.97); opacity: .85; }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-on); }
.btn.ghost { background: var(--tint); color: var(--accent); }
.btn.danger-ghost { background: rgba(255,59,48,.11); color: var(--danger); }
.btn.big { height: 50px; font-size: 17px; border-radius: calc(var(--r-btn) + 2px); }
.dir-b .btn.big { border-radius: 999px; }
.btn.full { width: 100%; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .4; cursor: default; }
.linkbtn { color: var(--accent); font-size: 14px; font-weight: 500; margin-left: auto; display: inline-flex; gap: 3px; align-items: center; }
.switch { width: 51px; height: 31px; border-radius: 16px; background: rgba(120,120,128,.24); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--ok); }
.dir-c .switch.on { background: var(--accent); }
.switch.on i { transform: translateX(20px); }
.ic.tiny { width: 14px; height: 14px; color: var(--sub); }

/* ---------- spinner + bars ---------- */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.2px solid var(--tint); border-top-color: var(--accent); animation: r-spin .8s linear infinite; flex: none; display: inline-block; }
.spin.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes r-spin { to { transform: rotate(360deg); } }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .5s ease; }
.bar.thin { height: 4px; margin: 2px 0 8px; }
.bar.f i { background: #AF52DE; }

/* ---------- tab bar ---------- */
.tabbar { flex: none; display: flex; background: var(--bar); border-top: .5px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 6px 4px 30px; position: relative; z-index: 6; }
.bare .tabbar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--sub); position: relative; }
.tab .ic { width: 27px; height: 27px; stroke-width: 1.7; }
.tab.on { color: var(--accent); }
.tab .badge { position: absolute; top: -3px; left: calc(50% + 6px); }
.dir-c .tab.on .ic { stroke-width: 2.1; }

/* ---------- chat list ---------- */
.tghead { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px 16px; background: var(--bar); }
.tghead b { font-size: 17px; }
.tglink { color: var(--accent); font-size: 17px; }
.tgsearch { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; margin: 8px 12px; border-radius: 10px; background: var(--chip); color: var(--sub); }
.tgsearch .ic { width: 16px; height: 16px; }
.tlist { display: flex; flex-direction: column; }
.dir-a .tlist { background: var(--surface); }
.trow { display: flex; align-items: center; gap: 12px; padding: 8px 14px; min-height: 76px; width: 100%; position: relative; }
.trow::after { content: ""; position: absolute; left: 78px; right: 0; bottom: 0; height: .5px; background: var(--line); }
.trow:last-child::after { display: none; }
.trow:active { background: var(--chip); }
.trow-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trow-1 { display: flex; align-items: center; gap: 5px; }
.trow-1 b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-1 small { margin-left: auto; color: var(--sub); font-size: 14px; }
.trow-2 { display: flex; align-items: flex-start; gap: 8px; color: var(--sub); font-size: 15px; line-height: 1.25; }
.trow-2 > span { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pinic { width: 13px; height: 13px; color: var(--sub); }
.trow.sel { background: var(--accent); color: var(--accent-on); }
.trow.sel .trow-2, .trow.sel small { color: inherit; opacity: .85; }
.trow.sel .badge { background: var(--accent-on); color: var(--accent); }
.dir-b .trow.sel, .dir-c .trow.sel { background: var(--tint); color: var(--text); }
.dir-b .trow.sel .trow-2, .dir-c .trow.sel .trow-2, .dir-b .trow.sel small, .dir-c .trow.sel small { color: var(--sub); opacity: 1; }
.card.tlist { overflow: hidden; }
.card.tlist .trow::after { left: 78px; }

.rav { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #2DD4BF, #0E9F9A 55%, #087F7B); }
.dir-a .rav { background: linear-gradient(180deg, #6FD3FF, #2AABEE); }
.dir-b .rav { background: linear-gradient(160deg, #3d9bff, #0A84FF 55%, #0062d6); }
.rav svg { width: 58%; height: 58%; }
.rav.sm { width: 30px; height: 30px; }
.rav.xl { width: 96px; height: 96px; border-radius: 28px; box-shadow: 0 12px 30px rgba(14,159,154,.35); }
.dir-a .rav.xl { box-shadow: 0 12px 30px rgba(42,171,238,.35); }
.dir-b .rav.xl { box-shadow: 0 12px 30px rgba(10,132,255,.35); }
.tav { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 26px; background: hsl(var(--h) 80% 92%); }
.dark .tav { background: hsl(var(--h) 35% 22%); }
.dir-b .tav, .dir-c .tav { border-radius: 16px; }
.jobstrip { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 10px 12px; border-radius: 12px; background: var(--tint); color: var(--text); font-size: 14px; width: calc(100% - 24px); }
.dir-c .jobstrip { margin: 0 0 12px; width: 100%; }
.jobstrip span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobstrip .ic { width: 14px; height: 14px; color: var(--sub); }

/* ---------- chat ---------- */
.chatcol { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; position: relative; }
.chead { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 10px 8px; background: var(--bar); border-bottom: .5px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); position: relative; z-index: 4; min-height: 52px; }
.chead .rav, .chead .tav { width: 38px; height: 38px; font-size: 19px; }
.chead-c { flex: 1; text-align: center; display: flex; flex-direction: column; min-width: 0; }
.chead-c b { font-size: 17px; font-weight: 600; }
.chead-c small, .chead-t small { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chead-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chead-t b { font-size: 17px; font-weight: 600; }
.chead-t small { display: flex; align-items: center; gap: 5px; }
.live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px rgba(52,199,89,.18); }
.tgback { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; min-width: 88px; }
.tgback .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.tgback .badge { background: var(--accent); margin-left: 4px; }
.chead-av { min-width: 88px; display: flex; justify-content: flex-end; }
.iback { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; width: 44px; height: 40px; position: relative; }
.iback .ic { width: 24px; height: 24px; stroke-width: 2.4; }
.iback .badge { position: absolute; left: 18px; top: 2px; }
.dir-b .chead { flex-direction: row; justify-content: space-between; padding-bottom: 6px; }
.chead-stack { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.chead-stack b { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 1px; }
.dir-b .chead-stack .rav { width: 44px; height: 44px; }
.pillbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 15px; background: var(--tint); color: var(--accent); font-size: 14px; font-weight: 600; flex: none; }
.tchips { flex: none; display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; background: var(--bar); border-bottom: .5px solid var(--line); scrollbar-width: none; position: relative; z-index: 3; }
.tchips::-webkit-scrollbar { display: none; }
.tchip { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--chip); font-size: 14px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; position: relative; flex: none; }
.tchip.on { background: var(--text); color: var(--bg); }
.tchip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tchip.more { color: var(--accent); background: none; }

.msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.msgs::-webkit-scrollbar { display: none; }
.wall { background: var(--wall); }
.dir-a .wall { background-size: 160px 160px, cover; }
.msgs-in { padding: 10px 10px 12px; display: flex; flex-direction: column; min-height: 100%; justify-content: flex-end; }
.day { display: flex; justify-content: center; margin: 4px 0 10px; }
.day span { font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 12px; color: var(--sub); }
.dir-a .day span { background: rgba(0,0,0,.18); color: #fff; }
.dir-a.dark .day span { background: rgba(255,255,255,.1); }
.dir-c .day span { background: var(--surface); box-shadow: var(--cardsh); }
.msg { display: flex; margin: 0 0 3px; }
.msg.tail { margin-bottom: 10px; }
.msg.me { justify-content: flex-end; }
.bub { max-width: 80%; padding: 7px 11px 7px 12px; border-radius: var(--r-bub); background: var(--them); color: var(--them-text); box-shadow: var(--cardsh); font-size: 16px; line-height: 1.32; position: relative; overflow-wrap: anywhere; }
.me .bub { background: var(--me); color: var(--me-text); }
.dir-b .bub { box-shadow: none; padding: 8px 13px; }
.tail.them .bub { border-bottom-left-radius: 6px; }
.tail.me .bub { border-bottom-right-radius: 6px; }
.meta { float: right; margin: 8px -2px -4px 10px; font-size: 11.5px; color: var(--them-meta); display: inline-flex; align-items: center; gap: 2px; line-height: 1; white-space: nowrap; }
.me .meta { color: var(--me-meta); }
.dir-b .msg:not(.tail) .meta { display: none; }
.ticks { display: inline-flex; position: relative; width: 16px; }
.ticks .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.ticks .tick2 { position: absolute; left: 4px; }
.rt { font-weight: 650; color: var(--accent); }
.me .rt { color: inherit; }
.dir-a.light .rt { color: #2C7FD0; }
.blist { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.blist li { display: flex; gap: 7px; align-items: flex-start; font-size: 15px; }
.blist .ic { color: var(--ok); width: 17px; height: 17px; margin-top: 1px; stroke-width: 2.5; }
.typing { display: flex; gap: 4px; padding: 13px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sub); animation: r-dot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes r-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* voice */
.voice { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; column-gap: 9px; min-width: 250px; padding-top: 9px; }
.vplay { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-on); display: grid; place-items: center; }
.me .vplay { background: var(--me-meta); color: var(--me); }
.dir-b .me .vplay, .dir-c .me .vplay { background: #fff; color: var(--me); }
.vplay .ic { width: 18px; height: 18px; }
.vwave { display: flex; align-items: center; gap: 2px; height: 24px; }
.vwave i { width: 3px; border-radius: 2px; background: currentColor; opacity: .45; }
.playing .vwave i:nth-child(-n+11) { opacity: 1; }
.vdur { font-size: 13px; opacity: .7; }
.vtx { grid-column: 1 / -1; font-size: 14px; font-style: italic; opacity: .8; margin-top: 6px; }
/* photo */
.photo { padding: 3px; max-width: 72%; }
.ph-img { width: 250px; height: 180px; border-radius: 15px; overflow: hidden; background: linear-gradient(160deg, #cfd4d8, #aeb6bb); display: grid; place-items: center; }
.wb { width: 86%; height: 78%; background: #fbfbf8; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.18), inset 0 0 0 4px #d9dcdf; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; transform: rotate(-2deg); font-family: "Marker Felt", "Comic Sans MS", "Segoe Print", cursive; color: #1b4fb3; font-size: 15px; }
.wb b { color: #d33; font-size: 17px; }
.wb em { color: #2a8a3a; margin-top: auto; align-self: flex-end; }
.cap { padding: 6px 9px 4px; }
.photo > .meta { position: absolute; right: 12px; bottom: 10px; background: rgba(0,0,0,.4); color: #fff; padding: 3px 6px; border-radius: 9px; margin: 0; }
/* file */
.file { display: flex; align-items: center; gap: 10px; min-width: 240px; flex-wrap: wrap; }
.ftile { width: 44px; height: 52px; border-radius: 8px; background: #E5484D; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: end center; padding-bottom: 8px; }
.fmeta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fmeta b { font-size: 15px; font-weight: 600; }
.fmeta small { font-size: 13px; opacity: .7; }
.file .meta { width: 100%; text-align: right; justify-content: flex-end; margin: 2px 0 -2px; }

/* cards inside chat */
.msg.wide .card { width: min(330px, 88%); padding: 12px 13px; border-radius: 18px; background: var(--them); color: var(--them-text); }
.dir-b .msg.wide .card { background: var(--surface); box-shadow: 0 0 0 .5px var(--line), 0 2px 8px rgba(0,0,0,.05); }
.dir-b.dark .msg.wide .card { background: var(--surface2); }
.wk-head { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.wk-pct { margin-left: auto; color: var(--accent); font-variant-numeric: tabular-nums; }
.wk-ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.wk-ic .ic { width: 12px; height: 12px; stroke-width: 3; }
.wk-ic.ok { background: var(--ok); }
.wk-ic.idle { background: var(--idle); }
.done .wk-pct { color: var(--ok); }
.wk-title { display: block; font-size: 16px; margin: 6px 0 9px; }
.steps { list-style: none; margin: 10px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--sub); }
.steps li.done { color: inherit; }
.steps li.run { color: inherit; font-weight: 500; }
.steps .ic { width: 14px; height: 14px; color: var(--ok); stroke-width: 3; }
.steps .o { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid var(--sub); opacity: .6; margin: 0 1px; }
.wk-btns { display: flex; gap: 8px; margin-top: 12px; }
.wk-btns .btn { flex: 1; height: 34px; font-size: 14px; }
.work.done .bar i { background: var(--ok); }
.work.stopped .bar i { background: var(--idle); }

.form .fhead { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.form .fhead .ic { width: 18px; height: 18px; color: var(--accent); }
.form .fhead b { font-size: 16px; }
.fcount { margin-left: auto; font-size: 13px; color: var(--sub); }
.fq { padding: 10px 0 2px; border-top: .5px solid var(--line); margin-top: 8px; }
.fq-q { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.fq-q small { color: var(--sub); font-weight: 400; }
.qn { width: 20px; height: 20px; border-radius: 50%; background: var(--tint); color: var(--accent); font-size: 12px; display: grid; place-items: center; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 34px; padding: 0 13px; border-radius: 17px; background: var(--chip); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; transition: background .12s, transform .1s; }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--accent); color: var(--accent-on); }
.chip .ic { width: 15px; height: 15px; stroke-width: 2.8; }
.dir-a .chip { border-radius: 10px; background: var(--tint); color: var(--accent); }
.dir-a .chip.on { background: var(--accent); color: #fff; }
.fsubmit { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 10px; border-top: .5px solid var(--line); }
.fsubmit small { color: var(--sub); font-size: 13px; }
.fsubmit .btn { min-width: 110px; }
.form.done .fhead .ic { color: var(--ok); stroke-width: 2.6; }
.form.done .meta { margin: 0 0 0 auto; }
.fsum { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.fsum li { display: flex; flex-direction: column; font-size: 15px; }
.fsum small { color: var(--sub); font-size: 13px; }

.approve { border-left: 4px solid var(--warn); }
.dir-b .msg.wide .approve, .dir-c .msg.wide .approve { border-left: 0; box-shadow: 0 0 0 1.5px var(--warn); }
.ap-head { display: flex; align-items: center; gap: 7px; color: var(--warn); font-size: 14px; }
.ap-head .ic { width: 18px; height: 18px; }
.ap-head small { margin-left: auto; color: var(--sub); font-size: 13px; }
.ap-title { font-size: 16px; font-weight: 600; margin: 8px 0 4px; }
.ap-detail { font-size: 14px; color: var(--sub); }
.ap-btns { display: flex; gap: 8px; margin-top: 12px; }
.ap-btns .btn { flex: 1; }
.approve.yes { border-color: var(--ok); }
.approve.yes .ap-head { color: var(--ok); }
.dir-b .msg.wide .approve.yes, .dir-c .msg.wide .approve.yes { box-shadow: 0 0 0 1.5px var(--ok); }
.approve.no .ap-head { color: var(--sub); }
.dir-b .msg.wide .approve.no, .dir-c .msg.wide .approve.no { box-shadow: 0 0 0 .5px var(--line); }
.approve.no { border-color: var(--idle); }

.info .ic-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.info .ic-head .ic { width: 18px; height: 18px; color: var(--accent); }
.info .ic-head .meta { margin: 0 0 0 auto; }
.info p { font-size: 15px; margin-bottom: 8px; }
.ic-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; padding: 5px 0; border-top: .5px solid var(--line); }
.ic-row span { color: var(--sub); }
.ic-row b { font-weight: 500; text-align: right; }
.btn.full .ic { margin-left: auto; }
.info .btn.full { margin-top: 8px; justify-content: flex-start; }

/* ---------- composer ---------- */
.cwrap { flex: none; position: relative; z-index: 8; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 7px 8px 8px; background: var(--bar); border-top: .5px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.ph:not(:has(.tabbar)) .composer { padding-bottom: 30px; }
.bare .ph:not(:has(.tabbar)) .composer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.inp { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 36px; border-radius: 18px; background: var(--surface); border: .5px solid var(--line); padding: 0 6px 0 13px; }
.dir-b .inp { background: transparent; border: 1px solid var(--line); }
.dir-c .inp { background: var(--surface2); border-color: transparent; }
.inp input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 34px; font-size: 16px; }
.inp input::placeholder { color: var(--sub); }
.inp .cbtn { width: 30px; height: 30px; }
.cbtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--sub); flex: none; }
.cbtn .ic { width: 24px; height: 24px; }
.cbtn.send { background: var(--accent); color: var(--accent-on); }
.cbtn.send .ic { width: 20px; height: 20px; stroke-width: 2.6; }
.cbtn.mic { color: var(--sub); }
.dir-c .cbtn.mic { background: var(--tint); color: var(--accent); }
.menubtn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: var(--accent-on); }
.menubtn.tg { height: 36px; padding: 0 12px 0 9px; border-radius: 18px; background: var(--accent); font-size: 15px; font-weight: 600; }
.menubtn.tg .ic { width: 19px; height: 19px; stroke-width: 2.4; }
.menubtn.round { width: 36px; height: 36px; border-radius: 50%; background: var(--chip); color: var(--text); }
.menubtn.round .ic { width: 22px; height: 22px; stroke-width: 2.2; transition: transform .2s; }
.menubtn.round.on .ic { transform: rotate(45deg); }
.menubtn.cmd { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); }
.menubtn.cmd .ic { width: 21px; height: 21px; stroke-width: 2; }
.menubtn.on { filter: brightness(.92); }
.composer.rec { align-items: center; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: r-blink 1s infinite; }
@keyframes r-blink { 50% { opacity: .25; } }
.rectime { font-variant-numeric: tabular-nums; font-weight: 600; width: 40px; }
.recwave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; color: var(--danger); overflow: hidden; }
.recwave i { width: 3px; border-radius: 2px; background: currentColor; animation: r-wave 1s ease-in-out infinite alternate; }
.recwave i:nth-child(3n) { animation-delay: .2s; }
.recwave i:nth-child(3n+1) { animation-delay: .45s; }
@keyframes r-wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

/* command menu */
.cmdpanel.pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); background: var(--surface); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.2), 0 0 0 .5px var(--line); max-height: 380px; overflow-y: auto; z-index: 10; }
.dark .cmdpanel.pop { background: var(--surface2); }
.cmdpanel.tg.pop { left: 0; right: 0; bottom: 100%; border-radius: 14px 14px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.08); border-top: .5px solid var(--line); max-height: 400px; }
.crow { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 48px; position: relative; font-size: 15px; }
.crow:active, .crow.sel { background: var(--tint); }
.crow b { font-weight: 600; color: var(--text); }
.crow > span:not(.crow-ic):not(.crow-t) { color: var(--sub); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tg .crow b { color: var(--accent); min-width: 68px; }
.crow + .crow::before { content: ""; position: absolute; left: 54px; right: 0; top: 0; height: .5px; background: var(--line); }
.crow-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.crow-ic .ic { width: 18px; height: 18px; }
.crow-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.crow-t span { color: var(--sub); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow kbd { font: 12px var(--font); color: var(--sub); background: var(--chip); border-radius: 5px; padding: 2px 6px; }
.c .cgroup { background: var(--surface); border-radius: 14px; overflow: hidden; }
.dark .c .cgroup { background: var(--surface2); }
.cmdpanel.c.pop .cgroup { background: none; }
.cmdpanel.c.pop .attachrow { padding: 10px 10px 4px; }
.sheet-title { font-size: 20px; font-weight: 700; margin: 2px 4px 12px; display: flex; align-items: baseline; gap: 8px; }
.sheet-title small { font-size: 13px; font-weight: 400; color: var(--sub); }
.cgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctile { background: var(--surface); border-radius: 16px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; min-height: 104px; }
.dark .ctile { background: var(--surface2); }
.ctile:active { transform: scale(.96); }
.ctile-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); color: var(--accent); display: grid; place-items: center; margin-bottom: 3px; }
.ctile-ic .ic { width: 21px; height: 21px; }
.ctile b { font-size: 14px; font-weight: 600; }
.ctile small { font-size: 11.5px; color: var(--sub); line-height: 1.2; }
.attachrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.attachrow button { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--sub); font-weight: 500; }
.attachrow .ic { width: 50px; height: 50px; padding: 13px; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--cardsh); }
.dark .attachrow .ic { background: var(--surface2); }
.cmdpanel.grid.pop { padding: 10px; width: 470px; left: 8px; right: auto; }
.cmdpanel.grid.pop .ctile { background: var(--surface2); }
.cmdpanel.grid.pop .attachrow { margin-bottom: 2px; }

/* "/" quick-picker */
.slash { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); background: var(--surface); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.2), 0 0 0 .5px var(--line); overflow: hidden; z-index: 10; }
.dark .slash { background: var(--surface2); }
.slash.dir-a { left: 0; right: 0; bottom: 100%; border-radius: 14px 14px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.slash-head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sub); padding: 10px 14px 4px; display: flex; justify-content: space-between; }
.slash-head small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.slash .crow b u { text-decoration: none; color: var(--accent); }
.slash.dir-a .crow b { color: var(--accent); }
.slash .empty { padding: 14px; color: var(--sub); font-size: 14px; }

/* sheets (phone) */
.sheet-wrap { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.32); animation: r-fade .2s; }
.sheet { position: relative; width: 100%; max-height: 90%; overflow-y: auto; background: var(--sheet); border-radius: 22px 22px 0 0; padding: 8px 16px 36px; animation: r-up .28s cubic-bezier(.2,.8,.2,1); scrollbar-width: none; }
.bare .sheet { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.dir-b .sheet, .dir-c .sheet { border-radius: 34px 34px 0 0; }
.grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--sub); opacity: .4; margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.sheet-head b { font-size: 20px; }
.sheet-x { width: 30px; height: 30px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; color: var(--sub); }
.sheet-x .ic { width: 15px; height: 15px; stroke-width: 2.6; }
@keyframes r-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes r-fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(30,30,32,.92); color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; z-index: 50; max-width: 86%; text-align: center; animation: r-fade .2s; }

/* model picker */
.mp { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--cardsh); border: 2px solid transparent; }
.dark .mrow { background: var(--surface2); }
.mrow.on { border-color: var(--accent); }
.mic-wrap { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; background: #0E9F9A; }
.mic-wrap.claude { background: #D97757; }
.mic-wrap.fable { background: #8E5BD9; }
.mic-wrap .ic { width: 24px; height: 24px; }
.mtxt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtxt b { font-size: 16px; }
.mtxt small { font-size: 13px; color: var(--sub); }
.mtag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--sub); margin-top: 3px; }
.mtag.local { color: var(--ok); }
.mtag .ic { width: 13px; height: 13px; }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.on .radio { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.radio .ic { width: 14px; height: 14px; stroke-width: 3; }
.mp .srow { background: var(--surface); border-radius: 14px; }
.dark .mp .srow { background: var(--surface2); }

/* rule editor */
.re-lbl { font-size: 13px; color: var(--sub); font-weight: 600; }
.re textarea { width: 100%; margin: 6px 0 10px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--accent); background: var(--surface); font-size: 17px; line-height: 1.35; resize: none; outline: 0; }
.dark .re textarea { background: var(--surface2); }
.re-from { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.re-from .ic { width: 14px; height: 14px; }
.re-ex { margin: 14px 0; }
.re-ex small { font-size: 13px; color: var(--sub); }
.them-ex { margin-top: 6px; max-width: 100%; display: inline-block; }
.re-btns { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.re-btns .fine { margin: 0; flex: 1; }
.re-btns .btn.primary { min-width: 130px; }

/* ---------- groups / rows ---------- */
.group { overflow: hidden; margin-bottom: 4px; }
.grow, .srow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 48px; width: 100%; position: relative; font-size: 16px; }
.grow + .grow::before, .srow + .srow::before, .grow + .srow::before, .srow + .grow::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--line); }
.grow > span:first-child { color: var(--text); flex: 1; }
.grow > b { font-weight: 400; color: var(--sub); text-align: right; max-width: 62%; }
.grow.nav .g-t, .srow > span:not(.logo):not(.sk-ic) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g-t b, .srow b { font-weight: 500; }
.g-t small, .srow small { font-size: 13px; color: var(--sub); }
.sk-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--tint); color: var(--accent); flex: none; }
.sk-ic .ic { width: 18px; height: 18px; }
.grow > span.sk-ic:first-child { flex: none; color: var(--accent); } /* beat ".grow > span:first-child" (Settings brain row) */
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.logo .ic { width: 17px; height: 17px; }
.warn-t { color: var(--warn) !important; }

/* ---------- jobs ---------- */
.jsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.jstat { background: var(--surface); border-radius: 14px; padding: 10px 8px; box-shadow: var(--cardsh); display: flex; flex-direction: column; align-items: center; }
.jstat b { font-size: 24px; font-weight: 700; line-height: 1.1; }
.jstat span { font-size: 12px; color: var(--sub); }
.jstat.run b { color: var(--accent); }
.jstat.warn b { color: var(--warn); }
.jstat.ok b { color: var(--ok); }
.jstat.idle b { color: var(--sub); }
.watchdog { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--sub); margin: 0 4px 12px; }
.watchdog .ic { width: 16px; height: 16px; color: var(--ok); margin-top: 1px; }
.watchdog b { color: var(--text); font-weight: 600; }
.jgrid { display: grid; gap: 10px; }
.jcard { padding: 12px 14px; }
.jcard.warn { box-shadow: var(--cardsh), inset 3px 0 0 var(--warn); }
.jc-top { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; width: 100%; }
.jc-st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.jc-st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.jc-st.run { color: var(--accent); }
.jc-st.warn { color: var(--warn); }
.jc-st.ok { color: var(--ok); }
.jc-st.idle { color: var(--sub); }
.jc-model { justify-self: end; font-size: 12px; color: var(--sub); background: var(--chip); border-radius: 6px; padding: 2px 7px; }
.jc-name { grid-column: 1 / -1; font-size: 17px; font-weight: 600; margin-top: 3px; }
.jc-step { grid-column: 1 / -1; font-size: 14px; color: var(--sub); }
.jc-top .bar { grid-column: 1 / -1; margin: 6px 0 2px; }
.jcard.warn .bar i { background: var(--warn); }
.jcard.idle .bar i { background: var(--idle); }
.jc-last { grid-column: 1 / -1; display: flex; gap: 6px; font-size: 13px; color: var(--sub); margin-top: 3px; }
.jc-last .ic { width: 14px; height: 14px; margin-top: 1px; }
.jc-last b { color: var(--text); font-weight: 500; }
.jc-btns { display: flex; gap: 8px; margin-top: 10px; }
.jc-btns .btn { flex: 1; height: 34px; font-size: 14px; }

.nhead { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 8px 8px; background: var(--bar); border-bottom: .5px solid var(--line); min-height: 44px; }
.nhead b { font-size: 17px; }
.nhead .iback { width: auto; }
.jd { padding: 14px 16px 24px; }
.jd-hero { display: flex; gap: 14px; align-items: center; padding: 16px; }
.ring { width: 84px; height: 84px; flex: none; }
.ring .trk { fill: none; stroke: var(--chip); stroke-width: 8; }
.ring .val { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .5s; }
.ring.warn .val { stroke: var(--warn); }
.ring.ok .val { stroke: var(--ok); }
.ring.idle .val { stroke: var(--idle); }
.ring text { fill: var(--text); font: 600 17px var(--font); }
.jd-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jd-t h2 { font-size: 20px; line-height: 1.2; }
.jd-t p { font-size: 14px; color: var(--sub); }
.jd-btns { display: flex; gap: 10px; margin: 14px 0; }
.jd-btns .btn { flex: 1; }
.log .lrow { display: flex; gap: 12px; padding: 10px 16px; font-size: 14px; position: relative; }
.log .lrow + .lrow::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--line); }
.log time { color: var(--sub); font-variant-numeric: tabular-nums; width: 42px; flex: none; }
.log .lrow.new span { font-weight: 600; }
.jd > .btn.full { margin-top: 14px; justify-content: center; }
.jd > .btn.full .ic { margin: 0; }

/* ---------- today ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 6px; margin-bottom: 10px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; position: relative; }
.wd small { font-size: 12px; color: var(--sub); }
.wd b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 500; }
.wd.on small { color: var(--danger); font-weight: 600; }
.wd.on b { background: var(--danger); color: #fff; font-weight: 600; }
.dir-c .wd.on b { background: var(--accent); color: var(--accent-on); }
.dir-c .wd.on small { color: var(--accent); }
.wd i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.wd:not(:has(i))::after { content: ""; height: 5px; }
.nextup { padding: 14px 16px 14px 20px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.nextup small { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.nextup b { font-size: 20px; }
.nextup span { font-size: 14px; color: var(--sub); }
.nu-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.sugg { display: grid; grid-template-columns: 30px 1fr; gap: 8px 10px; padding: 12px 14px; margin-bottom: 8px; background: linear-gradient(var(--tint), var(--tint)), var(--surface); }
.sugg p { font-size: 15px; }
.sg-btns { grid-column: 2; display: flex; gap: 8px; }
.sg-btns .btn { height: 32px; font-size: 14px; }
.today-cols section { min-width: 0; }
.tl { padding: 4px 0; }
.ev { display: flex; align-items: stretch; gap: 10px; padding: 9px 14px; position: relative; }
.ev + .ev::before { content: ""; position: absolute; left: 70px; right: 0; top: 0; height: .5px; background: var(--line); }
.ev time { width: 46px; flex: none; font-size: 15px; font-weight: 600; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.ev time small { font-size: 13px; color: var(--sub); font-weight: 400; }
.evbar { width: 4px; border-radius: 2px; flex: none; }
.ev-t { display: flex; flex-direction: column; min-width: 0; }
.ev-t b { font-weight: 600; font-size: 16px; }
.ev-t small { font-size: 13px; color: var(--sub); display: flex; gap: 4px; align-items: center; }
.ev-t small .ic { width: 13px; height: 13px; color: var(--accent); }
.todos { padding: 2px 0; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 14px; width: 100%; position: relative; }
.todo + .todo::before { content: ""; position: absolute; left: 50px; right: 0; top: 0; height: .5px; background: var(--line); }
.cbox { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sub); display: grid; place-items: center; flex: none; opacity: .8; }
.dir-b .cbox { border-radius: 7px; }
.todo.done .cbox { background: var(--accent); border-color: var(--accent); color: var(--accent-on); opacity: 1; }
.cbox .ic { width: 14px; height: 14px; stroke-width: 3; }
.cbox.plus { border-style: dashed; color: var(--accent); border-color: var(--accent); }
.td-t { display: flex; flex-direction: column; min-width: 0; }
.td-t b { font-weight: 500; font-size: 16px; }
.td-t small { font-size: 13px; color: var(--sub); }
.todo.done .td-t b { text-decoration: line-through; color: var(--sub); }
.todo.add .td-t b { color: var(--accent); }

/* ---------- memory ---------- */
.rules .rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; width: 100%; position: relative; }
.rules .rule + .rule::before { content: ""; position: absolute; left: 58px; right: 0; top: 0; height: .5px; background: var(--line); }
.r-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.r-ic.lock { background: rgba(255,149,0,.14); color: var(--warn); }
.r-ic .ic { width: 17px; height: 17px; }
.r-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.r-t b { font-weight: 500; font-size: 16px; line-height: 1.3; }
.r-t small { font-size: 13px; color: var(--sub); }
.rule > .ic.tiny { margin-top: 9px; }
.pgrid { display: grid; gap: 8px; }
.proj { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.proj > small { color: var(--sub); font-size: 13px; margin-bottom: 4px; }
.pr-row { font-size: 14px; display: flex; gap: 8px; }
.pr-row span { color: var(--sub); width: 38px; flex: none; }
.srow.sk .switch { margin-left: auto; }

/* ---------- settings ---------- */
.datacard { display: flex; gap: 12px; padding: 16px; align-items: flex-start; background: linear-gradient(135deg, rgba(52,199,89,.14), rgba(52,199,89,.05)), var(--surface); }
.datacard > .ic { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--ok); color: #fff; }
.datacard b { font-size: 17px; }
.datacard p { font-size: 14px; color: var(--sub); margin-top: 3px; }
.usage { padding: 12px 16px 14px; }
.u-row { display: flex; justify-content: space-between; font-size: 15px; margin: 8px 0 5px; }
.u-row:first-child { margin-top: 0; }
.u-row b { font-weight: 600; }
.usage small { font-size: 12.5px; color: var(--sub); display: block; margin-top: 4px; }
.srow.acc .btn { margin-left: auto; }

/* ---------- onboarding ---------- */
.ob { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.ob-top { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 16px; min-height: 44px; }
.obback { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; }
.obback .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.obdots { display: flex; gap: 6px; }
.obdots i { width: 7px; height: 7px; border-radius: 4px; background: var(--line); transition: width .2s; }
.obdots i.past { background: var(--accent); opacity: .45; }
.obdots i.on { width: 22px; background: var(--accent); }
.ob-body { padding: 8px 24px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ob h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; margin: 12px 0 8px; }
.ob h1.left, .ob-lead.left { align-self: stretch; text-align: left; }
.ob-lead { font-size: 17px; color: var(--sub); line-height: 1.4; margin-bottom: 18px; }
.ob-hero { margin-top: 24px; position: relative; }
.ob-hero.laptop .ic { width: 110px; height: 110px; color: var(--accent); stroke-width: 1.3; }
.lockbadge { position: absolute; right: -6px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--bg); }
.lockbadge .ic { width: 20px !important; height: 20px !important; color: #fff !important; stroke-width: 2 !important; }
.ob-hero.done { width: 96px; height: 96px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(52,199,89,.35); }
.ob-hero.done .ic { width: 50px; height: 50px; stroke-width: 2.6; }
.ob-dl { width: 100%; padding: 16px; margin-top: 4px; }
.ob-dl small { font-size: 13px; color: var(--sub); }
.dl-pick { display: flex; gap: 6px; margin-bottom: 10px; }
.osbtn { flex: 1; height: 38px; border-radius: 10px; background: var(--chip); font-size: 15px; font-weight: 500; }
.osbtn.on { background: var(--tint); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 600; }
.dl-run { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.dl-run .bar { height: 8px; margin-top: 6px; }
.dl-done { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dl-done .ic { width: 36px; height: 36px; padding: 7px; border-radius: 50%; background: var(--ok); color: #fff; stroke-width: 3; }
.ob-list { list-style: none; padding: 0; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 14px; text-align: left; align-self: stretch; }
.ob-list li { display: flex; gap: 14px; align-items: flex-start; }
.ob-list .ic { width: 28px; height: 28px; color: var(--accent); flex: none; margin-top: 2px; }
.ob-list span { display: flex; flex-direction: column; }
.ob-list b { font-size: 17px; }
.ob-list small { font-size: 15px; color: var(--sub); }
.ob-checks { align-self: stretch; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 15px; }
.ob-checks div { display: flex; align-items: center; gap: 8px; }
.ob-checks .ic { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.8; }
.ob-checks small { margin-left: auto; color: var(--sub); }
.ob-name { align-self: stretch; text-align: left; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--sub); font-weight: 500; }
.ob-name input { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 17px; outline: 0; color: var(--text); }
.ob-name input:focus { border-color: var(--accent); }
.ob .group { align-self: stretch; text-align: left; }
.ob .fine { align-self: stretch; text-align: left; }
.ob-try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.ob-sum { align-self: stretch; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; text-align: left; font-size: 15px; }
.ob-sum div { display: flex; gap: 10px; align-items: center; }
.ob-sum .ic { width: 20px; height: 20px; color: var(--accent); }
.ob-cta { flex: none; padding: 12px 24px 36px; }
.bare .ob-cta { padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* ---------- desktop ---------- */
.rdev.k-desktop { width: 1280px; height: 800px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0,0,0,.3), 0 30px 80px rgba(0,0,0,.3); font-size: 15px; }
.dk { height: 100%; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.dk-title { flex: none; height: 38px; display: flex; align-items: center; padding: 0 14px; background: var(--bar); border-bottom: .5px solid var(--line); font-size: 13px; color: var(--sub); }
.lights { display: flex; gap: 8px; width: 120px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.lights i:nth-child(2) { background: #FEBC2E; }
.lights i:nth-child(3) { background: #28C840; }
.dk-tt { flex: 1; text-align: center; font-weight: 600; color: var(--text); }
.dk-tr { width: 120px; display: flex; justify-content: flex-end; align-items: center; gap: 5px; color: var(--ok); font-weight: 500; font-size: 12px; white-space: nowrap; }
.dk-tr .ic { width: 13px; height: 13px; }
.dk-body { flex: 1; min-height: 0; display: flex; }
.dk-rail { flex: none; width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; background: var(--bar); border-right: .5px solid var(--line); }
.dk-brand { margin-bottom: 10px; }
.dk-brand .rav { width: 40px; height: 40px; border-radius: 12px; }
.dk-nav { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 12px; font-size: 11px; font-weight: 500; color: var(--sub); position: relative; }
.dk-nav .ic { width: 24px; height: 24px; }
.dk-nav.on { color: var(--accent); background: var(--tint); }
.dk-nav .badge { position: absolute; top: 3px; right: 9px; height: 16px; min-width: 16px; font-size: 11px; }
.dk-rail-foot { margin-top: auto; }
.mchip { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--sub); text-align: center; width: 64px; line-height: 1.15; }
.mchip .ic { width: 18px; height: 18px; color: var(--ok); }
.mchip.claude .ic, .mchip.fable .ic { color: var(--accent); }
/* Telegram Desktop: dark slate folder rail */
.dir-a .dk-rail { background: #2B3B4E; border: 0; }
.dir-a.dark .dk-rail { background: #121212; }
.dir-a .dk-nav { color: rgba(255,255,255,.65); }
.dir-a .dk-nav.on { color: #fff; background: rgba(255,255,255,.14); }
.dir-a .mchip { color: rgba(255,255,255,.7); }
/* Cord: wide sidebar with labels */
.dir-b .dk-rail { width: 210px; align-items: stretch; padding: 14px 10px; background: var(--bg); }
.dir-b .dk-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; margin-bottom: 14px; }
.dir-b .dk-brand b { font-size: 22px; font-weight: 700; }
.dir-b .dk-brand .rav { width: 32px; height: 32px; border-radius: 10px; }
.dir-b .dk-nav { width: auto; flex-direction: row; gap: 10px; font-size: 15px; padding: 9px 10px; color: var(--text); }
.dir-b .dk-nav .ic { width: 21px; height: 21px; color: var(--accent); }
.dir-b .dk-nav.on { background: var(--surface); color: var(--text); box-shadow: var(--cardsh); }
.dir-b.dark .dk-nav.on { background: var(--surface2); }
.dir-b .dk-nav .badge { position: static; margin-left: auto; }
.dir-b .mchip { flex-direction: row; width: auto; font-size: 13px; padding: 0 10px; gap: 6px; }
.dk-list { flex: none; width: 310px; display: flex; flex-direction: column; background: var(--surface); border-right: .5px solid var(--line); }
.dir-b .dk-list { background: var(--bg); }
.dir-b.light .dk-list { background: #fff; }
.dk-listhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px; }
.dk-listhead b { font-size: 22px; font-weight: 700; }
.dir-a .dk-listhead b { font-size: 17px; font-weight: 600; }
.dk-list .search { margin: 0 12px 8px; height: 34px; }
.dk-list .trow { min-height: 68px; padding: 8px 12px; gap: 10px; }
.dk-list .trow .rav, .dk-list .trow .tav { width: 48px; height: 48px; font-size: 22px; }
.dk-list .trow::after { left: 70px; }
.dk-list .trow-2 { font-size: 14px; }
.dir-b .dk-list .trow, .dir-c .dk-list .trow { border-radius: 12px; margin: 0 8px; width: calc(100% - 16px); }
.dir-b .dk-list .trow::after, .dir-c .dk-list .trow::after { display: none; }
.dk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.chatmain .chead { min-height: 60px; padding: 8px 16px; }
.dk-chead .chead-r { display: flex; gap: 8px; align-items: center; }
.dk-chead .rav, .dk-chead .tav { width: 40px; height: 40px; }
.k-desktop .msgs-in { padding: 16px 24px; max-width: 860px; margin: 0 auto; width: 100%; }
.k-desktop .bub { max-width: 70%; font-size: 15px; }
.k-desktop .msg.wide .card { width: min(400px, 80%); }
.k-desktop .composer { padding: 10px 16px 12px; }
.k-desktop .cwrap { max-width: 100%; }
.k-desktop .cmdpanel.pop, .k-desktop .slash { left: 16px; right: auto; width: 420px; }
.k-desktop .cmdpanel.grid.pop { width: 470px; }
.k-desktop .cmdpanel.tg.pop, .k-desktop .slash.dir-a { bottom: calc(100% + 4px); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.2), 0 0 0 .5px var(--line); }
.dk-side { flex: none; width: 290px; border-left: .5px solid var(--line); background: var(--bg); display: flex; flex-direction: column; }
.dir-a.light .dk-side { background: #fff; }
.dk-side .scroll { padding: 0 14px 16px; }
.dk-side .gh:first-child { margin-top: 16px; }
.mini-job { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; width: 100%; margin-bottom: 8px; }
.mini-job b { font-size: 14px; font-weight: 600; }
.mini-job small { font-size: 12.5px; color: var(--sub); }
.mini-ev { display: flex; gap: 10px; padding: 10px 12px; width: 100%; align-items: stretch; }
.mini-ev span:last-child { display: flex; flex-direction: column; }
.mini-ev small { font-size: 12.5px; color: var(--sub); }
.mini-todos .todo { padding: 8px 12px; gap: 10px; }
.mini-todos .cbox { width: 20px; height: 20px; }
.mini-todos .td-t b { font-size: 14px; }
.mini-todos .todo + .todo::before { left: 42px; }
.mini-data { display: flex; gap: 8px; align-items: center; padding: 10px 12px; margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--ok); }
.mini-data .ic { width: 16px; height: 16px; }
.dk-main.wide { background: var(--bg); }
.dk-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 18px 28px 10px; }
.dk-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-right: auto; }
.dir-a .dk-head h1 { font-size: 20px; font-weight: 600; }
.dk-head-r { display: flex; align-items: center; gap: 10px; }
.dk-date { color: var(--sub); font-size: 15px; }
.dk-content { padding: 6px 28px 28px; max-width: 1160px; width: 100%; box-sizing: border-box; }
.dk-content.today { max-width: 900px; }
.k-desktop .jgrid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.k-desktop .jobs .seg, .k-desktop .memory .seg { max-width: 360px; }
.k-desktop .jsum { max-width: 680px; }
.k-desktop .today-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.k-desktop .setcols, .k-desktop .memcols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
.k-desktop .setcols > section > .gh:first-child, .k-desktop .memcols > section > .gh:first-child { margin-top: 0; }
.k-desktop .memory .search { max-width: 520px; margin-bottom: 18px; }
.k-desktop .pgrid { grid-template-columns: 1fr 1fr; }
.dk-split { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 440px; }
.dk-split > .scroll:first-child { padding: 6px 20px 24px 28px; }
.dk-split .jgrid { grid-template-columns: 1fr 1fr; }
.dk-detail { border-left: .5px solid var(--line); background: var(--surface2); }
.dir-b.light .dk-detail, .dir-c.light .dk-detail { background: #fff; }
.dk-dhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; }
.dk-dhead b { font-size: 17px; }
.dk-detail .jd { padding-top: 10px; }
.modal-wrap { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; }
.modal { position: relative; width: 480px; max-height: 86%; overflow: auto; background: var(--sheet); border-radius: 20px; padding: 18px 20px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: r-fade .2s; }
.dk .toast { bottom: 40px; }
.dk-ob { flex: 1; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 0%, var(--tint), transparent 60%), var(--bg); }
.dk-obcard { width: 500px; height: 680px; border-radius: 24px; overflow: hidden; background: var(--bg); box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 .5px var(--line); display: flex; flex-direction: column; }
.dark .dk-obcard { background: var(--surface); }
.dark .dk-obcard .ob { background: var(--surface); }
.dark .dk-obcard .ob .card { background: var(--surface2); }
.dk-obcard .ob-cta { padding-bottom: 24px; }

@media (prefers-reduced-motion: reduce) {
  .rdev *, .rdev *::before, .rdev *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
