:root {
  --sidebar: #101112; --sidebar-sel: #1E1F23; --sidebar-muted: #A5A7AC;
  --bg: #F4F5F6; --surface: #FFFFFF;
  --text: #202124; --muted: #6E7279;
  --red: #B91C1C; --red-hover: #9F1717; --red-pale: #FAEDEF;
  --control: #ECEEF0; --ring-open: #E4E6EA; --charcoal: #2A2B2F;
  --line: #EDEEF0;
  --r-panel: 12px; --r-btn: 8px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 13px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 0; border-radius: var(--r-btn); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: #F8F8F9; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); }
.btn.neutral { background: var(--control); }
.btn.neutral:hover { background: #E2E4E7; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--control); }
.btn.danger { background: transparent; color: var(--red); }
.btn.danger:hover { background: var(--red-pale); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--red); font-weight: 600; cursor: pointer; font-size: inherit; text-align: left; }
.link:hover { text-decoration: underline; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: var(--r-btn); background: var(--surface); font-size: 13px; }
.panel .input, .panel .select, .panel .textarea, .modal .input, .modal .select, .modal .textarea, .drawer .input, .drawer .select, .drawer .textarea { background: var(--bg); }
.textarea { height: auto; min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7279' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input::placeholder, .textarea::placeholder { color: #8D9097; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--red); margin: 0; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--sidebar) 232px, var(--bg) 232px); }
.sidebar { background: var(--sidebar); color: #fff; display: flex; flex-direction: column; padding: 28px 14px 18px; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 12px 30px; text-decoration: none; }
.brand img { width: 163px; height: auto; aspect-ratio: 512 / 178; display: block; }
.brand .bs { color: var(--red); font-size: 16px; font-weight: 800; letter-spacing: 6px; padding-left: 6px; line-height: 1; }
.nav-label { font-size: 10px; letter-spacing: 1.2px; color: #7E8187; text-transform: uppercase; padding: 0 1px 6px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 13px; height: 46px; padding: 0 12px; border-radius: var(--r-btn); color: var(--sidebar-muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; }
.nav a:hover { color: #fff; background: #18191C; }
.nav a[aria-current="page"] { background: var(--sidebar-sel); color: #fff; font-weight: 600; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side-bottom .nav { padding-bottom: 12px; border-bottom: 1px solid #222326; }
.account { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: var(--r-btn); background: none; border: 0; color: #fff; cursor: pointer; text-align: left; width: 100%; }
.account:hover { background: #18191C; }
.avatar { width: 30px; height: 30px; border-radius: 7px; background: #26272B; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.account .who { min-width: 0; flex: 1; }
.account .who b { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who span { display: block; font-size: 10.5px; color: var(--sidebar-muted); }
.acct-menu { position: absolute; left: 14px; right: 14px; bottom: 74px; background: #1A1B1E; border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.acct-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #E6E7E9; padding: 10px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.acct-menu button:hover { background: var(--sidebar-sel); }
.acct-menu .meta { padding: 8px 12px 10px; font-size: 11px; color: var(--sidebar-muted); border-bottom: 1px solid #26272B; margin-bottom: 4px; word-break: break-all; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: 0 36px; gap: 16px; position: sticky; top: 0; z-index: 30; }
.crumbs { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 500; }
.crumbs .sep { color: #B5B7BC; }
.lockline { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.lockline svg { width: 13px; height: 13px; }
.menu-btn { display: none; width: 42px; height: 42px; border: 0; background: var(--control); border-radius: var(--r-btn); cursor: pointer; place-items: center; }
.content { padding: 30px 36px 24px; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.6px; line-height: 1.2; margin: 0 0 8px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.foot { display: flex; justify-content: space-between; gap: 16px; padding: 18px 36px 24px; font-size: 11px; color: var(--muted); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.error-box { background: var(--red-pale); color: var(--red); border-radius: var(--r-panel); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--r-panel); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 16px; gap: 12px; }
.panel-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }

/* ---------- Pitch decks ---------- */
.decks { display: grid; grid-template-columns: minmax(0, 1fr) 298px; gap: 20px; align-items: start; }
.deck-meta { display: flex; align-items: center; gap: 0; font-size: 11px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; row-gap: 4px; min-height: 18px; }
.deck-meta b { color: var(--text); font-weight: 600; }
.deck-meta > * + *::before { content: ""; display: inline-block; width: 1px; height: 12px; background: #D3D5D9; margin: 0 14px; vertical-align: -2px; }
.deck-meta .push { margin-left: auto; }
.deck-meta .push::before { display: none; }
.cover { position: relative; display: block; width: 100%; border-radius: var(--r-panel); overflow: hidden; background: #0b0c0d; border: 0; padding: 0; cursor: pointer; }
.cover img { display: block; width: 100%; height: auto; }
.cover .hover { position: absolute; inset: auto 16px 16px auto; display: flex; gap: 8px; opacity: 0; transition: opacity .15s; }
.cover:hover .hover, .cover:focus-visible .hover { opacity: 1; }
.cover-wrap { position: relative; }
.deck-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--control); color: var(--text); white-space: nowrap; }
.chip.red { background: var(--red-pale); color: var(--red); }
.chip.dark { background: var(--text); color: #fff; }
.chip.white { background: #fff; color: var(--red); }
.teasers { display: flex; flex-direction: column; gap: 22px; }
.teaser-tile { width: 100%; min-height: 152px; border: 0; border-radius: var(--r-panel); background: var(--control); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 18px; cursor: pointer; text-align: center; }
.teaser-tile:hover { background: #E5E7EA; }
.teaser-tile .plus { width: 34px; height: 34px; border-radius: 50%; background: #D7D9DD; display: grid; place-items: center; margin-bottom: 10px; color: #55585E; font-size: 18px; }
.teaser-tile b { font-size: 13px; font-weight: 600; color: #55585E; }
.teaser-tile span { font-size: 11px; color: var(--muted); }
.teaser-tile.ready { background: var(--surface); align-items: flex-start; text-align: left; justify-content: space-between; cursor: default; }
.file-ico { width: 38px; height: 46px; border-radius: 6px; background: var(--red-pale); color: var(--red); display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.file-row { display: flex; gap: 12px; align-items: center; width: 100%; }
.file-row .nm { font-weight: 600; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.locked { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ---------- Pipeline ---------- */
.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ring-card { background: var(--surface); border-radius: var(--r-panel); padding: 20px 20px; display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lab { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .lab b { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.1; }
.ring .lab span { font-size: 8px; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; margin-top: 4px; font-weight: 600; }
.ring-body { flex: 1; min-width: 0; }
.ring-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.ring-body h3 { margin: 0; font-size: 16px; font-weight: 700; }
.ring-title .link { font-size: 11.5px; }
.inv-new { background: var(--red-pale); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend li b { margin-left: auto; color: var(--text); font-weight: 700; font-size: 13px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.c { background: var(--charcoal); } .dot.s { background: var(--red); } .dot.o { background: #D0D3D8; }
.over { color: var(--red) !important; }
.ring-note { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; color: var(--muted); margin: 14px 0 22px; flex-wrap: wrap; }
.ring-note .link { font-size: 11px; }
.seg { display: inline-flex; background: var(--control); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 34px; min-width: 94px; padding: 0 18px; border: 0; background: none; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--red); color: #fff; }
.pills { display: inline-flex; background: var(--control); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.pills button { height: 36px; padding: 0 18px; border: 0; background: none; border-radius: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; }
.toolbar { display: flex; gap: 14px; align-items: center; margin: 14px 0 16px; flex-wrap: wrap; }
.toolbar .search { flex: 0 1 334px; min-width: 200px; }
.toolbar .spacer { flex: 1; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 20px; background: var(--surface); }
.table td { padding: 16px 20px; vertical-align: middle; border-top: 1px solid var(--line); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #FAFAFB; }
.table tbody tr.hl td { background: var(--red-pale); }
.table tbody tr.hl:hover td { background: #F7E4E7; }
.t-main { font-weight: 600; font-size: 13px; }
.t-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.table-wrap { background: var(--surface); border-radius: var(--r-panel); overflow: hidden; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); flex-wrap: wrap; }
.table-foot b { color: var(--text); font-weight: 600; }
.empty { padding: 48px 20px; text-align: center; }
.empty svg { width: 26px; height: 26px; color: #8D9097; }
.empty h3 { font-size: 15px; font-weight: 600; margin: 10px 0 6px; }
.empty p { margin: 0 0 16px; color: var(--muted); }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-list li { display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.act-list li:first-child { border-top: 0; }
.act-date { font-size: 12px; font-weight: 600; }
.act-body { min-width: 0; }
.act-body p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.act-group { padding: 12px 20px; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; background: #FAFAFB; border-top: 1px solid var(--line); }

/* ---------- Data room ---------- */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0 22px; }
.cat { background: var(--surface); border-radius: var(--r-panel); padding: 18px 18px 20px; border: 0; text-align: left; cursor: pointer; min-height: 116px; display: flex; flex-direction: column; }
.cat svg { width: 18px; height: 18px; color: var(--red); margin-bottom: 14px; }
.cat b { font-size: 14px; font-weight: 600; }
.cat span { font-size: 12px; color: var(--muted); margin-top: 8px; }
.cat:hover { background: #FCFCFC; }
.cat[aria-pressed="true"] { background: var(--red-pale); }
.dr-head { display: flex; gap: 16px; align-items: center; }
.dr-head .search { flex: 0 1 500px; }
.dr-head .spacer { flex: 1; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: 980px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 22px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.people td .chip { margin-right: 4px; }
.setup-box { background: var(--bg); border-radius: var(--r-btn); padding: 12px 14px; display: flex; gap: 10px; align-items: center; margin: 0 22px 18px; }
.setup-box code { flex: 1; font-size: 12px; overflow-wrap: anywhere; }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(16,17,18,.38); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); z-index: 90; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.12); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 14px; }
.drawer-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 24px 24px; display: flex; flex-direction: column; gap: 22px; }
.drawer-foot { display: flex; gap: 10px; justify-content: space-between; padding: 14px 24px; background: #FAFAFB; }
.section-t { font-size: 12px; font-weight: 700; color: var(--text); margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .full { grid-column: 1 / -1; }
.inv-rec { background: var(--bg); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: 1.1fr 1fr 1.1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.inv-rec .input, .inv-rec .select { background: var(--surface); height: 38px; }
.inv-rec .field > label { font-size: 11px; }
.inv-rec .meta { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.icon-btn { width: 38px; height: 38px; border: 0; background: transparent; border-radius: var(--r-btn); cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--control); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-wrap > .scrim { z-index: 0; }
.modal { position: relative; z-index: 1; background: var(--surface); border-radius: 14px; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal.wide { width: min(720px, 100%); }
.modal-head { padding: 22px 24px 8px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h2 { font-size: 18px; margin: 0; font-weight: 700; }
.modal-head p { margin: 6px 0 0; color: var(--muted); }
.modal-body { padding: 12px 24px 8px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dropzone { border-radius: 10px; background: var(--bg); padding: 22px; text-align: center; cursor: pointer; display: block; }
.dropzone.drag { background: var(--red-pale); }
.dropzone b { display: block; font-size: 13px; }
.dropzone span { font-size: 11.5px; color: var(--muted); }
.progress { height: 6px; background: var(--control); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--red); width: 0; transition: width .2s; }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-btn); background: var(--bg); cursor: pointer; }
.radio-list label input { margin-top: 2px; accent-color: var(--red); }
.radio-list small { display: block; color: var(--muted); font-size: 11.5px; }
.people-pick { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.people-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; background: var(--bg); }
.people-pick label input { accent-color: var(--red); }
.viewer { position: fixed; inset: 0; z-index: 110; background: rgba(16,17,18,.86); display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; color: #fff; }
.viewer-bar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer iframe, .viewer img { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer .img-box { flex: 1; overflow: auto; display: grid; place-items: center; }
.viewer .img-box img { max-width: 100%; max-height: 100%; width: auto; background: transparent; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.toast.err { background: var(--red); }
.form-err { color: var(--red); font-size: 12px; min-height: 0; margin: 0; }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--sidebar); }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 26px; }
.auth-brand img { width: 220px; height: auto; aspect-ratio: 512 / 178; }
.auth-brand .bs { color: var(--red); font-size: 22px; font-weight: 800; letter-spacing: 8px; padding-left: 8px; line-height: 1; }
.auth-card h1 { color: #fff; font-size: 20px; font-weight: 600; text-align: center; margin: 0 0 4px; }
.auth-card p.lead { color: var(--sidebar-muted); text-align: center; margin: -8px 0 6px; }
.auth-card .field label { color: var(--sidebar-muted); }
.auth-card .input { background: var(--sidebar-sel); color: #fff; }
.auth-card .btn.primary { width: 100%; margin-top: 6px; }
.auth-err { color: #F28B8B; min-height: 18px; margin: 0; text-align: center; font-size: 12.5px; }
.auth-foot { color: #6C6F75; font-size: 11px; text-align: center; margin-top: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .decks { grid-template-columns: 1fr; }
  .teasers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .rings { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.3); }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .topbar .lockline span { display: none; }
  .content { padding: 22px 16px 16px; }
  .foot { padding: 14px 16px 20px; flex-direction: column; gap: 4px; }
  .page-head { flex-direction: column; gap: 14px; }
  .page-head h1 { font-size: 28px; }
  .page-head .btn { width: 100%; }
  .teasers { grid-template-columns: 1fr; }
  .toolbar .search, .dr-head .search { flex: 1 1 100%; }
  .dr-head { flex-wrap: wrap; }
  .dr-head .btn { width: 100%; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border-top: 1px solid var(--line); padding: 14px 16px; }
  .table.stack tbody tr:first-child { border-top: 0; }
  .table.stack td { border: 0; padding: 4px 0; background: transparent !important; }
  .table.stack tr.hl { background: var(--red-pale); }
  .table.stack td[data-l]::before { content: attr(data-l); display: block; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 6px 0 2px; }
  .table.stack td.first::before { display: none; }
  .row-actions { justify-content: flex-start; }
  .act-list li { grid-template-columns: 1fr; gap: 6px; }
  .inv-rec { grid-template-columns: 1fr 1fr; }
  .form-grid, .grid2 { grid-template-columns: 1fr; }
  .ring-card { padding: 18px; gap: 16px; }
  .ring { width: 104px; height: 104px; }
  .ring .lab b { font-size: 19px; }
}
@media (max-width: 520px) {
  .cats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat { min-height: 100px; padding: 14px; }
  .seg { width: 100%; } .seg button { flex: 1; min-width: 0; }
  .pills { width: 100%; flex-wrap: nowrap; overflow-x: auto; } .pills button { flex: 1 0 auto; padding: 0 12px; white-space: nowrap; }
  .deck-meta { column-gap: 14px; } .deck-meta > * + *::before, .deck-meta .push::before { display: none; }
  .deck-meta .push { margin-left: 0; }
}
@media (min-width: 861px) {
  .contacts-t th:nth-child(1) { width: 24%; } .contacts-t th:nth-child(2) { width: 12%; }
  .contacts-t th:nth-child(3) { width: 13%; } .contacts-t th:nth-child(4) { width: 20%; }
  .contacts-t td:nth-child(3) { white-space: nowrap; }
}
