:root {
  --ink: #0f1e3d; --ink2: #475569; --muted: #8592a6; --line: rgba(15, 30, 61, .08);
  --blue: #2563eb; --blue2: #3b82f6; --bluebg: #eaf1ff;
  --glass: rgba(255, 255, 255, .82); --glass2: rgba(255, 255, 255, .94);
  --ok: #16a34a; --warn: #d97706; --err: #dc2626;
  --r: 18px; --shadow: 0 10px 30px rgba(30, 60, 120, .14), 0 2px 6px rgba(30, 60, 120, .06);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: var(--font); color: var(--ink); background: #dfe9f5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
input, select, textarea { font: inherit; color: var(--ink); }
i[data-ic] { display: inline-flex; width: 20px; height: 20px; flex: none; }
i[data-ic] svg, .dc-ic svg, .ic svg { width: 100%; height: 100%; }
[hidden] { display: none !important; }
.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .7); box-shadow: var(--shadow); }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.center { text-align: center; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 14px 0; margin: 0; }
.hint { font-size: 12.5px; color: var(--ink2); background: var(--bluebg); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; line-height: 1.5; }

#world { position: fixed; inset: 0; }
#world canvas { display: block; touch-action: none; }
.labels-layer { position: absolute !important; inset: 0; pointer-events: none; }
#loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; background: linear-gradient(#eef4fc, #dfe9f5); z-index: 50; transition: opacity .6s; color: var(--ink2); font-weight: 600; }
#loading.gone { opacity: 0; pointer-events: none; }
.ld-mark { width: 54px; height: 54px; margin: auto; border-radius: 16px; background: linear-gradient(135deg, #4f8bff, #1d4ed8); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.86); opacity: .7; } }

/* building labels */
.bld-label { pointer-events: auto; display: flex; align-items: center; gap: 9px; padding: 7px 14px 7px 8px; border-radius: 14px; background: var(--glass2); box-shadow: 0 6px 18px rgba(20, 50, 110, .16); border: 1px solid rgba(255, 255, 255, .9); white-space: nowrap; position: relative; transition: transform .15s, box-shadow .15s; }
.bld-label:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20, 50, 110, .22); }
.bld-label .ic { width: 30px; height: 30px; padding: 6px; border-radius: 10px; color: var(--blue); background: var(--bluebg); display: grid; }
.bld-label b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.15; }
.bld-label small { display: block; font-size: 10.5px; color: var(--ink2); font-weight: 500; }
.bld-label .badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; }
.bld-label.busy .ic { background: var(--blue); color: #fff; animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(37, 99, 235, .18); } }

/* agent tags */
.agent-tag { pointer-events: auto; display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 5px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-size: 10.5px; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); cursor: pointer; max-width: 220px; white-space: nowrap; }
.agent-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; flex: none; }
.agent-tag .act { font-weight: 500; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.agent-tag .act:empty { display: none; }
.agent-tag[data-status=running] .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); animation: blink 1s infinite; }
.agent-tag[data-status=waiting] .dot { background: #f59e0b; }
.agent-tag[data-status=queued] .dot { background: #3b82f6; }
.agent-tag[data-status=idle] { opacity: .85; }
@keyframes blink { 50% { opacity: .4; } }
.far .agent-tag[data-status=idle] { display: none; }
.far .agent-tag .act { max-width: 90px; }

/* brand + nav */
.brand { position: fixed; top: 14px; left: 14px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 14px; border-radius: var(--r); }
.brand .mark { width: 40px; height: 40px; display: block; }
.brand b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand small { font-size: 12px; color: var(--ink2); font-weight: 500; }
.sidenav { position: fixed; top: 100px; left: 14px; z-index: 10; padding: 10px; border-radius: var(--r); display: flex; flex-direction: column; gap: 4px; width: 172px; }
.sidenav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink2); position: relative; transition: background .15s; }
.sidenav button:hover { background: rgba(37, 99, 235, .07); }
.sidenav button.active { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .35); }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; background: var(--blue); color: #fff; border-radius: 9px; padding: 1px 7px; }
.sidenav button.active .nav-badge { background: #fff; color: var(--blue); }

.topright { position: fixed; top: 14px; right: 14px; z-index: 20; display: flex; gap: 10px; }
.round { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; position: relative; color: var(--blue); }
.round i[data-ic] { width: 24px; height: 24px; }
.round .dot { position: absolute; top: 11px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue2); box-shadow: 0 0 0 2px #fff; }
.menu { position: absolute; top: 60px; right: 0; width: 340px; max-height: 70vh; overflow: auto; border-radius: var(--r); padding: 8px; background: var(--glass2); }
.menu.small { width: 220px; }
.menu-h { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; }
.menu-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.menu-item:hover { background: var(--bluebg); }
.notif { display: flex; gap: 10px; width: 100%; padding: 10px; border-radius: 12px; }
.notif:hover { background: var(--bluebg); }
.notif b { display: block; font-size: 13px; } .notif small { display: block; color: var(--ink2); font-size: 12px; } .notif em { font-style: normal; font-size: 11px; color: var(--muted); }
.notif.unread { background: rgba(37, 99, 235, .06); }
.nk { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted); }
.nk.done { background: var(--ok); } .nk.failed { background: var(--err); }
.link { color: var(--blue); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link i[data-ic] { width: 15px; height: 15px; }

/* weather */
.weather { position: fixed; right: 14px; bottom: 14px; z-index: 10; border-radius: var(--r); display: flex; align-items: center; gap: 18px; padding: 14px 22px; }
.w-left { display: flex; gap: 10px; align-items: center; }
.w-left i[data-ic] { width: 38px; height: 38px; color: var(--blue); }
.weather b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.weather small { font-size: 12.5px; color: var(--ink2); }
.w-sep { width: 1px; align-self: stretch; background: var(--line); }

.ticker { position: fixed; left: 50%; transform: translateX(-50%); top: 14px; z-index: 9; border-radius: 999px; padding: 5px; display: flex; gap: 4px; max-width: calc(100vw - 560px); overflow: hidden; }
.tk { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; max-width: 300px; }
.tk:hover { background: var(--bluebg); }
.tk span:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.tk .pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: blink 1s infinite; flex: none; }
.ticker .more { align-self: center; font-size: 12px; color: var(--muted); padding: 0 10px; }

