:root {
  color-scheme: light;

  /* Canvas */
  --bg-base: #e7e9ef;
  --bg-glow-1: rgba(47, 111, 203, 0.045);
  --bg-glow-2: rgba(132, 184, 224, 0.045);

  /* Surfaces */
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-inset: #eceff4;

  /* Text */
  --text: #181b21;
  --text-2: #586170;
  --text-3: #8a919d;

  /* Hairlines & edges */
  --line: rgba(18, 22, 31, 0.09);
  --line-2: rgba(18, 22, 31, 0.14);
  --edge-light: rgba(255, 255, 255, 0.9);

  /* Accent — soft blue/cyan */
  --accent: #2f6fcb;
  --accent-2: #84b8e0;
  --accent-strong: #1f4e8c;
  --accent-soft: rgba(47, 111, 203, 0.08);
  --accent-line: rgba(47, 111, 203, 0.20);

  /* States */
  --blue: #2f6df0;
  --blue-ink: #2a4ba0;
  --blue-soft: rgba(47, 109, 240, 0.10);
  --blue-line: rgba(47, 109, 240, 0.26);
  --danger: #d22f20;
  --danger-soft: rgba(210, 47, 32, 0.10);
  --danger-line: rgba(210, 47, 32, 0.26);
  --amber: #c4790a;
  --success: #2a7d4f;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06), 0 2px 6px rgba(17, 24, 39, 0.05);
  --shadow-md:
    0 1px 2px rgba(17, 24, 39, 0.05),
    0 6px 14px -4px rgba(17, 24, 39, 0.10),
    0 18px 36px -12px rgba(17, 24, 39, 0.12);
  --shadow-lg:
    0 2px 4px rgba(17, 24, 39, 0.05),
    0 12px 24px -8px rgba(17, 24, 39, 0.12),
    0 32px 60px -20px rgba(17, 24, 39, 0.18);
  --shadow-accent: 0 6px 14px -6px rgba(47, 111, 203, 0.22), 0 2px 4px rgba(132, 184, 224, 0.12);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 620px at 12% -8%, var(--bg-glow-1), transparent 55%),
    radial-gradient(1000px 560px at 105% 2%, var(--bg-glow-2), transparent 52%),
    linear-gradient(180deg, #f2f3f7 0%, var(--bg-base) 100%);
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-tip] {
  position: relative;
}

[data-tip]::before,
[data-tip]::after {
  position: absolute;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

[data-tip]::after {
  content: attr(data-tip);
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 9px 11px;
  color: #ffffff;
  background: rgba(41, 45, 52, 0.94);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.22);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  transform: translate(-50%, 4px);
}

[data-tip]::before {
  content: "";
  bottom: calc(100% + 4px);
  left: 50%;
  border: 6px solid transparent;
  border-top-color: rgba(41, 45, 52, 0.94);
  transform: translate(-50%, 4px);
}

[data-tip]:focus-visible::before,
[data-tip]:focus-visible::after,
[data-tip]:focus-within::before,
[data-tip]:focus-within::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (pointer: fine) {
  [data-tip]:hover::before,
  [data-tip]:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (hover: none), (pointer: coarse) {
  [data-tip]::before,
  [data-tip]::after {
    display: none;
  }
}

.tip-left::after {
  right: 0;
  left: auto;
  transform: translate(0, 4px);
}

.tip-left::before {
  right: 18px;
  left: auto;
  transform: translate(0, 4px);
}

.tip-left:hover::before,
.tip-left:hover::after,
.tip-left:focus-visible::before,
.tip-left:focus-visible::after,
.tip-left:focus-within::before,
.tip-left:focus-within::after,
.tip-right:hover::before,
.tip-right:hover::after,
.tip-right:focus-visible::before,
.tip-right:focus-visible::after,
.tip-right:focus-within::before,
.tip-right:focus-within::after {
  transform: translate(0, 0);
}

.tip-right::after {
  right: auto;
  left: 0;
  transform: translate(0, 4px);
}

.tip-right::before {
  right: auto;
  left: 18px;
  transform: translate(0, 4px);
}

/* ---------- Public Landing ---------- */
.auth-screen {
  width: min(1240px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 46px;
}

.auth-screen[hidden] {
  display: none;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 0 34px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.12)),
    linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: var(--shadow-accent);
}

.landing-brand-title {
  font-weight: 760;
  line-height: 1.1;
}

.landing-brand-sub {
  color: var(--text-3);
  font-size: 12.5px;
}

.landing-nav,
.landing-actions,
.landing-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-nav a {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.landing-main {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(300px, 0.72fr) minmax(310px, 0.58fr);
  gap: 22px;
  align-items: stretch;
}

.landing-main-simple {
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 420px);
  min-height: calc(100vh - 150px);
  align-items: center;
}

.landing-copy,
.landing-auth-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.landing-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 52px);
}

.landing-main-simple .landing-copy {
  padding: clamp(18px, 4vw, 38px) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.landing-eyebrow {
  margin-bottom: 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.landing-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 650px;
  margin-top: 20px;
  color: var(--text-2);
  font-size: clamp(16px, 1.5vw, 18px);
}

.landing-actions {
  margin-top: 28px;
}

.landing-facts {
  margin-top: 28px;
  align-items: stretch;
}

.landing-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 650;
}

.landing-auth-card {
  align-self: start;
}

.landing-main-simple .landing-auth-card {
  align-self: center;
}

.simple-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

/* ---------- Header ---------- */
.simple-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 4px 0 34px;
}

.brand-block {
  min-width: 0;
}

.topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topline span {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

h1 {
  margin-top: 14px;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 760;
  color: var(--text);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 {
    background: linear-gradient(180deg, #20242c 0%, #454d5a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

.developer-line {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.runtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.runtime-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px rgba(138, 145, 157, 0.18);
}

.runtime-badge.checking::before {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(196, 121, 10, 0.18);
  animation: pulse 1.4s ease-in-out infinite;
}

.runtime-badge.gpu {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.runtime-badge.gpu::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(132, 184, 224, 0.16);
}

.runtime-badge.cpu {
  color: var(--blue-ink);
  background: var(--blue-soft);
  border-color: var(--blue-line);
}

.runtime-badge.cpu::before {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 109, 240, 0.20);
}

.runtime-badge.offline {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.runtime-badge.offline::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(210, 47, 32, 0.20);
}

.legacy-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.legacy-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

/* ---------- Layout ---------- */
.simple-main {
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) minmax(440px, 1.15fr);
  gap: 22px;
  align-items: start;
}

.upload-panel,
.jobs-panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.upload-panel {
  padding: 26px;
  position: sticky;
  top: 24px;
}

.upload-copy h2,
.panel-head h2 {
  font-size: 21px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.upload-copy p,
.panel-head p {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 14px;
}

/* ---------- Dropzone ---------- */
.dropzone {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 236px;
  margin-top: 20px;
  padding: 28px 22px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(47, 111, 203, 0.035), transparent 60%),
    var(--surface-inset);
  box-shadow: inset 0 2px 8px rgba(17, 24, 39, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  outline: none;
  border-style: solid;
  border-color: var(--accent);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(47, 111, 203, 0.07), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light), 0 0 0 4px var(--accent-soft);
}

.dropzone.dragover {
  transform: scale(1.005);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  color: var(--accent);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.dropzone-main {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dropzone-hint {
  font-size: 12.5px;
  color: var(--text-3);
}

.dropzone-file {
  width: min(100%, 440px);
  margin: 12px 0 16px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  overflow-wrap: anywhere;
}

/* ---------- Case Materials ---------- */
.case-upload-block {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.case-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.case-section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0;
}

.case-section-head p {
  margin: 3px 0 0;
  color: var(--text-3);
  font-size: 12.5px;
}

.case-defaults-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--text-2);
  background: var(--surface-inset);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  line-height: 1.45;
}

.case-defaults-note-modal {
  margin-top: 12px;
}

.case-defaults-note a,
.modal-subtitle a {
  color: var(--accent-strong);
  font-weight: 680;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.case-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.case-field {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.case-field-wide {
  grid-column: 1 / -1;
}

.case-field span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 680;
}

.case-field input,
.case-field textarea,
.case-field select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.case-field textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.4;
}

.case-field-help {
  color: var(--text-3, var(--text-2));
  font-size: 11px;
  line-height: 1.4;
}

.case-field input:focus,
.case-field textarea:focus,
.case-field select:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
  background: var(--surface);
}

.case-autocomplete-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-lg);
}

.case-autocomplete-menu[hidden] {
  display: none;
}

.case-autocomplete-menu button {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.case-autocomplete-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.case-autocomplete-main > span {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}

.case-autocomplete-main > small {
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-autocomplete-menu button:hover,
.case-autocomplete-menu button:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.case-autocomplete-menu small {
  flex: 0 0 auto;
  color: var(--text-3);
  font-size: 10px;
}

.case-inheritance-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: var(--text-2);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  font-size: 12px;
  line-height: 1.45;
}

.case-inheritance-note[hidden] {
  display: none;
}

.case-inheritance-note > div {
  display: grid;
  gap: 2px;
}

.case-inheritance-note strong {
  color: var(--text);
  font-size: 12.5px;
}

.case-inheritance-note .secondary-btn {
  flex: none;
}

.cases-grouping-note {
  margin: 6px 0 10px;
  color: var(--text-3, var(--text-2));
  font-size: 11px;
  line-height: 1.4;
}

.case-sources-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 13px;
}

.case-sources-list {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.case-source-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  gap: 7px;
  padding: 4px 8px 4px 10px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 620;
}

.case-source-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-source-remove {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.case-source-remove:hover,
.case-source-remove:focus-visible {
  color: var(--danger);
  background: var(--danger-soft);
  outline: none;
  transform: none;
  box-shadow: none;
}

.case-source-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.case-source-row:last-child {
  border-bottom: 0;
}

.case-source-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.case-source-meta {
  margin-top: 1px;
  color: var(--text-3);
  font-size: 11.5px;
}

.case-source-delete-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.case-source-delete-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.case-source-delete-btn:hover,
.case-source-delete-btn:focus-visible {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
  outline: none;
  transform: none;
  box-shadow: none;
}

.case-source-empty {
  padding: 10px 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- Buttons ---------- */
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-xs);
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease, opacity 130ms ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(180deg, #6fa8d9 0%, var(--accent) 62%, #285ba5 100%);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px -8px rgba(47, 111, 203, 0.26),
    0 3px 6px rgba(132, 184, 224, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

.secondary-btn {
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.secondary-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.primary-btn.compact,
.secondary-btn.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.submit-status {
  min-width: 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.submit-status.error {
  color: var(--danger);
}

/* ---------- Jobs ---------- */
.jobs-panel {
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), rgba(246, 248, 251, 0.4));
}

.jobs-list {
  min-height: 260px;
}

.empty-state {
  padding: 44px 24px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}

.job-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  padding: 14px 56px 36px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms ease;
}

.job-row:last-child {
  border-bottom: 0;
}

.job-row:hover {
  background: rgba(47, 111, 203, 0.018);
}

.job-row.status-processing,
.job-row.status-canceling {
  background:
    linear-gradient(90deg, rgba(47, 109, 240, 0.09), transparent 68%),
    var(--surface);
  border-left: 3px solid var(--blue);
}

.job-row.status-queued {
  background:
    linear-gradient(90deg, rgba(196, 121, 10, 0.08), transparent 68%),
    var(--surface);
  border-left: 3px solid var(--amber);
}

.job-row.status-processing:hover,
.job-row.status-canceling:hover {
  background:
    linear-gradient(90deg, rgba(47, 109, 240, 0.12), transparent 68%),
    var(--surface);
}

.job-row.status-queued:hover {
  background:
    linear-gradient(90deg, rgba(196, 121, 10, 0.11), transparent 68%),
    var(--surface);
}

.job-main {
  min-width: 0;
}

.job-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.job-title {
  min-width: 0;
  max-width: 100%;
  font-weight: 680;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.rename-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
}

.rename-icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rename-icon-btn:hover,
.rename-icon-btn:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  transform: none;
  box-shadow: none;
  outline: none;
}

.rename-form {
  display: flex;
  align-items: center;
  flex: 1 1 min(100%, 640px);
  min-width: min(100%, 260px);
  max-width: 720px;
  gap: 6px;
  margin: 0;
}

.rename-form[hidden] {
  display: none;
}

.rename-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 32px;
  padding: 5px 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 620;
  letter-spacing: 0;
}

