:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f8f8fa; --ink: #15151a; --ink-2: #3d3d46; --muted: #6e6e78; --line: #e4e4ea; --line-2: #efeff3;
  --accent: #4b3fe0; --accent-ink: #ffffff; --accent-soft: #ecebfd; --accent-2: #6d63f0;
  --ok: #0f7a4f; --ok-soft: #e3f4ec; --warn: #a15c00; --warn-soft: #fff1db; --danger: #c0262d; --danger-soft: #fde7e7; --info: #1d5fd1; --info-soft: #e5eefc;
  --shadow: 0 1px 2px rgba(20,20,30,.05), 0 4px 16px rgba(20,20,30,.06); --shadow-lg: 0 12px 48px rgba(20,20,30,.18);
  --r: 10px; --r-lg: 14px; --nav-w: 232px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f13; --surface: #17171d; --surface-2: #1d1d24; --ink: #ececf1; --ink-2: #c6c6d0; --muted: #8e8e9a; --line: #2a2a33; --line-2: #22222a;
    --accent: #8b82ff; --accent-ink: #0d0b24; --accent-soft: #24214a; --accent-2: #a49dff;
    --ok: #3ccf8e; --ok-soft: #12301f; --warn: #f0b04c; --warn-soft: #3a2a0f; --danger: #f06a6f; --danger-soft: #3d1517; --info: #7aa7ff; --info-soft: #172743;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 48px rgba(0,0,0,.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f13; --surface: #17171d; --surface-2: #1d1d24; --ink: #ececf1; --ink-2: #c6c6d0; --muted: #8e8e9a; --line: #2a2a33; --line-2: #22222a;
  --accent: #8b82ff; --accent-ink: #0d0b24; --accent-soft: #24214a; --accent-2: #a49dff;
  --ok: #3ccf8e; --ok-soft: #12301f; --warn: #f0b04c; --warn-soft: #3a2a0f; --danger: #f06a6f; --danger-soft: #3d1517; --info: #7aa7ff; --info-soft: #172743;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 48px rgba(0,0,0,.6); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; } h2 { font-size: 17px; font-weight: 650; } h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 8px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; } .end { justify-content: flex-end; } .mt { margin-top: 12px; } .mt-lg { margin-top: 22px; } .mb { margin-bottom: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }

