:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f7f9, #0d1014);
  --panel: light-dark(#ffffff, #151a21);
  --panel-2: light-dark(#f1f3f6, #1b222b);
  --line: light-dark(#e3e6eb, #262e39);
  --ink: light-dark(#14181f, #e7eaf0);
  --muted: light-dark(#5f6b7a, #8d99a8);
  --accent: light-dark(#2f5fe3, #6d93ff);
  --accent-ink: #fff;
  --star: #f5b700;
  --danger: light-dark(#c62828, #ff6b6b);
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px -12px rgb(0 0 0 / .18);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Theme chọn tay (nút sáng/tối) ghi đè theo hệ điều hành; light-dark() tự theo color-scheme */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden], .hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .small { font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; }
.btn.small { height: 30px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 18px; }
.icon-btn:hover { background: var(--panel-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=search], input[type=text], input[type=password], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 70% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
.login-card { max-width: 420px; text-align: center; }
.login-card h1 { font-size: 40px; margin: 8px 0; letter-spacing: -.02em; }
.login-card p { color: var(--muted); font-size: 16px; }
.login-logo { width: 64px; height: 64px; fill: var(--ink); }

/* ---------- khoá app (mật khẩu + OTP) ---------- */
.lock-form { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.lock-form h2 { margin: 0; font-size: 19px; }
.lock-form p { margin: 0; font-size: 14px; color: var(--ink); }
.lock-form p.muted { color: var(--muted); }
.lock-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lock-form input { width: 100%; font-weight: 400; color: var(--ink); }
.lock-form input[name=code] { font-family: var(--mono); letter-spacing: .2em; }
.lock-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.lock-steps li > input, .lock-steps li > .secret { display: flex; width: 100%; margin-top: 6px; }
.lock-steps li > .muted { display: block; margin-top: 4px; }
.lock-steps li::marker { font-weight: 700; color: var(--accent); }
.qr { width: 184px; margin: 8px auto 2px; padding: 6px; background: #fff; border-radius: 10px; line-height: 0; }
.qr svg { width: 100%; height: auto; }
.secret { display: flex; gap: 8px; align-items: center; }
.secret code { flex: 1; font-family: var(--mono); font-size: 14px; letter-spacing: .04em; background: var(--panel-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.lock-err { color: var(--danger) !important; font-size: 13.5px !important; }
.lock-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.btn.full-w { width: 100%; height: 40px; }
.rc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 4px 0; padding-left: 22px; font-size: 13px; color: var(--muted); }
.rc-list code { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.rc-actions { display: flex; gap: 6px; }

/* modal bảo mật */
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sec-row span { color: var(--muted); }
.sec-row .warn { color: var(--danger); }
.sec-form { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.sec-form h4 { margin: 0; font-size: 14px; }
.sec-form p { margin: 0; }
.sec-form > .btn { align-self: flex-start; }
.sec-inline { display: flex; gap: 8px; }
.sec-inline input { flex: 1; font-family: var(--mono); letter-spacing: .15em; }

/* ---------- layout ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand svg { width: 22px; height: 22px; fill: var(--ink); flex: none; }
.search { flex: 1; max-width: 560px; }
.search input { width: 100%; }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { width: 36px; height: 34px; border: 0; background: var(--panel); cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--accent); }
.theme-btn { display: grid; place-items: center; color: var(--muted); }
.theme-btn:hover { color: var(--ink); }
.theme-btn .ico { width: 18px; height: 18px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); }
.sync-ico { display: inline-block; }
.syncing .sync-ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.body { flex: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 0; }
.side { border-right: 1px solid var(--line); padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: var(--panel); }
.main { overflow-y: auto; padding: 16px 20px 96px; }

/* ---------- sidebar ---------- */
.nav-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--panel-2); }
.nav-item.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item .ico { color: var(--muted); }
.nav-item.on .ico { color: inherit; }
.nav-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .badge { font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.side-title.nav-title { margin: 12px 10px 4px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.side-title { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 4px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 2px 9px; font-size: 12.5px; cursor: pointer; }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.side-foot { margin-top: auto; padding: 0 4px; font-size: 11.5px; line-height: 1.45; }
.side-foot:empty { display: none; }
/* Bảo mật · Logout: 1 dòng nhỏ, căn 2 lề */
.side-mini { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 4px 0; border-top: 1px solid var(--line); }
.mini-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 3px 4px; border-radius: 6px; cursor: pointer; }
.mini-btn:hover { color: var(--ink); background: var(--panel-2); }
.mini-btn .ico { width: 13px; height: 13px; }
.side-mini .mini-btn:only-child, .side-mini .mini-btn.hidden + .mini-btn { margin-left: auto; }
.side-mini:not(:has(.mini-btn:not(.hidden))) { display: none; }
.side-foot .rate { display: block; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; cursor: help; }

/* tooltip nhẹ bằng CSS, nội dung lấy từ data-tip */
.has-tip { position: relative; }
.has-tip:hover::after, .has-tip:focus-visible::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  padding: 5px 9px; border-radius: 6px; background: var(--ink); color: var(--panel);
  font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }

/* ---------- banner & result bar ---------- */
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.banner p { margin: 0; flex: 1; min-width: 220px; }
.result-bar { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 10px; flex-wrap: wrap; }

/* ---------- repo cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.card-head { display: flex; gap: 10px; align-items: center; }
.card-head img { width: 26px; height: 26px; border-radius: 6px; background: var(--panel-2); flex: none; }
.card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title .owner { color: var(--muted); font-weight: 400; }
.card-desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; margin: 0; }
.meta { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.meta .star::before { content: '★ '; color: var(--star); }
.lang-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.pills { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 80%, var(--ink)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.pill.ai::after { content: ' ✦'; opacity: .7; }
.tag-archived { font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }

/* list view */
.grid.list { display: flex; flex-direction: column; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid.list .card { flex-direction: row; align-items: center; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 14px; gap: 14px; }
.grid.list .card:last-child { border-bottom: 0; }
.grid.list .card:hover { box-shadow: none; background: var(--panel-2); }
.grid.list .card-head { width: 300px; flex: none; }
.grid.list .card-desc { flex: 1; -webkit-line-clamp: 1; min-height: 0; }
.grid.list .meta { flex: none; width: 240px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.grid.list .pills { flex: none; width: 200px; justify-content: flex-end; overflow: hidden; flex-wrap: nowrap; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(860px, 100vw); background: var(--panel); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .22s ease; z-index: 40; overflow-y: auto; }
.drawer.on { transform: none; box-shadow: -20px 0 60px -30px rgb(0 0 0 / .4); }
.drawer-inner { padding: 20px 24px 60px; }
.d-head { display: flex; gap: 12px; align-items: flex-start; }
.d-head img { width: 44px; height: 44px; border-radius: 10px; }
.d-head h2 { margin: 0; font-size: 22px; line-height: 1.2; word-break: break-word; }
.d-head h2 .owner { color: var(--muted); font-weight: 500; }
.d-head p { margin: 4px 0 0; color: var(--muted); }
.d-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.d-status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-status .live { width: 8px; height: 8px; border-radius: 50%; background: var(--star); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.d-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.clone { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 14px 0; }
.clone-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.clone-tabs button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.clone-tabs button.on { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.clone-row { display: flex; gap: 8px; padding: 8px; align-items: center; }
.clone-row code { flex: 1; font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: nowrap; padding: 6px 8px; background: var(--panel-2); border-radius: 6px; }
.d-section { margin: 18px 0; }
.d-section h3 { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.cat-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-toggle button { border: 1px dashed var(--line); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.cat-toggle button.on { border-style: solid; background: color-mix(in srgb, var(--c) 15%, transparent); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.note { width: 100%; min-height: 60px; }

/* README */
.readme { border-top: 1px solid var(--line); padding-top: 18px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.readme img { max-width: 100%; height: auto; }
.readme pre { background: var(--panel-2); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.readme code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: .1em .35em; border-radius: 4px; }
.readme pre code { background: none; padding: 0; }
.readme table { border-collapse: collapse; display: block; overflow-x: auto; }
.readme th, .readme td { border: 1px solid var(--line); padding: 5px 10px; }
.readme h1, .readme h2 { border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.readme blockquote { margin: 0; padding: 0 1em; color: var(--muted); border-left: 3px solid var(--line); }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- chat ---------- */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 25; height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--panel); font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.chat { position: fixed; right: 20px; bottom: 20px; width: min(440px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 90px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px -20px rgb(0 0 0 / .45); display: flex; flex-direction: column; z-index: 35; transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none; transition: .18s; }
.chat.on { transform: none; opacity: 1; pointer-events: auto; }
.chat header { display: flex; gap: 8px; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.chat header .muted { flex: 1; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.assistant p { margin: 0 0 .5em; } .msg.assistant p:last-child { margin: 0; }
.msg.assistant ul, .msg.assistant ol { margin: .3em 0; padding-left: 1.2em; }
.repo-link { font-family: var(--mono); font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); padding: 0 6px; border-radius: 5px; cursor: pointer; }
.chat-hints { display: flex; flex-direction: column; gap: 6px; }
.chat-hints button { text-align: left; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13.5px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; max-height: 120px; resize: none; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 3px; animation: pulse 1s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }

/* ---------- modal ---------- */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
.m-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.m-head h3 { margin: 0; flex: 1; font-size: 17px; }
.m-body { padding: 16px 18px; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.m-tools { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.m-body .ico { vertical-align: -3px; }
.drag-handle { width: 24px; height: 34px; border: 0; background: transparent; color: var(--muted); cursor: grab; border-radius: 6px; display: grid; place-items: center; touch-action: none; padding: 0; }
.drag-handle:hover { background: var(--panel-2); color: var(--ink); }
.cat-row.dragging { opacity: .9; background: var(--panel-2); border-radius: 8px; box-shadow: var(--shadow); }
.cat-row.dragging .drag-handle { cursor: grabbing; }
#catRows .cat-row { transition: background .15s; }
.cat-row { display: grid; grid-template-columns: 24px 34px minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 1.6fr) 36px; gap: 6px; align-items: center; margin-bottom: 6px; }
.cat-row input[type=color] { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.cat-row input { width: 100%; }
.cat-head { font-size: 12px; color: var(--muted); font-weight: 600; }
.sg-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.sg-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sg-top input { flex: 1; min-width: 160px; font-weight: 600; }
.sg-repos { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); max-height: 140px; overflow-y: auto; }
.sg-repos b { color: var(--ink); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
.tx-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tx-item input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.tx-item .kw { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.only-mobile { display: none; }
@media (max-width: 900px) {
  .grid.list .card-head { width: 220px; } .grid.list .pills { display: none; }
}
@media (max-width: 760px) {
  .only-mobile { display: inline-flex; align-items: center; justify-content: center; }
  .hide-sm, .brand span, #sort, .seg { display: none; }
  .top { gap: 8px; padding: 0 10px; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 56px; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 32; transform: translateX(-100%); transition: transform .2s; }
  .side.on { transform: none; box-shadow: 20px 0 60px -30px rgb(0 0 0 / .4); }
  .main { padding: 12px 12px 90px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid.list .card { flex-wrap: wrap; } .grid.list .card-head { width: 100%; } .grid.list .meta { width: auto; justify-content: flex-start; }
  .drawer-inner { padding: 16px 16px 60px; }
  .d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-row { grid-template-columns: 24px 34px minmax(0, 1fr) 36px; }
  .cat-row .c-desc, .cat-row .c-kw { grid-column: 3 / 4; }
  .cat-row [data-del-cat], #addCatForm > button { grid-column: 4; grid-row: 1; }
  .m-foot .btn { white-space: normal; height: auto; min-height: 36px; padding: 6px 12px; text-align: center; }
  .cat-head { display: none; }
  .chat { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