.rename-input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.rename-save-btn,
.rename-cancel-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 650;
  border-radius: var(--radius-xs);
}

.rename-save-btn {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.rename-cancel-btn {
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.job-row.is-renaming .job-title,
.job-row.is-renaming .rename-icon-btn,
.job-row.is-renaming .status-pill,
.job-row.is-renaming .owner-tag {
  display: none;
}

.delete-job-btn {
  position: absolute;
  right: 16px;
  bottom: 10px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
}

.delete-job-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delete-job-btn:hover:not(:disabled),
.delete-job-btn:focus-visible:not(:disabled) {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
  transform: none;
  box-shadow: none;
  outline: none;
}

.delete-job-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.status-pill.processing,
.status-pill.queued,
.status-pill.canceling {
  background: var(--blue-soft);
  border-color: var(--blue-line);
  color: var(--blue-ink);
}

.status-pill.processing::before,
.status-pill.queued::before,
.status-pill.canceling::before {
  animation: pulse 1.4s ease-in-out infinite;
}

.status-pill.done,
.status-pill.done_with_warnings {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.status-pill.error,
.status-pill.canceled {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.job-meta {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--text-2);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-stage {
  grid-column: 1 / -1;
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12.5px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-stage.is-error {
  color: var(--danger);
}

.job-progress-message {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.job-progress-message.is-humor {
  color: var(--accent-strong);
}

.job-progress-fact {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-2);
  background: linear-gradient(135deg, rgba(196, 121, 10, 0.08), rgba(47, 111, 203, 0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.job-progress-fact-kicker {
  padding-top: 2px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.job-progress-fact strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.job-progress-fact p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.job-error {
  grid-column: 1 / -1;
  margin-top: 8px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-xs);
  background: var(--danger-soft);
  overflow: hidden;
}

.job-error > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}

.job-error > summary::-webkit-details-marker {
  display: none;
}

.job-error-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.job-error[open] > summary .job-error-line {
  white-space: normal;
  overflow: visible;
}

.job-error-toggle {
  flex: none;
  font-weight: 650;
  opacity: 0.85;
}

.job-error-toggle::after {
  content: "Подробнее";
}

.job-error[open] .job-error-toggle::after {
  content: "Свернуть";
}

.job-error-full {
  margin: 0;
  max-height: 220px;
  padding: 11px 13px;
  overflow: auto;
  border-top: 1px solid var(--danger-line);
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #7a2018;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.progress-shell {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-inset);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.10);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 7px rgba(47, 111, 203, 0.18);
  transition: width 200ms ease;
}

.job-actions {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 214px;
}

.action-link,
.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease;
}

.action-link {
  gap: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  box-shadow: none;
}

.action-button {
  cursor: pointer;
}

.action-link svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-link:hover {
  transform: translateY(-1px);
  background: rgba(47, 111, 203, 0.11);
  box-shadow: var(--shadow-sm);
}

.download-link {
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.download-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.info-tip {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  box-shadow: none;
}

.info-tip:hover,
.info-tip:focus-visible {
  transform: none;
  box-shadow: none;
}

.job-documents-split {
  position: relative;
  display: inline-grid;
  grid-template-columns: max-content 28px;
  grid-template-rows: 32px;
  align-items: stretch;
}

.job-documents-menu {
  grid-column: 2;
  grid-row: 1;
  position: static;
  display: block;
}

.job-documents-menu > summary::-webkit-details-marker {
  display: none;
}

.job-documents-menu > summary {
  list-style: none;
}

.documents-main-btn {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 8px 0 10px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 1px solid rgba(47, 111, 203, 0.38);
  border-right: 0;
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  box-shadow: var(--shadow-accent);
  font-size: 12.5px;
  font-weight: 720;
  text-decoration: none;
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.documents-main-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.documents-main-btn small {
  min-width: 34px;
  padding: 1px 5px;
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
}

.documents-main-btn:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 9px 18px -8px rgba(47, 111, 203, 0.34), 0 2px 5px rgba(47, 111, 203, 0.14);
}

.protocol-actions {
  display: inline-flex;
  align-items: stretch;
  gap: 5px;
}

.protocol-run-btn,
.protocol-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 130ms ease, box-shadow 130ms ease, background-color 130ms ease;
}

.protocol-run-btn {
  color: #ffffff;
  background: linear-gradient(180deg, #4f8f72, #2f6f56);
  border: 1px solid rgba(47, 111, 86, 0.32);
  box-shadow: 0 6px 14px -7px rgba(47, 111, 86, 0.32);
  cursor: pointer;
}

.protocol-run-btn svg,
.protocol-download-btn svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.protocol-run-btn:hover:not(:disabled),
.protocol-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.protocol-run-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.protocol-inline-status {
  flex: 1 0 100%;
  color: #2f6f56;
  font-size: 11px;
  line-height: 1.35;
}

.protocol-inline-status.is-error {
  color: var(--danger);
}

.protocol-download-btn {
  color: #2f6f56;
  background: rgba(47, 111, 86, 0.10);
  border: 1px solid rgba(47, 111, 86, 0.22);
}

.protocol-download-btn small {
  min-width: 32px;
  padding: 1px 5px;
  color: #255b47;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.protocol-download-btn-ghost {
  min-width: 40px;
  padding-inline: 9px;
  color: var(--text-2);
  background: var(--surface-2);
  border-color: var(--line-2);
}

.documents-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 32px;
  padding: 0;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 1px solid rgba(47, 111, 203, 0.38);
  border-left: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  box-shadow: var(--shadow-accent);
  cursor: pointer;
  user-select: none;
  transition: filter 130ms ease, box-shadow 130ms ease;
}

.documents-menu-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.documents-menu-trigger:hover,
.job-documents-menu[open] .documents-menu-trigger {
  filter: saturate(1.06) brightness(0.98);
  box-shadow: 0 9px 18px -8px rgba(47, 111, 203, 0.34), 0 2px 5px rgba(47, 111, 203, 0.14);
}

.documents-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 286px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge-light);
}

.documents-popover-title,
.document-choice {
  display: flex;
  align-items: center;
}

.documents-popover-title {
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.documents-popover-title span {
  color: var(--text);
  font-size: 13px;
  font-weight: 740;
}

.document-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.document-choice {
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 50px;
  padding: 7px 8px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease, background-color 130ms ease;
}

.document-choice span {
  font-size: 12.5px;
  font-weight: 800;
}

.document-choice small {
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.2;
}

.document-choice:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
}

.document-choice.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.document-choice.is-active small {
  color: var(--accent-strong);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.4;
  box-shadow: none;
  transform: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .auth-screen {
    width: min(100% - 32px, 1240px);
  }

  .landing-main {
    grid-template-columns: 1fr;
  }

  .landing-main-simple {
    min-height: auto;
  }

  .simple-main {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .auth-screen {
    width: min(100% - 24px, 1240px);
    padding-top: 16px;
  }

  .landing-header {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 20px;
  }

  .landing-copy {
    padding: 24px;
  }

  .landing-main-simple .landing-copy {
    padding: 8px 0 2px;
  }

  .landing-copy h1 {
    font-size: clamp(31px, 10vw, 42px);
  }

  .landing-actions .primary-btn,
  .landing-actions .secondary-btn,
  .landing-nav .primary-btn,
  .landing-nav .secondary-btn {
    width: 100%;
  }

  .landing-nav,
  .landing-actions {
    width: 100%;
  }

  .simple-shell {
    width: min(100% - 28px, 1180px);
    padding: 22px 0 48px;
  }

  .simple-header {
    flex-direction: column;
    gap: 18px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .upload-panel {
    padding: 20px;
  }

  .dropzone {
    min-height: 200px;
  }

  .case-form-grid {
    grid-template-columns: 1fr;
  }

  .case-sources-row,
  .case-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .case-sources-row .secondary-btn,
  .case-source-actions .secondary-btn {
    width: 100%;
  }

  .submit-row {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-row .primary-btn {
    width: 100%;
  }

  .panel-head {
    padding: 18px;
  }

  .job-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 56px 44px 18px;
  }

  .job-actions {
    grid-column: 1;
    grid-row: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
  }

  .documents-popover {
    right: auto;
    left: 0;
    width: min(300px, calc(100vw - 92px));
  }

  .job-meta {
    white-space: normal;
  }

  .job-progress-fact {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===================== Аккаунты: экран входа ===================== */
.auth-screen {
  display: block;
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(400px, 100%);
  padding: 30px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge-light);
}

.landing-auth-card {
  width: 100%;
}

.auth-head {
  margin-bottom: 22px;
  text-align: center;
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: var(--accent);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.auth-logo svg {
  width: 28px;
  height: 28px;
}

.auth-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

#authSubtitle {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.auth-form input,
.cabinet-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.05);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-form input:focus,
.cabinet-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.05), 0 0 0 4px var(--accent-soft);
}

.auth-error {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-xs);
}

.auth-error[hidden] {
  display: none;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-2);
}

.link-btn {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ===================== Модальные окна ===================== */
body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  padding: 22px;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--edge-light);
}

.modal-card-wide {
  width: min(720px, 100%);
  max-height: calc(100dvh - 48px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2 {
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.18;
  font-weight: 740;
  letter-spacing: -0.01em;
}

.modal-kicker {
  font-size: 12px;
  font-weight: 720;
  color: var(--accent-strong);
}

.modal-kicker.danger {
  color: var(--danger);
}

.modal-close-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  color: var(--text);
  background: var(--surface-inset);
  border-color: var(--line);
  transform: none;
  box-shadow: none;
  outline: none;
}

.modal-subtitle {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.modal-subtitle.strong {
  color: var(--text);
  font-weight: 680;
}

.modal-text {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.modal-field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.modal-field span {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 650;
}

.modal-field input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.05);
}

.filename-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.filename-input input {
  min-width: 0;
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
}

.filename-extension {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--text-2);
  background: var(--surface-inset);
  border: 1px solid var(--line-2);
  border-left: 0;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 13px;
  font-weight: 700;
}

.modal-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.05), 0 0 0 4px var(--accent-soft);
}