/* shell */
#app { display: flex; height: 100vh; height: 100dvh; }
.nav { width: var(--nav-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 3px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.brand b { display: block; font-size: 15px; }
.wsbtn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: left; margin-bottom: 8px; }
.wsbtn:hover { border-color: var(--accent); }
.wsbtn .sq { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.nav a.item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; }
.nav a.item:hover { background: var(--surface-2); color: var(--ink); }
.nav a.item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.item .badge { margin-left: auto; }
.nav .foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.me:hover { background: var(--surface-2); }
main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; overflow: auto; padding: 22px 28px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; color: var(--muted); }
.banner { background: var(--warn-soft); color: var(--warn); padding: 7px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.tabbar { display: none; }
.fab { display: none; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--line) 60%, var(--ink) 15%); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); } .btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; } .btn.icon { padding: 7px; } .btn.sm.icon { padding: 5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.input, .select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 140px; line-height: 1.5; }
label.f { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; } label.f:first-child { margin-top: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #c9c9d2; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { transform: translateX(16px); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.green { background: var(--ok-soft); color: var(--ok); } .pill.amber { background: var(--warn-soft); color: var(--warn); } .pill.red { background: var(--danger-soft); color: var(--danger); } .pill.blue { background: var(--info-soft); color: var(--info); } .pill.violet { background: var(--accent-soft); color: var(--accent); }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabs a.on { color: var(--accent); border-color: var(--accent); }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.kpi .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }

/* network marks + avatars */
.net { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 10.5px; flex: none; letter-spacing: -0.02em; }
.net.lg { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; }
.av { position: relative; width: 40px; height: 40px; flex: none; }
.av img, .av .ph { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.av .net { position: absolute; right: -4px; bottom: -3px; width: 18px; height: 18px; font-size: 8.5px; border-radius: 5px; border: 2px solid var(--surface); }
.av.sm, .av.sm img, .av.sm .ph { width: 30px; height: 30px; font-size: 12px; } .av.sm .net { width: 15px; height: 15px; font-size: 7.5px; right: -4px; bottom: -3px; }

/* modal + toast */
.overlay { position: fixed; inset: 0; background: rgba(12,12,20,.45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .14s; }
.modal.wide { width: min(1120px, 100%); }
.modal .mh { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal .mb { padding: 18px 20px; overflow: auto; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1b1b22; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: min(560px, 92vw); white-space: pre-line; animation: pop .15s; }
.toast.err { background: var(--danger); color: #fff; } .toast.ok { background: var(--ok); color: #fff; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.drop { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); z-index: 40; min-width: 230px; max-height: 360px; overflow: auto; padding: 4px; }
.drop .opt { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 9px; }
.drop .opt:hover, .drop .opt.on { background: var(--surface-2); }
.drop hr { border: 0; border-top: 1px solid var(--line); margin: 4px; }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; width: 100%; }
.auth .card { width: min(410px, 100%); padding: 28px; box-shadow: var(--shadow); }
.auth .nets { display: flex; gap: 6px; margin: 14px 0 4px; flex-wrap: wrap; }

/* calendar */
.calbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.calbar h2 { min-width: 170px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal .dh { background: var(--surface-2); padding: 7px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal .d { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; position: relative; min-width: 0; }
.cal .d:hover { background: var(--surface-2); }
.cal .d.out { background: var(--surface-2); } .cal .d.out .n { opacity: .45; }
.cal .d .n { font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; }
.cal .d.today .n b { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 7px; }
.cal .d .add { opacity: 0; color: var(--accent); font-weight: 700; } .cal .d:hover .add { opacity: 1; }
.ev { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; min-width: 0; }
.ev:hover { border-color: var(--accent); }
.ev .tm { font-weight: 650; flex: none; } .ev .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.ev .nets { display: flex; gap: 2px; flex: none; } .ev .net { width: 13px; height: 13px; font-size: 6.5px; border-radius: 3px; }
.ev.posted { border-left: 3px solid var(--ok); } .ev.failed { border-left: 3px solid var(--danger); } .ev.partial { border-left: 3px solid var(--warn); } .ev.scheduled, .ev.publishing { border-left: 3px solid var(--accent); }
.cal .more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; }
.week .wd { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 260px; display: flex; flex-direction: column; gap: 6px; }
.week .wd.today { border-color: var(--accent); }
.week .wd h4 { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }

/* post list */
.plist { display: flex; flex-direction: column; gap: 10px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; grid-template-columns: 84px minmax(0,1fr) auto; gap: 14px; align-items: start; }
.pcard .thumb { width: 84px; height: 84px; border-radius: 10px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 11px; position: relative; }
.pcard .thumb img, .pcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.pcard .thumb .cnt { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 10.5px; }
.pcard .cap { white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; color: var(--ink-2); }
.tg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 3px 0; flex-wrap: wrap; }
.tg .err { color: var(--danger); font-size: 12px; flex-basis: 100%; padding-left: 29px; }

/* composer */
.compose { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 22px; }
.accpick { display: flex; flex-wrap: wrap; gap: 8px; }
.accpick .a { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1.5px solid var(--line); border-radius: 99px; cursor: pointer; background: var(--surface); user-select: none; }
.accpick .a.on { border-color: var(--accent); background: var(--accent-soft); }
.accpick .a.off { opacity: .5; }
.accpick .a .chk { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 11px; }
.accpick .a.on .chk { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.counters { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.counters .over { color: var(--danger); font-weight: 700; }
.mediabox { display: flex; gap: 10px; flex-wrap: wrap; }
.mitem { width: 96px; height: 96px; border-radius: 10px; overflow: hidden; position: relative; background: var(--surface-2); border: 1px solid var(--line); }
.mitem img, .mitem video { width: 100%; height: 100%; object-fit: cover; }
.mitem .x { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 99px; width: 22px; height: 22px; cursor: pointer; display: grid; place-items: center; }
.mitem .k { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; border-radius: 5px; padding: 0 5px; font-size: 10px; }
.mitem .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.2); } .mitem .prog i { display: block; height: 100%; background: var(--accent); }
.dropzone { width: 96px; height: 96px; border-radius: 10px; border: 1.5px dashed var(--line); display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; font-size: 12px; padding: 6px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.netopts { border: 1px solid var(--line); border-radius: 12px; margin-top: 14px; }
.netopts .h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.netopts .b { padding: 0 12px 12px; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.netopts .b .full { grid-column: 1 / -1; }
.netopts + .netopts { margin-top: 8px; }
.when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preview { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; position: sticky; top: 0; }
.pv { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pv .ph { display: flex; align-items: center; gap: 8px; padding: 10px; }
.pv .pm { aspect-ratio: 1 / 1; background: #000; display: grid; place-items: center; color: #999; }
.pv .pm.tall { aspect-ratio: 9 / 16; width: min(100%, 240px); margin: 0 auto; }
.pv .pm img, .pv .pm video { width: 100%; height: 100%; object-fit: cover; }
.pv .pc { padding: 10px; white-space: pre-wrap; word-break: break-word; font-size: 13px; max-height: 220px; overflow: auto; }
.problems { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 13px; white-space: pre-line; }

/* accounts */
.accgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; gap: 12px; align-items: center; }
.acc .meta { min-width: 0; flex: 1; }
.connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.connect button { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; }
.connect button:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.connect button small { display: block; color: var(--muted); font-size: 12px; }

/* bars */
.hbar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .track { height: 10px; background: var(--line-2); border-radius: 4px; overflow: hidden; } .hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0,1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--line-2); display: block; }

/* phones / tablets */
@media (max-width: 1180px) { .compose { grid-template-columns: 1fr; } .preview { position: static; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .week { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 860px) {
  .nav { display: none; }
  #app { flex-direction: column; }
  .page { padding: 14px 16px 96px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 20; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 6px 0; }
  .tabbar a.on { color: var(--accent); }
  .fab { display: grid; position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); place-items: center; border: 0; box-shadow: var(--shadow-lg); z-index: 21; cursor: pointer; }
  .topbar-sm { display: flex !important; }
  .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cal .d { min-height: 64px; padding: 4px; } .cal .ev .tx, .cal .ev .nets { display: none; } .cal .ev { padding: 1px 4px; font-size: 10px; } .cal .dh { padding: 5px 4px; font-size: 11px; }
  .week { grid-template-columns: minmax(0,1fr); } .week .wd { min-height: 0; }
  .pcard { grid-template-columns: 64px minmax(0,1fr); } .pcard .thumb { width: 64px; height: 64px; } .pcard .acts { grid-column: 1 / -1; }
  .netopts .b { grid-template-columns: 1fr; }
  .overlay { padding: 0; align-items: end; } .modal { max-height: 100dvh; border-radius: 16px 16px 0 0; } .modal.wide { height: 100dvh; border-radius: 0; }
  .hide-sm { display: none !important; }
  h1 { font-size: 19px; }
}
.topbar-sm { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
@media (max-width: 420px) { .heat { grid-template-columns: 28px repeat(24, minmax(0,1fr)); } }
.connect button.off { opacity: .5; }
.cal .d { overflow: hidden; } .ev { overflow: hidden; max-width: 100%; }
.week .wd { min-width: 0; overflow: hidden; }
#cal { width: 100%; min-width: 0; }
.week { width: 100%; }
.ev .tx { min-width: 0; flex: 1 1 0; }
.page { overflow-x: hidden; }
