:root {
  color-scheme: light dark;
  --canvas: #f2f5f8;
  --paper: #fff;
  --ink: #1b2c3a;
  --muted: #546a7a;
  --line: #dce5eb;
  --soft: #edf3f7;
  --accent: #1979a7;
  --blue: #1985ba;
  --selection: #e2f2fb;
  --hover: #f3f8fb;
  --green: #20775c;
  --amber: #986015;
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: clamp(230px, 20vw, 295px) minmax(0, 1fr);
  grid-template-areas: "folders content";
}
.app-layout > .rail { grid-area: folders; }
.app-layout > main { grid-area: content; }
h1, h2, p, dl, dd { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, select, input { font: inherit; }
input, select { color: var(--ink); }
a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.rail { height: 100vh; position: sticky; top: 0; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); }
.project { min-height: 82px; display: flex; align-items: center; gap: 12px; color: var(--ink); border-bottom: 1px solid var(--line); padding: 14px 22px; }
.project b:not(.mark) { font-size: 19px; letter-spacing: -.04em; }
.project small { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.project div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.project > .icon { width: 15px; color: var(--muted); }
.project-directory { width: min(570px, calc(100% - 28px)); margin: 34px auto; }
.project-directory h1 { margin-bottom: 18px; }
.project-choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 11px 16px; color: var(--ink); }
.project-choice + .project-choice { border-top: 1px solid var(--line); }
.project-choice:hover { background: var(--hover); }
.project-choice span { flex: 1; overflow-wrap: anywhere; }
.project-choice .icon { width: 17px; color: var(--accent); }
.new-project { border-radius: 9px; background: var(--paper); padding: 14px 16px; margin-top: 14px; }
.new-project summary { color: var(--accent); font-weight: 650; }
.new-project form, .new-project form label { display: grid; gap: 8px; }
.new-project form { margin-top: 13px; justify-items: start; }
.new-project form label { width: 100%; }
.new-project input { background: var(--canvas); border: 1px solid var(--line); padding: 8px; border-radius: 7px; }
.nav-item .protected-label { color: var(--accent); display: block; }
.tag.protected-label { color: var(--accent); }
.settings-link { margin-left: auto; padding: 8px; font-size: 13px; white-space: nowrap; }
.settings-link:not([hidden]) + .access-link { margin-left: 0; }
.mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--blue); color: #fff; font: 700 25px Georgia,serif; }
nav { padding: 16px 12px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 9px 13px; font-size: 14px; color: var(--ink); border-radius: 8px; }
.nav-item > span { overflow-wrap: anywhere; }
.nav-item .icon { color: var(--muted); }
.nav-item small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--selection); font-weight: 650; color: var(--accent); }
.nav-item.active .icon, .nav-item.active small { color: var(--accent); }
.nav-caption { font-size: 12px; font-weight: 650; color: var(--muted); margin: 24px 13px 7px; }
main { min-width: 0; }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 3vw, 44px); background: var(--paper); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.crumbs a { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { color: var(--accent); }
.crumbs .icon { width: 13px; color: var(--muted); }
.crumbs span { font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.mobile-nav { display: none; }
.workspace { max-width: 1490px; margin: 0 auto; padding: 29px clamp(18px, 3vw, 44px) 50px; }
h1 { font-size: clamp(27px, 2.5vw, 38px); letter-spacing: -.045em; line-height: 1.2; font-weight: 650; }
.source { color: var(--muted); font-size: 13px; margin-top: 6px; }
.overview { display: grid; margin-bottom: 24px; }
.overview-title { margin-bottom: 16px; }
.totals { display: flex; padding: 15px 0; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--paper); }
.stat { display: grid; grid-template-columns: auto minmax(0,1fr); column-gap: 15px; align-content: center; width: 50%; position: relative; padding: 0 clamp(16px,2.1vw,32px); }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-icon { grid-row: 1/4; align-self: center; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--selection); color: var(--accent); }
.stat-icon .icon { width: 23px; height: 23px; }
.stat dt { font-size: 13px; color: var(--muted); font-weight: 550; }
.stat dd { font-size: clamp(28px,2.5vw,36px); font-weight: 650; line-height: 1.18; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat .unavailable { font-size: 22px; }
.health-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); padding: 5px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: var(--paper); }
.health-counts a { display: grid; align-content: start; gap: 4px; padding: 9px 10px; border-radius: 7px; color: var(--muted); font-size: 12px; }
.health-counts a[aria-current] { background: var(--selection); color: var(--accent); }
.health-counts a:hover { background: var(--hover); }
.health-counts strong { color: var(--ink); font: 650 19px/1.05 system-ui; font-variant-numeric: tabular-nums; }
.health-counts [data-health="ready"] strong { color: var(--accent); }
.stat-note { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; line-height: 1.45; }
.register, .profile { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--paper); }
.register-title { display: flex; align-items: center; gap: 9px; padding: 21px 23px 14px; }
h2 { font-size: 21px; letter-spacing: -.035em; font-weight: 650; line-height: 1.25; }
.result-count { font-size: 12px; font-weight: 650; color: var(--accent); background: var(--selection); border-radius: 6px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
.filters { padding: 0 23px 17px; }
.search-bar, .filter-footer, .filter-chips { display: flex; align-items: center; gap: 9px; }
.search { display: flex; align-items: center; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px 0 0; background: var(--canvas); flex: 1; }
.search .search-submit { display: grid; place-items: center; width: 38px; height: 100%; padding: 0; background: transparent; }
.search .icon { color: var(--muted); width: 16px; height: 16px; }
.search:focus-within { border-color: var(--accent); }
.search input { min-width: 0; width: 100%; border: 0; background: transparent; height: 100%; outline-offset: -2px; font-size: 13px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.search-bar .filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 42px; height: 42px; color: var(--accent); background: transparent; padding-inline: 9px; }
.search-bar .filter-toggle:is(:hover,[aria-expanded=true]) { background: var(--selection); }
.filter-toggle .icon { width: 17px; height: 17px; }
.filter-count { min-width: 19px; padding-inline: 4px; border-radius: 12px; background: var(--paper); text-align: center; }
.catalog-sort { display: flex; flex-wrap: wrap; gap: 4px 8px; min-width: 0; margin: 0 0 14px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--line); }
.catalog-sort legend { margin-bottom: 6px; padding: 0; font-weight: 600; font-size: 14px; }
.catalog-sort label { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 2px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.catalog-sort label:has(:checked) { color: var(--accent); background: var(--selection); }
.catalog-sort input { margin: 0; accent-color: var(--accent); }
.filter-panel { margin-top: 12px; padding: 15px; background: var(--canvas); border: 1px solid var(--line); border-radius: 9px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 162px), 1fr)); gap: 10px 13px; }
.filter-grid label, .bulk-config label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 13px; }
.filter-grid select, .bulk-config select, .bulk-config textarea { width: 100%; min-height: 39px; padding: 6px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font: inherit; }
.filter-footer { justify-content: flex-end; margin-top: 13px; flex-wrap: wrap; }
.filter-chips { margin-top: 10px; flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; max-width: 100%; border-radius: 6px; color: var(--accent); background: var(--selection); font-size: 12px; overflow-wrap: anywhere; }
.filter-chip:hover { background: var(--soft); }
.filter-chip .icon { width: 12px; height: 12px; }
button { border: 0; border-radius: 7px; height: 37px; padding: 0 17px; background: var(--accent); color: #fff; cursor:pointer; font-size: 13px; font-weight: 600; }
button:hover { filter: brightness(.92); }
.reset, .back { font-size: 13px; }
.reset:hover, .back:hover, .notice a:hover { text-decoration: underline; }
.register-head, .account { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(106px, 1fr) minmax(80px,.83fr) minmax(96px,.78fr) 14px; column-gap: 14px; align-items: center; padding-left: 23px; padding-right: 20px; }
.register-head { color: var(--muted); background: var(--hover); border-block: 1px solid var(--line); min-height: 33px; font-weight: 600; font-size: 11px; }
.account { min-height: 67px; padding-block: 10px; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.account:last-child { border: 0; }
.account:hover { background: var(--hover); }
.account:focus-visible { outline-offset: -2px; }
.identity { display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar { display: grid; place-items: center; flex: none; width: 37px; height: 37px; border-radius: 50%; color: #206f9b; background: #d8edf8; font-size: 13px; font-weight: 700; }
.account:nth-child(4n + 2) .avatar { color:#367266;background:#dcf0e9; }
.account:nth-child(4n + 3) .avatar { color:#7b5f9a;background:#eee7f5; }
.account:nth-child(4n) .avatar { color:#8b6134;background:#faecd9; }
.names { min-width:0; }
.names strong { font-weight: 650; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.names .tags { margin-top: 2px; }
.tag { font-size: 11px; color: var(--muted); background: var(--soft); border-radius: 4px; padding: 1px 5px; }
.connection, .phone { min-width: 0; }
.test-route { display: block; margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.phone { font-variant-numeric: tabular-nums; }
.register-title { flex-wrap: wrap; }
.tools-menu { position: relative; }
.catalog-menu { margin-left: auto; }
.tools-menu > summary { display: grid; place-items: center; height: 40px; width: 40px; list-style: none; border-radius: 50%; color: var(--accent); }
.tools-menu > summary::-webkit-details-marker, .telegram-login > summary::-webkit-details-marker { display: none; }
.tools-menu > summary .icon { stroke-width: 3.5; }
.tools-menu[open] > summary, .tools-menu > summary:hover { background: var(--selection); }
.tools-list { position: absolute; top: calc(100% + 3px); right: 0; z-index: 4; width: max-content; max-width: min(250px, 80vw); padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 5px 22px #11263724; }
.tools-list :is(button,a) { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 6px 12px; border-radius: 6px; color: var(--ink); background: transparent; font-size: 14px; font-weight: 500; text-align: left; }
.tools-list :is(button,a):hover { background: var(--hover); }
.tools-list :is(button,a) { gap: 10px; }
.tools-list .icon { color: var(--muted); }
.account-create { max-width: 530px; padding: 20px; }
.account-create h1 { font-size: 24px; }
.account-create form { display: grid; gap: 12px; margin-top: 16px; justify-items: start; }
.account-create label { display: grid; gap: 4px; width: 100%; }
.account-create input, .account-create select { width: 100%; padding: 8px 10px; color: var(--ink); background: var(--canvas); border: 1px solid var(--line); border-radius: 7px; }
.migration-checks { margin: 12px 0 18px; }
.migration-checks div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.migration-checks dd { flex: none; font-variant-numeric: tabular-nums; }
.pending-routes { margin-block: 20px; }
.pending-routes h2 { font-size: 17px; }
.pending-list { padding: 0; margin: 0; list-style: none; }
.pending-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 9px; border-bottom: 1px solid var(--line); }
.pending-list li > div { min-width: 0; overflow-wrap: anywhere; }
.pending-list small { display: block; color: var(--muted); margin-top: 3px; }
.account-create .pending-list form { margin: 0; }
.pending-pages { display: flex; align-items: center; justify-content: center; gap: 16px; margin-block: 12px; }
.migration-pending { padding-left: 19px; }
.pilot-result { margin-top: 10px; font-weight: 600; }
.pilot-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.pilot-write summary { color: var(--accent); }
.pilot-write[open] .pilot-actions { margin-top: 8px; }
.pilot-preview { padding: 8px 0; color: var(--muted); overflow-wrap: anywhere; }
.pilot-card { padding: 14px; margin-bottom: 15px; }
.pilot-card > summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.pilot-card > h2 { display: none; }
.pilot-form { display: grid; gap: 10px; margin-top: 10px; }
.pilot-form label { display: grid; gap: 5px; }
.pilot-form select, .pilot-form textarea { min-width: 0; max-width: 100%; padding: 7px; background: var(--canvas); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; }
.pilot-stories label { margin-block: 9px; }
.pilot-story-list small { display: block; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.status-summary { min-width: 0; }
.status-summary small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.status-summary .premium-status { color: var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.good { color: var(--green); }
.attention { color: var(--amber); }
.neutral { color: var(--muted); }
.account > .icon { width: 13px; height: 13px; color: var(--muted); }
.notice { padding: 8px 23px 25px; color: var(--muted); }
.utya, .access button.utya { display: block; width: min(100%, var(--utya-size, clamp(128px, 24vw, 152px))); height: auto; aspect-ratio: 1; margin: 0 auto; padding: 0; border: 0; background: transparent; border-radius: 9px; cursor: pointer; }
.utya:disabled { opacity: 1; cursor: default; }
.utya video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.empty-folder { text-align: center; padding-block: 24px 30px; }
.empty-folder .utya { --utya-size: clamp(160px, 36vw, 208px); margin-bottom: 12px; }
.back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 17px; }
.back .icon { width: 15px; height: 15px; }
.folder-heading h1 { margin-bottom: 22px; }
.profile-title { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.profile-title .avatar { width: 52px; height: 52px; font-size:18px; }
.profile { max-width: 760px; }
.profile h2 { padding: 20px 24px; font-size: 19px; border-bottom: 1px solid var(--line); }
.profile dl { padding: 0 23px; }
.profile dl div { display: flex; align-items:center; justify-content: space-between; gap: 22px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.profile dl div:last-child { border:0; }
.profile dt { color:var(--muted); }
.profile dd { text-align:right; overflow-wrap:anywhere; }
@media (min-width: 861px) and (max-width: 1100px) {
  .app-layout { grid-template-columns: 206px minmax(0,1fr); }
  .workspace { padding-inline:18px; }
  .register-head, .account { padding-inline:15px; column-gap:8px; grid-template-columns:minmax(115px,1.1fr) minmax(100px,1fr) minmax(72px,.7fr) minmax(76px,.75fr) 12px; }
}
@media (max-width: 860px) {
  .app-layout { display: block; }
  .rail { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { display: flex; align-items:center; gap:7px; list-style:none; cursor:pointer; color:var(--accent); font-weight:600; padding:8px; }
  .mobile-nav summary::-webkit-details-marker { display:none; }
  .mobile-nav summary .icon:last-child { width:13px; }
  .mobile-nav[open] { z-index:2; }
  .mobile-nav nav { position:absolute; right:12px; top:55px; width:min(270px,calc(100vw - 24px)); max-height:70vh; overflow:auto; background:var(--paper); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 30px #1424361c; }
}
@media (max-width: 650px) {
  .workspace { padding: 20px 12px 32px; }
  .topbar { height:52px; padding:0 12px 0 16px; }
  .totals { padding:14px 0; }
  .health-counts { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .stat { column-gap:8px; padding:0 12px; }
  .stat-icon { width:28px; height:28px; border-radius:7px; }
  .stat-icon .icon { width:17px; height:17px; }
  .stat dt { font-size:12px; }
  .stat dd { font-size:26px; }
  .stat .unavailable { font-size:16px; }
  .stat-note { font-size:10px; }
  .register-title { padding:16px 14px 12px; }
  h2 { font-size:19px; }
  .filters { padding: 0 14px 13px; }
  .search-bar { gap: 4px; }
  .filter-caption { display: none; }
  .catalog-sort { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-panel { padding: 11px; }
  .filter-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 135px), 1fr)); }
  .register-head { display:none; }
  .entries { border-top:1px solid var(--line); }
  .account { grid-template-columns: minmax(0,1fr) minmax(82px,auto); gap:3px 6px; padding:11px 14px; }
  .identity { grid-column:1; grid-row:1; }
  .connection { grid-column:1/-1; grid-row:2; padding-left:47px; color:var(--muted); font-size:12px; }
  .phone { grid-column:1/-1; grid-row:3; padding-left:47px; color:var(--muted); font-size:12px; }
  .status-summary { grid-column:2; grid-row:1; justify-self:end; text-align:right; max-width:125px; }
  .account > .icon { display:none; }
  .profile dl { padding:0 14px; }
  .profile h2 { padding-inline:14px; }
  .profile dl div { gap:14px; font-size:14px; }
}
@media (prefers-color-scheme: dark) {
  :root { --canvas:#101b24; --paper:#192731; --ink:#eff6fa; --muted:#a9bdca; --line:#33434f; --soft:#293a47; --accent:#77c8f4; --blue:#2378a4; --selection:#233e50; --hover:#20313d; --green:#8ed7b6; --amber:#eac17c; }
  button { color:#102534; }
}


@font-face {
  font-family: "Workspace Flags";
  src: url("/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}
[hidden] { display: none !important; }
.access-link { margin-left: auto; font-size: 13px; padding: 8px 12px; }
.guest-access { border-radius: 7px; background: var(--selection); font-weight: 600; white-space: nowrap; }
.register { overflow: clip; }
.server-login { display: grid; gap: 14px; justify-items: start; max-width: 38rem; padding: clamp(16px, 3vw, 28px); }
.server-login > :is(h1,p,form) { margin: 0; }
.server-login-qr { max-width: 100%; height: auto; justify-self: center; border-radius: 8px; }
.account-entry { position: relative; display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.account-entry:last-child { border-bottom: 0; }
.account-entry .account { flex: 1; min-width: 0; border: 0; }
.account-entry:has(input:checked) { background: var(--selection); }
.account-entry:nth-child(4n + 2) .avatar { color:#367266; background:#dcf0e9; }
.account-entry:nth-child(4n + 3) .avatar { color:#7b5f9a; background:#eee7f5; }
.account-entry:nth-child(4n) .avatar { color:#8b6134; background:#faecd9; }
.avatar-stack { position: relative; flex: none; display: inline-grid; }
.avatar-stack .avatar { position: relative; overflow: hidden; }
.avatar-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row-check { display: none; }
.selecting .row-check { display: block; position: absolute; inset: 0; z-index: 1; }
.row-check input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.account-entry:has(.row-check input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.selection-mark { position: absolute; width: 16px; height: 16px; bottom: -1px; right: -2px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--muted); box-shadow: 0 0 0 2px var(--paper); background: var(--paper); opacity: 0; transform: scale(.65); }
.selecting .selection-mark { opacity: 1; transform: scale(1); }
.account-entry:has(input:checked) .selection-mark { background: var(--blue); border-color: var(--blue); }
.selection-mark::after { content: ""; width: 7px; height: 4px; border: solid white; border-width: 0 0 2px 2px; opacity: 0; transform: translateY(-1px) rotate(-45deg); }
.account-entry:has(input:checked) .selection-mark::after { opacity: 1; }
.account-entry:has(input:checked) .avatar { transform: scale(.9); }
.can-select .account { -webkit-touch-callout: none; }
.row-menu { position: fixed; margin: 0; inset: auto; min-width: 190px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); box-shadow: 0 5px 22px #11263724; }
.row-menu button, .row-menu a { display: flex; align-items: center; width: 100%; min-height: 37px; padding-inline: 12px; border-radius: 5px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; }
.row-menu :is(button,a):hover { background: var(--hover); }
.selecting .account-entry:hover { background: var(--hover); }
.selecting .account-entry:has(input:checked):hover { background: var(--selection); }
.secondary, .select-toggle, .bulk-line button, .copy-field, .profile-edit {
  color: var(--accent); background: var(--selection);
}
.select-toggle { margin-left: auto; }
.bulk-tools, .bulk-result { background: var(--hover); padding: 15px 22px; border-block-start: 1px solid var(--line); }
.bulk-line, .form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-tools { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: var(--paper); }
.bulk-line strong { margin-right: 6px; }
.bulk-line button { font-size: 12px; padding-inline: 12px; }
.bulk-line .bulk-show-actions { margin-left: auto; color: var(--paper); background: var(--accent); }
.edit-profile label { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--muted); }
.edit-profile input, .edit-profile textarea {
  width: 100%; min-height: 37px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); color: var(--ink); padding: 7px 10px; font: inherit;
}
button:disabled { cursor: default; opacity: .55; }
.bulk-result details { margin-block: 8px; }
summary { cursor: pointer; }
.outcome-list { padding: 0; list-style: none; max-height: 230px; overflow-y: auto; }
.outcome-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.outcome-list small, .local-notice, .private-message, .link-preview { color: var(--muted); font-size: 13px; }

.profile-drawer, .bulk-confirm { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.profile-drawer {
  margin: 0 0 0 auto; padding: 18px 22px 32px;
  width: clamp(355px, 31vw, 470px); max-width: 100%; height: 100dvh; max-height: 100dvh; border-width: 0 0 0 1px;
}
.profile-drawer::backdrop { background: rgb(8 22 32 / 20%); }
.drawer-close { display: block; margin-left: auto; }
.account-pane { max-width: 740px; }
.profile-head { display: grid; justify-items: center; padding: 16px 0 24px; gap: 12px; text-align: center; }
.profile-name { font-size: 24px; overflow-wrap: anywhere; }
.profile-avatar { position: relative; overflow: hidden; width: 78px; height: 78px; font-size: 25px; }
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-edit { height: 32px; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.profile-edit, .pilot-actions button:has(.icon), .settings-tabs a:has(.icon) { display: inline-flex; align-items: center; gap: 7px; }
.profile-edit .icon, .pilot-actions .icon, .settings-tabs .icon { width: 18px; height: 18px; }
.drawer-close.secondary { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.contact-list .copy-field { min-width: 38px; min-height: 36px; padding-inline: 8px; }
.copy-field .icon { width: 18px; height: 18px; }
.telegram-login { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; margin: 0 0 12px; }
.telegram-login > summary { display: flex; gap: 10px; align-items: center; padding: 12px 15px; color: var(--accent); font-weight: 600; list-style: none; }
.telegram-login > summary .icon:last-child { margin-left: auto; width: 15px; }
.telegram-login[open] > summary .icon:last-child { transform: rotate(180deg); }
.telegram-login-body { padding: 0 15px 14px; border-top: 1px solid var(--line); }
.telegram-login summary, .telegram-login .source { text-align: left; }
.login-2fa { display: flex; gap: 8px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.login-2fa strong { color: var(--ink); }
.login-progress:not(:empty) { padding: 9px 12px; border-inline-start: 2px solid var(--accent); background: var(--selection); font-size: 14px; }
.login-progress:empty { display: none; }
.profile-web { display: inline-flex; align-items: center; min-height: 32px; padding-inline: 12px; border-radius: 7px; color: var(--accent); background: var(--selection); font-size: 13px; font-weight: 600; }
.profile-web:hover { background: var(--soft); }
.private-fields { background: var(--paper); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; }
.private-message, .private-fields > .local-notice { padding: 13px 15px; }
.contact-list { padding: 3px 16px; }
.contact-list > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list > div:last-child { border-bottom: 0; }
.contact-list dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.contact-list dd { display: flex; gap: 6px; justify-content: space-between; align-items: start; font-size: 15px; overflow-wrap: anywhere; white-space: pre-wrap; }
.country-flag { font-family: "Workspace Flags", "Segoe UI Emoji", sans-serif; margin-right: 7px; }
.copy-field { padding: 0 3px; height: 24px; background: transparent; font-size: 12px; flex-shrink: 0; }
.account-pane .profile h2 { font-size: 16px; padding: 14px 16px; }
.account-pane .profile dl { padding-inline: 16px; font-size: 14px; }
.account-pane .profile dl div { padding-block: 11px; }
.rehearsal-connections dd > * { display: block; }
.rehearsal-connections dd small { color: var(--muted); }
.edit-profile { display: grid; gap: 12px; padding: 16px; }
.edit-profile h2 { font-size: 17px; }
.edit-profile input[type="file"] { font-size: 12px; }
.edit-profile input::file-selector-button { font: inherit; }
.edit-profile textarea { resize: vertical; }
.link-preview { margin-top: -8px; }
.form-actions { justify-content: end; }
.form-message { font-size: 13px; color: var(--ink); }
.bulk-confirm { width: min(430px,calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 20px; border-radius: 13px; }
.bulk-confirm > .local-notice { margin-top: 6px; }
.bulk-confirm:has(.bulk-choices) { width: min(705px,calc(100% - 28px)); }
.bulk-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 15px; margin: 14px 0; }
.action-group { display: grid; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.action-group h3 { margin: 0; padding: 9px 10px; color: var(--muted); background: var(--canvas); font-size: 13px; }
.action-choice { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: auto; min-height: 44px; padding: 8px 10px; background: none; color: var(--ink); text-align: left; border-radius: 0; }
.action-choice:focus-visible { outline-offset: -2px; }
.action-choice + .action-choice { border-top: 1px solid var(--line); }
.action-choice:hover { background: var(--hover); filter: none; }
.action-choice .icon { width: 14px; height: 14px; color: var(--muted); }
.action-choice > .icon:first-child { width: 21px; height: 21px; }
.action-choice > span { flex: 1; }
.action-choice[data-action="remove_from_catalog"] > .icon:first-child { color: inherit; }
.action-choice[data-action="remove_from_catalog"] { color: var(--danger-ink, #a5414b); }
.legacy-actions { border-top: 1px solid var(--line); padding: 10px; color: var(--muted); font-size: 13px; }
.legacy-actions summary { cursor: pointer; }
.legacy-actions ul { padding-inline-start: 18px; margin: 8px 0 0; }
.legacy-actions li + li { margin-top: 5px; }
.bulk-config { display: grid; gap: 13px; }
.bulk-config textarea { resize: vertical; }
.bulk-config .name-split { display: flex; align-items: center; }
.bulk-photos { display: grid; gap: 9px; }
.bulk-photos input[type=file] { max-width: 100%; }
.bulk-photo-list { display: grid; max-height: 260px; overflow-y: auto; padding: 3px; }
.bulk-photo-row { display: grid; grid-template-columns: 36px minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 7px 3px; border-bottom: 1px solid var(--line); }
.bulk-photo-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.bulk-photo-row div { grid-column: 2; min-width: 0; }
.bulk-photo-row strong, .bulk-photo-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-photo-row small { color: var(--muted); font-size: 11px; }
.bulk-photo-row button { height: 29px; padding-inline: 8px; font-size: 12px; }
.profile-gallery { padding: 9px 16px 13px; border-top: 1px solid var(--line); }
.profile-previous-photos { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.profile-previous-photos img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; }
.bulk-config .form-message:empty { display: none; }
.bulk-targets { max-height: 110px; overflow: auto; margin: 5px 0 0; padding-left: 25px; font-size: 12px; color: var(--muted); }
.bio-mode { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 0; padding: 0; border: 0; }
.bio-mode legend { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.bio-mode label { display: inline-flex; align-items: center; }
.bulk-confirm::backdrop { background: rgb(7 19 27 / 50%); }
.danger { background: #a5414b; color: white; }
.account-security { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.account-security .icon { width: 17px; height: 17px; color: var(--accent); }
.two-factor-status { margin-left: auto; text-align: right; color: var(--muted); }
@media (prefers-color-scheme: dark) { :root { --danger-ink: #f19da6; } }
@media (max-width: 650px) {
  .bulk-choices { grid-template-columns: 1fr; gap: 8px; }
  .bulk-photo-row { grid-template-columns: 28px minmax(0,1fr) auto auto; gap: 5px; }
  .bulk-photo-row img { width: 28px; height: 28px; }
  .profile-drawer { width: 100%; border: 0; padding: 12px 16px 28px; }
  .select-toggle { font-size: 12px; padding-inline: 10px; }
  .bulk-tools, .bulk-result { padding: 12px 14px; }
  .bulk-line { gap: 5px; }
  .bulk-line button { padding-inline: 8px; }
  .access-link { padding-inline: 6px; }
}

@media (max-width: 650px) {
  .bulk-line { gap: 2px 8px; }
  .bulk-line strong { flex: 1 0 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
  .account, .account-entry, .nav-item, button, .search {
    transition: background-color 135ms ease-out, color 135ms ease-out, border-color 135ms ease-out, opacity 135ms ease-out;
  }
  .selection-mark, .selection-mark::after, .avatar-stack .avatar {
    transition: transform 150ms ease-out, opacity 130ms ease-out, background-color 140ms ease-out, border-color 140ms ease-out;
  }
  .bulk-tools:not([hidden]), .filter-panel:not([hidden]), .form-message:not(:empty), .bulk-result:not([hidden]),
  .contact-list, .edit-profile, .mobile-nav[open] nav, .row-menu:popover-open {
    animation: workspace-reveal 150ms ease-out;
  }
  .profile-drawer[open] { animation: drawer-enter 185ms cubic-bezier(.2,.7,.2,1); }
  .profile-drawer[open].leaving { animation: drawer-exit 145ms ease-in forwards; }
  .bulk-confirm[open] { animation: workspace-reveal 150ms ease-out; }
  .bulk-confirm[open].leaving { animation: workspace-hide 120ms ease-in forwards; }
  .profile-drawer[open]::backdrop, .bulk-confirm[open]::backdrop { animation: backdrop-reveal 155ms ease-out; }
  dialog.leaving::backdrop { opacity: 0; transition: opacity 120ms; }
}
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .bulk-tools, .filter-panel {
      interpolate-size: allow-keywords;
      height: auto;
      overflow: clip;
      transition: height 170ms ease, padding-block 170ms ease, margin-block 170ms ease, opacity 135ms ease, display 170ms allow-discrete;
    }
    :is(.bulk-tools,.filter-panel)[hidden] { height: 0; padding-block: 0; margin-block: 0; opacity: 0; }
    @starting-style {
      :is(.bulk-tools,.filter-panel):not([hidden]) { height: 0; padding-block: 0; margin-block: 0; opacity: 0; }
    }
  }
}
@keyframes workspace-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes workspace-hide { to { opacity: 0; transform: translateY(4px); } }
@keyframes drawer-enter { from { opacity: .4; transform: translateX(48px); } to { opacity: 1; transform: translateX(0); } }
@keyframes drawer-exit { to { opacity: 0; transform: translateX(48px); } }
@keyframes backdrop-reveal { from { opacity: 0; } to { opacity: 1; } }

.story-viewer img, .story-viewer video {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;
}
.pilot-story-list form { margin: 6px 0 12px; }