.minutes-topup-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 13px 14px;
  color: var(--text-2);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.minutes-topup-quote strong {
  color: var(--text);
  font-size: 20px;
}

.minutes-topup-contact-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.tbank-sbp-choice {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #8fcbd0;
  border-radius: var(--radius-xs);
  background: #f2fbfb;
}

.tbank-sbp-choice[hidden] {
  display: none;
}

.tbank-sbp-choice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tbank-sbp-choice-head strong {
  color: #123f46;
  font-size: 14px;
}

.tbank-sbp-choice-head span,
.tbank-sbp-note {
  color: #4b6e72;
  font-size: 11px;
}

.tbank-sbp-pay-btn {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  color: #ffffff;
  background: #08a652;
  border: 1px solid #078c46;
  border-radius: var(--radius-xs);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.tbank-sbp-pay-btn:hover {
  background: #078f47;
}

.tbank-sbp-pay-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.tbank-sbp-pay-btn[hidden],
.tbank-sbp-qr[hidden] {
  display: none;
}

.tbank-sbp-qr {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  text-align: center;
}

.tbank-sbp-qr img {
  width: min(260px, 76vw);
  height: auto;
  background: #ffffff;
  border: 8px solid #ffffff;
}

.tbank-sbp-qr a {
  color: #0d6470;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.tbank-sbp-reset-btn {
  min-height: 38px;
  padding: 8px 12px;
  color: #315c61;
  background: transparent;
  border: 1px solid #9bc8cc;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#minutesTopupForm.has-sbp-qr > .modal-subtitle,
#minutesTopupForm.has-sbp-qr > .modal-field,
#minutesTopupForm.has-sbp-qr > .minutes-topup-quote,
#minutesTopupForm.has-sbp-qr > .minutes-topup-contact-grid,
#minutesTopupForm.has-sbp-qr > .modal-text,
#minutesTopupForm.has-sbp-qr > .modal-error,
#minutesTopupForm.has-sbp-qr > .modal-actions {
  display: none;
}

#minutesTopupForm.has-sbp-qr .tbank-sbp-choice {
  margin-top: 14px;
}

