/* ============================================================
   FB Asset Manager — custom UI (no native-looking controls)
   ============================================================ */
:root {
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --panel: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e4e7ef;
  --line-2: #d5d9e4;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --brand-ring: rgba(79, 70, 229, .18);
  --danger: #e11d48;
  --danger-soft: #fff1f3;
  --ok: #059669;
  --warn: #d97706;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --side: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d13; --bg-2: #12151e; --panel: #151925; --text: #e8eaf2; --text-2: #c3c8d6; --muted: #8b93a7;
    --line: #232838; --line-2: #2e3448; --brand: #818cf8; --brand-2: #a78bfa; --brand-soft: #1d2140;
    --brand-ring: rgba(129, 140, 248, .25); --danger: #fb7185; --danger-soft: #2a1219;
    --shadow-xs: none; --shadow: 0 1px 0 rgba(255,255,255,.02); --shadow-lg: 0 16px 50px rgba(0,0,0,.55);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-ring); }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* custom scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout */
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); background: var(--panel); border-right: 1px solid var(--line);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30; transition: transform .25s var(--ease); }
.side .brand { padding: 20px 20px 14px; font-size: 16px; display: flex; gap: 10px; align-items: center; letter-spacing: -.01em; }
.side .brand b { color: var(--brand); font-weight: 700; }
.side .brand .logo { width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center;
  box-shadow: 0 4px 12px var(--brand-ring); }
.side nav { padding: 4px 12px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); margin-bottom: 2px; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.side nav a .nav-ic { display: grid; place-items: center; color: var(--muted); transition: color .15s; }
.side nav a:hover { background: var(--bg); color: var(--text); }
.side nav a:hover .nav-ic { color: var(--text); }
.side nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side nav a.active .nav-ic { color: var(--brand); }
.side nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side nav .sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; font-weight: 600; }
.side .me { border-top: 1px solid var(--line); padding: 14px 14px 14px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.side .me .me-info { flex: 1; min-width: 0; }
.side .me .me-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me .role { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #6366f1, #a855f7); letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; }
.main { flex: 1; margin-left: var(--side); min-width: 0; }
.topbar { display: none; }
.content { padding: 26px 30px 110px; max-width: 1520px; }
.scrim { display: none; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(2px); z-index: 25; }
  .main { margin-left: 0; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 8px;
    background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: saturate(1.5) blur(12px);
    border-bottom: 1px solid var(--line); padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .title { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  .content { padding: 16px 14px 120px; }
}

/* ---------- typography & common */
h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 14.5px; margin: 0 0 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; letter-spacing: -.005em; }
.title-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; color: var(--brand);
  background: var(--brand-soft); flex-shrink: 0; }
.h-ic { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--brand); background: var(--brand-soft); flex-shrink: 0; }
.count-pill { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
  padding: 1px 9px; border-radius: 20px; letter-spacing: 0; }
.count-pill:empty { display: none; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .grow > .muted.small { margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.hint { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; background: var(--bg-2); border-style: dashed; box-shadow: none; }
.meta-card { display: flex; gap: 10px; align-items: flex-start; line-height: 1.7; }
.meta-card > .ic { margin-top: 3px; }
.loading { display: grid; place-items: center; padding: 60px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.hide-xs { display: inline; }
@media (max-width: 520px) { .hide-xs { display: none; } }

/* ---------- dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; align-items: center;
  gap: 14px; color: var(--text); box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.t-blue { background: #e0e7ff; color: #4338ca; } .t-amber { background: #fef3c7; color: #b45309; }
.t-green { background: #d1fae5; color: #047857; } .t-violet { background: #ede9fe; color: #6d28d9; }
.t-cyan { background: #cffafe; color: #0e7490; } .t-pink { background: #fce7f3; color: #be185d; }
.t-teal { background: #ccfbf1; color: #0f766e; }
@media (prefers-color-scheme: dark) {
  .t-blue { background: #1e2250; color: #a5b4fc; } .t-amber { background: #33260c; color: #fcd34d; }
  .t-green { background: #0f2e24; color: #6ee7b7; } .t-violet { background: #261d48; color: #c4b5fd; }
  .t-cyan { background: #0d2c33; color: #67e8f9; } .t-pink { background: #351728; color: #f9a8d4; }
  .t-teal { background: #0d2d2a; color: #5eead4; }
}
.bars .row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; }
.bars .row .k { width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bars .row .bar { flex: 1; height: 8px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bars .row .bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); transition: width .5s var(--ease); }
.bars .row .bar i.green { background: #10b981; } .bars .row .bar i.red { background: #f43f5e; }
.bars .row .bar i.amber { background: #f59e0b; } .bars .row .bar i.gray { background: #94a3b8; }
.bars .row .v { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; color: var(--text); font-weight: 500;
  min-height: 38px; box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--bg); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn .ic { opacity: .9; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 92%, #fff), var(--brand)); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.25), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.danger.solid:hover { filter: brightness(1.06); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; min-height: 30px; gap: 5px; }
.btn.lg { min-height: 44px; font-size: 15px; font-weight: 600; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.icon-only { padding: 0; width: 38px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted);
  display: inline-grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn[data-copy]:active, .icon-btn[data-copy-from]:active { color: var(--ok); }

/* ---------- inputs (custom) */
input[type=text], input[type=password], input[type=number], input[type=search], input[type=email], input[type=tel], input[type=url], input:not([type]), textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 40px;
  outline: none; -webkit-appearance: none; appearance: none; box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line-2)); }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
#f_backup_codes, textarea[name="backup_codes"] { min-height: 125px; font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 13.5px; letter-spacing: .03em; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--panel) inset; -webkit-text-fill-color: var(--text); }

