@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f6f7f9;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f6;
  --border: #e5e7ec;
  --border-strong: #d4d8e0;
  --text: #11141a;
  --text-2: #4b5363;
  --text-3: #8a91a0;
  --accent: #5b5bf0;
  --accent-2: #7c6cff;
  --accent-soft: #ececfe;
  --accent-text: #4343d6;
  --on-accent: #ffffff;
  --grad: linear-gradient(135deg, #7c6cff 0%, #e255c4 100%);
  --shadow-sm: 0 1px 2px rgba(16, 20, 30, .05);
  --shadow: 0 1px 2px rgba(16, 20, 30, .04), 0 4px 16px rgba(16, 20, 30, .06);
  --shadow-lg: 0 10px 40px rgba(16, 20, 30, .16), 0 2px 8px rgba(16, 20, 30, .06);
  --overlay: rgba(12, 14, 20, .45);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --blue: #2563eb;   --blue-bg: #e8f0fe;
  --amber: #b45309;  --amber-bg: #fdf3e2;
  --violet: #7c3aed; --violet-bg: #f1ebfe;
  --red: #dc2626;    --red-bg: #fdecec;
  --green: #059669;  --green-bg: #e3f6ee;
  --gray: #6b7280;   --gray-bg: #eff1f4;
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #0e1014;
  --bg-2: #13161c;
  --surface: #161920;
  --surface-2: #1b1f27;
  --surface-3: #222631;
  --border: #262a35;
  --border-strong: #333846;
  --text: #eceef3;
  --text-2: #a9b0bf;
  --text-3: #6f7686;
  --accent: #7c7cff;
  --accent-2: #9a8cff;
  --accent-soft: #23234a;
  --accent-text: #a5a5ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .3);
  --overlay: rgba(0, 0, 0, .6);

  --blue: #6ea2ff;   --blue-bg: #18253f;
  --amber: #f5b454;  --amber-bg: #33260f;
  --violet: #b394ff; --violet-bg: #29203f;
  --red: #ff7a7a;    --red-bg: #3a1a1d;
  --green: #4fd3a0;  --green-bg: #11302a;
  --gray: #9aa1b0;   --gray-bg: #23262f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.ic { flex: none; display: block; }
.muted { color: var(--text-3); }
.sm { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }

/* ── layout ── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 14px rgba(124, 108, 255, .35); }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.me-card:hover { background: var(--surface-3); }
.me-name { font-weight: 600; font-size: 13px; line-height: 1.2; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 17px; font-weight: 650; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { padding: 24px 28px 48px; max-width: 1360px; width: 100%; margin: 0 auto; }
.btn.menu-btn { display: none; }

/* ── controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { filter: brightness(.95); }
.btn.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }

.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input, .select { height: 38px; }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.select { appearance: none; padding-right: 32px; cursor: pointer;
  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='%238a91a0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.search { position: relative; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search .input { padding-left: 34px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--radius-sm); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 550; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ── cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-title { font-size: 13px; font-weight: 650; color: var(--text-2); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

/* ── pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.t-blue { color: var(--blue); background: var(--blue-bg); }
.t-amber { color: var(--amber); background: var(--amber-bg); }
.t-violet { color: var(--violet); background: var(--violet-bg); }
.t-red { color: var(--red); background: var(--red-bg); }
.t-green { color: var(--green); background: var(--green-bg); }
.t-gray { color: var(--gray); background: var(--gray-bg); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; max-width: 100%; }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.urgent { color: var(--red); display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 12px; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }

/* ── tabs ── */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; border: 0; background: none; padding: 10px 12px; font-weight: 550; color: var(--text-2); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .cnt { font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); }
.tab.on .cnt { background: var(--accent-soft); color: var(--accent-text); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 160px; }