#minutesTopupForm.has-sbp-qr .tbank-sbp-note {
  display: none;
}

.tbank-sbp-note {
  margin: 8px 0 0;
  line-height: 1.45;
}

.minutes-topup-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.minutes-topup-or::before,
.minutes-topup-or::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.modal-case-grid {
  margin-top: 14px;
}

.case-modal-sources {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.case-source-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-error {
  margin-top: 14px;
  padding: 9px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.modal-error.neutral {
  color: var(--text-2);
  background: var(--surface-inset);
  border-color: var(--line);
}

.modal-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.upload-progress-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0 16px;
  width: min(540px, 100%);
  padding: 26px;
  overflow: hidden;
  color: var(--sek-ink, var(--text));
  background:
    linear-gradient(135deg, rgba(153, 126, 63, 0.08), transparent 42%),
    #fffefa;
  border-color: var(--sek-line, var(--line));
  border-radius: 4px;
}

.upload-progress-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--sek-burgundy, #762d31), var(--sek-gold, #a98947));
}

.upload-progress-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fffefa;
  background: var(--sek-burgundy, #762d31);
  border: 1px solid var(--sek-burgundy, #762d31);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(69, 30, 31, 0.18);
}

.upload-progress-mark svg {
  width: 25px;
  height: 25px;
}

.upload-progress-card[data-state="checking"] .upload-progress-mark svg,
.upload-progress-card[data-state="finishing"] .upload-progress-mark svg {
  animation: upload-mark-breathe 1.4s ease-in-out infinite;
}

.upload-progress-heading {
  align-self: center;
  min-width: 0;
}

.upload-progress-heading h2 {
  margin-top: 3px;
  font-family: "Old Standard TT", Georgia, "Times New Roman", serif;
  font-size: 24px;
  line-height: 1.15;
}

.upload-progress-heading .modal-subtitle {
  margin-top: 5px;
}

.upload-progress-file {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  margin-top: 24px;
  padding: 12px 14px;
  background: rgba(240, 237, 228, 0.72);
  border-left: 3px solid var(--sek-gold, #a98947);
}

.upload-progress-file strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-progress-file span {
  flex: none;
  color: var(--sek-muted, var(--text-2));
  font-size: 11px;
}

.upload-progress-track {
  grid-column: 1 / -1;
  position: relative;
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  background: #e5e0d5;
  border: 1px solid rgba(93, 79, 51, 0.12);
  border-radius: 999px;
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--sek-burgundy, #762d31), #a04d51);
  border-radius: inherit;
  transition: width 180ms ease-out;
}

.upload-progress-track.is-indeterminate span {
  width: 38%;
  animation: upload-progress-indeterminate 1.25s ease-in-out infinite;
}

.upload-progress-stats {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.upload-progress-stats strong {
  color: var(--sek-burgundy, #762d31);
  font-size: 14px;
}

.upload-progress-stats span,
.upload-progress-hint {
  color: var(--sek-muted, var(--text-2));
  font-size: 11px;
}

.upload-progress-hint {
  grid-column: 1 / -1;
  min-height: 32px;
  margin-top: 10px;
  line-height: 1.45;
}

.upload-progress-cancel {
  grid-column: 1 / -1;
  justify-self: end;
  margin-top: 16px;
}

@keyframes upload-progress-indeterminate {
  from { transform: translateX(-110%); }
  to { transform: translateX(285%); }
}

@keyframes upload-mark-breathe {
  0%, 100% { transform: translateY(0); opacity: 0.82; }
  50% { transform: translateY(-2px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .upload-progress-track.is-indeterminate span,
  .upload-progress-card .upload-progress-mark svg {
    animation: none;
  }
}

.case-input-state {
  min-height: 28px;
  margin: 10px 0 14px;
  padding: 6px 9px;
  color: var(--text-2);
  background: var(--surface-inset);
  border-left: 3px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
}

.case-input-state[data-status="pending"] {
  color: var(--accent);
  border-left-color: var(--accent);
}

.case-input-state[data-status="confirmed"],
.case-input-state[data-status="locked"] {
  color: var(--success);
  border-left-color: var(--success);
}

.case-participant-picker {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.case-participant-picker .secondary-btn {
  min-height: 38px;
}

.cabinet-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.cabinet-form-field span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 680;
}

.cabinet-form-field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.profile-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.profile-directory-guide {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
  color: var(--text-2);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  line-height: 1.45;
}

#case-default-settings {
  scroll-margin-top: 72px;
}

.profile-directory-guide strong {
  color: var(--text);
  font-size: 14px;
}

.profile-directory-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.profile-directory-card h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
}

.profile-directory-card .cabinet-form-field {
  margin-bottom: 12px;
}

.profile-directory-card .cabinet-form-field:last-child {
  margin-bottom: 0;
}

.profile-directory-card .cabinet-form-field small {
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
}

.profile-directory-default {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-directory-default > span {
  color: var(--accent-strong);
  font-size: 12.5px;
}

.profile-directory-default select {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  font-weight: 650;
}

.profile-directory-others > span {
  color: var(--text-2);
}

.profile-directory-note {
  margin-bottom: 18px;
}

.profile-document-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cabinet-form-field textarea,
.cabinet-form-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font: inherit;
}

.cabinet-form-field textarea.profile-directory-input {
  min-height: 104px;
  resize: vertical;
  line-height: 1.4;
}

.profile-email-section {
  margin-bottom: 16px;
}

.profile-email-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid var(--line, #d9d3c8);
  border-radius: 999px;
  color: var(--muted, #746f67);
  font-size: 12px;
  white-space: nowrap;
}

.profile-email-badge.verified {
  border-color: rgba(45, 126, 79, 0.3);
  background: rgba(45, 126, 79, 0.08);
  color: #2d7e4f;
}

.profile-email-warning {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 116, 26, 0.28);
  border-radius: var(--radius-xs);
  background: rgba(232, 177, 79, 0.1);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
}

.profile-email-warning strong {
  color: var(--text);
  font-size: 13px;
}

@media (max-width: 700px) {
  .case-participant-picker {
    grid-template-columns: 1fr;
  }

  .case-inheritance-note {
    align-items: stretch;
    flex-direction: column;
  }

  .case-inheritance-note .secondary-btn {
    width: 100%;
  }

  .profile-directory-grid {
    grid-template-columns: 1fr;
  }

  .profile-document-settings-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .modal-actions > button {
    width: 100%;
  }

  .modal-overlay {
    place-items: center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .modal-card,
  .modal-card-wide {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 16px;
    scrollbar-gutter: auto;
  }

  .upload-progress-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0 12px;
    padding: 20px;
  }

  .upload-progress-mark {
    width: 46px;
    height: 46px;
  }

  .upload-progress-heading h2 {
    font-size: 21px;
  }

  .upload-progress-file {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    margin-top: 20px;
  }

  .upload-progress-file strong {
    width: 100%;
  }

  .upload-progress-cancel {
    justify-self: stretch;
    width: 100%;
  }

  #minutesTopupForm .modal-field {
    margin-top: 13px;
  }

  #minutesTopupForm .modal-head {
    position: sticky;
    z-index: 3;
    top: 0;
    margin: -16px -16px 0;
    padding: 16px 16px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

  #minutesTopupForm .minutes-topup-contact-grid {
    gap: 6px;
    margin-top: 12px;
  }

  #minutesTopupForm .modal-text {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
  }

  #minutesTopupForm .tbank-sbp-choice {
    margin-top: 12px;
    padding: 12px;
  }

  #minutesTopupForm .modal-actions {
    position: sticky;
    z-index: 2;
    bottom: 0;
    margin: 16px -16px -16px;
    padding: 12px 16px 16px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
  }

  .tbank-sbp-choice-head span {
    display: none;
  }

  .tbank-sbp-qr {
    gap: 8px;
    padding: 4px 0;
  }

  .tbank-sbp-qr img {
    width: min(230px, 68vw, 43dvh);
    border-width: 5px;
  }

  .tbank-sbp-qr a,
  .tbank-sbp-reset-btn {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (max-height: 680px) {
  .modal-overlay {
    place-items: center;
    padding-block: 8px;
  }

  .modal-card,
  .modal-card-wide {
    max-height: calc(100dvh - 16px);
  }

  .tbank-sbp-qr img {
    width: min(210px, 58vw, 38dvh);
  }
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  color: #ffffff;
  background: linear-gradient(180deg, #dc4b3e, var(--danger));
  border: 1px solid var(--danger);
  border-radius: var(--radius-xs);
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(180, 35, 24, 0.30);
}

.danger-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px rgba(180, 35, 24, 0.34);
}

.danger-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.danger-btn.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
}