select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 40px; border: 1px solid var(--line-2); background-color: var(--panel);
  border-radius: var(--radius-sm); padding: 8px 34px 8px 12px; font-size: 13.5px; cursor: pointer; color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }

/* custom checkbox */
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; min-height: 18px; margin: 0; flex-shrink: 0;
  border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--panel); cursor: pointer; display: inline-grid; place-items: center;
  transition: background .15s, border-color .15s, box-shadow .15s; vertical-align: middle; }
input[type=checkbox]:hover { border-color: var(--brand); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
input[type=checkbox]::after { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s var(--ease); background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:checked::after { transform: scale(1); }

.input-ic { position: relative; }
.input-ic > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ic > input { padding-left: 38px; }

.f { display: block; margin-bottom: 14px; }
.f > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.f > span .req { color: var(--danger); }
.f-row { display: flex; gap: 4px; align-items: center; }
.f-row > input, .f-row > textarea { flex: 1; min-width: 0; }
.f-row > textarea + .icon-btn { align-self: flex-start; margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); padding: 6px 12px; background: var(--panel);
  border-radius: 20px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 500; color: var(--text-2); transition: all .15s; }
.checks label:hover { border-color: var(--brand); }
.checks label input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.checks label .chip-check { display: none; }
.checks label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.checks label:has(input:checked) .chip-check { display: inline-block; }
.form-sec { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }

/* ---------- toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; min-height: 40px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.search-box { position: relative; flex: 1 1 220px; max-width: 320px; }
.search-box > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input[type=search] { padding-left: 36px; min-height: 36px; font-size: 13.5px; background: var(--bg); box-shadow: none; border-color: transparent; }
.search-box input[type=search]:focus { background: var(--panel); border-color: var(--brand); }
.toolbar select { width: auto; min-width: 130px; flex: 0 1 auto; min-height: 36px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; color: var(--text-2); }
.chk-box { display: flex; }
.toolbar .chk { padding: 0 6px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; color: var(--text-2); background: var(--panel); transition: all .15s; }
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.chip-toggle:hover { border-color: var(--warn); }
.chip-toggle:has(input:checked) { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
@media (prefers-color-scheme: dark) { .chip-toggle:has(input:checked) { background: #33260c; color: #fcd34d; border-color: #92400e; } }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; line-height: 1.6; }
.badge.green, .badge.red, .badge.amber, .badge.blue { border-color: transparent; }
.badge.green::before, .badge.red::before, .badge.amber::before, .badge.blue::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #ffe4e6; color: #be123c; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.blue { background: var(--brand-soft); color: var(--brand); }
.badge.gray { background: var(--bg-2); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .badge.green { background: #0f2e1d; color: #86efac; }
  .badge.red { background: #3a1420; color: #fda4af; }
  .badge.amber { background: #33260c; color: #fcd34d; }
}

/* ---------- tables (become cards on mobile) */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th, table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600;
  background: var(--bg); position: sticky; top: 0; white-space: nowrap; z-index: 1; }
table.t th:first-child { border-top-left-radius: var(--radius); }
table.t th:last-child { border-top-right-radius: var(--radius); }
table.t tbody tr { cursor: pointer; transition: background .12s; }
table.t tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
table.t tbody tr.sel { background: var(--brand-soft); }
table.t tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.t td.nowrap { white-space: nowrap; }
table.t td .clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
table.t .num { font-weight: 700; color: var(--brand); white-space: nowrap; background: var(--brand-soft); padding: 2px 8px; border-radius: 7px; font-size: 12.5px; }
table.t td.cb { width: 40px; }

@media (max-width: 760px) {
  .table-wrap { background: transparent; border: 0; overflow: visible; box-shadow: none; }
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t thead { display: none; }
  table.t tbody tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 10px; padding: 10px 14px; position: relative; }
  table.t tbody tr:hover { background: var(--panel); }
  table.t tbody tr.sel { background: var(--brand-soft); border-color: var(--brand); }
  table.t tbody tr.sel td:first-child { box-shadow: none; }
  table.t td { border: 0; padding: 4px 0; display: flex; gap: 10px; align-items: center; min-height: 28px; }
  table.t td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; width: 88px; flex-shrink: 0; font-weight: 500; }
  table.t td[data-label=""]::before { display: none; }
  table.t td.cb { position: absolute; right: 12px; top: 12px; width: auto; }
  table.t td.cb::before { display: none; }
  table.t td .clip { max-width: 58vw; }
  table.t td:empty, table.t td.hide-m { display: none; }
}

.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 14px; flex-wrap: wrap; }
.pager-btns { display: inline-flex; gap: 6px; }

