/* Поддержка Inscale — дизайн-система партнёрского портала (portal.inscale.ru: shell.css + app.css), шрифт Onest.
   Токены, шапка с пилюлями, белые карточки на градиенте, таблицы, чипы, бейджи — как в портале; экраны входа — как auth портала. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Onest-cyrillic-ext-11a468877c94605e8d19498e02468e1e.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Onest-cyrillic-fe2bd26ae82a604773dc696a60820fd4.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Onest-latin-ext-3e2cb98882069277dc6a50dedc7f3d25.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Onest-latin-3db826ed1c5d780edac1a068afa38081.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 {
  --ink: #0F1729; --ink-strong: #080F21; --ink-2: #1D283A; --text-2: #344256; --muted: #65758B; --muted-2: #94A3B8;
  --page-top: #CAE9FE; --page-bot: #F4F0F0; --white: #FFFFFF;
  --slate-50: #F8FAFC; --slate-100: #F1F5F9; --slate-200: #E1E7EF; --slate-300: #CBD5E1;
  --blue: #1194FF; --blue-700: #0E84E6; --blue-soft: #DCEBFE; --blue-100: #CAE9FE;
  --success: #0E9F6F; --success-bg: #DEF7EC;
  --warning: #F97415; --warning-bg: #FFEDD6;
  --danger: #E02424; --danger-2: #F05151; --danger-bg: #FDE8E8;
  --violet: #6B3FA0; --violet-bg: #EEE6FA;
  --r-card: 20px; --r-16: 16px; --r-12: 12px; --r-8: 8px; --r-pill: 999px;
  --sh-card: 0 0 2px rgba(15, 23, 42, .12), 0 0 1px rgba(15, 23, 42, .04), 0 2px 6px rgba(15, 23, 42, .04), 0 16px 24px rgba(15, 23, 42, .04);
  --sh-hair: 0 0 0 .5px rgba(15, 23, 42, .12);
  --sh-pop: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px -8px rgba(15, 23, 42, .22);
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --bar-h: 56px; --gut: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text-2);
  background: linear-gradient(180deg, var(--page-top) 0%, var(--page-bot) 60%) fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(17, 148, 255, .18); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, .16); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }

/* ---------- каркас и шапка (shell портала) ---------- */
.app { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gut) var(--gut); flex: 1 0 auto; display: flex; flex-direction: column; }
.topbar { height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 8px; flex: 0 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 9px; user-select: none; flex: 0 0 auto; }
.logo-badge { position: relative; width: 28px; height: 28px; border-radius: 8px; overflow: hidden; flex: 0 0 auto; background: linear-gradient(160deg, #54B4FF 0%, #1194FF 58%, #0E84E6 100%); box-shadow: inset 0 -1.2px 1.5px rgba(255, 255, 255, .25), 0 2px 6px -2px rgba(17, 148, 255, .5); display: grid; place-items: center; }
.logo-badge img { width: 18.6px; height: 9.3px; }
.logo-word img { height: 11px; width: auto; }
.logo-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-700); background: rgba(255, 255, 255, .6); padding: 4px 9px; border-radius: var(--r-pill); margin-left: 4px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; justify-content: center; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; font-size: 13px; font-weight: 600; line-height: 1; color: var(--text-2); padding: 8px 14px; border-radius: var(--r-pill); white-space: nowrap; transition: background .14s, color .14s, box-shadow .14s; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.nav a.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 .5px rgba(15, 23, 42, .04); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.me { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 600; max-width: 260px; }
.me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: var(--r-pill); flex: 0 0 auto; background: linear-gradient(150deg, #54B4FF, #1194FF); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.avatar.slate { background: var(--slate-200); color: var(--text-2); box-shadow: none; }
.topbar-right form { margin: 0; }
.pill-btn { border: none; background: var(--slate-100); color: var(--ink); font-weight: 500; font-size: 14px; padding: 0 20px; height: 40px; border-radius: var(--r-pill); cursor: pointer; transition: background .15s, transform .12s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.pill-btn:hover { background: var(--slate-200); }
.pill-btn:active { transform: translateY(1px); }
.pill-btn.dark { background: var(--ink-strong); color: #fff; }
.pill-btn.dark:hover { background: #11182e; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 8px 4px; gap: 6px 12px; }
  .nav { order: 3; flex: 1 1 100%; justify-content: flex-start; padding-bottom: 4px; }
  .page-head .actions .inline-form { flex-wrap: wrap; }
  .me span:last-child { display: none; }
  .logo-tag { display: none; }
}

/* ---------- страница ---------- */
.page { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.page--narrow { max-width: 880px; width: 100%; margin: 0 auto; }
.page--mid { max-width: 1120px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 8px 0; }
.page-head > div { min-width: 0; }
.page-title { font-weight: 700; font-size: 22px; line-height: 28px; color: var(--ink); margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.page-sub { font-size: 13px; font-weight: 500; color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 8px 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs span::before { content: "/"; margin-right: 6px; color: var(--muted-2); }
.card { background: var(--white); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 24px; }
.panel { background: var(--white); border-radius: var(--r-16); box-shadow: var(--sh-hair); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.sec-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; }
.ph { font-size: 16px; font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); }
.t13 { font-size: 13px; } .t12 { font-size: 12px; } .t11 { font-size: 11px; }
.fw700 { font-weight: 700; } .fw600 { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.hr { height: 1px; background: var(--slate-200); border: 0; margin: 0; width: 100%; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: var(--r-8); border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .14s, box-shadow .14s, border-color .14s, transform .1s; font-family: inherit; color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-ghost { background: var(--slate-100); color: var(--ink); }
.btn-ghost:hover { background: var(--slate-200); }
.btn-outline { background: #fff; border-color: var(--slate-200); color: var(--ink); }
.btn-outline:hover { border-color: var(--slate-300); background: var(--slate-50); }
.btn-danger { background: #fff; border-color: var(--slate-200); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger-2); background: var(--danger-bg); }
.btn-dark { background: var(--ink-strong); color: #fff; }
.btn-dark:hover { background: #11182e; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; border-radius: 10px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-700); cursor: pointer; }

/* ---------- чипы, бейджи, пилюли ---------- */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--slate-200); background: #fff; color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .14s; }
.chip:hover { border-color: var(--slate-300); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { opacity: .6; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .01em; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.st-new { background: var(--blue-soft); color: var(--blue-700); }
.st-work { background: var(--warning-bg); color: var(--warning); }
.st-wait { background: var(--violet-bg); color: var(--violet); }
.st-ok { background: var(--success-bg); color: var(--success); }
.st-cancel { background: var(--slate-100); color: var(--muted); }
.st-err { background: var(--danger-bg); color: var(--danger); }
.sev { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.sev-1 { background: var(--danger); color: #fff; }
.sev-2 { background: var(--warning-bg); color: var(--warning); }
.sev-3 { background: var(--slate-100); color: var(--text-2); }
.ttype { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; background: var(--slate-100); color: var(--text-2); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 5px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; background: var(--slate-100); color: var(--muted); }
.pill.blue { background: var(--blue-soft); color: var(--blue-700); }
.pill.orange { background: var(--warning-bg); color: var(--warning); }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- сообщения ---------- */
.flash { display: flex; flex-direction: column; gap: 8px; }
.note { padding: 12px 16px; border-radius: var(--r-12); font-size: 13px; line-height: 1.5; font-weight: 500; background: #fff; box-shadow: var(--sh-hair); color: var(--text-2); }
.note--ok { background: var(--success-bg); color: #0B6B4C; box-shadow: none; }
.note--err { background: var(--danger-bg); color: #9B1C1C; box-shadow: none; }
.note--info { background: var(--blue-soft); color: var(--ink-2); box-shadow: none; }
.note a { text-decoration: underline; }

/* ---------- таблица ---------- */
.tbl-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 16px 10px; white-space: nowrap; border-bottom: 1px solid var(--slate-200); }
table.tbl tbody td { padding: 12px 16px; border-bottom: 1px solid var(--slate-100); color: var(--text-2); vertical-align: middle; }
table.tbl tbody tr.link { cursor: pointer; transition: background .12s; }
table.tbl tbody tr.link:hover { background: var(--slate-50); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.tbl td.num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .nowrap { white-space: nowrap; }
.cell-ent { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-ent .ent-meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nm { font-size: 13px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.sub { font-size: 11px; font-weight: 500; color: var(--muted); }
.sub.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rowlink { position: absolute; inset: 0; }
tr.link td:first-child { position: relative; }
tr.link > td { position: relative; }
.ent { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--blue); }
.ent.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 12px; }
.ent.slate { background: var(--slate-100); color: var(--muted); }
.ent.dark { background: var(--ink-strong); color: #fff; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { position: relative; display: flex; align-items: center; height: 36px; flex: 1 1 240px; max-width: 360px; }
.search input { height: 36px; width: 100%; border: 1px solid var(--slate-200); border-radius: var(--r-8); background: #fff; padding: 0 12px; font: inherit; font-size: 13px; color: var(--ink); outline: none; transition: border-color .14s, box-shadow .14s; }
.search input::placeholder { color: var(--muted-2); }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 148, 255, .14); }
.sel { height: 36px; border: 1px solid var(--slate-200); border-radius: var(--r-8); background: #fff; padding: 0 34px 0 12px; font: inherit; font-size: 13px; color: var(--ink); outline: none; -webkit-appearance: none; 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='%235b6b7c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; max-width: 100%; }
.sel:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 148, 255, .14); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 56px 16px; text-align: center; }
.empty .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--slate-100); color: var(--muted-2); display: grid; place-items: center; margin-bottom: 4px; font-size: 20px; font-weight: 700; }
.empty .et { font-size: 15px; font-weight: 700; color: var(--ink); }
.empty .es { font-size: 13px; color: var(--muted); max-width: 46ch; }
@media (max-width: 760px) {
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; }
  table.tbl tbody tr { padding: 10px 4px; border-bottom: 1px solid var(--slate-100); position: relative; }
  table.tbl tbody tr:last-child { border-bottom: none; }
  table.tbl tbody td { padding: 3px 0; border: none; }
  table.tbl tbody td.hide-m { display: none; }
  table.tbl tbody tr.hot td:first-child { box-shadow: none; }
  table.tbl tbody tr.hot { box-shadow: inset 3px 0 0 var(--danger); padding-left: 10px; }
  table.tbl td.right-m { position: absolute; right: 4px; top: 10px; }
}

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.req { color: var(--danger); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=search], .field select, .field textarea, .input {
  height: 38px; border: 1px solid var(--slate-200); border-radius: var(--r-8); background: #fff; padding: 0 12px; font: inherit; font-size: 13px; color: var(--ink); outline: none; transition: border-color .14s, box-shadow .14s; width: 100%;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field textarea.tall { min-height: 180px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 148, 255, .14); }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: var(--muted-2); }
.field select, select.input { -webkit-appearance: none; appearance: none; padding-right: 34px; 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='%235b6b7c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.field .hint { font-size: 11px; color: var(--muted); }
.field--err input, .field--err select, .field--err textarea { border-color: var(--danger-2); }
.err { font-size: 12px; color: var(--danger); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); cursor: pointer; }
.check small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.check--box { border: 1px solid var(--slate-200); border-radius: var(--r-12); padding: 12px 14px; background: #fff; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { width: auto; flex: 1 1 200px; }
.inline-form .sel { width: auto; flex: 0 1 auto; min-width: 150px; }
.page-head .actions .inline-form { flex-wrap: nowrap; }
.page-head .actions .sel { min-width: 190px; }
.inline-form .input--sm { flex: 0 1 180px; }
[data-public-only][hidden], .choice[hidden], .approve [hidden] { display: none; }
form.is-note .field textarea { background: #FFFBF0; border-color: #F2C46D; }

/* выбор типа и критичности */
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.choice legend { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 2px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.choice-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--slate-200); border-radius: var(--r-12); padding: 12px 14px; background: #fff; cursor: pointer; transition: all .14s; }
.choice-item:hover { border-color: var(--slate-300); }
.choice-item input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue); }
.choice-item:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 148, 255, .14); }
.choice-body { display: flex; flex-direction: column; gap: 3px; color: var(--ink); font-size: 13px; font-weight: 600; }
.choice-body small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.field--err .choice-item { border-color: var(--danger-2); }

/* файлы */
.filepick { font: inherit; font-size: 12px; color: var(--muted); max-width: 100%; }
.filepick::file-selector-button { font: inherit; font-weight: 600; font-size: 12px; margin-right: 10px; height: 28px; padding: 0 10px; border-radius: var(--r-8); border: 1px solid var(--slate-200); background: #fff; color: var(--ink); cursor: pointer; }
.filepick::file-selector-button:hover { border-color: var(--slate-300); background: var(--slate-50); }
.files { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.files a { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 28px; padding: 0 10px; border: 1px solid var(--slate-200); border-radius: var(--r-8); background: #fff; font-size: 12px; font-weight: 600; color: var(--ink); transition: all .14s; }
.files a::before { content: ""; flex: 0 0 auto; width: 13px; height: 13px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231194FF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/%3E%3C/svg%3E") no-repeat center / contain; }
.files a:hover { border-color: var(--slate-300); background: var(--slate-50); }
.files__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.files__size { color: var(--muted); font-weight: 500; }

/* ---------- переписка ---------- */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { background: var(--white); border-radius: var(--r-16); box-shadow: var(--sh-hair); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 72px; min-width: 0; }
.msg--staff { background: #F4FAFF; box-shadow: 0 0 0 .5px rgba(17, 148, 255, .35); }
.msg--note { background: #FFFBF0; box-shadow: none; border: 1px dashed #F2C46D; }
.msg__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.msg__head b { color: var(--ink); font-weight: 700; }
.msg__who { font-size: 11px; font-weight: 600; color: var(--muted); }
.msg--staff .msg__who { color: var(--blue-700); }
.msg--note .msg__who { color: #9A5B00; }
.msg__when { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.msg__body { white-space: pre-line; overflow-wrap: anywhere; color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* ---------- карточка: пары, время, история ---------- */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.kv dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.kv dd a:hover { color: var(--blue-700); }
.dur { width: 100%; border-collapse: collapse; font-size: 13px; }
.dur td { padding: 7px 0; border-bottom: 1px solid var(--slate-100); vertical-align: middle; }
.dur tr:last-child td { border-bottom: 0; }
.dur__val { font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
.dur__times { width: 34px; text-align: right; color: var(--muted); font-size: 11px; font-weight: 700; }
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; }
.tl-item .rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.tl-item .knob { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 5px; }
.tl-item .line { flex: 1 1 auto; width: 2px; background: var(--slate-200); margin: 4px 0; }
.tl-item:last-child .line { display: none; }
.tl-item .c { padding-bottom: 14px; min-width: 0; }
.tl-item .ct { font-size: 13px; font-weight: 600; color: var(--text-2); overflow-wrap: anywhere; }
.tl-item .cm { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--slate-100); flex-wrap: wrap; }
.mini-row:last-child { border-bottom: none; }
.mini-row .body { flex: 1 1 auto; min-width: 0; }
.mini-row .t { font-size: 13px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.mini-row .s { font-size: 11px; color: var(--muted); font-weight: 500; }

/* учётки на подтверждении */
.acc-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.approve { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, .7fr) auto; gap: 12px; align-items: end; border-top: 1px solid var(--slate-100); padding-top: 16px; }
@media (max-width: 900px) { .approve { grid-template-columns: 1fr; } }

/* ---------- подвал ---------- */
.foot { flex: 0 0 auto; text-align: center; color: var(--muted); font-size: 12px; font-weight: 500; padding: 14px 16px 10px; display: flex; gap: 8px 20px; flex-wrap: wrap; justify-content: center; }
.foot a:hover { color: var(--ink); }

/* ---------- вход и регистрация (auth портала) ---------- */
.auth { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 0 24px 14px; background: var(--white); }
.auth .topbar { height: 76px; }
.auth-card { flex: 1 1 auto; border-radius: 48px; background: linear-gradient(180deg, #CAE9FE 0%, #F4F0F0 100%); box-shadow: 0 30px 80px -46px rgba(16, 40, 80, .26); display: flex; align-items: center; justify-content: center; padding: clamp(24px, 6vh, 72px) 24px; position: relative; overflow: hidden; }
.form-col { width: 522px; max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.form-col--wide { width: 640px; }
.auth-title { font-weight: 700; color: var(--ink-strong); text-align: center; margin: 0; font-size: 50px; line-height: 1.04; letter-spacing: -1px; text-wrap: balance; }
.auth-sub { text-align: center; font-size: 17px; line-height: 1.45; font-weight: 400; color: var(--ink-strong); margin: 16px auto 0; max-width: 480px; text-wrap: pretty; }
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 18px; margin-top: 32px; }
.afield { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.afield input { width: 100%; height: 56px; border-radius: 12px; border: 1px solid rgba(8, 15, 33, .04); background: rgba(8, 15, 33, .04); padding: 0 18px; font: inherit; font-size: 16px; color: var(--ink-strong); outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.afield input::placeholder { color: var(--muted); }
.afield input:focus { border-color: rgba(17, 148, 255, .5); background: rgba(8, 15, 33, .02); box-shadow: 0 0 0 3px rgba(17, 148, 255, .12); }
.afield--err input { border-color: rgba(224, 36, 36, .55); }
.afield .err { padding-left: 4px; }
.agrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
@media (max-width: 560px) { .agrid { grid-template-columns: 1fr; } }
.auth-btn { width: 100%; height: 56px; border: none; border-radius: 12px; font: inherit; font-weight: 500; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-strong); color: #fff; box-shadow: 0 14px 28px -18px rgba(8, 15, 33, .7); transition: background .15s, transform .12s; }
.auth-btn:hover { background: #11182e; }
.auth-btn:active { transform: translateY(1px); }
.text-link { background: none; border: none; padding: 0; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink-strong); cursor: pointer; }
.text-link:hover { color: var(--blue); }
.auth-links { width: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; margin-top: 22px; text-align: center; }
.auth-note { width: 100%; margin-top: 24px; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.45; background: rgba(255, 255, 255, .7); color: var(--ink-strong); text-align: center; }
.auth-note--err { background: rgba(224, 36, 36, .09); color: #8A1F1F; }
.auth-note a { text-decoration: underline; }
.consent { font-size: 13px; line-height: 1.5; color: var(--muted); width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--ink-strong); }
.consent a { color: var(--muted); text-decoration: underline; }
.remember { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-strong); width: 100%; cursor: pointer; }
.remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink-strong); }
.success-check { width: 72px; height: 72px; border-radius: 50%; background: #25BE86; display: grid; place-items: center; margin: 0 auto 26px; box-shadow: 0 14px 30px -12px rgba(37, 190, 134, .7); color: #fff; font-size: 34px; font-weight: 700; }
@media (max-width: 720px) {
  .auth { padding: 0 12px 10px; }
  .auth .topbar { height: 64px; }
  .auth-card { padding: 40px 18px; border-radius: 28px; }
  .auth-title { font-size: 34px; }
  .auth-sub { font-size: 15px; }
  .form-col, .form-col--wide { width: 100%; }
}

/* утилиты вместо inline style (CSP style-src self) */
.h32 { height: 32px; } .h36 { height: 36px; } .h38 { height: 38px; } .mt12 { margin-top: 12px; } .w160 { width: 160px; }
.text-link.t13 { font-size: 13px; }
.inline-form .sel.input--sm { min-width: 210px; }