.fab { position: fixed; left: 14px; bottom: 14px; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 16px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 700; box-shadow: 0 10px 24px rgba(29, 78, 216, .4); }
.fab:hover { filter: brightness(1.08); }

/* panel (views) */
.panel { position: fixed; z-index: 12; top: 100px; left: 200px; bottom: 14px; width: min(760px, calc(100vw - 230px)); border-radius: 22px; display: flex; flex-direction: column; background: var(--glass2); animation: slidein .25s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }
.panel-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.panel-h h2 { margin: 0; font-size: 20px; font-weight: 800; }
.panel-b { flex: 1; overflow: auto; padding: 8px 22px 22px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink2); }
.icon-btn:hover { background: var(--bluebg); color: var(--blue); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: #fff; border-radius: 16px; padding: 16px; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 10px; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.dc-h { display: flex; gap: 10px; align-items: center; }
.dc-h b, .fac-card b { display: block; font-size: 15px; } .dc-h small, .fac-card small { color: var(--ink2); font-size: 12px; }
.dc-ic { width: 40px; height: 40px; padding: 8px; border-radius: 12px; display: grid; flex: none; color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 12%, white); }
.dc-ic.sm { width: 34px; height: 34px; padding: 7px; border-radius: 10px; }
.dc-role { margin: 0; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.dc-f { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.fac-card { flex-direction: row; align-items: center; }
.avatars { display: flex; } .avatars .avatar { margin-right: -6px; box-shadow: 0 0 0 2px #fff; }
.avatar { border-radius: 50%; background: var(--c, #64748b); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.sess { width: 36px; height: 36px; background: #e2e8f0; color: var(--ink2); padding: 8px; }
.avatar.sess.on { background: #dcfce7; color: var(--ok); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-style: normal; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #f1f5f9; color: var(--ink2); }
.chip.run { background: #dcfce7; color: #15803d; } .chip.q { background: var(--bluebg); color: var(--blue); } .chip.sub { background: #f3e8ff; color: #7e22ce; }

.sec { margin-bottom: 20px; }
.sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.sec-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .sec-h h3 { margin: 0; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); width: 100%; }
button.row:hover { border-color: rgba(37, 99, 235, .35); }
.row-m { flex: 1; min-width: 0; } .row-m b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row-m small { display: block; font-size: 12px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead { font-style: normal; font-size: 10px; background: var(--bluebg); color: var(--blue); padding: 1px 6px; border-radius: 6px; vertical-align: 2px; }
.st { font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; background: #f1f5f9; color: var(--ink2); }
.st-running { background: #dcfce7; color: #15803d; } .st-waiting { background: #fef3c7; color: #b45309; } .st-queued { background: var(--bluebg); color: var(--blue); }
.st-done { background: #dcfce7; color: #15803d; } .st-failed { background: #fee2e2; color: #b91c1c; } .st-cancelled { background: #f1f5f9; color: #64748b; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 10px; min-height: 100%; }
.kcol { background: rgba(241, 245, 249, .8); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; min-height: 200px; }
.kcol-h { display: flex; justify-content: space-between; padding: 2px 4px 10px; font-size: 13px; } .kcol-h span { color: var(--muted); font-weight: 600; }
.kcol-b { display: flex; flex-direction: column; gap: 8px; }
.tcard { background: #fff; border-radius: 14px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tcard:hover { box-shadow: var(--shadow); }
.tcard > b { font-size: 13.5px; line-height: 1.35; }
.tc-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.tc-div { font-size: 11px; font-weight: 700; color: var(--c); }
.tc-act { font-family: var(--mono); font-size: 11px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-f { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.tc-f .muted { margin-left: auto; font-weight: 500; }
.tlist { display: flex; flex-direction: column; gap: 8px; }

/* drawer */
.drawer { position: fixed; z-index: 15; top: 76px; right: 14px; bottom: 14px; width: min(460px, calc(100vw - 28px)); border-radius: 22px; display: flex; flex-direction: column; background: var(--glass2); animation: drawin .25s ease; }
@keyframes drawin { from { opacity: 0; transform: translateX(20px); } }
.drawer-h { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; display: flex; gap: 10px; align-items: center; min-width: 0; }
.drawer-title b { display: block; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .drawer-title small { color: var(--ink2); font-size: 12px; }
.drawer-title > div { min-width: 0; }
.drawer-b { flex: 1; overflow: auto; padding: 16px 18px 18px; }
body.drawer-open .weather { opacity: 0; pointer-events: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stats b { display: block; font-size: 20px; font-weight: 800; } .stats small { font-size: 11px; color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.form input, .form select, .form textarea { border: 1px solid #dbe3ee; border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; }
.form textarea { resize: vertical; line-height: 1.5; }
.form textarea.mono { font-family: var(--mono); font-size: 12px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue2); box-shadow: 0 0 0 4px rgba(59, 130, 246, .15); }
.form input[type=color] { padding: 4px; height: 40px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.form-f { display: flex; justify-content: flex-end; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.btn i[data-ic] { width: 17px; height: 17px; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }
.btn.primary:hover { background: #1d4ed8; } .btn:disabled { opacity: .6; }
.btn.ghost { background: #f1f5f9; color: var(--ink2); } .btn.ghost:hover { background: #e2e8f0; }
.btn.danger { color: var(--err); }
.btn.icon { padding: 10px; }
.tgl { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink2); }

.now { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.now p { margin: 0; color: var(--ink2); }

.tmeta { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.tm-row { display: flex; gap: 8px; align-items: center; min-width: 0; } .tm-row .act { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tm-grid small { display: block; font-size: 11px; color: var(--muted); } .tm-grid b, .tm-grid .link { font-size: 13px; }
.tm-grid .avatar { vertical-align: middle; }
.tm-act { display: flex; justify-content: space-between; align-items: center; }
.parent { margin-bottom: 12px; }

.log { background: #0f172a; border-radius: 14px; padding: 10px; max-height: 46vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; color: #e2e8f0; }
.le { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.lt { color: #64748b; font-family: var(--mono); font-size: 10.5px; padding-top: 2px; flex: none; }
.lb { min-width: 0; flex: 1; }
.lb em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: #94a3b8; display: block; }
.lb code { font-family: var(--mono); font-size: 11.5px; color: #93c5fd; word-break: break-all; }
.le-user .lb em { color: #fbbf24; } .le-text .lb em { color: #86efac; } .le-result .lb em { color: #4ade80; }
.le-error .lb em, .le-tool_error .lb em { color: #f87171; } .le-tool_error code { color: #fca5a5; }
.le-system { opacity: .7; }
.log.hide-tools .le-tool { display: none; }
.log .md pre { background: #1e293b; padding: 8px; border-radius: 8px; overflow: auto; } .log .md code { color: #bae6fd; }
.result { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; line-height: 1.6; }
.result-sec.err .result { border-color: #fecaca; background: #fff7f7; }
.md h4 { margin: 10px 0 4px; font-size: 14px; } .md li { margin-left: 16px; } .md pre { background: #f1f5f9; padding: 10px; border-radius: 10px; overflow: auto; font-size: 12px; } .md code { font-family: var(--mono); font-size: 12px; background: rgba(148, 163, 184, .18); padding: 1px 4px; border-radius: 4px; } .md pre code { background: none; padding: 0; } .md a { color: var(--blue); word-break: break-all; }
.follow { flex-direction: row; align-items: flex-end; position: sticky; bottom: -18px; background: var(--glass2); padding: 10px 0 2px; }
.follow textarea { flex: 1; }
.follow.disabled { opacity: .5; pointer-events: none; }

.meter { margin-bottom: 14px; } .m-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.m-b { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; } .m-b i { display: block; height: 100%; background: var(--c); border-radius: 999px; transition: width .5s; }
.prayer { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.prayer div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; text-align: center; } .prayer small { display: block; font-size: 11.5px; color: var(--ink2); } .prayer b { font-size: 17px; }
.prayer .next { background: var(--blue); color: #fff; border-color: var(--blue); } .prayer .next small { color: #dbeafe; }
.feed { display: flex; flex-direction: column; gap: 8px; }
.fi { display: flex; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; width: 100%; }
.fi b { font-size: 13px; } .fi p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink2); line-height: 1.45; word-break: break-word; }

.toast-wrap { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.ok { background: #166534; } .toast.err { background: #b91c1c; } .toast.out { opacity: 0; transform: translateY(8px); }

/* demo banner */
.demo-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 11; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(15, 30, 61, .82); color: #fff; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.demo-bar .dd { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; animation: blink 1.4s infinite; }
.demo-bar button { background: rgba(255, 255, 255, .16); color: #fff; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.demo-bar button:hover { background: rgba(255, 255, 255, .28); }
.switch { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 13.5px !important; color: var(--ink) !important; }
.switch input { width: 18px !important; height: 18px; accent-color: var(--blue); }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .brand { top: calc(10px + env(safe-area-inset-top)); left: 10px; padding: 8px 14px 8px 10px; }
  .brand .mark { width: 30px; height: 30px; } .brand b { font-size: 15px; } .brand small { font-size: 10.5px; }
  .topright { top: calc(10px + env(safe-area-inset-top)); right: 10px; gap: 8px; } .round { width: 42px; height: 42px; } .round i[data-ic] { width: 20px; height: 20px; } .round .dot { top: 8px; right: 9px; }
  .menu { width: calc(100vw - 20px); right: -0px; }
  .sidenav { top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); left: 10px; right: 10px; width: auto; flex-direction: row; padding: 6px; justify-content: space-between; border-radius: 20px; z-index: 30; }
  .sidenav button { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10px; flex: 1; align-items: center; text-align: center; }
  .sidenav button span { white-space: nowrap; }
  .nav-badge { position: absolute; top: 2px; right: 8px; margin: 0; padding: 0 5px; font-size: 9.5px; }
  .weather { top: calc(66px + env(safe-area-inset-top)); bottom: auto; right: 10px; padding: 8px 12px; gap: 10px; }
  .weather b { font-size: 15px; } .weather small { font-size: 10.5px; } .w-left i[data-ic] { width: 26px; height: 26px; }
  .fab { bottom: calc(86px + env(safe-area-inset-bottom)); right: 10px; left: auto; padding: 13px; border-radius: 50%; } .fab span { display: none; }
  .ticker { top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); left: 10px; transform: none; max-width: calc(100vw - 90px); }
  .demo-bar { bottom: auto; top: calc(66px + env(safe-area-inset-top)); left: 10px; transform: none; font-size: 11px; padding: 4px 4px 4px 10px; }
  .demo-bar button { padding: 4px 9px; font-size: 11px; }
  body.drawer-open .demo-bar, body.panel-open .demo-bar { display: none; }
  .ticker .tk { max-width: 200px; }
  .panel { top: calc(64px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); border-radius: 20px; }
  .panel-h { padding: 14px 16px 6px; } .panel-b { padding: 6px 14px 16px; }
  .kanban { grid-template-columns: repeat(4, 78vw); overflow-x: auto; scroll-snap-type: x mandatory; } .kcol { scroll-snap-align: start; }
  .drawer { top: calc(64px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.drawer-open .fab, body.panel-open .fab, body.drawer-open .ticker, body.panel-open .ticker { display: none; }
  .bld-label { padding: 3px 7px 3px 3px; gap: 4px; border-radius: 9px; }
  .bld-label .ic { width: 17px; height: 17px; padding: 3px; border-radius: 6px; }
  .bld-label b { font-size: 9px; } .bld-label small { display: none; }
  .bld-label .badge { min-width: 15px; height: 15px; font-size: 9px; top: -5px; right: -5px; }
  .tm-grid { grid-template-columns: 1fr 1fr; }
  .stats b { font-size: 17px; }
  .prayer { grid-template-columns: repeat(5, 1fr); gap: 4px; } .prayer b { font-size: 14px; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
}