/* ===================== Чип пользователя ===================== */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 4px 13px 4px 5px;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.user-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 var(--edge-light);
}

.user-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.user-avatar.lg {
  width: 46px;
  height: 46px;
  font-size: 17px;
}

.user-name {
  max-width: 160px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-name-row {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.header-billing-label {
  flex: none;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.header-billing-compact {
  display: block;
  width: 100%;
  margin-top: 5px;
}

.header-billing-track,
.profile-billing-track {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: 999px;
}

.header-billing-track {
  height: 3px;
}

.header-billing-bar,
.profile-billing-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 300ms ease, background-color 180ms ease;
}

.header-billing-compact.is-warning .header-billing-bar,
.profile-billing-section.is-warning .profile-billing-bar {
  background: #b7791f;
}

.header-billing-compact.is-critical .header-billing-bar,
.profile-billing-section.is-critical .profile-billing-bar {
  background: var(--danger);
}

.header-billing-compact.is-unlimited .header-billing-bar,
.profile-billing-section.is-unlimited .profile-billing-bar {
  background: #2f855a;
}

/* ===================== Кабинет (slide-over) ===================== */
.cabinet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 39, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.cabinet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cabinet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(400px, 92vw);
  padding: 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1), visibility 260ms;
}

.cabinet.open {
  transform: none;
  visibility: visible;
}