/* ---------- floating bars */
.bulkbar { position: fixed; left: calc(var(--side) + 24px); right: 24px; bottom: 20px; z-index: 15;
  background: #0f172a; color: #fff; border-radius: 16px; padding: 10px 12px 10px 14px; display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap; box-shadow: 0 16px 40px rgba(15,23,42,.35); animation: rise .2s var(--ease); }
.bulkbar .sel-count { background: var(--brand); color: #fff; border-radius: 8px; padding: 2px 9px; font-weight: 700; font-size: 13px; }
.bulkbar b { font-weight: 500; opacity: .85; }
.bulkbar .c-select { width: 180px; }
.bulkbar .c-select-trigger { background: #1e293b; border-color: #334155; color: #fff; }
.bulkbar .btn { min-height: 36px; }
.bulkbar .btn.ghost { color: #cbd5e1; }
.bulkbar .btn.ghost:hover { background: #1e293b; color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { .bulkbar { background: #1c2133; border: 1px solid var(--line-2); } }
@media (max-width: 900px) { .bulkbar { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); } }

.savebar { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 15;
  background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: saturate(1.5) blur(12px);
  border-top: 1px solid var(--line); padding: 12px 30px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; }
.savebar .grow { flex: 1; display: flex; align-items: center; gap: 8px; }
.dot-warn { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(217,119,6,.15); display: inline-block; }
@media (max-width: 900px) { .savebar { left: 0; padding-left: 14px; padding-right: 14px; } }

/* ---------- connections */
.links .lrow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.links .lrow:last-of-type { border-bottom: 0; }
.links .lrow-name { display: flex; align-items: center; gap: 8px; flex: 1 1 140px; min-width: 0; }
.links .lrow-name .lname { flex: 1; min-width: 0; }
.links .lrow .lname { flex: 1 1 120px; min-width: 0; font-weight: 600; }
.links .lrow .lname .sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.links .lrow .c-select { flex: 0 1 150px; min-width: 125px; max-width: 170px; }
.links .lrow .c-select-trigger { min-height: 32px; padding: 4px 10px; font-size: 12.5px; background: var(--bg); }
.links .lrow select { width: auto; min-height: 32px; padding: 4px 28px 4px 10px; font-size: 12.5px; max-width: 160px; }
.links .lrow [data-link-del]:hover { color: var(--danger); background: var(--danger-soft); }
.links .ladd { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); flex-wrap: wrap; align-items: center; }
.links .ladd input { flex: 2 1 180px; min-width: 140px; }
.links .ladd .c-select { flex: 1 1 145px; min-width: 130px; max-width: 220px; }
.links .ladd select { flex: 1 1 130px; width: auto; }
.links h2 .count { font-size: 11.5px; color: var(--muted); font-weight: 600; background: var(--bg-2); padding: 0 8px; border-radius: 10px; }

/* ---------- avatars & external links */
.page-avatar { border-radius: 50%; object-fit: cover; background: var(--bg); border: 1px solid var(--line); flex-shrink: 0; vertical-align: middle; display: inline-block; }
.page-avatar.fallback { display: inline-flex; align-items: center; justify-content: center; user-select: none; }
.page-cell { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; max-width: 100%; }
.page-cell .clip { max-width: 180px; }
.title-with-avatar { display: inline-flex; align-items: center; gap: 10px; }
.ext-fb-link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 12.5px; vertical-align: middle; transition: opacity .15s; }
.ext-fb-link:hover { opacity: .75; text-decoration: underline; }
.ext-fb-btn { color: var(--muted); }
.ext-fb-btn:hover { color: var(--brand); }

/* ---------- 2FA code */
.totp { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; position: relative; overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; letter-spacing: .06em;
  background: var(--brand-soft); color: var(--brand); padding: 5px 9px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  cursor: pointer; width: 124px; min-width: 124px; text-align: center; user-select: none; white-space: nowrap; transition: transform .1s; }
.totp:hover { filter: brightness(.97); }
.totp:active { transform: scale(.97); }
.totp .totp-code { flex: 1; text-align: center; }
.totp small { display: inline-block; width: 24px; text-align: right; font-size: 11px; font-weight: 600; opacity: .7; letter-spacing: 0; }
.complete { font-size: 12px; font-weight: 700; white-space: nowrap; padding: 2px 8px; border-radius: 7px; }
.complete.full { color: var(--ok); background: #d1fae5; }
.complete.part { color: var(--warn); background: #fef3c7; }
@media (prefers-color-scheme: dark) { .complete.full { background: #0f2e24; } .complete.part { background: #33260c; } }

/* ---------- modal, confirm, toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 14px; animation: fade .15s ease; }
.modal { background: var(--panel); border-radius: 18px; width: 100%; max-width: 760px; max-height: 92vh; overflow: auto;
  padding: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .2s var(--ease); }
.modal.sm { max-width: 440px; }
.modal .mh { display: flex; align-items: center; margin-bottom: 14px; }
.modal .mh h2 { margin: 0; flex: 1; font-size: 16px; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.confirm { text-align: center; padding-top: 4px; }
.confirm h2 { justify-content: center; font-size: 17px; margin: 14px 0 6px; }
.confirm p { margin: 0; font-size: 13.5px; }
.confirm .mf { justify-content: center; }
.confirm .mf .btn { min-width: 110px; }
.confirm-ic { width: 52px; height: 52px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.confirm-ic.danger { background: var(--danger-soft); color: var(--danger); }
.preview { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 10px; }
.preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview th { background: var(--bg); position: sticky; top: 0; }
.preview td, .preview th { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; background: #0f172a; color: #fff; padding: 10px 16px 10px 12px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; max-width: 90vw; animation: pop .2s var(--ease); }
.toast .ic { color: #34d399; }
.toast.err { background: var(--danger); }
.toast.err .ic { color: #fff; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1000px 500px at 10% -10%, var(--brand-soft), transparent 60%), radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 30px; box-shadow: var(--shadow-lg); border-radius: 20px; }
.auth-logo { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: #fff; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 24px var(--brand-ring); }
.auth h1 { margin-bottom: 4px; }
.auth p { margin: 0 0 22px; }
.err-box { color: var(--danger); font-size: 13px; margin-bottom: 10px; }
.err-box:empty { display: none; }

/* ---------- segmented control */
.seg-control { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg-btn { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s ease; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.seg-btn .count { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.seg-btn.active .count { background: var(--brand-soft); color: var(--brand); }

/* ---------- drawer / bottom sheet */
.drawer-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92vw; background: var(--panel);
  z-index: 61; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.drawer-bg.open .drawer { transform: translateX(0); }
.drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-header .title-wrap { flex: 1; min-width: 0; }
.drawer-header h2 { margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.drawer-header .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--panel); }
.sheet-handle { display: none; }
@media (max-width: 768px) {
  .drawer { top: auto; left: 0; width: 100%; max-width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .drawer-bg.open .drawer { transform: translateY(0); }
  .sheet-handle { display: block; width: 40px; height: 4px; background: var(--line-2); border-radius: 2px; margin: 10px auto 4px; flex-shrink: 0; }
  .drawer-header { padding-top: 6px; }
}

/* ---------- passkey selector */
.passkey-wrap { display: flex; flex-direction: column; gap: 8px; }
.passkey-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.passkey-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.passkey-card { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px; background: var(--panel); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .15s ease; user-select: none; min-height: 42px; }
.passkey-card:hover { border-color: var(--brand); background: var(--bg); }
.passkey-card.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: 0 0 0 3px var(--brand-ring); }
.passkey-card .p-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.passkey-card .p-label { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
@media (max-width: 420px) { .passkey-cards { grid-template-columns: 1fr; } }
.passkey-clear { font-size: 12px; color: var(--muted); cursor: pointer; background: none; border: 0; padding: 0; font-weight: 500; }
.passkey-clear:hover { color: var(--danger); }
.passkey-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.passkey-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- duplicate warning */
.dup-alert { display: none; align-items: center; gap: 6px; color: var(--danger); font-size: 12px; margin-top: 6px; font-weight: 500; }
.dup-alert.show { display: flex; }
.dup-alert svg { flex-shrink: 0; }

/* ---------- history timeline */
.timeline { position: relative; padding-left: 26px; display: flex; flex-direction: column; gap: 18px; margin: 10px 0; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: flex; flex-direction: column; gap: 3px; }
.tl-dot { position: absolute; left: -26px; top: 2px; width: 18px; height: 18px; border-radius: 50%; color: transparent; overflow: hidden;
  background: var(--panel); border: 2px solid var(--brand); box-shadow: 0 0 0 4px var(--panel); }
.tl-dot.assigned { border-color: #4f46e5; background: #eef2ff; }
.tl-dot.released { border-color: #d97706; background: #fffbeb; }
.tl-dot.passkey { border-color: #7c3aed; background: #f5f3ff; }
.tl-dot.status { border-color: #059669; background: #ecfdf5; }
.tl-dot.created { border-color: #94a3b8; background: var(--bg-2); }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.tl-action { font-weight: 600; font-size: 13.5px; color: var(--text); }
.tl-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tl-desc { font-size: 12.5px; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; margin-top: 3px; }
.tl-actor { font-size: 11.5px; color: var(--muted); }

/* ---------- settings / status manager */
.status-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.status-item { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.status-item .s-name { flex: 1; font-weight: 500; font-size: 13.5px; }
.status-item input[type=text] { flex: 1; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.status-item .s-actions { display: flex; gap: 4px; align-items: center; }
.status-add-bar { display: flex; gap: 8px; margin-top: 12px; }
.status-add-bar input { flex: 1; }

/* ---------- custom select */
.c-select { position: relative; width: 100%; }
.c-select.wide { grid-column: 1 / -1; }
.c-select.open { z-index: 60; }
.c-select-trigger { width: 100%; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius-sm);
  padding: 8px 12px; min-height: 40px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, background-color .15s; color: var(--text); user-select: none; box-shadow: var(--shadow-xs); }
.c-select-trigger:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line-2)); }
.c-select.open .c-select-trigger { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.c-select-val { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.c-select-chevron { display: grid; place-items: center; color: var(--muted); transition: transform .2s ease; margin-left: 8px; flex-shrink: 0; }
.c-select.open .c-select-chevron { transform: rotate(180deg); color: var(--brand); }
.c-select-sm .c-select-trigger { min-height: 36px; padding: 5px 11px; font-size: 13px; }
.toolbar .c-select { width: 160px; min-width: 160px; max-width: 160px; flex: 0 0 160px; }
.toolbar .c-select .c-select-trigger { overflow: hidden; }
.page-head .c-select { width: auto; min-width: 160px; }
.page-head .c-select-trigger { min-height: 38px; padding: 5px 11px; font-size: 13px; }
.c-select-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 65;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 320px; overflow: hidden; flex-direction: column; min-width: 190px; }
.c-select.open .c-select-menu { display: flex; animation: cSelectFade .12s ease-out; }
@keyframes cSelectFade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.c-select-search-box { padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.c-select-search-input { width: 100%; min-height: 34px !important; padding: 4px 10px !important; border-radius: 8px !important; font-size: 13px; background: var(--bg) !important; box-shadow: none !important; }
.c-select-list { overflow-y: auto; max-height: 250px; padding: 5px; }
.c-select-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; font-size: 13px; color: var(--text); transition: background .1s; margin-bottom: 1px; }
.c-select-opt:hover { background: var(--bg); }
.c-select-opt.selected { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.c-opt-text { flex: 1; display: flex; align-items: center; gap: 6px; }
.c-opt-check { color: var(--brand); display: grid; place-items: center; }
.c-select-backdrop { display: none; position: fixed; inset: 0; z-index: 54; }
.c-select-backdrop.show { display: block; }
@media (max-width: 768px) {
  .c-select-backdrop { background: rgba(15,23,42,.4); backdrop-filter: blur(2px); z-index: 68; }
  .c-select.open .c-select-menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 69; width: 100%;
    border-radius: 22px 22px 0 0; max-height: 75vh; padding-bottom: env(safe-area-inset-bottom); animation: cSelectSlideUp .24s cubic-bezier(.16, 1, .3, 1); }
  .c-select.open .c-select-menu .sheet-handle { display: block; width: 40px; height: 4px; background: var(--line-2); border-radius: 2px; margin: 10px auto 4px; flex-shrink: 0; }
  .c-select-opt { padding: 12px; font-size: 14px; }
  @keyframes cSelectSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .toolbar .c-select { flex: 1 1 140px; max-width: none; min-width: 0; }
  .search-box { max-width: none; flex-basis: 100%; }
}

/* ---------- column customizer */
.col-custom-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.col-custom-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; user-select: none; transition: background .12s; }
.col-custom-item:hover { background: var(--panel); }
.col-custom-left { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.col-custom-name { font-size: 13.5px; font-weight: 500; }
.col-custom-btns { display: flex; gap: 4px; align-items: center; }
.col-custom-btns .icon-btn { padding: 5px; border: 1px solid var(--line); background: var(--panel); }
.col-custom-btns .icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.col-custom-btns .icon-btn:disabled { opacity: .3; cursor: default; border-color: var(--line); color: var(--muted); }
.bulkbar .c-select-val .muted { color: #94a3b8; }
.bulkbar .c-select-chevron { color: #94a3b8; }
@media (max-width: 520px) {
  .page-head .grow { flex-basis: 100%; }
  .page-head > .btn.primary { flex: 1; }
  h1 { font-size: 20px; }
  .title-ic { width: 34px; height: 34px; }
}

/* ---------- table cells: value + aligned action icons */
.cell-val { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: middle; }
.cell-val > .clip { min-width: 0; }
.cell-acts { display: inline-flex; align-items: center; gap: 0; flex-shrink: 0; }
.cell-acts:empty { display: none; }
table.t .icon-btn { padding: 5px; width: 26px; height: 26px; }
.page-cell .cell-acts { margin-left: -2px; }
.tool-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }
.tool-tags .badge { font-weight: 500; }

/* ---------- tool chips with a permanent checkbox (no layout shift on select) */
.checks label { padding: 6px 12px 6px 9px; gap: 7px; }
.checks label input { position: static; opacity: 1; pointer-events: auto; width: 16px; height: 16px; min-height: 16px; border-radius: 5px; }
.checks label input::after { width: 9px; height: 9px; }
.checks label .chip-check { display: none !important; }
@media (min-width: 761px) {
  table.t td { white-space: nowrap; }
  .tool-tags { flex-wrap: nowrap; max-width: none; }
}

/* ---------- drop-up selects (when no room below, e.g. bulk bar) */
@media (min-width: 769px) {
  .c-select.up .c-select-menu { top: auto; bottom: calc(100% + 6px); }
  .c-select.up.open .c-select-menu { animation: cSelectFadeUp .12s ease-out; }
}
@keyframes cSelectFadeUp { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.toolbar .c-select { width: 148px; min-width: 148px; max-width: 148px; flex: 0 0 148px; }

/* ---------- columns popover */
.col-anchor { position: relative; display: inline-flex; }
#colCustomBtn.active { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.col-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; width: 270px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; animation: cSelectFade .12s ease-out; }
.col-pop-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line); }
.col-pop-head b { font-size: 14px; }
.col-pop .col-custom-list { margin: 8px 0 4px; max-height: min(60vh, 440px); gap: 2px; padding-right: 2px; }
.col-pop .col-custom-item { padding: 4px 6px; border: 0; background: transparent; border-radius: 8px; justify-content: flex-start; gap: 4px; }
.col-pop .col-custom-item:hover { background: var(--bg); }
.col-pop .col-custom-item.off .col-custom-name { color: var(--muted); }
.col-pop .col-custom-left { padding: 4px 2px; gap: 9px; }
.col-pop-hint { display: flex; align-items: center; gap: 5px; padding: 6px 6px 0; border-top: 1px solid var(--line); }
.grip { display: grid; place-items: center; width: 22px; height: 26px; color: var(--muted); cursor: grab; touch-action: none; flex-shrink: 0; border-radius: 6px; }
.grip:hover { color: var(--text); background: var(--line); }
.grip .ic circle { fill: currentColor; }
.sorting, .sorting * { cursor: grabbing !important; user-select: none; }
.dragging { background: var(--brand-soft) !important; box-shadow: 0 6px 18px rgba(15, 23, 42, .12); position: relative; z-index: 1; }
@media (max-width: 768px) { .col-pop { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 20px 20px 0 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); } }

/* ---------- settings option lists */
.settings-grid { align-items: start; }
.opt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.opt-card-head h2 { margin: 0; }
.opt-card-foot { margin-top: 16px; display: flex; justify-content: flex-end; }
.status-item { padding: 6px 10px 6px 4px; gap: 8px; }
.status-item .badge { flex-shrink: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- compact filters (one button + popover + chips) */
.pop-anchor { position: relative; display: inline-flex; }
#filterBtn.active, #filterBtn.has-filters { border-color: var(--brand); color: var(--brand); }
#filterBtn.active { box-shadow: 0 0 0 4px var(--brand-ring); }
.filter-count { background: var(--brand); color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.filter-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 70; width: 440px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; animation: cSelectFade .12s ease-out; }
.filter-pop[hidden] { display: none; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 10px 4px 4px; }
.filter-grid .ff { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-grid .ff > span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.toolbar .filter-grid .c-select { width: 100%; min-width: 0; max-width: none; flex: none; }
.filter-grid .ff-wide { grid-column: 1 / -1; justify-content: center; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.filter-chips:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px; font-weight: 600; white-space: nowrap; max-width: 240px; }
.fchip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.fchip button:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.toolbar { flex-wrap: wrap; }
@media (max-width: 768px) {
  .filter-pop { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 20px 20px 0 0; max-height: 80vh; overflow-y: auto; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .filter-grid { grid-template-columns: 1fr; }
}

/* ---------- read-only records (member not related to the asset) */
.ro-banner { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 8%, var(--panel)); }
.ro-banner > .ic { color: #b45309; margin-top: 2px; flex-shrink: 0; }
.ro-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ro-fieldset:disabled .form-sec { opacity: .85; }
.ro-fieldset:disabled input:not([type=checkbox]), .ro-fieldset:disabled textarea, .ro-fieldset:disabled .c-select-trigger { cursor: not-allowed; background: var(--bg); }
.ro-lock { display: inline-grid; place-items: center; margin-left: 6px; color: var(--muted); vertical-align: middle; }
.savebar[hidden] { display: none; }
.filter-count[hidden] { display: none; }

/* ---------- record header */
.rec-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.rec-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 30%, transparent)); }
.rec-back { flex-shrink: 0; margin-left: -6px; }
.rec-avatar { flex-shrink: 0; display: grid; place-items: center; }
.rec-avatar .page-avatar { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; }
.rec-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); }
.rec-main { flex: 1 1 260px; min-width: 0; }
.rec-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rec-main h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.rec-id { display: inline-flex; align-items: center; padding: 2px 4px 2px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; margin-right: 4px; }
.rec-id .icon-btn { width: 24px; height: 24px; padding: 4px; }
.rec-sub .badge .ic { margin-right: 2px; vertical-align: -2px; }
.rec-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.rec-actions .c-select { width: 190px; }
@media (max-width: 760px) {
  .rec-head { padding: 14px; gap: 10px; }
  .rec-avatar .page-avatar, .rec-ic { width: 44px; height: 44px; border-radius: 12px; }
  .rec-main h1 { font-size: 19px; white-space: normal; }
  .rec-actions { width: 100%; margin-left: 0; }
  .rec-actions > * { flex: 1; }
  .rec-actions .c-select { width: auto; }
}

/* ---------- connected cards */
.links { display: flex; flex-direction: column; gap: 12px; }
.links-head { display: flex; align-items: center; gap: 8px; }
.links-head h2 { margin: 0; flex: 1; min-width: 0; }
.links-head .count { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; }
.lpick { position: relative; }
.lpick-box { position: relative; }
.lpick-box > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lpick-box input { width: 100%; padding-left: 36px; min-height: 40px; background: var(--bg); border-color: transparent; box-shadow: none; font-size: 13.5px; }
.lpick-box input:focus { background: var(--panel); border-color: var(--brand); }
.lpick.busy .lpick-box::after { content: ""; position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lpick-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 330px; overflow-y: auto; }
.lpick.open .lpick-menu:not(:empty) { display: block; animation: cSelectFade .12s ease-out; }
.lpick-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px 4px; }
.lpick-none { padding: 8px; font-size: 13px; color: var(--muted); }
.lpick-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.lpick-opt:hover:not(:disabled), .lpick-opt.active { background: var(--bg); }
.lpick-opt.active { box-shadow: inset 0 0 0 1px var(--line-2); }
.lpick-opt:disabled { cursor: default; opacity: .65; }
.lpick-opt.create { margin-top: 4px; border-top: 1px dashed var(--line-2); border-radius: 0 0 9px 9px; padding-top: 10px; }
.lpick-opt.create b { color: var(--brand); }
.lname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; color: var(--text); text-decoration: none; }
.lname b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lname .sub { font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.lname:hover b { color: var(--brand); }
.l-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.lpick-opt .l-ic, .lconfirm .l-ic { width: 30px; height: 30px; }
.l-ic.new { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.links .page-avatar { border-radius: 10px; flex-shrink: 0; }
.lconfirm { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand) 4%, var(--panel)); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.lconfirm[hidden] { display: none; }
.lconfirm-item { display: flex; align-items: center; gap: 10px; }
.lconfirm-row { display: flex; gap: 8px; }
.lconfirm-row .c-select { flex: 1; min-width: 0; }
.lrows { display: flex; flex-direction: column; }
.links .lrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 6px; padding: 10px 6px; margin: 0 -6px;
  border-bottom: 1px solid var(--line); border-radius: 10px; flex-wrap: nowrap; }
.links .lrow:last-child { border-bottom: 0; }
.links .lrow:hover { background: var(--bg); }
.l-acts { display: flex; align-items: center; gap: 4px; }
.l-acts .badge { margin-right: 2px; }
.l-acts .icon-btn { width: 28px; height: 28px; padding: 6px; }
.l-del { color: var(--muted); }
.links .lrow .l-del:hover { color: var(--danger); background: var(--danger-soft); }
.l-meta { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; }
.l-meta > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.links .lrow .l-meta .c-select { flex: 0 1 180px; min-width: 130px; max-width: 200px; }
.l-meta-ro { grid-column: 2 / -1; font-size: 12px; color: var(--muted); }
.l-empty { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--muted); font-size: 13px; }
.l-empty .ic { flex-shrink: 0; opacity: .7; }
.page-avatar.fallback { position: relative; display: inline-block; background: var(--brand-soft); border-radius: 10px; flex-shrink: 0; }
.page-avatar.fallback::before { content: ""; position: absolute; inset: 26%; background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22V4'/%3E%3Cpath d='M4 4h11l-1.5 4L15 12H4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22V4'/%3E%3Cpath d='M4 4h11l-1.5 4L15 12H4'/%3E%3C/svg%3E") center / contain no-repeat; }
.rec-avatar .page-avatar.fallback { border-radius: 14px; }
@media (max-width: 760px) { .rec-main { flex: 1 1 0; } .rec-back { margin-left: -10px; } }

/* ---------- duplicate protection */
.dup-alert { padding: 7px 10px; border-radius: 8px; background: var(--danger-soft); line-height: 1.35; }
.dup-alert span { flex: 1; }
.dup-open { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--danger); white-space: nowrap; text-decoration: underline; }
.f.has-dup input, .f.has-dup textarea { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent) !important; }
.bulk-res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.bulk-stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.bulk-stat b { font-size: 24px; line-height: 1.1; }
.bulk-stat span { font-size: 12.5px; color: var(--muted); }
.bulk-stat.ok b { color: var(--ok, #16a34a); }
.bulk-stat.warn { border-color: #f59e0b; background: color-mix(in srgb, #f59e0b 8%, var(--panel)); }
.bulk-stat.warn b { color: #b45309; }
.dup-table { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.dup-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dup-table th { position: sticky; top: 0; background: var(--bg); text-align: left; padding: 7px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dup-table td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.dup-table td.mono { white-space: nowrap; }

/* ---------- compact record header (v2) */
.rec-head { overflow: visible; padding: 12px 16px; gap: 12px; margin-bottom: 14px; }
.rec-head::before { display: none; }
.rec-avatar .page-avatar, .rec-ic { width: 40px; height: 40px; border-radius: 11px; }
.rec-avatar .page-avatar.fallback { border-radius: 11px; }
.rec-main { flex: 1 1 280px; }
.rec-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec-title h1 { margin: 0; font-size: 19px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rec-tag { flex-shrink: 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; }
.rec-sub { margin-top: 5px; gap: 5px; }
.rec-id { padding: 0 2px 0 8px; height: 26px; margin-right: 2px; font-size: 12px; }
.rec-sub .badge { height: 24px; }
.rec-actions .btn, .rec-actions .c-select-trigger { min-height: 36px; }
.rec-actions .c-select { width: 170px; }
.rec-actions .c-select-menu { left: auto; right: 0; min-width: 200px; }
@media (max-width: 760px) {
  .rec-head { padding: 12px; }
  .rec-avatar .page-avatar, .rec-ic { width: 36px; height: 36px; }
  .rec-title h1 { font-size: 17px; white-space: normal; }
}

/* ---------- compact connected cards (v2): one line per connection */
.links { gap: 10px; padding: 14px 16px; }
.links-head h2 { font-size: 14.5px; }
.lpick-box input { min-height: 36px; }
.links .lrow { grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 8px; padding: 7px 6px; }
.links .lrow .l-meta { grid-column: auto; }
.links .lrow .l-meta .c-select { width: 142px; min-width: 0; max-width: none; flex: none; }
.links .lrow .l-meta .c-select-trigger { min-height: 30px; padding: 3px 9px; font-size: 12.5px; }
.links .lrow .l-meta .c-select-menu { left: auto; right: 0; min-width: 180px; }
.l-meta-ro { grid-column: auto; font-size: 12px; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; white-space: nowrap; }
.l-acts { gap: 2px; }
.links .lrow .l-ic, .links .lrow .page-avatar { width: 30px; height: 30px; border-radius: 9px; }
.lname b { font-size: 13px; }
.lname .sub { font-size: 11.5px; }
.l-empty { padding: 10px 12px; font-size: 12.5px; }
.lpick-opt .lpick-ext { width: 28px; height: 28px; padding: 6px; color: var(--muted); flex-shrink: 0; }
.lpick-opt .lpick-ext:hover { color: var(--brand); background: var(--brand-soft); }
.lpick-opt.is-done { cursor: default; }
.lpick-opt.is-done .lname { opacity: .6; }
@media (max-width: 520px) {
  .links .lrow .l-meta .c-select { width: 118px; }
}
/* wider connected cards so names fit on one line */
#linksGrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.lconfirm { flex-direction: row; align-items: center; gap: 8px; padding: 7px 8px; }
.lconfirm .lname { min-width: 0; }
.lconfirm .l-meta .c-select { width: 142px; }
.lconfirm .l-meta .c-select-trigger { min-height: 30px; padding: 3px 9px; font-size: 12.5px; }
.lconfirm .l-meta .c-select-menu { left: auto; right: 0; min-width: 180px; }
.lconfirm .btn.sm { min-height: 30px; padding: 0 10px; white-space: nowrap; }
.lconfirm .l-ic, .lconfirm .page-avatar { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; }
@media (max-width: 520px) { .lconfirm { flex-wrap: wrap; } .lconfirm .lname { flex-basis: calc(100% - 80px); } }

/* ---------- record header (v3): one line in the card, status chips under it */
.rec-head { padding: 10px 14px; gap: 10px; margin-bottom: 8px; flex-wrap: nowrap; }
.rec-avatar .page-avatar, .rec-ic { width: 34px; height: 34px; border-radius: 10px; }
.rec-main { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rec-main h1 { margin: 0; font-size: 18px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.rec-main .rec-id { flex-shrink: 0; margin: 0; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px 4px; }
.rec-chips .badge { height: 24px; }
.rec-chips .badge .ic { margin-right: 2px; vertical-align: -2px; }
@media (max-width: 900px) {
  .rec-head { flex-wrap: wrap; }
  .rec-main { flex-wrap: wrap; flex: 1 1 0; row-gap: 4px; }
  .rec-main h1 { white-space: normal; font-size: 17px; }
}

/* ---------- Quick Links & Trending */
.bm-filters { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.bm-tile { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 10px; font-weight: 700; font-size: 14px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--tone) 25%, transparent); }
.bm-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 460px; }
.bm-link .page-avatar { width: 32px; height: 32px; border-radius: 10px; }
.bm-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.bm-title { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-title:hover { color: var(--brand); text-decoration: underline; }
.bm-url { font-size: 11.5px; color: var(--muted); font-family: 'JetBrains Mono', ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.bm-acts { text-align: right; }
.bm-acts .icon-btn, .bm-card-foot .icon-btn { width: 30px; height: 30px; padding: 7px; }
.bm-pin { color: var(--muted); }
.bm-pin:hover { color: var(--brand); }
.bm-pin.on { color: var(--brand); background: var(--brand-soft); }
.bm-pin.on .ic { fill: currentColor; }
.bm-del:hover { color: var(--danger); background: var(--danger-soft); }
.bm-section-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 2px 10px; }
.bm-section-h .count { background: var(--bg-2); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.bm-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 20px; }
.bm-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-top: 3px solid var(--brand); }
.bm-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bm-card-top .bm-txt { flex: 1; }
.bm-card-top .page-avatar { width: 40px; height: 40px; border-radius: 11px; }
.bm-notes { font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-card-foot { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.bm-card-foot .badge { margin-right: 2px; }
.bm-table .bm-link { max-width: 380px; }
.bm-table .bm-url { max-width: 250px; }
.bm-table td .clip { max-width: 220px !important; }

/* ---- posts (quick links / trending) */
.bm-table tbody tr[data-open], .bm-card[data-open] { cursor: pointer; }
.bm-card[data-open]:hover { box-shadow: 0 0 0 1px var(--brand), var(--shadow, 0 1px 2px rgba(0,0,0,.06)); }
.bm-card[data-open]:focus-visible, .bm-table tbody tr[data-open]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bm-title { display: block; }
.bm-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.bm-table .bm-sub { max-width: 280px; }
.bm-tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 1px 7px; margin-right: 3px; white-space: nowrap; }
.bm-links-cell { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.bm-links-cell .icon-btn { width: 26px; height: 26px; padding: 5px; }
.bm-pin-toggle .ic { flex-shrink: 0; }
.bm-card .bm-title { white-space: nowrap; }
/* preview drawer */
.pv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pv-chips:empty { display: none; }
.pv-sec { margin-bottom: 18px; }
.pv-h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.pv-h .count { background: var(--bg-2); border-radius: 999px; padding: 0 7px; font-size: 11px; }
.pv-h .btn { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; }
.pv-notes { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.pv-links { display: flex; flex-direction: column; gap: 6px; }
.pv-link { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-width: 0; }
.pv-link:hover { border-color: var(--brand); }
.pv-link .bm-txt { flex: 1; }
.pv-link .bm-url { max-width: none; }
.pv-link .page-avatar { width: 34px; height: 34px; border-radius: 10px; }
.pv-n { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg-2); flex-shrink: 0; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }
/* post form */
.pform { display: flex; flex-direction: column; gap: 14px; }
.pform .form-grid { margin: 0; }
.pform textarea { resize: vertical; min-height: 92px; }
.p-links { display: flex; flex-direction: column; gap: 6px; }
.p-link-row { display: flex; align-items: center; gap: 8px; }
.p-link-row input { flex: 1; min-width: 0; }
.p-link-row .icon-btn { flex-shrink: 0; color: var(--muted); }
.p-link-row .icon-btn:hover { color: var(--danger); background: var(--danger-soft); }
.p-thumb { display: inline-grid; flex-shrink: 0; width: 30px; height: 30px; }
.p-thumb .page-avatar, .p-thumb .bm-tile { width: 30px !important; height: 30px !important; border-radius: 9px; font-size: 12px; }
.p-add-link { align-self: flex-start; margin-top: 2px; }
.chip-input { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 40px; padding: 5px 8px; border: 1px solid var(--line-2, var(--line)); border-radius: var(--radius-sm); background: var(--panel); cursor: text; }
.chip-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chip-input input { flex: 1; min-width: 90px; border: 0 !important; outline: 0; box-shadow: none !important; padding: 4px 2px !important; min-height: 0 !important; background: transparent; }
.chip-input .chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; padding: 2px 4px 2px 9px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.chip-input .chip button { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.chip-input .chip button:hover { background: rgba(0,0,0,.08); }
@media (max-width: 760px) {
  .pv-link .cell-acts .icon-btn { width: 34px; height: 34px; }
}

.secret-hidden { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); background: var(--bg-2); border: 1px dashed var(--line); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.secret-locked { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--muted); font-size: 13px; }
.secret-locked .ic { flex-shrink: 0; }
.secret-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; border-radius: 10px; background: var(--brand-soft); color: var(--text); font-size: 13px; }
.secret-note > .ic { color: var(--brand); flex-shrink: 0; }
.secret-note span { flex: 1; min-width: 180px; }

/* ---- connected cards: "Add new" sticks to the bottom of the suggestions; inline quick form */
.lpick-opt.create { position: sticky; bottom: -6px; background: var(--panel); margin-bottom: -6px; padding-bottom: 10px; }
.lpick-opt.create:hover, .lpick-opt.create.active { background: var(--brand-soft); }
.lquick { margin-top: 10px; padding: 12px; border: 1px solid var(--brand); border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 3px var(--brand-soft); display: flex; flex-direction: column; gap: 10px; }
.lquick-h { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.lquick-h > .ic { color: var(--brand); }
.lquick-h .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lquick-h .icon-btn { width: 28px; height: 28px; padding: 6px; margin-left: auto; flex-shrink: 0; }
.lquick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lquick-grid.three { grid-template-columns: 1.1fr 1fr 0.9fr; }
.lquick-grid .f { margin: 0; min-width: 0; }
.lquick-grid input { min-height: 38px; }
.lquick-grid .c-select, .lquick-grid .c-select-trigger { width: 100%; }
.lquick .dup-alert { margin: 0; }
.lquick .dup-alert .btn { margin-left: auto; flex-shrink: 0; }
.lquick-foot { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .lquick-grid, .lquick-grid.three { grid-template-columns: 1fr; }
  .lquick-h .muted { display: none; }
  .lquick-foot .btn { flex: 1; justify-content: center; }
}