/* ── request list ── */
.rlist { display: flex; flex-direction: column; gap: 10px; }
.rcard {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  padding: 12px 16px 12px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.rcard.unread { border-left: 3px solid var(--accent); padding-left: 10px; }
.rcover { width: 64px; height: 64px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--text-3); }
.rcover img { width: 100%; height: 100%; object-fit: cover; }
.rtitle { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; min-width: 0; }
.rtitle b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rid { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.rmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--text-3); font-size: 12.5px; }
.rmeta .row { gap: 5px; }
.rside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.overdue { color: var(--red); font-weight: 600; }

.empty { text-align: center; padding: 64px 20px; color: var(--text-3); }
.empty .empty-ic { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { padding: 14px 16px; }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .l { font-size: 12px; color: var(--text-3); font-weight: 550; }

/* ── request page ── */
.rhead { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.rhead h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; word-break: break-word; }
.rgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.raside { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }

.stepper { display: flex; align-items: flex-start; gap: 0; padding: 16px 18px; margin-bottom: 18px; overflow-x: auto; }
.step { flex: 1; min-width: 110px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.step-top { display: flex; align-items: center; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-3); border: 2px solid var(--border); flex: none; z-index: 1; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 6px; border-radius: 2px; }
.step.done .step-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done .step-line { background: var(--accent); }
.step.current .step-dot { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.step.warn .step-dot { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 15%, transparent); }
.step-label { font-weight: 600; font-size: 13px; }
.step-time { font-size: 12px; color: var(--text-3); }

.brief { padding: 20px; }
.brief-text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.6; }
.brief-text a, .bubble a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

.timeline { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 6px; }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 86%; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-head { font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: baseline; }
.msg-head b { color: var(--text-2); font-weight: 600; }
.bubble { background: var(--surface-3); padding: 9px 13px; border-radius: 16px 16px 16px 5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg.mine .bubble { background: var(--accent); color: var(--on-accent); border-radius: 16px 16px 5px 16px; }
.msg.mine .bubble a { color: inherit; }
.event { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-3); font-size: 12.5px; text-align: center; flex-wrap: wrap; }
.event .ev-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.event b { color: var(--text-2); font-weight: 600; }
.block-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); }
.block-card.deliver { border-color: color-mix(in srgb, var(--violet) 35%, var(--border)); background: color-mix(in srgb, var(--violet-bg) 45%, var(--surface)); }
.block-card.revision { border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); background: color-mix(in srgb, var(--amber-bg) 55%, var(--surface)); }
.block-card.accept { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); background: color-mix(in srgb, var(--green-bg) 55%, var(--surface)); }
.block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.block-head .title { font-weight: 650; }
.block-text { white-space: pre-wrap; word-break: break-word; margin: 6px 0 10px; }

.composer { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 40px; max-height: 220px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; background: var(--surface-2); outline: none; line-height: 1.45; }
.composer textarea:focus { border-color: var(--accent); background: var(--surface); }