.cabinet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cabinet-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cabinet-id-text {
  min-width: 0;
}

.cabinet-name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 720;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cabinet-username {
  font-size: 13px;
  color: var(--text-3);
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 140ms ease, color 140ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.cabinet-section h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.cabinet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cabinet-section-head h3 {
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.stat-value {
  font-size: 24px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.stat-label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.profile-billing-section {
  position: relative;
}

.profile-billing-head,
.profile-billing-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.profile-billing-head {
  margin-bottom: 18px;
}

.profile-billing-head h3 {
  margin-bottom: 0;
}

.profile-billing-caption {
  display: block;
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-billing-badge {
  padding: 5px 9px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-billing-section.is-unlimited .profile-billing-badge {
  color: #276749;
  background: rgba(47, 133, 90, 0.1);
  border-color: rgba(47, 133, 90, 0.24);
}

.profile-billing-balance {
  flex: 0 0 auto;
}

.profile-billing-balance span,
.profile-billing-progress > span {
  display: block;
  color: var(--text-3);
  font-size: 11.5px;
}

.profile-billing-balance strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(25px, 4vw, 38px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1;
}

.profile-billing-progress {
  width: min(440px, 62%);
  padding-top: 6px;
}

.profile-billing-track {
  height: 9px;
  margin-bottom: 7px;
}

.profile-billing-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.profile-billing-metric {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
}

.profile-billing-metric span,
.profile-billing-metric strong {
  display: block;
}

.profile-billing-metric span {
  color: var(--text-3);
  font-size: 11px;
}

.profile-billing-metric strong {
  margin-top: 4px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
}

.profile-billing-note {
  margin: 12px 0 0;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.45;
}

.profile-credit-section {
  position: relative;
}

.profile-credit-layout {
  display: grid;
  gap: 20px;
}

.profile-credit-summary,
.profile-credit-ledger,
.profile-credit-entry-copy {
  min-width: 0;
}

.profile-credit-head,
.profile-credit-actions,
.profile-credit-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-credit-head h3 {
  margin-bottom: 0;
}

.profile-credit-balance {
  color: var(--accent-strong);
  font-size: 24px;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.profile-credit-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
}

.profile-credit-history-head {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-credit-history {
  margin-top: 6px;
}

.profile-credit-entry {
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.profile-credit-entry:last-child {
  border-bottom: 0;
}

.profile-credit-entry-copy {
  display: grid;
  gap: 3px;
}

.profile-credit-entry-label {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.profile-credit-entry-details {
  color: var(--text-3);
  font-size: 10.5px;
}

.profile-credit-entry > strong {
  flex: none;
  white-space: nowrap;
}

.profile-credit-entry strong.is-credit {
  color: #276749;
}

.profile-credit-entry strong.is-debit {
  color: var(--text-2);
}

.profile-credit-empty {
  padding: 10px 0 2px;
  color: var(--text-3);
  font-size: 12px;
}

@media (max-width: 520px) {
  .profile-billing-head,
  .profile-credit-head {
    flex-direction: column;
  }

  .profile-billing-badge {
    white-space: normal;
  }

  .profile-billing-overview {
    flex-direction: column;
  }

  .profile-billing-progress {
    width: 100%;
  }

  .profile-billing-metrics {
    grid-template-columns: 1fr;
  }

  .profile-credit-entry {
    gap: 8px;
  }
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.toggle-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toggle-title {
  font-size: 14px;
  font-weight: 600;
}

.toggle-sub {
  font-size: 12px;
  color: var(--text-3);
}

.toggle-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.toggle-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 27px;
  background: var(--surface-inset);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(17, 24, 39, 0.18);
  transition: background-color 180ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.toggle-input:checked + .toggle-track {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(19px);
}

.toggle-input:focus-visible + .toggle-track {
  box-shadow: inset 0 1px 3px rgba(17, 24, 39, 0.18), 0 0 0 4px var(--accent-soft);
}

.cabinet-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cabinet-status {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--text-2);
}

.cabinet-status.error {
  color: var(--danger);
}

.cabinet-status.ok {
  color: var(--accent-strong);
}

.cabinet-note {
  margin: 0 0 12px;
  color: var(--text-2);
  line-height: 1.45;
}

.cabinet-link-btn {
  width: 100%;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.notifications-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 12px;
}

.notification-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 8px;
  padding: 11px 12px;
  color: var(--text-2);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.notification-summary-card strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.notification-summary-card small {
  grid-column: 1 / -1;
  color: var(--text-3);
  font-size: 11.5px;
}

.notification-summary-card.has-unread {
  border-color: var(--accent-line);
}

.notification-summary-card.support.has-unread {
  background: #fff8e8;
  border-color: rgba(123, 34, 48, 0.3);
}

.notification-summary-card.support.has-unread strong {
  color: #7b2230;
}

.notifications-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.notification-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.notification-filter span {
  min-width: 19px;
  padding: 1px 5px;
  color: var(--text-3);
  background: var(--surface-inset);
  border-radius: 999px;
  font-size: 10.5px;
  text-align: center;
}

.notification-filter:hover,
.notification-filter.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.notification-filter.is-active span {
  color: inherit;
  background: var(--surface);
}

.notification-filter.has-unread:not(.is-active)::after {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 999px;
  content: "";
}

.notification-group {
  display: grid;
  gap: 8px;
}

.notification-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.notification-group-head h4 {
  margin: 0;
  font-size: 13px;
}

.notification-group-head span {
  color: var(--text-3);
  font-size: 11.5px;
}

.notification-group.category-support .notification-group-head h4 {
  color: #7b2230;
}

.notification-group-list {
  display: grid;
  gap: 8px;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.notification-row.unread {
  border-color: var(--accent-line);
  box-shadow: inset 3px 0 0 var(--accent);
}

.notification-row.warning.unread {
  border-color: rgba(217, 119, 6, 0.28);
  box-shadow: inset 3px 0 0 #d97706;
}

.notification-row.danger.unread {
  border-color: var(--danger-line);
  box-shadow: inset 3px 0 0 var(--danger);
}

.notification-row.category-support {
  background: #fffdf7;
  border-color: rgba(123, 34, 48, 0.22);
}

.notification-row.category-support.unread {
  background: #fff8e8;
  border-color: rgba(123, 34, 48, 0.36);
  box-shadow: inset 4px 0 0 #7b2230;
}

.notification-main {
  flex: 1;
  min-width: 0;
}

.notification-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
}

.notification-title > span:nth-child(2) {
  overflow-wrap: anywhere;
}

.notification-ticket {
  flex: none;
  padding: 2px 6px;
  color: #7b2230;
  background: rgba(123, 34, 48, 0.08);
  border: 1px solid rgba(123, 34, 48, 0.16);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.notification-dot {
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--text-3);
  border-radius: 999px;
}

.notification-row.success .notification-dot {
  background: var(--accent);
}

.notification-row.warning .notification-dot {
  background: #d97706;
}

.notification-row.danger .notification-dot {
  background: var(--danger);
}

.notification-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-3);
}

.notification-message {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
}

.notification-empty {
  padding: 10px;
  color: var(--text-3);
  background: var(--surface-inset);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.session-main {
  flex: 1;
  min-width: 0;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-badge {
  flex: none;
  padding: 2px 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.session-meta,
.session-empty {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.35;
}

.logout-btn {
  margin-top: auto;
  min-height: 44px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-xs);
  font-weight: 650;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease;
}

.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 680px) {
  .user-name {
    display: none;
  }

  .user-chip {
    padding: 4px;
  }

  .notifications-summary {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .notifications-filters {
    flex-wrap: nowrap;
    margin-right: -10px;
    overflow-x: auto;
    padding: 0 10px 5px 0;
  }

  .notification-filter {
    flex: 0 0 auto;
  }

  .notification-row {
    display: grid;
  }

  .notification-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ===================== Переключатель «Мои / Все» ===================== */
.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scope-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.08);
}

.scope-toggle[hidden] {
  display: none;
}

.scope-btn {
  padding: 5px 13px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.scope-btn.is-active {
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.owner-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ===================== Админ-секция кабинета ===================== */
.admin-overview {
  margin-bottom: 14px;
}

.admin-system {
  margin-bottom: 14px;
}

.admin-audit {
  margin-bottom: 14px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-overview-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.admin-overview-grid b {
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.01em;
}

.admin-overview-grid span {
  font-size: 11px;
  color: var(--text-3);
}

.admin-system-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.admin-metric-card > span,
.admin-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-3);
}

.admin-metric-card b {
  font-size: 16px;
  font-weight: 740;
}

.admin-metric-card small {
  color: var(--text-3);
  line-height: 1.4;
}

.admin-block-group,
.admin-backup-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-attention-panel {
  padding: 12px 14px;
  border-left: 4px solid var(--line-2);
  background: var(--surface-2);
}

.admin-attention-panel.has-signals {
  border-left-color: var(--danger);
  background: #fff8f7;
}

.admin-attention-panel.is-clear {
  border-left-color: var(--success);
  background: #f3faf6;
}

.admin-signal-title,
.admin-alert-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-signal-title > span,
.admin-alert-severity {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 650;
}

.admin-alert-list,
.admin-active-list,
.admin-backup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-active-list {
  margin-top: 10px;
}

.admin-alert-item,
.admin-active-item,
.admin-backup-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.admin-alert-item.warning {
  color: #76520c;
  background: rgba(250, 176, 5, 0.12);
  border-color: rgba(250, 176, 5, 0.36);
}

.admin-alert-item.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.admin-alert-item.info {
  color: var(--text-2);
  background: var(--surface-2);
  border-color: var(--line);
}

.admin-alert-item .admin-alert-severity {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 10.5px;
  text-transform: uppercase;
}

.admin-alert-item b,
.admin-active-item b,
.admin-backup-item b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.admin-alert-item span,
.admin-active-item span,
.admin-active-item small,
.admin-backup-item span {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-active-item.processing {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.admin-active-item.canceling,
.admin-active-item.error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
}

.admin-backup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.admin-backup-head p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
}

.disk-bar {
  height: 7px;
  overflow: hidden;
  background: var(--surface-inset);
  border-radius: 999px;
}

.disk-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.disk-bar-fill.ok {
  background: var(--accent);
}

.disk-bar-fill.warning {
  background: var(--amber);
}

.disk-bar-fill.danger {
  background: var(--danger);
}

.admin-error-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.admin-diagnostic-panel {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-diagnostic-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  cursor: pointer;
  color: var(--text-2);
  font-weight: 700;
}

.admin-diagnostic-panel > summary small {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
}

.admin-diagnostic-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 12px;
}

.admin-diagnostic-content .admin-error-list {
  margin-top: 2px;
}

.admin-error-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
}

.admin-error-item b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.admin-error-item span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-3);
}

.admin-error-item p {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

.admin-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.admin-audit-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.admin-audit-item b {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.admin-audit-item span {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.admin-audit-item p {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}

.admin-storage-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field.compact {
  gap: 5px;
}

.field.compact input {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 13px;
}

.toggle-row.compact {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--edge-light);
}

.admin-user-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar.sm {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.admin-user-text {
  min-width: 0;
}

.admin-user-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
}

.admin-user-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
}

.role-badge {
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
}

.role-badge.self {
  color: var(--text-2);
  background: var(--surface-inset);
  border-color: var(--line);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.mini-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mini-btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}