.details { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; font-size: 13px; align-items: center; }
.details dt { color: var(--text-3); font-weight: 500; }
.details dd { margin: 0; text-align: right; display: flex; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; font-weight: 550; }
.history { display: flex; flex-direction: column; gap: 0; }
.h-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: start; padding: 6px 0; font-size: 13px; position: relative; }
.h-item::before { content: ''; position: absolute; left: 8px; top: 22px; bottom: -6px; width: 2px; background: var(--border); }
.h-item:last-child::before { display: none; }
.h-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border); margin-top: 1px; }
.h-item.on .h-dot { background: var(--accent); border-color: var(--accent); }
.h-item .sub { font-size: 11.5px; color: var(--text-3); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.action-note { font-size: 12.5px; color: var(--text-2); background: var(--surface-3); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.45; }

/* ── media ── */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.mgrid.lg { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.mtile { position: relative; aspect-ratio: 1; border-radius: 11px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); cursor: zoom-in; display: grid; place-items: center; color: var(--text-3); padding: 0; }
.mtile img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.mtile:hover img { transform: scale(1.04); }
.mtile .badge { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 11px; font-weight: 600; backdrop-filter: blur(4px); }
.mtile .play { position: absolute; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); }
.mtile .fname { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.mtile.file { cursor: pointer; flex-direction: column; gap: 6px; padding: 10px; text-align: center; font-size: 12px; }
.mtile.file .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; color: var(--text-2); }
.mtile .rv { position: absolute; top: 6px; right: 6px; }
.processing { font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 9, 12, .94); display: flex; flex-direction: column; animation: fade .15s; }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #e8eaf0; }
.lb-top .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .btn { background: rgba(255, 255, 255, .08); border-color: transparent; color: #fff; }
.lb-top .btn:hover { background: rgba(255, 255, 255, .16); }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 64px 24px; position: relative; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb-stage audio { width: min(520px, 90vw); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lb-audio { display: flex; flex-direction: column; align-items: center; gap: 18px; color: #c9cdd8; }
.lb-audio .art { width: 120px; height: 120px; border-radius: 28px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.lb-note { color: #9aa1b0; font-size: 12px; text-align: center; padding: 0 16px 12px; }

/* ── dropzone ── */
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; color: var(--text-2); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.dropzone b { color: var(--text); }
.fprev { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 12px; }
.fitem { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-3); }
.fitem img, .fitem video { width: 100%; height: 100%; object-fit: cover; }
.fitem .fx { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.fitem .fmeta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 8px; background: var(--surface-3); font-size: 12px; max-width: 220px; }
.fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { border: 0; background: none; cursor: pointer; color: var(--text-3); display: grid; place-items: center; padding: 2px; }

.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); transition: width .2s; }

/* ── base ── */
.char-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.char-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 550; color: var(--text-2); transition: all .15s; }
.char-btn:hover { border-color: var(--border-strong); color: var(--text); }
.char-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.char-btn .sw { width: 12px; height: 12px; border-radius: 50%; }
.char-btn .n { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s; display: flex; flex-direction: column; }
.ccard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }
.ccard .mtile { aspect-ratio: 4 / 5; border: 0; border-radius: 0; width: 100%; }
.ccard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.ccard-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── admin ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off td { opacity: .5; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.charcard { display: flex; align-items: center; gap: 12px; padding: 14px; }
.charcard .big-sw { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--text); }

/* ── modal ── */
.modal-wrap { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: grid; place-items: center; padding: 20px; animation: fade .15s; backdrop-filter: blur(2px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--border); }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; }
.error { color: var(--red); background: var(--red-bg); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; }
.cred { font-family: ui-monospace, 'SF Mono', Consolas, monospace; background: var(--surface-3); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; white-space: pre-wrap; }

/* ── notifications ── */
.bell { position: relative; }
.bell .count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: pop .15s; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 650; }
.pop-list { max-height: 420px; overflow: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.notif:hover { background: var(--surface-2); }
.notif:last-child { border-bottom: 0; }
.notif .n-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
.notif .n-text { font-size: 13px; line-height: 1.4; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; gap: 10px; align-items: flex-start; max-width: 380px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: slide .25s cubic-bezier(.2, .9, .3, 1.1); cursor: pointer; font-size: 13.5px; }
.toast.err { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.toast .t-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; }

/* ── login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(800px 500px at 15% 10%, color-mix(in srgb, #7c6cff 22%, transparent), transparent 60%),
  radial-gradient(700px 500px at 90% 90%, color-mix(in srgb, #e255c4 18%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 32px 28px; border-radius: 22px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.login-card .brand-logo { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes slide { from { opacity: 0; transform: translateY(12px); } }
@keyframes shimmer { to { background-position: -200% 0; } }

.backdrop { display: none; }

/* ── responsive ── */
@media (max-width: 1100px) {
  .rgrid { grid-template-columns: 1fr; }
  .raside { position: static; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; width: 270px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .shell.menu-open .sidebar { transform: none; }
  .shell.menu-open .backdrop { display: block; position: fixed; inset: 0; z-index: 85; background: var(--overlay); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .page { padding: 16px 14px 40px; }
  .rcard { grid-template-columns: 52px 1fr; gap: 12px; }
  .rcover { width: 52px; height: 52px; }
  .rside { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .msg { max-width: 96%; }
  .lb-stage { padding: 0 8px 16px; }
  .lb-nav { display: none; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .cgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .hide-m { display: none; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

/* ── форма задачи: поля с поиском, переключатели, теги ── */
.modal.xl { width: min(860px, 100%); }
.modal.xl .modal-head { padding: 24px 28px 0; }
.modal.xl .modal-head h3 { font-size: 20px; }
.modal.xl .modal-body { padding: 20px 28px; gap: 18px; }
.modal.xl .modal-foot { padding: 4px 28px 24px; }
.modal.xl .field > label { font-size: 14px; color: var(--text); font-weight: 650; }
.modal.xl .field > label.caps { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid .input { height: 44px; font-size: 14.5px; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 20px; }
.field > label { display: flex; align-items: center; gap: 6px; }

.combo { position: relative; }
.combo .input { padding-right: 34px; cursor: pointer; }
.combo .input:focus { cursor: text; }
.combo .input.has-value { color: var(--text); }
.combo-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--text-3); display: grid; place-items: center; cursor: pointer; }
.combo-btn:hover { background: var(--surface-3); color: var(--text); }
.combo-btn.pass { pointer-events: none; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70; max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .12s; }
.combo-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.combo-item.hi { background: var(--surface-3); }
.combo-item.on { color: var(--accent-text); font-weight: 600; }
.combo-item.create { color: var(--accent-text); font-weight: 600; border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 8px 8px; }
.combo-item .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.combo-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.combo-empty { padding: 12px; color: var(--text-3); text-align: center; font-size: 13px; }
.combo.small .input { height: 36px; font-size: 13.5px; }

.chipgroup { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; transition: all .15s; }
.choice:hover { color: var(--text); border-color: var(--text-3); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent) inset; }

.hint-q { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); font-size: 11px; font-weight: 700; cursor: help; text-transform: none; letter-spacing: 0; outline: none; }
.hint-q:hover, .hint-q:focus { background: var(--accent-soft); color: var(--accent-text); }
.hint-q::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 9px 11px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 500; line-height: 1.45; white-space: normal; text-align: left; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 90; }
.hint-q:hover::after, .hint-q:focus::after { opacity: 1; }

.tagchip { --tc: #64748b; display: inline-flex; align-items: center; gap: 3px; height: 28px; padding: 0 6px 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 30%, transparent); }
.tagchip .hash { opacity: .6; }
.tagchip button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 2px; border-radius: 5px; opacity: .7; }
.tagchip button:hover { opacity: 1; background: color-mix(in srgb, var(--tc) 20%, transparent); }
.tagchip.small { height: 22px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.fmt-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: 11.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip.fmt span { font-variant-numeric: tabular-nums; }

.attach-row { border: 1px dashed transparent; border-radius: 12px; padding: 2px; transition: all .15s; }
.attach-row.over { border-color: var(--accent); background: var(--accent-soft); }
.attach-btn .btn { width: 52px; height: 44px; background: var(--surface-3); border-color: var(--border); border-radius: 10px; }
.attach-btn .btn:hover { background: var(--border); }

.brief-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; padding: 12px 14px; margin: 4px 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.bs-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bs-item.wide { grid-column: 1 / -1; }
.bs-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.bs-v { font-weight: 600; font-size: 13.5px; }

.toolbar.filters { margin-top: -6px; }
.toolbar.filters .select { min-width: 140px; height: 36px; font-size: 13.5px; }
.f-combo { width: 190px; }

@media (max-width: 860px) {
  .form-grid, .spec-grid { grid-template-columns: 1fr; }
  .modal.xl .modal-head, .modal.xl .modal-body, .modal.xl .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .f-combo { width: 100%; }
  .toolbar.filters .select { flex: 1; min-width: 0; }
  .hint-q::after { left: auto; right: -10px; transform: none; }
}
