﻿:root {
  --brand-red: #b91c1c;
  --brand-graphite: #1a1d24;
  --brand-steel: #5b6573;
  --brand-amber: #c4a574;
  --brand-green: #15803d;
  --brand-blue: #2563eb;
  --modum-ink: #0e1114;
  --modum-panel: #14181d;
  --modum-text: #f4f2ec;
  --modum-muted: #9aa3ae;
  --modum-accent: #c4a574;
  --modum-accent-soft: rgba(196, 165, 116, 0.16);
  --action: var(--modum-ink);
  --action-hover: #1a1f26;
  --surface: #ffffff;
  --surface-soft: #f3f1ec;
  --surface-rail: #0e1114;
  --line: #e2e0d8;
  --text: #14181d;
  --muted: #6b7280;
  --danger-soft: #fee2e2;
  --ok-soft: #dcfce7;
  --warn-soft: #fef3c7;
  --shadow: 0 12px 32px rgba(14, 17, 20, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(196, 165, 116, 0.07), transparent 55%),
    var(--surface-soft);
  color: var(--text);
  font-family: Manrope, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot,
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 50% at 12% 18%, rgba(196, 165, 116, 0.12), transparent 55%),
    linear-gradient(135deg, #0e1114 0%, #14181d 52%, #0c0f12 100%);
}

.boot {
  place-content: center;
  justify-items: center;
  text-align: center;
  color: #f4f1ea;
  gap: 10px;
}

.boot-brand {
  font-family: Manrope, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c4a574;
}

.boot-lead {
  max-width: 28rem;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(244, 241, 234, 0.88);
}

.boot-status {
  margin-top: 8px;
  font-size: 0.92rem;
  color: rgba(244, 241, 234, 0.55);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.logo-box,
.product-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--modum-ink);
  color: var(--modum-accent);
  border: 1px solid rgba(196, 165, 116, 0.4);
  display: grid;
  place-items: center;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.brand-title {
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--modum-text);
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--modum-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* —— Modum selling gate (login) —— */
.modum-gate {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--modum-text);
  background: var(--modum-ink);
  font-family: Manrope, "Segoe UI", sans-serif;
}

.modum-gate-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 12% 18%, rgba(196, 165, 116, 0.16), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(196, 165, 116, 0.08), transparent 50%),
    linear-gradient(135deg, #0e1114 0%, #14181d 52%, #0c0f12 100%);
}

.modum-gate-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000 20%, transparent 75%);
}

.modum-gate-grid {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 0;
}

.modum-gate-hero {
  max-width: 34rem;
  animation: modum-gate-rise 700ms ease-out both;
}

.modum-gate-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--modum-accent);
}

.modum-gate-brand {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--modum-text);
}

.modum-gate-headline {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 18ch;
  color: var(--modum-text);
}

.modum-gate-lead {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--modum-muted);
  max-width: 38ch;
  font-weight: 400;
}

.modum-gate-home-link {
  margin: -12px 0 22px;
}

.modum-gate-home-link a {
  color: var(--modum-accent, #c4a574);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.modum-gate-home-link a:hover {
  text-decoration: underline;
}

.modum-register-offer {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.16), rgba(196, 165, 116, 0.05));
  color: var(--modum-text);
  font-size: 14px;
  line-height: 1.45;
}

.modum-register-offer strong {
  display: block;
  margin: 0 0 4px;
  color: var(--modum-ink);
}

.modum-gate h1,
.modum-gate h2,
.modum-gate h3 {
  color: var(--modum-text);
}

.modum-gate .muted {
  color: var(--modum-muted);
}

.modum-gate-deck {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  animation: modum-gate-rise 900ms ease-out both;
}

.modum-gate-deck-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.55);
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.22), rgba(196, 165, 116, 0.08));
  color: var(--modum-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.modum-gate-deck-link:hover {
  transform: translateY(-1px);
  border-color: var(--modum-accent);
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.32), rgba(196, 165, 116, 0.12));
}

.modum-gate-deck-meta {
  margin: 0;
  font-size: 13px;
  color: rgba(154, 163, 174, 0.85);
}

.modum-gate-auth {
  animation: modum-gate-rise 800ms ease-out 80ms both;
}

.modum-login-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--text);
}

.modum-login-panel .brand-mark {
  margin-bottom: 12px;
}

/* White card: brand title must be ink, not light gate text */
.login-panel .brand-title,
.modum-login-panel .brand-title {
  color: var(--modum-ink);
}

.login-panel .brand-subtitle,
.modum-login-panel .brand-subtitle {
  color: #9a7d4a;
}

.modum-login-panel .muted {
  margin: 0 0 8px;
  color: var(--muted);
}

.modum-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f1ec;
}

.modum-auth-tab {
  border: 0;
  border-radius: 9px;
  min-height: 36px;
  background: transparent;
  color: #687385;
  font-weight: 700;
  font-size: 13px;
}

.modum-auth-tab.is-active {
  background: #fff;
  color: var(--modum-ink);
  box-shadow: 0 1px 4px rgba(14, 17, 20, 0.08);
}

.modum-login-panel .modum-primary-button,
.modum-login-panel .primary-button.modum-primary-button {
  background: var(--modum-ink);
  border-color: var(--modum-ink);
  color: var(--modum-text);
  border-radius: 10px;
  min-height: 44px;
  letter-spacing: 0.01em;
}

.modum-login-panel .modum-primary-button:hover {
  background: #1a1f24;
  border-color: var(--modum-accent);
}

.modum-org-code {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f3f1ec !important;
  color: var(--modum-ink);
  cursor: default;
}

.modum-org-code-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.modum-org-code-hint.is-ok {
  color: #1f6b3a;
}

.modum-org-code-hint.is-bad {
  color: var(--brand-red);
}

.modum-login-composite {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid var(--line, #d7dbe3);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.modum-login-prefix {
  display: grid;
  place-items: center;
  padding: 0 12px;
  background: #f3f1ec;
  color: var(--modum-ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-right: 1px solid var(--line, #d7dbe3);
  white-space: nowrap;
}

.modum-login-composite input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.modum-login-full {
  margin: 6px 0 0;
  font-size: 12px;
}

@keyframes modum-gate-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .modum-gate {
    overflow: auto;
    min-height: 100dvh;
  }

  .modum-gate-grid {
    grid-template-columns: 1fr;
    width: min(440px, calc(100% - 28px));
    padding: 20px 0 40px;
    gap: 22px;
    align-items: start;
    min-height: auto;
  }

  /* Form first on phones — less scroll before login */
  .modum-gate-auth {
    order: -1;
  }

  .modum-gate-brand {
    font-size: clamp(34px, 10vw, 48px);
    margin-bottom: 12px;
  }

  .modum-gate-headline {
    max-width: none;
    font-size: clamp(18px, 5vw, 24px);
    margin-bottom: 12px;
  }

  .modum-gate-lead {
    max-width: none;
    font-size: 15px;
    margin-bottom: 18px;
  }

  .modum-login-panel {
    padding: 22px 18px;
  }

  .modum-gate-deck-link {
    width: 100%;
  }

  .modum-gate-deck-meta {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .modum-gate-grid {
    width: calc(100% - 20px);
  }

  .modum-gate-eyebrow {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
}

.field {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.field label {
  color: var(--brand-steel);
  font-size: 13px;
}

.field > span {
  color: var(--brand-steel);
  font-size: 13px;
  font-weight: 700;
}

.field > small {
  display: block;
  margin-top: -2px;
  font-size: 12px;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea,
.action-form input,
.action-form select,
.action-form textarea,
.table-wrap input,
.table-wrap select,
.filters input,
.filters select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  box-sizing: border-box;
}

.field textarea,
.action-form textarea,
.updates-compose textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
  font: inherit;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 8px 14px;
  background: #fff;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

a.primary-button,
a.ghost-button,
a.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.text-link {
  color: var(--modum-ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(196, 165, 116, 0.45);
}
button.text-link {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(196, 165, 116, 0.45);
  border-radius: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--modum-ink);
  box-shadow: none;
}

.text-link:hover {
  color: #000;
  border-bottom-color: var(--modum-accent);
  text-decoration: none;
}

.primary-button {
  width: 100%;
  background: var(--action);
  border-color: var(--action);
  color: var(--modum-text);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-button:hover {
  background: var(--action-hover);
  border-color: var(--modum-accent);
  box-shadow: 0 0 0 1px var(--modum-accent);
}

.primary-button.inline {
  width: auto;
}

label.primary-button.inline,
label.ghost-button.inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.ghost-button.danger {
  border-color: #fecaca;
  color: var(--brand-red);
}

.org-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

tr.is-current-org td {
  background: #f8fafc;
}

.table-wrap table {
  min-width: 720px;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--brand-steel);
}

.error-text {
  min-height: 20px;
  color: var(--brand-red);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
}

.nav-drawer-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.42);
}

.nav-drawer-backdrop[hidden] {
  display: none !important;
}

.sidebar {
  background:
    radial-gradient(520px 240px at 0% 0%, rgba(196, 165, 116, 0.14), transparent 60%),
    linear-gradient(180deg, #12161b 0%, var(--modum-ink) 100%);
  color: var(--modum-text);
  min-height: 100vh;
  padding: 18px 14px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 88vw);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.2s ease, visibility 0s linear 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
}

.app-shell.nav-open .sidebar {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.2s ease, visibility 0s;
  box-shadow: 8px 0 28px rgba(14, 17, 20, 0.28);
}

.app-shell.nav-no-anim .sidebar,
.app-shell.nav-no-anim .nav-drawer-backdrop {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-drawer-backdrop {
    transition: none !important;
  }
}

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

.sidebar-drawer-head .brand-mark {
  margin-bottom: 0;
}

.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--modum-muted) !important;
  border: 1px solid rgba(196, 165, 116, 0.22) !important;
  border-radius: 10px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}

.sidebar-close:hover {
  background: rgba(196, 165, 116, 0.14) !important;
  color: var(--modum-text) !important;
  border-color: rgba(196, 165, 116, 0.4) !important;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(14, 17, 20, 0.28) !important;
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f7f4ee 100%) !important;
  color: var(--modum-ink, #0e1114) !important;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-drawer-toggle:hover {
  border-color: rgba(14, 17, 20, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.55);
  background: #fffdf8 !important;
  color: var(--modum-ink, #0e1114) !important;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(14, 17, 20, 0.1);
  background: linear-gradient(180deg, #ffffff 0%, #f6f3ec 100%);
  color: var(--modum-ink, #0e1114);
  display: inline-grid;
  place-items: center;
}

.topbar-icon-btn:hover {
  border-color: rgba(196, 165, 116, 0.55);
  background: #fffdf8;
  color: var(--modum-ink, #0e1114);
}

.topbar-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.topbar-bell {
  position: relative;
}

.topbar-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.nav-link-label {
  min-width: 0;
}

.nav-link-badge,
.nav-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
}

.nav-section-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar-logout {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.topbar-news-btn {
  position: relative;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-chat {
  position: relative;
}

.topbar-news-btn .topbar-bell-badge {
  top: -4px;
  right: -4px;
}

.topbar-news-btn[aria-expanded="true"] {
  border-color: rgba(196, 165, 116, 0.55);
  background: #fffdf8;
}

.topbar-news-short {
  display: none;
}

.platform-news-tape {
  margin: 0 16px 0;
}

.platform-news-tape[hidden] {
  display: none !important;
}

.platform-news-tape-inner {
  margin: 12px 0 0;
  padding: 14px 16px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #c4a574 35%, #e8e4dc);
  background: linear-gradient(135deg, #fff8ee 0%, #fff 72%);
}

.platform-news-tape-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.platform-news-tape-head strong {
  display: block;
  margin-bottom: 4px;
}

.platform-news-tape-head p {
  margin: 0;
  max-width: 42rem;
}

.platform-news-tape-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.platform-news-card {
  flex: 0 0 min(280px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.platform-news-card:hover {
  border-color: rgba(196, 165, 116, 0.55);
  background: #fffdf8;
}

.platform-news-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.platform-news-card strong {
  font-size: 15px;
  line-height: 1.35;
}

.platform-news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 900px) {
  .topbar-news-full {
    display: none;
  }
  .topbar-news-short {
    display: inline;
  }
}

.notifications-panel {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 40;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
}

.notifications-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.notifications-panel-actions {
  display: flex;
  gap: 6px;
}

.notifications-panel-list {
  padding: 8px;
}

.notifications-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  color: inherit;
}

.notifications-item.is-unread {
  background: color-mix(in srgb, #b91c1c 8%, var(--surface));
  border-color: color-mix(in srgb, #b91c1c 22%, var(--line));
}

.notifications-item.is-update {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line));
}

.notifications-item.is-update.is-unread {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 14%, var(--surface));
}

.notifications-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.notifications-item-cta {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--modum-accent, #c4a574) 70%, #0e1114);
}

.error-brief.is-critical {
  border-color: color-mix(in srgb, #b91c1c 32%, var(--line));
  background: color-mix(in srgb, #b91c1c 7%, var(--surface));
}

.error-brief.is-warn {
  border-color: color-mix(in srgb, #b45309 32%, var(--line));
  background: color-mix(in srgb, #b45309 7%, var(--surface));
}

.error-brief.is-info {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 8%, var(--surface));
}

.error-brief h2 {
  margin: 0 0 8px;
}

.error-brief-grid {
  display: grid;
  gap: 12px;
}

.error-brief-item h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #667085);
}

.error-brief-item p {
  margin: 0;
  line-height: 1.45;
}

.error-brief-tech {
  margin-top: 14px;
}

.error-brief-tech summary {
  cursor: pointer;
  font-weight: 650;
}

.error-brief-tech pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.4;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #0e1114 6%, var(--surface));
}

.ops-specialist {
  margin: 16px 0 8px;
}

.ops-specialist > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 0;
}

.ops-specialist .section-panel {
  margin-top: 12px;
}

.notifications-panel-foot {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

.notifications-panel-foot .text-link,
.notifications-panel-foot button {
  font-size: 13px;
  font-weight: 650;
}

.support-reply-preview {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.company-brand-banner {
  display: flex;
  align-items: stretch;
  height: 40px;
  min-height: 40px;
  min-width: 0;
  max-width: min(280px, 36vw);
  background: var(--org-brand-rail, #111827);
  color: var(--org-brand-ink, #fff);
  border: 1px solid color-mix(in srgb, var(--org-brand-accent, #b91c1c) 35%, var(--line));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: none;
}

.company-brand-accent {
  width: 6px;
  flex: 0 0 6px;
  background: var(--org-brand-accent, #b91c1c);
}

.company-brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px 0 12px;
  min-width: 0;
}

.company-brand-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.company-brand-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.has-org-brand .topbar {
  background: linear-gradient(180deg, var(--org-brand-soft, #f7f5f0) 0%, #f3f1ec 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--org-brand-accent, var(--modum-accent)) 22%, var(--line));
}

.has-org-brand .sidebar {
  /* Компания может красить баннер, но рельс продукта остаётся Модум */
  background:
    radial-gradient(520px 240px at 0% 0%, rgba(196, 165, 116, 0.14), transparent 60%),
    linear-gradient(180deg, #12161b 0%, var(--modum-ink) 100%);
}

/* Логотип продукта Модум никогда не перекрашивается цветом компании */
.has-org-brand .product-logo,
.has-org-brand .sidebar .logo-box {
  background: var(--modum-ink) !important;
  color: var(--modum-accent) !important;
  border-color: rgba(196, 165, 116, 0.4) !important;
}

.brand-theme-studio {
  margin: 10px 0 4px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 14px;
  background: #fcfcfb;
}

.brand-theme-studio .field-label {
  font-weight: 650;
  margin-bottom: 8px;
  font-size: 13px;
}

.brand-theme-preview {
  display: flex;
  align-items: stretch;
  min-height: 44px;
  margin: 0 0 12px;
  max-width: 320px;
  background: var(--preview-rail, #111827);
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: none;
}

.brand-theme-preview-accent {
  width: 4px;
  flex: 0 0 4px;
  background: var(--preview-accent, #b91c1c);
}

.brand-theme-preview > div {
  padding: 8px 12px;
}

.brand-theme-preview-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.brand-theme-preview-name {
  font-size: 14px;
  font-weight: 700;
}

.settings-company-layout {
  max-width: 760px;
  display: grid;
  gap: 14px;
}

.settings-company-layout:has([data-settings-panel="structure"]:not([hidden])) {
  max-width: none;
  width: 100%;
}

.settings-company-card {
  max-width: none;
}

.settings-company-lead {
  margin: 6px 0 0;
  max-width: 42em;
  line-height: 1.55;
  font-size: 14.5px;
}

.settings-company-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  max-width: 720px;
}

.settings-company-form .form-grid {
  margin: 0;
}

.settings-company-subhead {
  margin: 4px 0 0;
  font-size: 1.05rem;
}

.settings-company-form .field {
  margin: 0;
}

.settings-company-form .field input {
  min-height: 44px;
}

.settings-company-form input[type="checkbox"],
.settings-company-form .field input[type="checkbox"] {
  min-height: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  align-self: center;
}

.settings-company-form .field-hint {
  margin-top: 4px;
}

.settings-company-form .form-actions {
  margin-top: 4px;
}

.settings-company-hint {
  margin: 4px 2px 0;
  font-size: 13px;
}

.settings-company-hint .text-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.settings-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #ebe7df;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.settings-tab {
  border: 0;
  border-radius: 9px;
  min-height: 38px;
  padding: 0 16px;
  background: transparent;
  color: #5b6573;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.settings-tab.is-active {
  background: #fff;
  color: var(--modum-ink, #0e1114);
  box-shadow: 0 1px 4px rgba(14, 17, 20, 0.08);
}

.mail-message-item.is-unread strong {
  font-weight: 800;
}

.mail-message-item.is-selected {
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 40%, var(--line, #d6d3cd));
  background: color-mix(in srgb, var(--accent, #b91c1c) 6%, #fff);
}

.mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mail-toolbar-account {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.mail-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mail-account-select {
  min-width: min(100%, 260px);
}

.mail-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 14px;
}

.mail-search-row input[type="search"] {
  flex: 1;
  min-width: 180px;
}

.mail-compose .field {
  margin-bottom: 10px;
}

.mail-compose-modal {
  width: min(640px, 100%);
}

#mailComposeOverlay,
#mailAddMailboxOverlay {
  z-index: 40;
}

.mail-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mail-file-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mail-file-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--action, #111);
  background: var(--action, #111);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(14, 17, 20, 0.16);
}

.mail-file-pick-btn:hover {
  background: var(--action-hover, #1c1c1c);
  border-color: var(--modum-accent, #c4a574);
  box-shadow: 0 0 0 1px var(--modum-accent, #c4a574);
}

.mail-file-pick-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.settings-tab-module::after {
  content: "модуль";
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--modum-ink, #0e1114);
  background: color-mix(in srgb, var(--modum-accent, #b91c1c) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--modum-accent, #b91c1c) 30%, #fff);
}

.settings-module-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--modum-ink, #0e1114);
  background: color-mix(in srgb, var(--modum-accent, #b91c1c) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--modum-accent, #b91c1c) 28%, #fff);
}

.settings-module-card > h2 {
  margin-top: 0;
}

.settings-channel-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.settings-channel-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid #e2ddd2;
  border-radius: 14px;
  background: #fffefb;
}

.settings-channel-card.is-connected {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 45%, #e2ddd2);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f4ec 100%);
}

.settings-channel-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f3f1ec;
  color: #0e1114;
}

.settings-channel-icon.is-telegram {
  background: #2AABEE;
  color: #fff;
}

.settings-channel-icon.is-whatsapp {
  background: #25D366;
  color: #fff;
}

.settings-channel-icon.is-max {
  background: linear-gradient(135deg, #471AFF 0%, #9500FF 100%);
  color: #fff;
}

.settings-channel-card.is-connected .settings-channel-icon {
  box-shadow: 0 1px 4px rgba(14, 17, 20, 0.12);
}

.settings-channel-card.is-connected .settings-channel-icon.is-telegram,
.settings-channel-card.is-connected .settings-channel-icon.is-whatsapp,
.settings-channel-card.is-connected .settings-channel-icon.is-max {
  color: #fff;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
}

.test-flow-ready-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.test-flow-viewswitch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f1ec;
  border: 1px solid #e8e4db;
}

.test-flow-viewtab {
  border: 0;
  background: transparent;
  color: #5b6472;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.test-flow-viewtab.is-active {
  background: #fff;
  color: var(--modum-ink, #0e1114);
  box-shadow: 0 1px 3px rgba(14, 17, 20, 0.08);
}

.test-flow-limit {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.test-flow-blocked {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.test-flow-blocked p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
}

.test-flow-blocked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-flow-limit p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
}

.test-flow-limit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button.inline.compact {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.settings-channel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 4px;
}

.settings-channel-status {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8a7349;
}

.settings-channel-card.is-available .settings-channel-status {
  color: #8a93a0;
}

.settings-channel-hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

/* —— Work structure canvas —— */
.work-structure-panel .work-structure-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ws-sync-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f0c7a0;
  background: #fff7ed;
  color: #44403c;
  font-size: 14px;
  line-height: 1.45;
}

.ws-sync-banner strong {
  display: block;
  margin-bottom: 4px;
  color: #9a3412;
}

.ws-sync-banner p {
  margin: 0;
}

.work-structure-panel h2 {
  margin: 0 0 6px;
}

.work-structure-preview {
  border: 1px solid #e4dfd4;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(820px 280px at 12% 0%, rgba(196, 165, 116, 0.14), transparent 58%),
    linear-gradient(180deg, #fbfaf6 0%, #f3f0e8 100%);
  min-height: 560px;
  height: max(560px, calc(100vh - 280px));
  width: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
}

.work-structure-empty {
  padding: 48px 24px;
  text-align: center;
  color: #14181d;
}

.work-structure-empty .muted {
  color: #6b7280;
}

.ws-canvas {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 360px;
  height: 100%;
  color: #f4f2ec;
}

.ws-canvas.is-readonly {
  grid-template-columns: 1fr;
  min-height: 100%;
  height: 100%;
  color: #14181d;
}

.ws-canvas.is-readonly.is-navigable {
  pointer-events: auto;
}

.ws-canvas.is-readonly.is-navigable .ws-stage {
  cursor: grab;
  touch-action: none;
}

.ws-canvas.is-readonly.is-navigable.is-panning .ws-stage {
  cursor: grabbing;
}

.ws-node.is-clickable {
  cursor: pointer;
  outline: 2px solid transparent;
  transition: outline-color .15s ease, box-shadow .15s ease;
}

.ws-node.is-clickable:hover {
  outline-color: color-mix(in srgb, var(--org-brand-accent, #b91c1c) 70%, #111);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.work-structure-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.work-structure-preview {
  min-height: 560px;
  height: max(560px, calc(100vh - 280px));
}

.work-structure-preview.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 170;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 12px;
  border-radius: 0;
  background: #f8fafc;
  box-sizing: border-box;
  overflow: hidden;
}

.work-structure-preview-placeholder {
  width: 100%;
  min-height: 360px;
  border: 1px dashed #e4dfd4;
  border-radius: 16px;
  background: #f3f0e8;
  box-sizing: border-box;
}

body.ws-structure-fullscreen-open {
  overflow: hidden;
}

/* Employee card must sit above the fullscreen structure canvas. */
body.ws-structure-fullscreen-open .preview-modal-overlay[data-employee-modal]:not([hidden]) {
  z-index: 180;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: rgba(14, 17, 20, 0.34);
}

body.ws-structure-fullscreen-open .preview-modal-overlay[data-employee-modal]:not([hidden]) .preview-modal {
  width: min(520px, 100vw);
  max-height: 100vh;
  height: 100%;
  margin: 0;
  border-radius: 0;
  border: 0;
  border-left: 1px solid #e8e0d4;
  box-shadow: -24px 0 60px rgba(14, 17, 20, 0.28);
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(196, 165, 116, 0.14), transparent 55%),
    #fffdf9;
  animation: ws-employee-sheet-in 0.22s ease-out;
}

@keyframes ws-employee-sheet-in {
  from {
    transform: translateX(18px);
    opacity: 0.72;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  body.ws-structure-fullscreen-open .preview-modal-overlay[data-employee-modal]:not([hidden]) .preview-modal {
    width: 100vw;
  }
}

.work-structure-preview.is-fullscreen .ws-canvas,
.work-structure-preview.is-fullscreen .ws-stage-wrap,
.work-structure-preview.is-fullscreen .ws-stage {
  height: 100%;
  min-height: 0;
}

.employee-attendance-peek {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
}

.employee-attendance-peek h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.employee-card-block {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.employee-card-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

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

.employee-card-block-head h3 {
  margin: 0;
}

.employee-card-block-hint {
  margin: 10px 0 0;
}

.employee-card-block-danger {
  border-color: #fecaca;
  background: #fff7f7;
}

.preview-modal-overlay[data-employee-modal] .preview-modal-actions {
  display: none;
}

.preview-modal-overlay[data-employee-modal] .preview-modal h2 {
  margin-right: 300px;
}

.employee-modal-chrome {
  position: absolute;
  top: 16px;
  right: 56px;
  z-index: 3;
}

.employee-modal-full-btn {
  white-space: nowrap;
  font-size: 13px;
  padding: 7px 12px;
}

.employee-card-fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.employee-card-fold > summary::-webkit-details-marker {
  display: none;
}

.employee-card-fold > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: rotate(45deg);
  margin-top: -4px;
}

.employee-card-fold[open] > summary {
  margin-bottom: 12px;
}

.employee-card-fold[open] > summary::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

.form-grid .employee-active-field {
  grid-column: 1 / -1;
}

.employee-active-field .employee-active-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-sizing: border-box;
}

.employee-active-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  accent-color: #111827;
}

.employee-modal-footer {
  margin-top: 4px;
  padding-top: 4px;
}

@media (max-width: 720px) {
  .preview-modal-overlay[data-employee-modal] .preview-modal h2 {
    margin: 48px 0 6px;
  }

  .employee-modal-chrome {
    left: 16px;
    right: 56px;
    top: 16px;
  }

  .employee-modal-full-btn {
    width: 100%;
    justify-content: center;
  }
}
.employee-field-combo {
  position: relative;
  z-index: 6;
}
.employee-field-combo .employee-field-suggest,
.employee-field-combo .marketing-city-suggest {
  z-index: 80;
}
.employee-web-cred-grid {
  display: grid;
  gap: 8px;
  margin: 0 0 10px;
}
.employee-web-cred-grid .ghost-button {
  margin-left: 8px;
}
.employee-web-issued {
  margin: 0 0 14px;
}

.employee-attendance-stat-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.employee-attendance-stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #eceff3;
}

.employee-attendance-stat-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 2px;
}

.employee-attendance-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 6px;
  color: #374151;
  font-size: 0.92rem;
}

.preview-modal-wide {
  max-width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

button.ts-fio-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
}

button.ts-fio-link:hover {
  color: var(--org-brand-accent, #b91c1c);
  text-decoration-color: currentColor;
}

.ws-canvas.is-readonly .ws-stage-wrap {
  display: block;
  height: 100%;
  min-height: 100%;
  position: relative;
}

.ws-canvas.is-readonly .ws-stage {
  height: 100%;
  min-height: 100%;
  cursor: default;
  background-color: transparent;
  background-image:
    linear-gradient(rgba(20, 24, 29, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 29, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

.ws-preview-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e4dfd4;
  box-shadow: 0 8px 24px rgba(20, 24, 29, 0.08);
}

.ws-preview-toolbar .ghost-button {
  min-width: 36px;
}

.ws-preview-zoom {
  min-width: 48px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #14181d;
}

.ws-preview-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 3;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  color: #6b7280;
  pointer-events: none;
}

.work-structure-preview .ws-edges {
  color: #b8955f;
}

.work-structure-preview .ws-node {
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
  border: 1px solid #e2ddd2;
  box-shadow: 0 10px 24px rgba(20, 24, 29, 0.08);
  color: #14181d;
}

.work-structure-preview .ws-node-kicker {
  color: #9a7d4a;
}

.work-structure-preview .ws-node-sub {
  color: #6b7280;
}

.ws-palette {
  padding: 14px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.ws-palette-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a574;
  margin-bottom: 10px;
}

.ws-palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f2ec;
  font-weight: 650;
  font-size: 13px;
  text-align: left;
}

.ws-palette-item:hover {
  border-color: rgba(196, 165, 116, 0.55);
  background: rgba(196, 165, 116, 0.12);
}

.ws-palette-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c4a574;
}

.ws-palette-item.tone-company .ws-palette-dot { background: #c4a574; }
.ws-palette-item.tone-department .ws-palette-dot { background: #60a5fa; }
.ws-palette-item.tone-manager .ws-palette-dot { background: #f59e0b; }
.ws-palette-item.tone-staff .ws-palette-dot { background: #34d399; }
.ws-palette-item.tone-role .ws-palette-dot { background: #a78bfa; }

.ws-palette-hint {
  margin: 12px 2px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #9aa3ae !important;
}

.ws-stage-wrap {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.ws-toolbar .ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: #f4f2ec;
  border-color: rgba(255, 255, 255, 0.14);
}

.ws-toolbar-spacer {
  flex: 1;
}

.ws-stage {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  cursor: default;
  touch-action: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

.ws-canvas.is-edit.is-panning .ws-stage,
.ws-canvas.is-panning .ws-stage {
  cursor: grabbing;
}

.ws-canvas.is-marqueing .ws-stage {
  cursor: crosshair;
}

.ws-marquee {
  position: absolute;
  z-index: 6;
  border: 1px solid rgba(196, 165, 116, 0.95);
  background: rgba(196, 165, 116, 0.14);
  border-radius: 4px;
  pointer-events: none;
  box-sizing: border-box;
}

.ws-world {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.ws-edges {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  color: rgba(196, 165, 116, 0.85);
}

.ws-canvas.is-edit .ws-edges {
  pointer-events: auto;
}

.ws-edge {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  marker-end: url(#ws-arrow);
  pointer-events: stroke;
  cursor: pointer;
}

.ws-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
  cursor: pointer;
}

.ws-edge.is-selected {
  stroke: #ea580c;
  stroke-width: 3;
  filter: drop-shadow(0 0 4px rgba(234, 88, 12, 0.45));
}

.ws-edge.is-draft {
  stroke-dasharray: 6 6;
  opacity: 0.75;
  pointer-events: none;
}

.ws-nodes {
  position: absolute;
  left: 0;
  top: 0;
}

.ws-node {
  position: absolute;
  width: 208px;
  min-height: 78px;
  padding: 10px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  user-select: none;
}

.ws-node.is-selected {
  border-color: rgba(196, 165, 116, 0.85);
  box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.25), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.ws-node.tone-company { border-top: 3px solid #c4a574; }
.ws-node.tone-department { border-top: 3px solid #60a5fa; }
.ws-node.tone-manager { border-top: 3px solid #f59e0b; }
.ws-node.tone-staff { border-top: 3px solid #34d399; }
.ws-node.tone-role { border-top: 3px solid #a78bfa; }

.ws-node-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4a574;
  margin-bottom: 4px;
}

.ws-node-title {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  pointer-events: none;
}

.ws-node-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #9aa3ae;
  min-height: 1.2em;
  pointer-events: none;
}

.ws-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #0f1318;
  background: #c4a574;
  padding: 0;
  cursor: crosshair;
}

.ws-handle-out {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
}

.ws-handle-in {
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  background: #f4f2ec;
  pointer-events: none;
}

.ws-status {
  padding: 8px 12px;
  font-size: 12px;
  color: #9aa3ae !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 10, 12, 0.62);
  backdrop-filter: blur(6px);
}

.ws-overlay-card {
  width: min(1600px, 72vw);
  max-width: calc(100vw - 32px);
  height: min(920px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #12161c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.ws-context-menu {
  position: fixed;
  z-index: 90;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1a1f26;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 4px;
}

.ws-context-menu button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f4f2ec;
  text-align: left;
  padding: 10px 12px;
  font-weight: 650;
  font-size: 13px;
}

.ws-context-menu button:hover {
  background: rgba(196, 165, 116, 0.16);
}

.ws-context-menu button.is-danger {
  color: #fda4a4;
}

.ws-edit-dialog {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}

.ws-edit-card {
  width: min(440px, calc(100% - 32px));
  padding: 20px 20px 16px;
  border-radius: 14px;
  background: #fff;
  color: #14181d;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.ws-edit-card h3 {
  margin: 0 0 4px;
}

.ws-edit-type {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.ws-edit-card .field {
  margin: 10px 0;
}

.ws-edit-card .field select {
  width: 100%;
}

.ws-edit-employee {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 24, 29, 0.08);
}

.ws-edit-card .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.ws-node.is-linked {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.ws-node-linked {
  margin-left: 6px;
  color: #34d399;
  font-size: 0.7em;
  vertical-align: middle;
}

.ws-overlay-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f4f2ec;
}

.ws-overlay-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4a574;
  margin-bottom: 4px;
}

.ws-overlay-head h2 {
  margin: 0 0 4px;
  color: #f4f2ec;
}

.ws-overlay-head .muted {
  margin: 0;
  color: #9aa3ae;
}

.ws-overlay-card .ws-canvas {
  min-height: 0;
  height: 100%;
}

.ws-overlay-card .ws-stage {
  min-height: 0;
  height: 100%;
}

@media (max-width: 860px) {
  .ws-canvas,
  .ws-overlay-card .ws-canvas {
    grid-template-columns: 1fr;
  }

  .ws-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ws-palette-title,
  .ws-palette-hint {
    width: 100%;
  }

  .ws-palette-item {
    width: auto;
    margin: 0;
  }
}

.org-bot-block {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #e2ddd2;
  border-radius: 14px;
  background: #faf9f6;
}

.org-bot-block h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.brand-theme-picker {
  margin: 0 0 12px;
}

.brand-theme-picker .field-label {
  font-weight: 650;
  margin-bottom: 4px;
}

.brand-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.brand-theme-option {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.brand-theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.brand-theme-option.is-selected,
.brand-theme-option:has(input:checked) {
  border-color: var(--org-brand-accent, #b91c1c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--org-brand-accent, #b91c1c) 35%, transparent);
}

.brand-theme-swatch {
  width: 56px;
  height: 40px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--swatch-accent) 0 10px, transparent 10px),
    var(--swatch-rail);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.brand-theme-meta strong {
  font-size: 13px;
  line-height: 1.3;
}

.brand-color-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.brand-color-row input[type="color"] {
  width: 48px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.brand-color-row input[type="text"],
.brand-color-row input:not([type]) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sidebar .brand-mark {
  margin-bottom: 18px;
  padding: 2px 6px 14px;
  border-bottom: 1px solid rgba(196, 165, 116, 0.14);
}

.sidebar .brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.sidebar .brand-subtitle {
  color: rgba(196, 165, 116, 0.85);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
  font-family: Manrope, "Segoe UI", sans-serif;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.nav-footer {
  margin-top: auto;
  padding: 14px 2px 4px;
  border-top: 1px solid rgba(196, 165, 116, 0.2);
  display: grid;
  gap: 6px;
}

.nav-footer-link {
  justify-content: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  color: rgba(236, 231, 223, 0.78);
  min-height: 44px;
}

.nav-footer-modules {
  color: #f4efe6;
  background: rgba(196, 165, 116, 0.14);
  border: 1px solid rgba(196, 165, 116, 0.35);
}

.nav-footer-modules:hover,
.nav-footer-modules.active {
  color: #fff;
  background: rgba(196, 165, 116, 0.22);
}

.nav-footer-link:hover {
  color: #fff;
  background: rgba(196, 165, 116, 0.12);
}

.nav-footer-link.active {
  color: #fff;
  background: rgba(196, 165, 116, 0.16);
}

.nav-section {
  display: grid;
  gap: 1px;
  margin-top: 2px;
}

.nav-section-toggle {
  border: 0;
  width: 100%;
  min-height: 42px;
  text-align: left;
  color: #ece7df;
  background: transparent;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
  cursor: pointer;
}

.nav-section-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-section.is-open > .nav-section-toggle {
  color: #fff;
}

.nav-section-chevron {
  font-size: 12px;
  font-weight: 500;
  color: rgba(196, 165, 116, 0.75);
  opacity: 1;
}

.nav-section.is-open .nav-section-chevron {
  transform: rotate(90deg);
}

.nav-section-items {
  display: none;
  padding-left: 0;
}

.nav-section.is-open .nav-section-items {
  display: block;
}

.nav-section-items-inner {
  display: grid;
  gap: 1px;
  padding: 2px 0 6px 10px;
  margin-left: 10px;
  border-left: 0;
}

.nav-link {
  border: 0;
  width: 100%;
  min-height: 42px;
  text-align: left;
  color: #ece7df;
  background: transparent;
  border-radius: 12px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.nav-sublink {
  min-height: 38px;
  padding: 0 12px 0 14px;
  color: rgba(236, 231, 223, 0.72);
  font-size: 14px;
  font-weight: 500;
}

.nav-sublink:hover,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  box-shadow: none;
}

.nav-link.active,
.nav-sublink.active {
  background: rgba(196, 165, 116, 0.14);
  color: #fff;
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--modum-accent);
}

.org-create-grid {
  display: grid;
  grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.org-create-grid .field-code input {
  max-width: 140px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.org-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.org-picker-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.org-picker-card:hover,
.org-picker-card.is-current {
  border-color: #c43b3b;
  box-shadow: 0 0 0 1px rgba(196, 59, 59, 0.15);
}

.module-panel h2 {
  margin-top: 0;
}

.main {
  min-width: 0;
}

.topbar {
  height: 68px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 35%, var(--line));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.topbar-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-family: Manrope, "Segoe UI", sans-serif;
}

.topbar-identity strong {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--modum-ink, #0e1114);
}

.topbar-identity-extra {
  white-space: nowrap;
}

.name-plate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
}

.name-plate-name {
  min-width: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.name-plate-role {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.62;
  white-space: nowrap;
}

.name-plate.is-compact {
  height: 40px;
  min-height: 40px;
  padding: 0 16px;
  gap: 8px;
}

.name-plate.is-compact .name-plate-name {
  font-size: 13px;
  font-weight: 600;
}

.name-plate--bronze {
  color: #3a2e18;
  background: linear-gradient(180deg, #cbb48a 0%, #a89062 100%);
  border-color: #7a6340;
  box-shadow:
    inset 0 1px 0 rgba(248, 236, 200, 0.35),
    inset 0 -1px 0 rgba(90, 70, 28, 0.16),
    0 1px 0 rgba(70, 54, 20, 0.1);
}

.name-plate--bronze .name-plate-role {
  color: #7a5c28;
  opacity: 0.92;
}

.name-plate.is-trainee.name-plate--bronze {
  color: #3a3414;
  background: linear-gradient(180deg, #f4e7b4 0%, #d9bc62 100%);
  border-color: #a88828;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.55),
    inset 0 -1px 0 rgba(120, 90, 20, 0.14),
    0 1px 0 rgba(90, 70, 16, 0.1);
}

.name-plate.is-trainee .name-plate-role {
  color: #6a5410;
  opacity: 1;
  letter-spacing: 0.08em;
}

.name-plate--silver {
  color: #3a4048;
  background: linear-gradient(180deg, #eef0f2 0%, #e2e5e9 100%);
  border-color: #b7bdc6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(60, 68, 78, 0.08),
    0 1px 0 rgba(40, 46, 54, 0.07);
}

.name-plate--silver .name-plate-role {
  color: #5c6670;
  opacity: 0.88;
}

.name-plate--gold {
  color: #4a3c12;
  background: linear-gradient(180deg, #e4cc76 0%, #d0b046 100%);
  border-color: #b89428;
  box-shadow: 0 0 0 1px rgba(184, 148, 40, 0.18);
}

.name-plate--gold .name-plate-role {
  color: #8a7018;
  opacity: 0.88;
}

.name-plate--platinum {
  color: #ece8e2;
  background: linear-gradient(180deg, #3a3d43 0%, #2c2f35 100%);
  border-color: #6d6a63;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(0, 0, 0, 0.18);
}

.name-plate--platinum .name-plate-role {
  color: #d4cbb8;
  opacity: 0.72;
}

.page-title-heading .name-plate {
  height: 40px;
  font-size: 15px;
}

.page-title-heading .name-plate-name {
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .topbar-identity .name-plate-role,
  .topbar-identity-extra {
    display: none;
  }
}

.page {
  padding: 24px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-title > div > .muted {
  margin: 6px 0 0;
  max-width: 62ch;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 1.85rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--modum-ink);
}

h2 {
  margin: 22px 0 12px;
  font-size: 18px;
  font-weight: 750;
  color: var(--modum-ink);
}

.muted {
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin: 14px 0 20px;
  align-items: stretch;
}

.metric-card,
.section-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  min-height: 118px;
  border-top: 3px solid #d6d3c8;
}

.metric-card.tone-people { border-top-color: #3b82f6; }
.metric-card.tone-assessment { border-top-color: #0f766e; }
.metric-card.tone-danger { border-top-color: #dc2626; }
.metric-card.tone-learning { border-top-color: var(--modum-accent); }
.metric-card.tone-draft { border-top-color: #a16207; }
.metric-card.tone-warn { border-top-color: #c2410c; }
.metric-card.tone-mentor { border-top-color: #0891b2; }

.dash-summary-line {
  margin: -6px 0 16px;
  font-size: 14px;
}

.dash-summary-line strong {
  color: var(--modum-ink);
  font-weight: 750;
}

html.quest-active .first-run-card {
  display: none !important;
}

.first-run-card {
  margin: 0 0 18px;
  padding: 18px 18px 14px;
  border: 1px solid #e8e0d4;
  background:
    radial-gradient(520px 180px at 0% 0%, rgba(234, 88, 12, 0.08), transparent 55%),
    linear-gradient(180deg, #fffdf9 0%, #faf7f2 100%);
}

.first-run-offer {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(196, 165, 116, 0.4);
  background: linear-gradient(180deg, #fff8ee, #faf3e6);
}

.first-run-offer strong {
  display: block;
  color: #3d3428;
  font-size: 15px;
}

.first-run-offer p {
  margin: 6px 0 10px;
  color: #6b6256;
  font-size: 13px;
  line-height: 1.45;
}

.first-run-welcome {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.first-run-welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 17, 20, 0.48);
}

.first-run-welcome-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 22px 22px 18px;
  border-radius: 18px;
  border: 1px solid #e8e0d4;
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(234, 88, 12, 0.1), transparent 55%),
    #fffdf9;
  box-shadow: 0 24px 60px rgba(14, 17, 20, 0.22);
}

.first-run-welcome-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.first-run-welcome-lead {
  margin: 0 0 14px;
}

.first-run-welcome-map {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.first-run-welcome-map li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #efe8dc;
}

.first-run-welcome-map-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #f3efe8;
  color: #44403c;
}

.first-run-welcome-map strong {
  display: block;
  margin-bottom: 2px;
}

.first-run-welcome-map p {
  margin: 0;
  font-size: 13px;
}

.first-run-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.first-run-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.platform-help-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 8px;
  line-height: 1.45;
}

.platform-help-list li {
  color: var(--text-muted, #5b6472);
}

.platform-help-list strong {
  color: var(--text, #1f2937);
}

.platform-help-lead {
  margin: 0 0 16px;
  max-width: 42rem;
  line-height: 1.45;
}

.help-courses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border, rgba(15, 23, 42, 0.08));
}

.help-course {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--border, #d7dde8);
  border-radius: 16px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, #fff 0%, #faf9f7 100%);
  min-height: 100%;
}

.help-course.is-done {
  border-color: color-mix(in srgb, #1f8a4c 45%, #d7dde8);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1f8a4c 18%, transparent);
}

.help-course.is-locked {
  opacity: 0.88;
  background: #f7f7f5;
}

.help-course-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.help-course-no {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a7340;
}

.help-course-progress {
  font-size: 13px;
  color: #5b6472;
}

.help-course-progress strong {
  color: #1f2937;
}

.help-course-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #167a45;
  background: color-mix(in srgb, #1f8a4c 12%, #fff);
  border-radius: 999px;
  padding: 4px 10px;
}

.help-course-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.help-course-lead {
  margin: 0;
  color: #5b6472;
  line-height: 1.45;
  font-size: 14px;
}

.help-course-cta {
  justify-self: start;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
}

.help-course-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.help-course-actions .help-course-cta {
  margin-top: 0;
}

.help-course-cta-secondary {
  background: transparent;
  color: #1f2937;
  border: 1px solid #cfd5de;
}

.help-course-cta-secondary:hover {
  background: #f3f4f6;
  color: #111827;
}

.help-course-cta:hover {
  background: #111827;
}

.help-course.is-done .help-course-cta {
  background: transparent;
  color: #1f2937;
  border: 1px solid #cfd5de;
}

.help-course-locked {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.knowledge-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.knowledge-library-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.knowledge-library-open-all {
  font-size: 13px;
}

.knowledge-folds {
  display: grid;
  gap: 10px;
}

.knowledge-fold {
  border: 1px solid var(--border, #d7dde8);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.knowledge-fold-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 650;
  font-size: 15px;
  color: #1f2937;
  user-select: none;
}

.knowledge-fold-summary::-webkit-details-marker {
  display: none;
}

.knowledge-fold-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #8b93a1;
  border-bottom: 2px solid #8b93a1;
  transform: rotate(-45deg);
  transition: transform 0.16s ease;
  flex: 0 0 auto;
}

.knowledge-fold[open] .knowledge-fold-chevron {
  transform: rotate(45deg);
}

.knowledge-fold-body {
  padding: 0 16px 14px;
}

.knowledge-group {
  margin: 0 0 16px;
}

.knowledge-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #5b6472);
}

.knowledge-links {
  display: grid;
  gap: 6px;
}

a.knowledge-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-decoration: none;
  color: var(--text, #1f2937);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.1));
  border-radius: 10px;
  padding: 11px 14px;
  background: #fff;
  font-weight: 500;
  line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.knowledge-link:hover {
  border-color: rgba(15, 23, 42, 0.28);
  background: rgba(15, 23, 42, 0.02);
}

a.knowledge-link::after {
  content: "→";
  color: var(--text-muted, #5b6472);
  font-weight: 400;
}

@media (max-width: 820px) {
  .help-courses {
    grid-template-columns: 1fr;
  }
}

.quest-overlay {
  position: fixed;
  inset: 0;
  z-index: 120; /* dim layer — same on every step */
  pointer-events: none;
}

.quest-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.quest-spotlight {
  position: fixed;
  box-sizing: border-box;
  border-radius: 999px;
  /* One cream oval ring (JS sets capsule radius). Dim fills the rest. No outline. */
  box-shadow: 0 0 0 3px #fffef8, 0 0 0 9999px rgba(14, 17, 20, 0.58);
  outline: none;
  background: transparent;
  z-index: 1;
  pointer-events: none;
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease, border-radius 0.18s ease;
}

/* work + surface: softer dim so forms/tables stay readable; hole still marks the action */
html.quest-pin-aside .quest-spotlight,
html.quest-soft-spotlight .quest-spotlight,
html[data-quest-layer="work"] .quest-spotlight,
html[data-quest-layer="surface"] .quest-spotlight {
  box-shadow: 0 0 0 3px #fffef8, 0 0 0 9999px rgba(14, 17, 20, 0.22);
  outline: none;
}

.quest-target-live {
  position: relative;
  z-index: 131 !important; /* above dim (120), below card (140) */
  border-radius: inherit;
}

/* Layers: dim (120) < open menu (130) < target (131/133) < training card (140). */
html.quest-active.quest-nav-focus .app-shell.nav-open .sidebar {
  z-index: 130;
}

html.quest-active.quest-nav-focus .app-shell.nav-open .nav-drawer-backdrop {
  pointer-events: none;
  z-index: 125;
}

.quest-card-host {
  position: fixed;
  inset: 0;
  z-index: 140; /* training card host — always above dim + target */
  pointer-events: none;
}

.quest-card-host .quest-card {
  pointer-events: auto;
}

.quest-card {
  position: fixed;
  z-index: 140;
  max-width: 400px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid #e8e0d4;
  background: #fffdf9;
  box-shadow: 0 18px 50px rgba(14, 17, 20, 0.28);
}


.quest-card--beside-nav {
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #f0e6d8;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 22px 55px rgba(14, 17, 20, 0.38);
}

.quest-card--beside-nav .quest-card-title {
  font-size: 1.35rem;
}

.quest-card--beside-nav .quest-card-lead {
  font-size: 15px;
  color: #292524;
}

.quest-card--rail {
  max-width: min(920px, calc(100vw - 32px));
  padding: 14px 18px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #f0e6d8;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 40px rgba(14, 17, 20, 0.28);
}

.quest-card--rail .quest-card-kicker {
  margin-bottom: 2px;
  user-select: none;
  touch-action: none;
}

.quest-brand-mark[data-quest-drag-handle] {
  user-select: none;
  touch-action: none;
}

.quest-drag-hint {
  float: right;
  opacity: 0.45;
  letter-spacing: 1px;
  font-size: 0.85em;
}

.quest-card--rail .quest-card-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.quest-card--rail .quest-card-lead {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 62em;
}

.quest-card--rail .quest-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
  margin: 0 0 10px;
  counter-reset: quest-step;
}

.quest-card--rail .quest-step-list li {
  margin: 0;
  padding: 8px 10px 8px 38px;
  border-radius: 10px;
  background: #faf7f2;
  border: 1px solid #f0e6d8;
  font-size: 13.5px;
  line-height: 1.4;
}

.quest-card--rail .quest-step-list li::before {
  top: 50%;
  left: 10px;
  width: 20px;
  height: 20px;
  font-size: 11px;
  line-height: 20px;
  transform: translateY(-50%);
}

.quest-card--rail .quest-card-hint {
  margin: 0 0 8px;
  font-size: 13px;
}

.quest-card--rail .quest-card-actions {
  margin-top: 0;
  justify-content: flex-end;
}

/* Narrow vertical training panel — beside open employee modal, not over it. */
.quest-card--aside {
  max-width: 360px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #f0e6d8;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 40px rgba(14, 17, 20, 0.28);
}

.quest-card--aside .quest-card-kicker {
  margin-bottom: 2px;
  font-size: 11px;
}

.quest-card--aside .quest-card-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.quest-card--aside .quest-card-lead {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.4;
}

.quest-card--aside .quest-step-list {
  margin: 0 0 8px;
  padding: 0;
}

.quest-card--aside .quest-step-list li {
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px 8px 42px;
}

.quest-card--aside .quest-step-list li::before {
  left: 10px;
  width: 22px;
  height: 22px;
  font-size: 11px;
  line-height: 22px;
}

.quest-card--aside .quest-card-hint {
  font-size: 12.5px;
  margin: 0 0 8px;
}

.quest-card--aside .quest-card-actions {
  margin-top: 4px;
  flex-direction: column;
  align-items: stretch;
}

.quest-card--aside .quest-card-actions .primary-button {
  width: 100%;
}

html.quest-active.quest-nav-focus .quest-target-live {
  z-index: 133 !important;
  box-shadow: none;
  background: rgba(255, 247, 237, 0.1);
}

.quest-card--welcome {
  max-width: 560px;
  padding: 28px 28px 22px;
  text-align: center;
}

.quest-brand-mark {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c2410c;
  margin-bottom: 10px;
}

.quest-card-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c2410c;
  margin-bottom: 4px;
}

.quest-card-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.25;
}

.quest-card--welcome .quest-card-title {
  font-size: 1.75rem;
  margin-bottom: 10px;
}

.quest-card-lead {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: #44403c;
}

.quest-card-lead + .quest-card-lead {
  margin-top: -4px;
}

.quest-card-lead strong {
  font-weight: 700;
  color: #1c1917;
}

.quest-card-lead em {
  font-style: italic;
  color: #57534e;
}

.quest-card-lead strong em,
.quest-card-lead em strong {
  font-weight: 700;
  font-style: italic;
  color: #9a3412;
}

.quest-card-hint strong {
  font-weight: 700;
  color: #1c1917;
}

.quest-card--welcome .quest-card-lead {
  font-size: 16.5px;
  line-height: 1.55;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

.quest-welcome-list {
  list-style: none;
  margin: 0 auto 16px;
  padding: 0;
  max-width: 34em;
  text-align: left;
}

.quest-welcome-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 15px;
  line-height: 1.45;
  color: #44403c;
}

.quest-welcome-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ea580c;
}

.quest-step-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  counter-reset: quest-step;
}

.quest-step-list li {
  position: relative;
  counter-increment: quest-step;
  margin: 0 0 10px;
  padding: 10px 12px 10px 44px;
  border-radius: 12px;
  background: #faf7f2;
  border: 1px solid rgba(28, 25, 23, 0.06);
  font-size: 14.5px;
  line-height: 1.45;
  color: #44403c;
}

.quest-step-list li:last-child {
  margin-bottom: 0;
}

.quest-step-list li::before {
  content: counter(quest-step);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #1c1917;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.quest-card-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #c2410c;
  font-weight: 600;
}

.quest-card--welcome .quest-card-actions {
  justify-content: center;
}

.quest-card-block {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
}

.quest-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.quest-card-complete {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  color: #78716c;
  cursor: pointer;
  text-decoration: underline;
}

.quest-card--welcome .quest-card-complete {
  display: block;
  margin: 4px auto 0;
}

html.quest-active .nav-drawer-toggle,
html.quest-active [data-quest] {
  scroll-margin: 120px;
}

.first-run-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c2410c;
  margin-bottom: 4px;
}

.first-run-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.first-run-lead {
  margin: 0;
}

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

.first-run-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.first-run-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
}

.first-run-step.is-next {
  border-color: rgba(234, 88, 12, 0.35);
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.08);
}

.first-run-step.is-done {
  opacity: 0.78;
}

.first-run-step-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #f3efe8;
  color: #44403c;
}

.first-run-step.is-done .first-run-step-index {
  background: #dcfce7;
  color: #166534;
}

.first-run-step-body strong {
  display: block;
  margin-bottom: 2px;
}

.first-run-step-body p {
  margin: 0;
  font-size: 13px;
}

.first-run-step-done {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
}

.empty-guide {
  padding: 20px 18px;
  border-radius: 14px;
  border: 1px dashed #d6d0c6;
  background: #fbfaf6;
  margin: 0 0 14px;
}

.empty-guide strong {
  display: block;
  margin-bottom: 6px;
}

.empty-guide p {
  margin: 0 0 12px;
}

@media (max-width: 720px) {
  .first-run-step {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .first-run-step .primary-button,
  .first-run-step-done {
    grid-column: 2;
  }
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.dash-kpi-grid.is-lifecycle {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dash-kpi-grid.is-steady {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dash-mode-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6f1;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.life-composition {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.life-composition-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.life-composition-total {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--modum-ink);
}

.life-composition-bar {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #eceae3;
  border: 1px solid var(--line);
}

.life-composition-bar .is-staff {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  min-width: 0;
}

.life-composition-bar .is-trainee {
  background: linear-gradient(90deg, #c2410c, #f59e0b);
  min-width: 0;
}

.life-composition-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  font-size: 13px;
  color: var(--modum-ink);
}

.life-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.life-dot.is-staff { background: #0f766e; }
.life-dot.is-trainee { background: #c2410c; }

.life-instruction-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.life-stat-chip {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.life-stat-chip strong {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--modum-ink);
  line-height: 1.1;
}

.life-stat-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.life-stat-chip.is-warn {
  border-color: #f0c7a0;
  background: #fff8f1;
}

@media (max-width: 640px) {
  .life-instruction-stats {
    grid-template-columns: 1fr;
  }
}


.dash-kpi-card {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
  box-shadow: var(--shadow);
  border-top: 3px solid #d6d3c8;
}

.dash-kpi-card.tone-assessment { border-top-color: #0f766e; }
.dash-kpi-card.tone-learning { border-top-color: var(--modum-accent); }
.dash-kpi-card.tone-people { border-top-color: #3b82f6; }
.dash-kpi-card.tone-warn { border-top-color: #c2410c; }
.dash-kpi-card.tone-danger { border-top-color: #dc2626; }
.dash-kpi-card.tone-ok { border-top-color: #15803d; }
.dash-kpi-card.tone-mentor { border-top-color: #7c3aed; }

.dash-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dash-kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dash-kpi-value {
  margin: 8px 0 6px;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 800;
  color: var(--modum-ink);
  line-height: 1.1;
}

.dash-spark {
  flex: 0 0 auto;
  opacity: 0.9;
}

.dash-spark polyline { stroke: #94a3b8; }
.dash-spark.tone-assessment polyline { stroke: #0f766e; }
.dash-spark.tone-learning polyline { stroke: var(--modum-accent); }
.dash-spark.tone-people polyline { stroke: #3b82f6; }
.dash-spark.tone-warn polyline { stroke: #c2410c; }
.dash-spark.tone-danger polyline { stroke: #dc2626; }
.dash-spark.tone-ok polyline { stroke: #15803d; }

.life-pipeline-panel {
  margin-bottom: 14px;
}

.life-pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.life-stage {
  flex: 1 1 0;
  min-width: 140px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  border-top: 3px solid #d6d3c8;
}

.life-stage.tone-assessment { border-top-color: #0f766e; }
.life-stage.tone-learning { border-top-color: var(--modum-accent); }
.life-stage.tone-people { border-top-color: #3b82f6; }
.life-stage.tone-warn { border-top-color: #c2410c; }
.life-stage.tone-danger { border-top-color: #dc2626; }
.life-stage.tone-ok { border-top-color: #15803d; }

.life-stage-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.life-stage-count {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--modum-ink);
  line-height: 1.1;
}

.life-stage-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.life-stage-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.life-chip {
  border: 1px solid var(--line);
  background: #f7f5f0;
  color: var(--modum-ink);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.life-chip:hover {
  border-color: var(--modum-accent);
  background: #fff;
}

.life-chip.is-more {
  cursor: default;
  color: var(--muted);
  background: transparent;
}

.life-stage-empty {
  font-size: 12px;
}

.life-arrow {
  flex: 0 0 18px;
  align-self: center;
  height: 2px;
  margin: 0 2px;
  background: linear-gradient(90deg, #d6d3c8, var(--modum-accent));
  position: relative;
}

.life-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--modum-accent);
}

.life-metrics {
  display: grid;
  gap: 10px;
}

.life-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.life-metric-label {
  color: var(--muted);
  font-size: 13px;
}

.life-metric-value {
  font-size: 15px;
  color: var(--modum-ink);
}

.dash-learning-mini {
  margin-top: 12px;
  font-size: 13px;
}

.dash-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
}

.dash-delta.is-up { color: #15803d; }
.dash-delta.is-down { color: #b42318; }
.dash-delta.is-flat { color: var(--muted); font-weight: 500; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin: 0 0 14px;
}

.dash-panel {
  padding: 16px 18px 18px;
}

.dash-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.dash-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: middle;
}

.dash-swatch.is-tests { background: var(--modum-ink); }
.dash-swatch.is-acks { background: var(--modum-accent); }

.dash-trend-bars {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 160px;
  padding: 8px 4px 0;
}

.dash-trend-col {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.dash-trend-pair {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 120px;
}

.dash-bar {
  width: 12px;
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
}

.dash-bar.is-tests {
  background: linear-gradient(180deg, #2a3038 0%, var(--modum-ink) 100%);
}

.dash-bar.is-acks {
  background: linear-gradient(180deg, #d8bf8f 0%, var(--modum-accent) 100%);
}

.dash-trend-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
}

.dash-attention-list {
  display: grid;
  gap: 8px;
}

.dash-attention-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.dash-attention-item:hover {
  border-color: rgba(196, 165, 116, 0.55);
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.2);
}

.dash-attention-item strong {
  font-size: 1.25rem;
  color: var(--modum-ink);
}

.dash-attention-item span {
  color: #374151;
  font-size: 14px;
  line-height: 1.35;
}

.dash-attention-empty {
  padding: 18px 14px;
  border-radius: 12px;
  background: #f3faf5;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.dash-updates {
  display: grid;
  gap: 10px;
}

.dash-update-card {
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.dash-update-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.dash-update-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--modum-ink);
}

.dash-update-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .dash-kpi-grid.is-lifecycle,
  .dash-kpi-grid.is-steady {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dash-kpi-grid,
  .dash-kpi-grid.is-lifecycle,
  .dash-kpi-grid.is-steady,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .life-arrow {
    display: none;
  }
}

@media (max-width: 640px) {
  .dash-kpi-grid,
  .dash-kpi-grid.is-lifecycle,
  .dash-kpi-grid.is-steady,
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
  flex: 1 1 auto;
}

.metric-value {
  font-size: 28px;
  font-weight: 760;
  margin-top: 10px;
  line-height: 1.1;
}

.metric-product {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.section-panel {
  padding: 16px;
  margin-bottom: 16px;
}

.route-error .error-text {
  margin: 14px 0 8px;
  font-size: 14px;
}

.route-error .primary-button {
  margin-top: 8px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.employee-list-filters {
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
}

.employee-search-combo {
  position: relative;
  z-index: 5;
}

.employee-search-suggest {
  z-index: 12;
}

.employee-search-suggest button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: normal;
}

.employee-search-suggest button.is-active,
.employee-search-suggest button:hover,
.employee-search-suggest button:focus {
  background: #f4f1ea;
}

.employee-search-empty {
  padding: 8px 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--brand-steel);
  background: #f8fafc;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

#timesheetPreview table {
  min-width: 680px;
}

#timesheetPreview th,
#timesheetPreview td {
  padding: 8px 10px;
}

#timesheetPreview td {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.attention-group {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.attention-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
}

.attention-group .table-wrap {
  border-top: 1px solid var(--line);
  max-height: 320px;
  overflow: auto;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status.ok {
  background: var(--ok-soft);
  color: var(--brand-green);
}

.status.warn {
  background: var(--warn-soft);
  color: #92400e;
}

.status.bad {
  background: var(--danger-soft);
  color: var(--brand-red);
}

.status.neutral {
  background: #e8edf3;
  color: var(--brand-steel);
}

.banner {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 12px 0;
  padding: 10px 12px;
  font-weight: 700;
}

.banner.warn {
  background: var(--warn-soft);
  border-color: #facc15;
  color: #92400e;
}

.banner.ok {
  background: var(--ok-soft);
  border-color: #86efac;
  color: var(--brand-green);
}

.banner.bad {
  background: var(--danger-soft);
  border-color: #fca5a5;
  color: var(--brand-red);
}

.billing-pulse {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.updates-compose-panel {
  max-width: 760px;
}

.updates-compose {
  display: grid;
  gap: 4px;
}

.updates-compose .field {
  margin: 8px 0;
}

.updates-compose-top {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.updates-compose .form-actions {
  margin-top: 8px;
}

.updates-feed-card h2 {
  font-size: 1.1rem;
}

.updates-howto {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.updates-howto-body {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
}

.updates-edit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.checkbox-field input,
.checkbox-field input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
  align-self: center;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  grid-column: 1 / -1;
}

.checkbox-row input {
  margin-top: 3px;
}

@media (max-width: 720px) {
  .updates-compose-top {
    grid-template-columns: 1fr;
  }

  .updates-compose-panel {
    max-width: none;
  }
}

.billing-pulse-ok { border-color: #86efac; background: var(--ok-soft); }
.billing-pulse-warn { border-color: #facc15; background: var(--warn-soft); }
.billing-pulse-bad { border-color: #fca5a5; background: var(--danger-soft); }
.billing-pulse-unknown,
.billing-pulse-loading { background: #f8fafc; }

.billing-pulse-btn {
  flex: 1;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 0;
  color: inherit;
  font: inherit;
}

.billing-pulse-btn strong {
  font-size: 15px;
}

.billing-pulse-link {
  align-self: center;
}

.billing-overview {
  margin-bottom: 16px;
}

.billing-overview-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
}

.billing-overview-sign {
  font-size: 16px;
  font-weight: 800;
}

.billing-overview-next {
  grid-column: 1 / 2;
  font-weight: 600;
}

.billing-overview-chevron {
  grid-row: 1 / 3;
  align-self: center;
  font-size: 18px;
}

.billing-overview-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-steel);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  color: var(--modum-ink);
  border-color: color-mix(in srgb, var(--modum-accent) 55%, var(--line));
  background: linear-gradient(180deg, #fffdf8 0%, #f7f1e4 100%);
  box-shadow: inset 0 0 0 1px rgba(196, 165, 116, 0.25);
}

.updates-admin-tabs {
  margin: 8px 0 16px;
}

.updates-admin-panel {
  display: grid;
  gap: 12px;
}

.updates-day-group {
  display: grid;
  gap: 12px;
}

.updates-day-heading {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: #3d3a34;
}

.updates-prepare-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* display:grid otherwise overrides HTML [hidden] — tabs look stuck on «На проверке». */
.updates-admin-panel[hidden] {
  display: none !important;
}

.updates-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.updates-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: min(240px, 100%);
}

.updates-card-actions .primary-button {
  white-space: normal;
  line-height: 1.25;
  min-height: 44px;
}

.admin-budget-report.tone-ok {
  border-color: color-mix(in srgb, #15803d 35%, var(--line));
}

.admin-budget-report.tone-warn {
  border-color: color-mix(in srgb, #c2410c 40%, var(--line));
}

.admin-budget-report.tone-bad {
  border-color: color-mix(in srgb, #b91c1c 45%, var(--line));
}

.admin-budget-headline {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.admin-release-board {
  display: grid;
  gap: 16px;
  margin: 0 0 18px;
}

@media (min-width: 960px) {
  .admin-release-board {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
    align-items: stretch;
  }
}

.admin-release-current,
.admin-release-drafts {
  border-radius: 18px;
  padding: 22px 24px;
  min-width: 0;
}

.admin-release-current {
  background: linear-gradient(165deg, #111827 0%, #1f2937 72%, #0f172a 100%);
  color: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.admin-release-current.is-empty {
  background: #111827;
}

.admin-release-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}

.admin-release-current h2,
.admin-release-drafts h2 {
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.admin-release-current h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  color: #fff;
}

.admin-release-drafts h2 {
  font-size: 1.45rem;
  color: #111827;
}

.admin-release-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  line-height: 1.35;
}

.admin-release-lede {
  margin: 0 0 10px;
  font-size: 0.98rem;
  line-height: 1.4;
  opacity: 0.88;
}

.admin-release-where {
  margin: 0;
  opacity: 0.78;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-release-current .form-actions,
.admin-release-drafts .form-actions {
  margin-top: 14px;
}

.admin-release-current .primary-button {
  background: #fff;
  color: #111827;
  border-color: #fff;
}

.admin-release-drafts {
  background: linear-gradient(165deg, #ecfdf5 0%, #fff7ed 55%, #eff6ff 100%);
  border: 2px solid #111827;
}

.admin-release-draft-count {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.patch-kind {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.patch-kind-added {
  background: #dcfce7;
  color: #166534;
}

.patch-kind-fixed {
  background: #dbeafe;
  color: #1e40af;
}

.admin-release-current .patch-kind-added {
  background: #14532d;
  color: #bbf7d0;
}

.admin-release-current .patch-kind-fixed {
  background: #1e3a8a;
  color: #bfdbfe;
}

.admin-release-fold {
  margin: 4px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-release-drafts .admin-release-fold {
  border-top-color: rgba(17, 24, 39, 0.12);
}

.admin-release-fold > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 10px 0;
  font-weight: 800;
  user-select: none;
}

.admin-release-fold > summary::-webkit-details-marker {
  display: none;
}

.admin-release-fold-label {
  min-width: 0;
}

.admin-release-fold-arrow {
  flex: 0 0 auto;
  transition: transform 0.16s ease;
  opacity: 0.8;
}

.admin-release-fold[open] > summary .admin-release-fold-arrow {
  transform: rotate(90deg);
}

.admin-release-fold-body {
  padding: 0 0 12px;
}

.admin-release-compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.admin-release-compact-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.patch-item-text {
  min-width: 0;
  flex: 1;
}

.patch-item-text strong {
  display: inline;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.patch-item-detail {
  margin: 6px 0 0;
  max-width: 42em;
  font-size: 0.94rem;
  font-weight: 450;
  line-height: 1.5;
  opacity: 0.92;
}

.admin-release-where-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-release-drafts .admin-release-where-chip {
  background: rgba(15, 23, 42, 0.08);
  color: #111827;
}

.updates-magazine-version,
.platform-news-version {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.metric-card.tone-ok { border-top-color: #15803d; }
.metric-card.tone-bad { border-top-color: #b91c1c; }
.metric-card.tone-warn { border-top-color: #c2410c; }

.card-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(14, 17, 20, 0.04);
}

.card-toolbar-status,
.card-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.instruction-card-shell {
  padding-top: 12px;
}

.instruction-card-shell .card-tabs {
  position: sticky;
  top: 62px;
  z-index: 4;
  background: #fff;
  padding-bottom: 8px;
}

.instruction-test-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
}

.instruction-test-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  justify-content: flex-start;
}

.instruction-test-summary-row strong {
  font-size: 0.95rem;
}

.instruction-req-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 11.5rem;
  padding: 7px 32px 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%235b6573' d='M1.2 1.4 6 6.2 10.8 1.4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

.instruction-req-select.is-on {
  border-color: #22c55e;
  color: var(--brand-green);
  background-color: #ecfdf3;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), 0 0 14px rgba(34, 197, 94, 0.28);
}

.instruction-req-select.is-on {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2315803d' d='M1.2 1.4 6 6.2 10.8 1.4'/></svg>");
}

.instruction-req-select.is-off {
  border-color: #e8a4a4;
  color: #9f2a2a;
  background-color: #fdf6f6;
  box-shadow: none;
}

.instruction-req-select.is-off {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%239f2a2a' d='M1.2 1.4 6 6.2 10.8 1.4'/></svg>");
}

.instruction-req-select:focus {
  outline: none;
}

.instruction-req-select.is-on:focus {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28), 0 0 14px rgba(34, 197, 94, 0.32);
}

.instruction-req-select.is-off:focus {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.question-pack-head {
  display: block;
  margin-bottom: 8px;
}

.question-pack-generate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 10px 0 12px;
}

.question-pack-count-field {
  min-width: 180px;
  max-width: 220px;
  margin: 0;
}

.question-pack-actions {
  margin: 0 0 12px;
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #d8d3c8;
  border-radius: 14px;
  background: #faf9f6;
  line-height: 1.45;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.section-heading-row h2 {
  margin: 0;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

tr.is-highlight td {
  background: color-mix(in srgb, var(--accent, #2563eb) 12%, transparent);
}

.org-manager-access {
  max-width: 420px;
}

.org-manager-access summary {
  cursor: pointer;
  color: var(--accent, #b91c1c);
  font-weight: 600;
}

.detail-grid.instruction-summary-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.detail-grid.instruction-summary-grid .detail-item {
  padding: 8px 10px;
  min-width: 0;
}

.detail-grid.instruction-summary-grid .detail-label {
  font-size: 11px;
  margin-bottom: 3px;
}

@media (max-width: 1100px) {
  .detail-grid.instruction-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.action-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
  align-items: start;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.two .field,
.form-grid .field {
  margin: 0;
}

.form-grid .full,
.form-actions.full {
  grid-column: 1 / -1;
}

.form-grid.three {
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(170px, auto);
  align-items: start;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-actions.vertical {
  align-items: stretch;
  flex-direction: column;
}

.checkbox-field label {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
  min-height: 38px;
}

.checkbox-field input[type="checkbox"] {
  width: auto;
}

.settings-company-form .checkbox-field,
.settings-company-form .settings-toggle-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.settings-company-form .checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  flex: 0 0 18px;
  align-self: center;
}

.login-prefix-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.login-prefix-lock {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line, #d1d5db);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  white-space: nowrap;
  user-select: none;
}

.login-prefix-field input {
  border-radius: 0 8px 8px 0 !important;
  flex: 1;
}

.action-status {
  min-height: 28px;
}

.detail-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 6px 10px;
  min-height: auto;
  cursor: pointer;
}

.recognition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.recognition-grid div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 9px 10px;
}

.recognition-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.recognition-grid b {
  font-weight: 700;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.preview-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.56);
}

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

.preview-modal {
  position: relative;
  width: min(1040px, 100%);
  max-height: 86vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 22px;
}

.preview-modal h2 {
  margin: 0 44px 6px 0;
}

.preview-modal-subtitle {
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.preview-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.preview-modal .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.preview-modal .field {
  margin: 0;
}

.timesheet-change-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timesheet-change-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #16a34a 28%, var(--line));
  background: color-mix(in srgb, #16a34a 12%, #fff);
  color: #166534;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
  cursor: help;
}

.timesheet-change-chip.is-fill {
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 28%, var(--line));
  background: color-mix(in srgb, var(--accent, #b91c1c) 8%, #fff);
  color: color-mix(in srgb, var(--accent, #b91c1c) 70%, #334155);
}

.timesheet-changed-fio {
  font-weight: 700;
}

.timesheet-changed-meta {
  margin-top: 2px;
  font-size: 0.85rem;
}

.timesheet-diff-row .timesheet-diff-will {
  vertical-align: middle;
}

.timesheet-will-update {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.timesheet-will-update-value {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, #16a34a 14%, #fff);
  border: 1px solid color-mix(in srgb, #16a34a 30%, var(--line));
  color: #14532d;
  font-weight: 700;
}

.timesheet-will-update-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  min-width: 180px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: normal;
}

.timesheet-will-update:hover .timesheet-will-update-tip,
.timesheet-will-update:focus .timesheet-will-update-tip,
.timesheet-will-update:focus-within .timesheet-will-update-tip {
  opacity: 1;
  transform: translateY(0);
}

.preview-edit-field.will-update {
  border-radius: 12px;
  padding: 8px;
  background: color-mix(in srgb, #16a34a 8%, #fff);
  border: 1px solid color-mix(in srgb, #16a34a 22%, var(--line));
}

.preview-edit-field .will-update-mark {
  margin-left: 6px;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: #166534;
}

.preview-edit-field .will-update-diff {
  display: block;
  margin: 2px 0 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #166534;
}

.preview-edit-field .will-update-diff strong {
  font-weight: 700;
}

.support-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 12px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding: 8px 4px 4px;
  background: color-mix(in srgb, var(--line) 35%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.support-chat-msg {
  max-width: min(920px, 94%);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.support-chat-msg.is-manager {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: color-mix(in srgb, var(--accent, #b91c1c) 10%, #fff);
}

.support-chat-msg.is-admin {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #fff;
}

.support-chat-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.support-chat-body {
  white-space: pre-wrap;
  line-height: 1.45;
}

.support-chat-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.support-chat-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.support-chat-file:hover {
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 40%, var(--line));
}
.support-chat-attach {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.support-chat-file-preview {
  display: block;
  max-width: min(240px, 70%);
  max-height: 160px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}
.support-chat-attach .support-chat-file {
  margin-top: 0;
}

.support-composer {
  margin-top: 4px;
}

.support-composer-bar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, #c4a574);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.support-composer-bar.is-textonly {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.support-composer-attach,
.support-composer-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
}

.support-composer-attach {
  border: 1px solid transparent;
  background: transparent;
  color: #5b6572;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-composer-attach:hover {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 14%, #fff);
  color: #1c2430;
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 32%, var(--line));
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.support-composer-attach:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--modum-accent, #c4a574) 55%, #94a3b8);
  outline-offset: 2px;
}

.support-composer-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.support-composer-icon-attach {
  width: 20px;
  height: 20px;
}

.support-composer-file-thumb {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 22%, var(--line));
  background: #fff;
}

.support-composer-file-thumb[hidden] {
  display: none !important;
}

.support-composer-bar textarea {
  width: 100%;
  min-height: 44px;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  padding: 10px 4px;
  font: inherit;
  line-height: 1.35;
}

.support-composer-send {
  width: 48px;
  border-radius: 14px;
}

.support-composer-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  min-height: 0;
}

.support-composer-filechip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 420px);
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line));
  background: linear-gradient(180deg, #fffefb 0%, #f7f4ee 100%);
  font-size: 0.88rem;
  color: #334155;
}

.support-composer-filechip[hidden] {
  display: none !important;
}

.support-composer-file-label {
  flex: 0 0 auto;
  font-weight: 650;
  color: #64748b;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.support-composer-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.support-composer-file-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: #64748b;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.support-composer-file-clear:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0e1114;
}

.support-composer-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.support-composer-status select {
  min-width: 120px;
}

.messenger-main-compose .action-status:empty {
  display: none;
}

.updates-feed-card.is-focus {
  outline: 2px solid color-mix(in srgb, var(--modum-accent, #c4a574) 55%, transparent);
  outline-offset: 2px;
}

.support-ticket-row {
  cursor: pointer;
}

.support-ticket-row:hover td {
  background: color-mix(in srgb, var(--accent, #2563eb) 8%, transparent);
}

.link-button.support-ticket-title,
button.support-ticket-title {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button.support-ticket-title:hover,
button.support-ticket-title:hover {
  color: var(--accent, #2563eb);
}

.support-chat-modal {
  width: min(820px, 96vw);
  max-height: 92vh;
  overflow: auto;
}

.support-chat-modal-thread {
  margin: 8px 0 12px;
}

.support-module-connect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #1f8a4c 35%, #d7dde8);
  border-radius: 12px;
  background: color-mix(in srgb, #1f8a4c 8%, #fff);
}

.support-module-connect[hidden] {
  display: none !important;
}

.support-module-connect .action-status.is-ok {
  color: #1f8a4c;
}

.employee-test-detail {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--line) 22%, #fff);
}

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

.employee-test-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.employee-test-question {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.employee-test-question.is-correct {
  border: 2px solid #16a34a;
  background: color-mix(in srgb, #22c55e 10%, #fff);
}

.employee-test-question.is-wrong {
  border: 3px solid #dc2626;
  background: color-mix(in srgb, #ef4444 14%, #fff);
  box-shadow: inset 4px 0 0 #dc2626;
}

.employee-test-question.is-wrong .employee-test-question-title::after {
  content: " · ошибка";
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.85em;
}

.employee-test-question-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.employee-test-options {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.employee-test-options li {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  line-height: 1.35;
}

.employee-test-options .is-selected {
  font-weight: 700;
}

.employee-test-options .is-correct-opt {
  color: #14532d;
  background: color-mix(in srgb, #22c55e 28%, #fff);
  border-color: #16a34a;
  font-weight: 700;
}

.employee-test-options .is-wrong-opt {
  color: #111827;
  background: color-mix(in srgb, #111827 14%, #fff);
  border: 2px solid #111827;
  font-weight: 700;
}

.employee-test-options .is-selected-correct {
  color: #14532d;
  background: color-mix(in srgb, #22c55e 36%, #fff);
  border: 2px solid #15803d;
}

.employee-test-opt-mark {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.92em;
  font-weight: 700;
  color: inherit;
}

.timesheet-mapping-panel {
  margin: 14px 0 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--line) 18%, #fff);
}

.timesheet-mapping-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.timesheet-recognition-panel {
  margin: 14px 0 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--line) 18%, #fff);
}

.timesheet-recognition-panel h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.timesheet-recognition-panel.is-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.timesheet-recognition-panel.is-review {
  border-color: #fde68a;
  background: #fffbeb;
}

.timesheet-recognition-panel.is-poor {
  border-color: #fecaca;
  background: #fef2f2;
}

.timesheet-recognition-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--line) 18%, #fff);
}

.timesheet-recognition-bar.is-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.timesheet-recognition-bar.is-review {
  border-color: #fde68a;
  background: #fffbeb;
}

.timesheet-recognition-bar.is-poor {
  border-color: #fecaca;
  background: #fef2f2;
}

.timesheet-recognition-bar-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.timesheet-recognition-bar-text strong {
  font-size: 0.98rem;
}

.recognition-report-modal {
  max-width: min(760px, 94vw);
  max-height: min(86vh, 900px);
  overflow: auto;
}

.recognition-report-modal .timesheet-recognition-panel {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.detail-grid.timesheet-preview-stats {
  gap: 14px;
  margin-bottom: 14px;
}

.detail-grid.timesheet-preview-stats .detail-item {
  border-radius: 10px;
  padding: 12px 14px;
}

.recognition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.recognition-quality-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.recognition-quality-meta {
  margin-top: 4px;
  font-size: 0.85rem;
}

.recognition-quality-issues {
  margin: 8px 0 0;
  padding-left: 18px;
}

.recognition-field-chips {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.recognition-field-chips li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.recognition-field-chips em {
  font-style: normal;
  color: #78716c;
  font-size: 0.85rem;
}

.timesheet-mapping-advanced {
  margin-top: 12px;
}

.timesheet-mapping-advanced > summary {
  cursor: pointer;
  color: #57534e;
  font-size: 0.92rem;
}

.messenger-shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Мессенджер: весь блок в высоту окна, скролл только внутри переписки */
.page:has(> .messenger-page) {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 68px);
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 12px 10px 12px;
}

.messenger-page {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  width: 100%;
  max-width: none;
}

.messenger-page > .page-title {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.messenger-page > .page-title h1 {
  margin: 0;
  font-size: 1.35rem;
}

.messenger-page > .page-title .muted {
  margin-top: 2px;
}

.messenger-page > .messenger-shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.messenger-sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fafc 0%, #fff 48%);
  overflow: auto;
  min-height: 0;
  padding: 12px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.messenger-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.messenger-section-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 6px 8px;
  font-weight: 700;
}

.messenger-thread-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  color: inherit;
}

.messenger-thread-item:hover {
  background: color-mix(in srgb, var(--line) 55%, #fff);
}

.messenger-thread-item.is-active {
  background: color-mix(in srgb, var(--accent, #b91c1c) 10%, #fff);
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 28%, var(--line));
}

.messenger-thread-item.is-unread {
  background: color-mix(in srgb, var(--accent, #b91c1c) 7%, #fff);
}

.messenger-thread-item.is-unread strong {
  font-weight: 800;
}

.messenger-thread-item strong {
  font-size: 0.95rem;
}

.messenger-sidebar-empty {
  padding: 4px 8px 10px;
  font-size: 0.9rem;
}

.messenger-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(1200px 240px at 10% -10%, color-mix(in srgb, var(--accent, #b91c1c) 8%, transparent), transparent),
    #fff;
}

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

.messenger-main-head h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.messenger-kicker {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.messenger-main-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 14px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.messenger-main-body .support-chat,
.messenger-main-body .messenger-thread,
.messenger-assistant-chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: none;
  background: transparent;
  box-shadow: none;
}

.messenger-main-body > .messenger-assistant-pending {
  flex: 0 1 auto;
  max-height: 28%;
  overflow: auto;
}

.messenger-main-compose {
  flex: 0 0 auto;
  padding: 8px 14px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, #f8fafc 80%, #fff);
}

.messenger-empty {
  margin: auto;
  color: #64748b;
  text-align: center;
  padding: 32px 16px;
}

.messenger-shell-employees .messenger-sidebar {
  gap: 10px;
}

.messenger-sidebar-head {
  padding: 2px 4px 0;
}

.messenger-search-field {
  margin: 0;
}

.messenger-search-field input {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: #fff;
}

.messenger-empty-state {
  margin: auto;
  max-width: 360px;
  text-align: center;
  padding: 40px 20px;
  display: grid;
  gap: 8px;
}

.messenger-empty-state strong {
  font-size: 1.05rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.updates-magazine {
  display: grid;
  gap: 16px;
  max-width: 820px;
}

.updates-magazine-card {
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line));
  border-radius: 18px;
  padding: 20px 22px 18px;
  background:
    linear-gradient(180deg, #fffefb 0%, #faf7f1 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.updates-magazine-card.is-planned {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: var(--line);
}

.updates-magazine-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.updates-magazine-meta time {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #64748b;
}

.updates-magazine-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.updates-magazine-lead {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.5;
  color: #334155;
}

.updates-magazine-card .admin-release-fold {
  border-top-color: rgba(17, 24, 39, 0.1);
}

.updates-magazine-card .admin-release-where-chip {
  background: rgba(15, 23, 42, 0.08);
  color: #111827;
}

.updates-magazine-body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #475569;
}

.messenger-employee-panel .support-chat {
  max-height: min(58vh, 520px);
}

@media (max-width: 900px) {
  .messenger-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .messenger-sidebar {
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .page:has(> .messenger-page) {
    height: calc(100dvh - 68px);
    padding: 10px 8px 10px;
  }
}

.support-reply-preview {
  margin-top: 6px;
}

.instruction-library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  position: relative;
}

.instruction-library-main {
  min-width: 0;
}

.instr-browser {
  display: grid;
  gap: 14px;
}

.instr-browser-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.instr-browser-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.instr-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.instr-crumb-link {
  border: 0;
  background: transparent;
  color: var(--modum-ink, #0e1114);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, transparent);
  text-underline-offset: 3px;
}

.instr-crumb-sep {
  color: #94a3b8;
  font-weight: 500;
}

.instr-breadcrumb .is-current {
  color: var(--text);
}

.instr-folder-create {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.instr-folder-create[hidden] {
  display: none !important;
}

.instr-folder-create .field {
  min-width: min(280px, 100%);
  flex: 1 1 220px;
  margin: 0;
}

.instr-browser-body {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.instr-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.instr-folder-tile-wrap {
  position: relative;
}

.instr-folder-tile {
  width: 100%;
  min-height: 148px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, #c4a574);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 70%);
  color: var(--modum-ink, #0e1114);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.instr-folder-tile:hover,
.instr-folder-tile:focus-visible {
  border-color: var(--modum-accent, #c4a574);
  box-shadow: 0 10px 24px rgba(14, 17, 20, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.instr-folder-tile.is-muted {
  background: #f8fafc;
  color: #64748b;
}

.instr-folder-icon {
  width: 48px;
  height: 48px;
  color: var(--modum-ink, #0e1114);
}

.instr-folder-tile-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.instr-folder-tile-meta {
  font-size: 12px;
  color: #64748b;
}

.instr-folder-tile-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s ease;
}

.instr-folder-tile-wrap:hover .instr-folder-tile-actions,
.instr-folder-tile-wrap:focus-within .instr-folder-tile-actions {
  opacity: 1;
}

.instr-folder-current-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.instr-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.instr-archive-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f0e6d8;
  background: #fffaf5;
  color: #44403c;
  font-size: 14px;
  line-height: 1.45;
}

.instr-archive-note-warn {
  display: block;
  margin-top: 6px;
  color: #9a3412;
}

.instr-search {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  min-width: min(340px, 100%);
  border: 1px solid #d6d3d1;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.instr-search input,
.instr-search .instr-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  min-height: 40px;
  box-shadow: none;
}

.instr-search input:focus,
.instr-search .instr-search-input:focus {
  outline: none;
}

.instr-search-btn,
.instr-search .instr-search-btn {
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-left: 1px solid #e7e5e4;
  border-radius: 0;
  min-height: 40px;
  padding: 0 16px;
  background: #fafaf9;
  font-weight: 600;
}

.instr-search-btn:hover,
.instr-search .instr-search-btn:hover {
  background: #f5f5f4;
}

.instr-file-list {
  display: grid;
  gap: 8px;
}

.instr-file-row {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(23rem, max-content);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.instr-file-row:hover,
.instr-file-row:focus-visible {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 70%, var(--line));
  background: #fffdf8;
  outline: none;
}

.instr-file-row.needs-test {
  background: color-mix(in srgb, #f59e0b 7%, #fff);
}

.instr-file-row.unassigned {
  background: #fff7ed;
}

.instr-file-icon {
  width: 28px;
  height: 34px;
  color: #334155;
}

.instr-file-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.instr-file-main strong {
  font-size: 15px;
  line-height: 1.3;
}

.instr-file-sub {
  font-size: 12px;
}

.instr-file-chips,
.instr-file-side {
  display: grid;
  grid-template-columns: 8.5rem 8.75rem 4.75rem;
  align-items: center;
  justify-items: start;
  column-gap: 12px;
  width: 100%;
  min-width: 23rem;
}

.instr-file-col {
  display: flex;
  align-items: center;
  min-width: 0;
}

.instr-file-col .status {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instr-file-col-people {
  justify-content: flex-start;
}

.instr-assigned-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.instr-assigned-chip .instr-assigned-num {
  font-weight: 700;
}

.instr-assigned-chip .instr-assigned-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.instr-empty {
  padding: 28px 12px;
  text-align: center;
}

.test-results-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
}

.test-results-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #fffefb 0%, #f7f5f0 100%);
}

.test-results-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.test-results-mode {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #ebe7df;
}

.test-results-mode .ghost-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5b6573;
  font-weight: 700;
  font-size: 13px;
  box-shadow: none;
}

.test-results-mode .ghost-button.active {
  border-color: transparent;
  background: #fff;
  color: var(--modum-ink, #0e1114);
  box-shadow: 0 1px 4px rgba(14, 17, 20, 0.08);
}

.test-results-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.test-results-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.test-results-search {
  position: relative;
  display: block;
  min-width: 0;
}

.test-results-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #8a93a0;
  pointer-events: none;
}

.test-results-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 38px;
  border: 1px solid #d8d3c8;
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.test-results-search input::placeholder {
  color: #98a0ab;
}

.test-results-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 70%, #d8d3c8);
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.18);
}

.test-results-select {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.test-results-select > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a93a0;
}

.test-results-select select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d8d3c8;
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.test-results-select select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 70%, #d8d3c8);
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.18);
}

.test-result-tree {
  display: grid;
  gap: 10px;
}

.test-result-empty {
  padding: 28px 18px;
  border: 1px dashed #d8d3c8;
  border-radius: 14px;
  background: #faf9f6;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.test-result-node {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.test-result-node .test-result-node {
  border: 0;
  border-radius: 10px;
  background: #fbfaf7;
  margin: 0;
}

.test-result-node-head {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.test-result-node-head.nested {
  padding: 12px 14px;
  background: transparent;
}

.test-result-node-head:hover {
  background: #fffdf8;
}

.test-result-chevron {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f4efe3;
  color: var(--modum-ink, #0e1114);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease;
}

.test-result-node.is-open > .test-result-node-head > .test-result-chevron {
  transform: rotate(90deg);
}

.test-result-node-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.test-result-node-main strong {
  font-size: 15px;
  font-weight: 750;
}

.test-result-node-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px 40px;
  border-top: 1px solid #f1eee7;
}

.test-result-node-body[hidden] {
  display: none !important;
}

.test-result-node-body.attempts {
  gap: 6px;
  padding-left: 52px;
}

.test-result-attempt {
  width: 100%;
  display: grid;
  grid-template-columns: 110px auto auto auto minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.test-result-attempt:hover {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, var(--line));
  background: #fffdf8;
}

.test-result-attempt-no {
  font-weight: 700;
}

.test-result-attempt-open {
  color: var(--modum-ink, #0e1114);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.test-result-modal {
  width: min(820px, calc(100vw - 24px));
  max-height: min(86vh, 900px);
  overflow: auto;
}

.test-result-modal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.test-result-modal-summary.is-passed {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.test-result-modal-summary.is-failed {
  border-color: #fecaca;
  background: #fff7f7;
}

.test-result-review {
  margin-top: 8px;
}

@media (max-width: 860px) {
  .test-results-filters {
    grid-template-columns: 1fr;
  }

  .test-result-node-head {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .test-result-node-body,
  .test-result-node-body.attempts {
    padding-left: 12px;
  }

  .test-result-attempt {
    grid-template-columns: 1fr 1fr;
  }
}

.instruction-upload-panel.is-collapsed {
  display: none;
}

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

.instr-upload-head h2 {
  margin: 0;
  font-size: 16px;
}

.instr-upload-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.3fr) minmax(140px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
}

.instr-upload-grid > .field {
  margin: 0;
  min-width: 0;
}

.instr-upload-file .file-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.file-picker-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #d6d3d1;
  background: #fff;
  font-weight: 600;
}

.file-picker-btn:hover {
  border-color: #a8a29e;
  background: #fafaf9;
}

.file-picker-name {
  flex: 1 1 140px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker-name.is-chosen {
  color: #1c1917;
  font-weight: 600;
}

.instr-upload-actions {
  margin: 0;
  white-space: nowrap;
}

.instr-upload-actions-label {
  display: block;
  min-height: 1.2em;
  line-height: 1.2;
  visibility: hidden;
}

.instr-upload-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.instr-upload-actions .primary-button.inline {
  align-self: stretch;
  min-height: 40px;
}

.instruction-upload-form .form-actions {
  margin-top: 0;
}

.danger-ghost {
  color: #b91c1c;
}

.danger-ghost:hover {
  border-color: #fecaca;
  background: #fef2f2;
}

.instruction-list-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.instruction-readiness-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.instruction-readiness-filters .ghost-button.active {
  border-color: #94a3b8;
  background: #f1f5f9;
}

@media (max-width: 960px) {
  .instr-upload-grid {
    grid-template-columns: 1fr;
  }

  .instr-file-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .instr-file-chips,
  .instr-file-side {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .instr-file-side {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }
}

.instruction-compact-list th,
.instruction-compact-list td {
  padding-top: 8px;
  padding-bottom: 8px;
  vertical-align: middle;
}

.instruction-compact-list td:first-child {
  max-width: 360px;
}

.instruction-compact-list tr.instruction-row-unassigned td {
  background: #fff7ed;
}

.instruction-compact-list tr.instruction-row-needs-test td {
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}

.instruction-core-fields {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(180px, 1fr);
  gap: 12px;
  align-items: end;
}

.page-title-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.label-with-tip,
.section-heading-row h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.section-heading-row h2 {
  margin: 0;
}

.help-tip {
  position: relative;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.55);
  background: linear-gradient(180deg, #fffdf8 0%, #f4efe3 100%);
  color: var(--modum-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: help;
  flex: 0 0 auto;
  vertical-align: middle;
}

.help-tip:hover,
.help-tip:focus-visible,
.help-tip.is-open {
  background: var(--modum-ink);
  border-color: var(--modum-accent);
  color: var(--modum-accent);
  outline: none;
}

.help-tip-bubble {
  display: none;
  position: fixed;
  z-index: 80;
  width: min(360px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(196, 165, 116, 0.35);
  background: #161a20;
  color: #f4f2ec;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  box-shadow: 0 16px 40px rgba(14, 17, 20, 0.28);
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.help-tip-bubble::before {
  content: "";
  position: absolute;
  top: -5px;
  left: var(--tip-arrow-left, 24px);
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #161a20;
  border-left: 1px solid rgba(196, 165, 116, 0.35);
  border-top: 1px solid rgba(196, 165, 116, 0.35);
}

.help-tip.tip-above .help-tip-bubble::before,
.help-tip-bubble.tip-above::before {
  top: auto;
  bottom: -5px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(196, 165, 116, 0.35);
  border-bottom: 1px solid rgba(196, 165, 116, 0.35);
}

.help-tip.is-open .help-tip-bubble,
.help-tip-bubble.is-portaled {
  display: block;
  z-index: 320;
}

.instruction-upload-panel {
  padding-bottom: 14px;
}

.instruction-description-field {
  grid-column: 1 / -1;
}

.instruction-description-field textarea {
  min-height: 64px;
  resize: vertical;
}

.instruction-optional-description .ghost-button {
  margin-bottom: 4px;
}

.instruction-file-actions {
  margin-bottom: 16px;
}
.instruction-recipient-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.instruction-recipient-list > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.instruction-recipient-list span {
  color: var(--muted);
  font-size: 12px;
}

.timesheet-howto-list {
  margin: 10px 0 12px;
  padding-left: 1.2em;
  color: var(--muted);
}

.timesheet-howto-list li {
  margin: 6px 0;
}

.timesheet-howto-list strong {
  color: var(--ink, #14181d);
}

.ts-online-panel .section-heading {
  align-items: flex-start;
}

.ts-online-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin: 8px 0 12px;
  color: var(--muted);
}

.ts-online-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(70vh, 720px);
  border: 1px solid var(--line, #e2e0d8);
  border-radius: 12px;
  background: #fff;
}

.ts-online-scroll.is-zoomed-in {
  overflow-x: auto;
}

.ts-online-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 12px;
}

.ts-online-table th,
.ts-online-table td {
  border-right: 1px solid #eceae3;
  border-bottom: 1px solid #eceae3;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}

.ts-online-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f5f0;
  font-weight: 700;
  text-align: center;
  padding: 5px 2px;
  white-space: normal;
  line-height: 1.15;
  overflow: hidden;
}

.ts-online-table thead th small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 10px;
}

.ts-online-table .ts-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}

.ts-online-table thead .ts-sticky {
  z-index: 4;
  background: #f7f5f0;
}

.ts-online-table .ts-col-num {
  left: 0;
  min-width: 32px;
  width: 32px;
  text-align: center;
}

.ts-online-table .ts-col-fio {
  left: 32px;
  min-width: 88px;
  width: 156px;
  z-index: 2;
}

.ts-online-table thead .ts-col-fio {
  z-index: 4;
}

.ts-online-table .ts-col-pos { min-width: 56px; }
.ts-online-table .ts-col-shift { min-width: 48px; }
.ts-online-table .ts-col-hire { min-width: 64px; }
.ts-online-table .ts-col-phone { min-width: 64px; }
.ts-online-table .ts-col-day { min-width: 16px; }
.ts-online-table .ts-col-total,
.ts-online-table .ts-col-norm { min-width: 44px; }

.ts-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.ts-zoom-controls [data-ts-zoom-out],
.ts-zoom-controls [data-ts-zoom-in] {
  min-width: 32px;
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.ts-zoom-controls [data-ts-zoom-label] {
  min-width: 3.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted, #6b675e);
}

.ts-col-resizer:hover,
.ts-online-table.is-resizing .ts-col-resizer {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, transparent);
}

.ts-online-table.is-resizing,
.ts-online-table.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.ts-online-table .is-col-hidden,
.ts-online-table tr.is-row-hidden {
  display: none !important;
}

.ts-online-table.is-view .ts-col-fio,
.ts-online-table.is-view .ts-col-fio .ts-fio-link,
.ts-online-table.is-view .ts-col-fio span,
.ts-online-table.is-view .ts-col-pos,
.ts-online-table.is-view .ts-col-shift {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.ts-online-table.is-view .ts-col-fio {
  padding: 6px 8px;
}

.ts-online-table input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  font: inherit;
  color: inherit;
  text-align: inherit;
  min-width: 0;
}

.ts-online-table .ts-col-fio input,
.ts-online-table .ts-col-pos input,
.ts-online-table .ts-col-shift input,
.ts-online-table .ts-col-hire input,
.ts-online-table .ts-col-phone input {
  text-align: left;
  padding-left: 8px;
}

.ts-online-table .ts-col-day input,
.ts-online-table .ts-col-total input,
.ts-online-table .ts-col-norm input {
  text-align: center;
}

.ts-online-table .ts-col-extra {
  min-width: 110px;
}

.ts-online-table input[type="date"] {
  min-width: 132px;
  padding: 4px 6px;
}

.ts-extra-title {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.ts-suggest-pop {
  position: fixed;
  z-index: 360;
  max-height: min(420px, 55vh);
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 30%, var(--line, #e7e1d6));
  background: #fffefb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.ts-suggest-pop[hidden] {
  display: none !important;
}

.ts-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.ts-suggest-item:hover,
.ts-suggest-item.is-active {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 18%, #fff);
}

.ts-suggest-hint {
  color: var(--muted, #6b675e);
  font-weight: 500;
}

.ts-tip-btn {
  position: relative;
}

.ts-tip-btn[data-tip]:hover::after,
.ts-tip-btn[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line, #e7e1d6));
  background: #fffefb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  color: #2b2a26;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}

.ts-tip-btn.ts-tip-end[data-tip]:hover::after,
.ts-tip-btn.ts-tip-end[data-tip]:focus-visible::after {
  left: auto;
  right: 0;
  transform: none;
}

.ts-editor-shell .form-actions,
.ts-online-panel .form-actions {
  overflow: visible;
}

.ts-ctx-menu {
  position: fixed;
  z-index: 370;
  min-width: 240px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 30%, var(--line, #e7e1d6));
  background: #fffefb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.ts-ctx-menu[hidden] {
  display: none !important;
}

.ts-ctx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ts-ctx-menu button:hover {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 18%, #fff);
}

.ts-ctx-menu hr {
  border: 0;
  border-top: 1px solid var(--line, #e7e1d6);
  margin: 4px 6px;
}

.ts-online-table .is-weekend,
.ts-online-table th.is-weekend {
  background: #f3f1ec;
}

.ts-online-table td.is-hours {
  background: #eef8f1;
}

.ts-online-table td.is-code {
  background: #fff4e5;
  font-weight: 700;
}

.ts-online-table td.code-б { background: #fee2e2; }
.ts-online-table td.code-о { background: #e0e7ff; }
.ts-online-table td.code-к { background: #fef3c7; }
.ts-online-table td.code-п { background: #f3e8ff; }

.ts-online-legend {
  margin-top: 10px;
}

.ts-month-archive {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.ts-month-archive .ghost-button.compact {
  padding: 4px 10px;
  font-size: 12px;
}

.ts-month-archive .ghost-button.is-active {
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
  font-weight: 600;
}

.ts-excel-tools {
  flex-wrap: wrap;
  gap: 8px;
}

.ts-work-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line, #e7e1d6);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffefb 0%, #f7f4ee 100%);
  overflow: visible;
}

.ts-period-wrap {
  position: relative;
}

.ts-period-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 42%, var(--line, #e7e1d6));
  background: linear-gradient(180deg, #fffefb 0%, #f7f3ec 100%);
  color: #1c2430;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(91, 74, 50, 0.06), 0 8px 18px rgba(28, 36, 48, 0.04);
}

.ts-period-btn:hover {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 78%, var(--line));
}

.ts-period-btn[aria-expanded="true"] {
  border-color: var(--modum-accent, #c4a574);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--modum-accent, #c4a574) 22%, transparent);
}

.ts-period-icon {
  width: 18px;
  height: 18px;
  color: #5b4a32;
  flex: 0 0 auto;
  pointer-events: none;
}

.ts-period-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ts-period-select:focus {
  outline: none;
}

.ts-period-cal {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: 292px;
  padding: 14px 14px 16px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 38%, var(--line, #e7e1d6));
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--modum-accent, #c4a574) 16%, transparent), transparent 55%),
    linear-gradient(180deg, #fffdf8 0%, #f6f1e8 100%);
  box-shadow: 0 22px 48px rgba(28, 36, 48, 0.16);
}

.ts-period-cal[hidden] {
  display: none !important;
}

.ts-period-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.ts-period-cal-head strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ts-period-cal-nav {
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line, #e7e1d6));
  border-radius: 10px;
  background: #fff;
  color: #5b4a32;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.ts-period-cal-nav:hover {
  border-color: var(--modum-accent, #c4a574);
  background: #fffaf3;
}

.ts-period-cal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ts-period-cal-month {
  position: relative;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, #fff 70%, transparent);
  color: #1c2430;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.ts-period-cal-month:hover {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 22%, #fff);
}

.ts-period-cal-month.is-now:not(.is-selected) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--modum-accent, #c4a574) 70%, transparent);
}

.ts-period-cal-month.is-selected {
  background: #161a20;
  color: #f7f1e6;
  box-shadow: 0 8px 16px rgba(22, 26, 32, 0.18);
}

.ts-period-cal-month.has-data::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--modum-accent, #c4a574);
}

.ts-period-cal-month.is-selected.has-data::after {
  background: #e8c48a;
}

.ts-upload-cluster,
.ts-download-cluster,
.ts-edit-cluster,
.ts-steward-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ts-steward-summary:not(:empty) {
  max-width: min(360px, 42vw);
  font-size: 13px;
  line-height: 1.35;
}

.ts-steward-modal {
  width: min(720px, 100%);
}

.ts-steward-add {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  margin: 16px 0;
}

.ts-steward-list {
  display: grid;
  gap: 10px;
}

.ts-steward-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line, #e7e1d6);
  border-radius: 12px;
  background: #fffefb;
}

.ts-period-select-visible {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 42%, var(--line, #e7e1d6));
  background: linear-gradient(180deg, #fffefb 0%, #f7f3ec 100%);
  font: inherit;
  font-weight: 700;
}

@media (max-width: 720px) {
  .ts-steward-add,
  .ts-steward-row {
    grid-template-columns: 1fr;
  }
}

.ts-work-status {
  min-height: 0;
  max-width: min(420px, 48vw);
  flex: 1 1 220px;
}

.ts-work-status:empty {
  display: none;
}

.ts-work-status .status {
  display: inline-block;
  white-space: normal;
  line-height: 1.35;
  animation: ts-status-in 0.35s ease;
}

@keyframes ts-status-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

.ts-upload-menu-wrap {
  position: relative;
}

.ts-upload-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  z-index: 30;
  min-width: 280px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 28%, var(--line));
  background: #fffefb;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.ts-upload-menu[hidden] {
  display: none !important;
}

.ts-upload-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.ts-upload-menu-item:hover {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 16%, #fff);
}

.ts-upload-menu-help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--line, #e7e1d6);
  color: #64748b;
  font-size: 0.88rem;
}

.ts-editor-overlay {
  z-index: 40;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: var(--surface, #fff);
}

.ts-editor-modal {
  width: 100%;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
}

.ts-editor-modal .ts-editor-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}

.ts-editor-modal .section-heading {
  align-items: flex-start;
  gap: 12px;
}

.ts-editor-modal .section-heading .form-actions {
  flex-shrink: 0;
  margin-right: 0;
}

.ts-editor-modal .ts-online-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  height: 100%;
}

body.ts-editor-open {
  overflow: hidden;
}
/* Timesheet fullscreen editor / employee modal: same surface stack under the card.
   150 editor · 155 modal · 160 training card (unified, was 160/170 mixed). */
body.ts-editor-open .ts-editor-overlay {
  z-index: 150;
}

html.quest-editor-safe .quest-spotlight,
html.quest-modal-safe .quest-spotlight,
html[data-quest-layer="surface"] .quest-spotlight {
  box-shadow: 0 0 0 3px #fffef8, 0 0 0 9999px rgba(14, 17, 20, 0.22);
  outline: none;
}

html.quest-editor-safe .quest-card-host,
html.quest-editor-safe .quest-card,
html.quest-modal-safe .quest-card-host,
html.quest-modal-safe .quest-card,
html.quest-work-surface .quest-card-host,
html.quest-work-surface .quest-card,
html[data-quest-layer="surface"] .quest-card-host,
html[data-quest-layer="surface"] .quest-card {
  z-index: 160;
}

html.quest-modal-safe .preview-modal-overlay[data-employee-modal]:not([hidden]) {
  z-index: 155;
  justify-content: flex-start;
  padding-left: max(16px, calc((100vw - 1180px) / 2));
  padding-right: 328px; /* strip for narrow training aside */
}

html.quest-modal-safe .preview-modal-overlay[data-employee-modal]:not([hidden]) .preview-modal {
  width: min(900px, 100%);
  max-height: 88vh;
}

html.quest-modal-safe .quest-target-live,
html[data-quest-layer="surface"] .quest-target-live {
  z-index: 156 !important;
}


.ts-online-panel[data-ts-mode="view"] .ts-online-table.is-view td span {
  display: inline-block;
  min-height: 1.1em;
}

.ts-online-table.is-view input {
  display: none;
}

.ts-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 6px;
  margin: 0 2px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  background: #f3f1ec;
}

.ts-chip.is-hours { background: #eef8f1; }
.ts-chip.code-б { background: #fee2e2; }
.ts-chip.code-о { background: #e0e7ff; }
.ts-chip.code-к { background: #fef3c7; }
.ts-chip.code-п { background: #f3e8ff; }

.employee-timesheet-day.is-code {
  background: #fff4e5;
}


.audience-assign-block p {
  margin: 0 0 8px;
}

.audience-assign-block .primary-button {
  margin-top: 4px;
}

.action-form.compact {
  margin-top: 18px;
}

.audience-block {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

/* .form-grid { display:grid } otherwise overrides HTML [hidden] and shows filters on «all». */
.audience-block [hidden],
.audience-block .form-grid[hidden],
.audience-block .field[hidden],
.audience-mode-hint[hidden],
.audience-people-picker[hidden],
.audience-live-match[hidden] {
  display: none !important;
}

.audience-mode-hint {
  margin: 0 0 10px;
}

.audience-people-picker {
  display: grid;
  gap: 10px;
}

.audience-selected-strip {
  margin: 0 0 4px;
}

.audience-selected-empty {
  margin: 0;
}

.audience-selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audience-selected-chip {
  margin: 0;
}

.audience-selected-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e7dccb;
  background: #fff8ef;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.audience-selected-chip-btn strong {
  font-size: 0.92rem;
}

.audience-selected-chip-btn span:not(.audience-selected-chip-x) {
  color: #6b7280;
  font-size: 0.8rem;
}

.audience-selected-chip-x {
  margin-left: 2px;
  color: #9a3412;
  font-weight: 700;
}

.quest-card--draggable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.quest-card--draggable.is-dragging {
  cursor: grabbing;
}

.quest-card--draggable button,
.quest-card--draggable a,
.quest-card--draggable input,
.quest-card--draggable select,
.quest-card--draggable textarea,
.quest-card--draggable label {
  cursor: pointer;
  user-select: auto;
  touch-action: manipulation;
}

.schedule-file-value {
  display: inline-block;
  max-width: 220px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f5f5f4;
  font-size: 0.85rem;
  white-space: normal;
  word-break: break-word;
}

.schedule-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-pick .ghost-button.is-selected {
  border-color: #166534;
  background: #dcfce7;
  color: #14532d;
  font-weight: 600;
}

.schedule-picked-ok {
  margin-top: 6px;
  color: #166534;
  font-size: 0.85rem;
  font-weight: 600;
}

.schedule-picked-hint {
  margin-top: 6px;
  font-size: 0.8rem;
}

tr.schedule-row-ok td {
  background: #f0fdf4;
}

.schedule-learn-banner {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
}

.schedule-learn-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.schedule-learn-logic {
  margin: 8px 0 12px;
  padding-left: 18px;
}

.schedule-learn-banner select {
  min-width: 160px;
}

.attention-schedule-help {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.audience-live-match,
.audience-people-picker [data-audience-people-list] {
  margin-top: 4px;
}

.audience-live-match-head {
  margin: 0 0 8px;
  font-size: 14px;
}

.audience-match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  max-height: 240px;
  overflow: auto;
}

.audience-match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.audience-match-row > div,
.audience-match-toggle {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: default;
}

.audience-match-toggle {
  cursor: pointer;
}

.audience-match-row.is-selected {
  border-color: #f0c7a0;
  background: #fff7ed;
}

.audience-match-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audience-match-copy span,
.audience-match-row > div span {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.audience-match-check {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #c2410c;
  flex: 0 0 auto;
  margin-top: 2px;
  background: #fff;
}

.audience-match-row.is-selected .audience-match-check {
  border-color: #ea580c;
  background: #ffedd5;
}

.audience-match-empty {
  margin: 0;
}

.audience-picker-results {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.audience-picker-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.audience-picker-row:hover {
  border-color: #c4b5a0;
  background: #fffdf8;
}

.audience-picker-row span {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.audience-picker-empty {
  margin: 0;
}

.audience-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.audience-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
}

.audience-chip-remove {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.audience-chip-remove:hover {
  color: #b91c1c;
}

.audience-preview {
  margin-top: 14px;
  padding: 14px;
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}

.audience-preview ul {
  max-height: 260px;
  overflow: auto;
}

.technical-value {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.detail-grid.instruction-summary-grid.employee-attendance-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.employee-attendance-card {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 18px 18px 16px;
  border: 1px solid #e2ddd2;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fffefb 0%, #f7f4ee 100%);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.employee-attendance-card:hover {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, #e2ddd2);
  box-shadow: 0 10px 28px rgba(14, 17, 20, 0.08);
  transform: translateY(-1px);
}

.employee-attendance-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.employee-attendance-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a93a0;
  margin-bottom: 4px;
}

.employee-attendance-period {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--modum-ink, #0e1114);
}

.employee-attendance-cta {
  flex: 0 0 auto;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8a7349;
}

.employee-attendance-card.is-empty {
  cursor: default;
  pointer-events: none;
}

.employee-attendance-history {
  margin-top: 16px;
}

.employee-attendance-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.employee-timesheet-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(88vh, 920px);
  overflow: auto;
}

.employee-timesheet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.employee-timesheet-summary .detail-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #faf9f6;
}

.employee-timesheet-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 6px;
}

.employee-timesheet-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8a93a0;
  text-transform: lowercase;
}

.employee-timesheet-weekdays span:nth-child(6),
.employee-timesheet-weekdays span:nth-child(7) {
  color: #b08970;
}

.employee-timesheet-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.employee-timesheet-day {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid #e8e4db;
  border-radius: 12px;
  background: #fff;
}

.employee-timesheet-day.is-weekend {
  background: #f7f6f3;
}

.employee-timesheet-day.is-empty {
  border-style: dashed;
  background: transparent;
  min-height: 72px;
  opacity: 0.28;
  pointer-events: none;
}

.employee-timesheet-day.is-worked {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 45%, #e8e4db);
  background: #fffaf1;
}

.employee-timesheet-day-num {
  font-size: 12px;
  color: #8a93a0;
  font-weight: 700;
}

.employee-timesheet-day-num small {
  font-weight: 600;
  text-transform: lowercase;
}

.employee-timesheet-day strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--modum-ink, #0e1114);
}

.employee-messenger-readonly-hint {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .employee-timesheet-summary {
    grid-template-columns: 1fr 1fr;
  }

  .employee-timesheet-weekdays,
  .employee-timesheet-days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .employee-timesheet-day {
    min-height: 56px;
    padding: 6px 4px;
  }

  .employee-attendance-card-top {
    flex-direction: column;
  }

  .detail-grid.instruction-summary-grid.employee-attendance-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.question-pack-panel {
  margin: 12px 0 16px;
  padding-top: 4px;
}

.analysis-open-btn {
  border-color: rgba(196, 165, 116, 0.55);
  color: var(--modum-ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  background:
    linear-gradient(180deg, #fffdf8 0%, #f4efe3 100%);
}

.analysis-open-btn:hover {
  border-color: var(--modum-accent);
  background: var(--modum-ink);
  color: var(--modum-text);
}

.analysis-modal-overlay {
  z-index: 40;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(14, 17, 20, 0.72), rgba(14, 17, 20, 0.5));
}

.analysis-modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(212, 175, 55, 0.14), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
  box-shadow: 0 28px 80px rgba(14, 17, 20, 0.35);
}

.analysis-modal-head {
  padding: 28px 28px 8px;
}

.analysis-modal .preview-modal-close {
  top: 18px;
  right: 18px;
  border-radius: 999px;
}

.analysis-kicker {
  margin: 0 0 8px;
  color: #8a6d1d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-modal h2 {
  margin: 0 48px 8px 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.2;
  color: #111827;
}

.analysis-modal .preview-modal-subtitle {
  margin: 0;
  max-width: 46rem;
  color: #5b6472;
  font-weight: 500;
}

.analysis-wait {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 16px 28px 0;
  padding: 14px 16px;
  border: 1px solid #e7e0cc;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf6 0%, #faf6ea 100%);
  color: #3f3a2c;
}

.analysis-wait p {
  margin: 4px 0 0;
  color: #5c5646;
  line-height: 1.45;
}

.analysis-wait.is-busy {
  border-color: #d6c48a;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.analysis-wait-spinner {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid rgba(138, 109, 29, 0.2);
  border-top-color: #8a6d1d;
  border-radius: 50%;
  animation: analysis-spin 0.8s linear infinite;
  flex: 0 0 auto;
}

@keyframes analysis-spin {
  to { transform: rotate(360deg); }
}

.analysis-modal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 16px 28px 8px;
}

.analysis-modal-body {
  padding: 8px 28px 28px;
  overflow: auto;
  max-height: min(62vh, 720px);
}

.analysis-loading {
  padding: 28px 0;
  color: #6b7280;
  text-align: center;
}

.analysis-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}

.analysis-metric {
  padding: 14px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
}

.analysis-metric span {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.analysis-metric strong {
  font-size: 1.35rem;
  color: #111827;
}

.analysis-note {
  margin: 0 0 14px;
  color: #6b7280;
}

.analysis-section {
  margin: 0 0 16px;
  padding: 16px 16px 12px;
  border: 1px solid #e8ebf0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.analysis-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #111827;
}

.analysis-hero-summary {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: #dde3ec;
}

.analysis-summary {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #1f2937;
}

.analysis-columns {
  display: grid;
  gap: 12px;
}

@media (min-width: 820px) {
  .analysis-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.analysis-list {
  margin: 0;
  padding-left: 1.15rem;
}

.analysis-list li {
  margin: 0 0 8px;
  line-height: 1.45;
  color: #1f2937;
}

.analysis-empty,
.analysis-empty-state p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

.analysis-empty-state {
  text-align: left;
  background:
    linear-gradient(180deg, #fcfcfd 0%, #f4f6f8 100%);
}

.analysis-hard-grid {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .analysis-hard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.analysis-hard-card {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8edf3;
}

.analysis-hard-card p {
  margin: 0 0 6px;
  color: #111827;
  font-weight: 600;
  line-height: 1.35;
}

.analysis-hard-rate {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff1f1;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 640px) {
  .analysis-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .analysis-modal-head,
  .analysis-modal-toolbar,
  .analysis-modal-body,
  .analysis-wait {
    margin-left: 16px;
    margin-right: 16px;
  }

  .analysis-modal-head,
  .analysis-modal-toolbar,
  .analysis-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .analysis-wait {
    margin-left: 16px;
    margin-right: 16px;
  }
}


.ghost-button.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.test-flow-card {
  margin: 0 0 16px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
  box-shadow: var(--shadow);
}

.test-flow-hero {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .test-flow-hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.9fr);
    align-items: start;
  }
}

.test-flow-kicker {
  margin-bottom: 8px;
}

.test-flow-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--modum-ink);
}

.test-flow-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 46rem;
}

.test-flow-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.test-flow-step {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.test-flow-step span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #eef2f7;
  color: var(--brand-steel);
}

.test-flow-step b {
  font-size: 0.82rem;
  font-weight: 700;
}

.test-flow-step small {
  font-size: 0.72rem;
  line-height: 1.2;
  color: inherit;
  opacity: 0.85;
}

.test-flow-step.is-done {
  border-color: #86efac;
  background: var(--ok-soft);
  color: var(--brand-green);
}

.test-flow-step.is-done span {
  background: #bbf7d0;
  color: var(--brand-green);
}

.test-flow-step.is-current {
  border-color: rgba(196, 165, 116, 0.55);
  background: linear-gradient(180deg, #fffdf8 0%, #f7f1e4 100%);
  color: var(--modum-ink);
}

.test-flow-step.is-current span {
  background: var(--modum-ink);
  color: var(--modum-accent);
}

.test-flow-toolbar,
.test-flow-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  margin-top: 4px;
}

.test-flow-generate-note {
  margin: 8px 0 0;
  max-width: none;
  font-size: 13px;
  line-height: 1.35;
}

.test-flow-action,
.test-flow-card .primary-button,
.test-flow-section .primary-button,
.question-pack-item-actions .primary-button {
  background: linear-gradient(180deg, #f8f1e3 0%, #ead7b0 100%);
  border: 1px solid color-mix(in srgb, var(--modum-accent, #c4a574) 70%, #d6c09a);
  color: var(--modum-ink, #0e1114);
  border-radius: 999px;
  min-height: 38px;
  padding: 8px 16px;
  font-weight: 750;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(14, 17, 20, 0.06);
}

.test-flow-action:hover,
.test-flow-card .primary-button:hover,
.test-flow-section .primary-button:hover,
.question-pack-item-actions .primary-button:hover {
  background: linear-gradient(180deg, #fff8ec 0%, #e4c994 100%);
  border-color: var(--modum-accent, #c4a574);
  color: var(--modum-ink, #0e1114);
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.22);
}

.test-flow-toolbar .field input,
.test-flow-settings input {
  border: 1px solid #e8e4db;
  border-radius: 12px;
  background: #faf8f4;
  min-height: 38px;
}

.test-flow-toolbar .field input:focus,
.test-flow-settings input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, #e8e4db);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.18);
}

.test-flow-settings {
  margin-top: 16px;
  padding: 12px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid #efeae0;
}

.test-flow-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  justify-content: flex-start;
}

.test-flow-settings-title {
  margin: 0 4px 8px 0;
  font-size: 0.95rem;
  align-self: center;
}

.test-flow-settings-lead {
  margin: 8px 0 0;
  font-size: 13px;
}

.test-flow-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.test-flow-settings-grid .field,
.test-flow-settings-row .field {
  min-width: 8.5rem;
  margin: 0;
}

.test-flow-settings-grid input,
.test-flow-settings-row input {
  width: 7rem;
}

.question-pack-status-wrap {
  display: grid;
  gap: 8px;
  flex: 1 1 260px;
  min-width: min(100%, 260px);
  align-self: center;
}

.question-pack-status-wrap .status {
  white-space: normal;
  line-height: 1.4;
  max-width: 42rem;
}

.test-flow-fail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.test-flow-actionbar {
  align-items: center;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e8e4db;
  background: #faf8f4;
  position: sticky;
  top: 8px;
  z-index: 2;
}

.test-flow-pickbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 650;
  font-size: 13px;
}

.test-flow-pickbar.is-ok {
  background: #f3fbf6;
  border-color: #86efac;
  color: var(--brand-green, #166534);
}

.test-flow-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}

.test-flow-list-head h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.test-flow-list-head .muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.test-flow-list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.test-flow-empty {
  margin: 8px 0 0;
}

.test-flow-section {
  margin: 18px 0 8px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.question-pack-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.question-pack-toolbar {
  margin: 12px 0;
}

.question-pack-sheet {
  margin: 0;
  display: grid;
  gap: 10px;
}

.question-pack-item {
  padding: 0;
  border: 1px solid var(--border, #d7dde7);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.question-pack-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
}

.question-pack-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.question-pack-chevron {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  background: #f4efe3;
  color: var(--modum-ink, #0e1114);
  font-weight: 700;
  transition: transform .15s ease;
}

.question-pack-item:not(.is-collapsed) .question-pack-chevron {
  transform: rotate(90deg);
}

.question-pack-toggle-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.question-pack-preview-text {
  font-size: 13px;
  line-height: 1.35;
  color: #374151;
}

.question-pack-correct-preview {
  font-size: 12px;
}

.question-pack-item-body {
  padding: 0 14px 14px;
  border-top: 1px solid #f0ece4;
}

.question-pack-item-body[hidden] {
  display: none !important;
}

.question-pack-edit-hint {
  margin: 10px 0 0;
  font-size: 12px;
}

.question-pack-approve {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.question-pack-approve.is-locked {
  color: #0f766e;
  cursor: default;
}

.question-pack-item.is-approved {
  border-color: #3d9a5f;
  background: #f7fcf9;
}

.question-pack-options {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.question-pack-option {
  display: grid;
  gap: 4px;
}

.question-pack-option-label {
  font-size: 0.9rem;
  color: var(--muted, #5b6472);
}

.question-pack-option.is-correct .question-pack-option-label {
  color: var(--text, #1f2937);
  font-weight: 600;
}

.question-pack-item-body .field textarea,
.question-pack-option textarea,
.question-pack-item textarea {
  width: 100%;
  min-height: 64px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
  border: 1px solid #e8e4db;
  border-radius: 14px;
  background: #faf8f4;
  padding: 12px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.question-pack-item-body .field textarea:focus,
.question-pack-option textarea:focus,
.question-pack-item textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, #e8e4db);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.2);
}

.question-pack-option.is-correct textarea {
  border-color: #86efac;
  background: #f7fcf8;
}

.question-pack-option.is-correct textarea:focus {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

@media (max-width: 720px) {
  .test-flow-actionbar {
    position: static;
  }

  .question-pack-item-head {
    flex-direction: column;
  }
}

.question-pack-preview {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 10px;
}

.question-pack-preview ul {
  margin: 6px 0 0;
  padding-left: 1.1rem;
}

.question-pack-preview .question-pack-correct {
  font-weight: 600;
}

@media print {
  .sidebar,
  .topbar,
  .form-actions,
  .question-pack-toolbar,
  button {
    display: none !important;
  }
  .question-pack-item {
    break-inside: avoid;
    border: none;
    padding: 0 0 12px;
  }
}

@media (max-width: 1100px) {
  .detail-grid.instruction-summary-grid.employee-attendance-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.employee-profile {
  max-width: 720px;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.profile-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2fr);
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-list dt {
  color: var(--muted);
}

.profile-list dd {
  margin: 0;
  font-weight: 600;
}

.section-heading,
.employee-instruction-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2,
.employee-instruction-title-row h2,
.employee-instruction-title-row h3 {
  margin: 0;
}

.section-heading .muted {
  margin: 6px 0 0;
}

.employee-learning-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.employee-learning-action {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.employee-learning-action h2 {
  margin: 0 0 8px;
}

.employee-learning-action p {
  margin: 0;
}

.employee-instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.employee-instruction-list {
  margin-top: 12px;
}

.employee-instruction-list .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-instruction-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.employee-instruction-title-row h2,
.employee-instruction-title-row h3,
.employee-instruction-meta dd,
.employee-instruction-content {
  overflow-wrap: anywhere;
}

.employee-instruction-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 16px 0;
}

.employee-instruction-meta div {
  min-width: 0;
}

.employee-instruction-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.employee-instruction-meta dd {
  margin: 3px 0 0;
  font-weight: 600;
}

.employee-instruction-detail {
  max-width: min(960px, 100%);
}

.employee-instruction-detail.employee-instruction-card-reader {
  max-width: none;
  width: 100%;
}

.employee-instruction-card-compact,
.employee-instruction-card-reader {
  display: grid;
  gap: 16px;
}

.employee-instruction-detail-title {
  margin-top: 8px;
}

.employee-instruction-description {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f8fa;
  color: var(--muted);
  line-height: 1.55;
}

.employee-instruction-preview-hint {
  margin: 0 0 12px;
}

.employee-instruction-preview-head h3 {
  margin: 0 0 6px;
}

.employee-instruction-preview-section {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.employee-instruction-preview-section-reader {
  border-top: 0;
  padding-top: 0;
}

.employee-instruction-preview-frame-host {
  margin-top: 8px;
}

.instr-reader-launch {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f8fa;
}

.instr-reader-compact-wrap {
  display: grid;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f5;
  overflow: hidden;
}

.instr-reader-compact {
  width: 100%;
  max-width: 100%;
  height: min(78vh, calc(100dvh - 220px));
  min-height: 560px;
  overflow: auto;
  background: #fff;
}

.instr-reader-compact .instr-reader-frame,
.instr-reader-compact .employee-instruction-document-frame,
.instr-reader-frame-compact {
  width: 100%;
  height: 100%;
  min-height: 560px;
  pointer-events: auto;
}

.instr-reader-open-link {
  text-decoration: none;
}

.instr-reader-prompt {
  margin: 0 0 10px;
  color: var(--brand-steel);
  line-height: 1.45;
}

.instr-reader-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.instr-reader-launch-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 52ch;
}

.employee-instruction-card-meta {
  margin: 12px 0 18px;
}

.employee-instruction-stats-section {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.employee-instruction-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.employee-instruction-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.employee-instruction-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.employee-instruction-attempts {
  display: grid;
  gap: 10px;
}

.employee-instruction-attempt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.employee-instruction-attempt-detail {
  margin-top: 12px;
}

@media (max-width: 720px) {
  .employee-instruction-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .instr-reader-compact,
  .instr-reader-compact .instr-reader-frame,
  .instr-reader-compact .employee-instruction-document-frame,
  .instr-reader-frame-compact {
    height: min(70vh, calc(100dvh - 200px));
    min-height: 420px;
  }
}

.instr-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #0f172a;
}

.instr-reader-overlay[hidden] {
  display: none !important;
}

body.instr-reader-fs-open {
  overflow: hidden;
}

.instr-reader {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  width: 100%;
  background: #111827;
}

.instr-reader-fs {
  min-height: 100%;
}

.instr-reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 3;
}

.instr-reader-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.instr-reader-zoom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.instr-reader-zoom-label {
  min-width: 3.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.instr-reader-body {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  height: calc(100vh - 58px);
}

.instr-reader-viewport {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #1f2937;
}

.instr-reader-frame,
.employee-instruction-document-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.instr-reader-nav {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  width: min(300px, calc(100% - 24px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  display: grid;
  gap: 10px;
}

.instr-reader-nav[hidden] {
  display: none !important;
}

.instr-reader-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.instr-reader-nav-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.instr-reader-page-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.instr-reader-page-field input {
  width: 4.2rem;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.employee-instruction-acknowledgement-section {
  margin-top: 4px;
  border-top: 0;
  padding-top: 12px;
}

.employee-instruction-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.employee-instruction-document-modal .preview-modal {
  width: min(1100px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.employee-instruction-content {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  line-height: 1.65;
}

.employee-instruction-acknowledgement-section {
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.employee-instruction-acknowledgement-section h3 {
  margin: 0 0 12px;
}

.employee-instruction-acknowledgement-action p,
.employee-instruction-acknowledgement-error p {
  margin: 0 0 12px;
}

.employee-instruction-acknowledgement-success,
.employee-instruction-acknowledgement-pending,
.employee-instruction-acknowledgement-loading,
.employee-instruction-acknowledgement-error {
  display: grid;
  gap: 6px;
}

.employee-instruction-acknowledgement-success {
  color: var(--brand-green);
}

.employee-instruction-acknowledgement-pending {
  color: #92400e;
}

.employee-instruction-acknowledgement-error {
  color: var(--brand-red);
}

.employee-instruction-test-section {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-instruction-test-section h3,
.employee-instruction-test-question h4 {
  margin: 0 0 12px;
}

.employee-instruction-test-start p,
.employee-instruction-test-error p {
  margin: 0 0 12px;
}

.employee-instruction-test-loading,
.employee-instruction-test-error,
.employee-instruction-test-result {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 7px;
}

.employee-instruction-test-loading {
  color: var(--muted);
  background: var(--surface-soft);
}

.employee-instruction-test-error,
.employee-instruction-test-result.failed {
  border: 1px solid #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.employee-instruction-test-result.success {
  border: 1px solid #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.employee-instruction-test-answer-review {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.employee-instruction-test-answer-review-title {
  margin: 0;
  font-size: 1rem;
}

.employee-instruction-test-answer-review-hint {
  margin: 0;
  font-size: 0.9rem;
}

.settings-toggle-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.settings-toggle-field .label-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}

.employee-instruction-test-progress {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.employee-instruction-test-options {
  display: grid;
  gap: 10px;
}

.employee-instruction-test-option {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  white-space: normal;
}

.employee-instruction-test-option span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-blue);
  font-size: 12px;
}

.employee-instruction-preview-section {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.employee-instruction-preview-section h3 {
  margin: 0 0 12px;
}

.employee-instruction-preview-loading,
.employee-instruction-preview-error,
.employee-instruction-preview-note {
  padding: 14px 16px;
  border-radius: 7px;
  background: #f8fafc;
}

.employee-instruction-preview-loading,
.employee-instruction-preview-note {
  color: var(--muted);
}

.employee-instruction-preview-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.employee-instruction-preview-error p {
  margin: 8px 0 12px;
}

.employee-instruction-preview-frame-host {
  margin-top: 8px;
}

.employee-instruction-preview-frame {
  display: block;
  width: 100%;
  min-height: min(72vh, 820px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 860px) {
  .instr-reader-body {
    height: calc(100vh - 96px);
  }

  .instr-reader-nav {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .employee-instruction-preview-frame,
  .employee-instruction-document-frame {
    border-radius: 0;
  }
}

@media (max-width: 860px) {
  .org-create-grid {
    grid-template-columns: 1fr;
  }

  .org-create-grid .field-code input {
    max-width: none;
  }

  .instruction-library-layout {
    grid-template-columns: 1fr;
  }

  .instruction-core-fields {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: 100vh;
    position: fixed;
  }

  .topbar {
    position: static;
  }

  .page,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

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

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

  .profile-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .employee-instruction-grid,
  .employee-learning-actions,
  .employee-instruction-meta {
    grid-template-columns: 1fr;
  }

  .employee-instruction-title-row {
    flex-direction: column;
    gap: 10px;
  }

  .employee-instruction-preview-frame,
  .employee-instruction-document-frame {
    min-height: 68vh;
    height: auto;
    border-radius: 6px;
  }

  .preview-modal-overlay {
    align-items: flex-start;
    padding: 14px;
  }
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.wizard-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.wizard-step.current {
  border-color: var(--brand-blue);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.wizard-step.done {
  background: var(--ok-soft);
  color: var(--brand-green);
}

@media (max-width: 960px) {
  .wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Modum Marketing */
.marketing-chips { display:flex; flex-wrap:wrap; gap:8px; }
.marketing-chip {
  display:inline-flex; gap:4px; align-items:center;
  padding:4px 10px; border-radius:999px; background:var(--surface-2, #f3f4f6);
  border:1px solid var(--line); font-size:12px;
  cursor:pointer; font:inherit; color:inherit;
}
button.marketing-chip:hover { border-color: var(--brand-blue, #2563eb); }
.marketing-status {
  display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px;
  background:var(--surface-2, #f3f4f6); border:1px solid var(--line);
}
.marketing-status.status-new { background:#eef2ff; }
.marketing-status.status-contacted,
.marketing-status.status-no_reply { background:#fff7ed; }
.marketing-status.status-replied,
.marketing-status.status-interested,
.marketing-status.status-pilot { background:#ecfdf5; }
.marketing-status.status-not_interested { background:#fef2f2; }
.marketing-status.status-customer { background:#dcfce7; }
.marketing-history { display:flex; flex-direction:column; gap:10px; }
.marketing-message {
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--surface);
}
.marketing-message header { display:flex; justify-content:space-between; gap:12px; margin-bottom:6px; }
.marketing-message-subject { font-weight:600; margin-bottom:4px; }
.marketing-message-body {
  margin:0; white-space:pre-wrap; font-family:inherit; font-size:13px; line-height:1.45;
}
.marketing-filters .form-actions { margin-top:12px; }
.marketing-tabs {
  display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px;
}
.marketing-tab {
  border:1px solid var(--line); background:var(--surface); color:inherit;
  border-radius:999px; padding:8px 14px; cursor:pointer; font:inherit;
  font-weight:600;
}
.marketing-tab.is-active {
  background:#111; color:#fff; border-color:#111;
}
.marketing-discovery-form .form-grid { margin-bottom:0; }
.marketing-size-row {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:10px 14px;
}
.marketing-size-field {
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:0;
}
.marketing-size-field span {
  font-size:0.85rem;
  color:var(--muted, #667);
}
.marketing-size-field input {
  width:5.5rem;
  max-width:5.5rem;
  padding:8px 10px;
}
.marketing-size-limit input {
  width:4.5rem;
  max-width:4.5rem;
}
.marketing-size-hint {
  flex:1 1 100%;
  display:block;
  margin-top:2px;
  font-size:0.85rem;
  line-height:1.35;
}
.marketing-okved-block {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.marketing-okved-title {
  font-size:0.9rem;
  font-weight:600;
}
.marketing-okved-hint {
  margin:0;
  font-size:0.85rem;
  line-height:1.35;
}
.marketing-okved-selected {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.marketing-okved-tag {
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:7px 10px;
  border:1px solid #111;
  border-radius:999px;
  background:#111;
  color:#fff;
  font-size:0.85rem;
  cursor:pointer;
}
.marketing-okved-tag span[aria-hidden="true"] {
  opacity:0.8;
  font-size:1rem;
  line-height:1;
}
.marketing-okved-tag:hover {
  background:#333;
  border-color:#333;
}
.marketing-progress {
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted, #667);
  font-size:0.92rem;
}
.marketing-progress-spin {
  width:14px;
  height:14px;
  border:2px solid #c9cdd4;
  border-top-color:#1a1a1a;
  border-radius:50%;
  animation: marketing-spin 0.8s linear infinite;
  flex:0 0 auto;
}
@keyframes marketing-spin {
  to { transform: rotate(360deg); }
}
.marketing-band-note {
  margin-top:-6px;
  margin-bottom:8px;
  font-size:0.86rem;
}
.marketing-progress-lg {
  align-items:flex-start;
  gap:12px;
  padding:18px 4px;
}
.marketing-progress-lg .marketing-progress-spin {
  width:18px;
  height:18px;
  margin-top:2px;
}
.marketing-discovery-waiting {
  min-height:120px;
}
.marketing-discovery-actions-bar {
  margin-top:20px;
  padding-top:4px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.marketing-city-combo { position:relative; }
.marketing-city-combo input { width:100%; }
.marketing-city-suggest {
  position:absolute;
  z-index:40;
  left:0;
  right:0;
  top:calc(100% + 4px);
  margin:0;
  padding:4px 0;
  list-style:none;
  max-height:220px;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface, #fff);
  box-shadow:0 8px 24px rgba(0,0,0,0.08);
}
.marketing-city-suggest li {
  padding:8px 12px;
  cursor:pointer;
}
.marketing-city-suggest li:hover,
.marketing-city-suggest li.is-active {
  background:color-mix(in srgb, var(--surface) 70%, #111 8%);
}
.marketing-discovery-summary {
  margin:0 0 14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:color-mix(in srgb, var(--surface) 88%, #f5f5f5);
}
.marketing-shortfall {
  margin:8px 0 0;
  color:#7a3b00;
  line-height:1.45;
}
.marketing-contacts {
  margin-top:10px;
  display:grid;
  gap:4px;
  font-size:0.95em;
}
.marketing-contacts a { text-decoration:underline; text-underline-offset:2px; }
.marketing-maps-link { white-space: nowrap; }
.marketing-checko-name { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.marketing-checko-chip {
  margin-left: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.marketing-site-dead { color:#8a4b2a; }
.marketing-enrich-note { margin:6px 0 0; max-width:72ch; line-height:1.4; }
.marketing-workflow-tip {
  margin:10px 0 0; padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  background:rgba(0,0,0,0.03); max-width:78ch; line-height:1.45;
}
.marketing-contact-tip { margin:8px 0 0; font-size:0.92em; color:inherit; opacity:0.85; }
.marketing-capture-steps { margin:12px 0 16px; padding-left:18px; line-height:1.6; }
.marketing-capture-modal { max-width:560px; }
.marketing-prompt-details { margin:10px 0 0; }
.marketing-prompt-details summary { cursor:pointer; color:inherit; font-weight:600; }
.marketing-prompt-pre {
  margin:8px 0 0; padding:12px; border:1px solid var(--line); border-radius:10px;
  background:var(--surface, #fff); white-space:pre-wrap; font-size:12px; line-height:1.4;
  max-height:280px; overflow:auto;
}
.marketing-fit-line { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:4px; }
.marketing-fit-badge {
  display:inline-block; font-size:0.85em; font-weight:600;
  padding:3px 8px; border-radius:999px; border:1px solid var(--line);
}
.marketing-fit-badge.fit-strong { background:#e8f6ea; border-color:#9dcfab; color:#1f5b2d; }
.marketing-fit-badge.fit-good { background:#eef4ff; border-color:#9db4e8; color:#1f3f7a; }
.marketing-fit-badge.fit-weak { background:#fff6e8; border-color:#e0c08a; color:#7a4a00; }
.marketing-fit-badge.fit-low { background:#f4f4f4; border-color:#ccc; color:#555; }
.marketing-discovery-card.fit-weak,
.marketing-discovery-card.fit-low { opacity:0.96; }
.marketing-discovery-list { display:flex; flex-direction:column; gap:12px; }
.marketing-discovery-card {
  border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:var(--surface);
}
.marketing-discovery-card header {
  display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:8px;
}
.marketing-discovery-actions { display:flex; gap:8px; flex-wrap:wrap; }
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.module-card h2 { font-size: 1.15rem; }
.module-card p { margin: 8px 0; line-height: 1.45; }

.modules-custom-panel {
  max-width: 760px;
}

.modules-custom-lead {
  margin: 8px 0 4px;
  max-width: 62ch;
  line-height: 1.45;
}

.modules-custom-form,
.modules-bind-form {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.modules-custom-form .field,
.modules-bind-form .field {
  margin: 10px 0;
}

.modules-custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 14px 18px;
  align-items: start;
}

.modules-custom-form textarea {
  min-height: 88px;
}

.modules-custom-form .form-actions,
.modules-bind-form .form-actions {
  margin-top: 6px;
  gap: 12px;
}

.modules-custom-form .action-status,
.modules-bind-form .action-status {
  margin: 0;
}

@media (max-width: 720px) {
  .modules-custom-row {
    grid-template-columns: 1fr;
  }
  .modules-custom-panel {
    max-width: none;
  }
}

/* Manager module catalog (company settings) */
.module-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.module-catalog-card {
  text-align: left;
  border: 1px solid var(--border, #d7dde8);
  background: var(--surface, #fff);
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  color: inherit;
  font: inherit;
}
.module-catalog-card:hover,
.module-catalog-card.is-selected {
  border-color: var(--modum-accent, #0b6bcb);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--modum-accent, #0b6bcb) 35%, transparent);
}
.module-catalog-card.is-enabled {
  border-top: 3px solid var(--modum-accent, #0b6bcb);
}
.module-catalog-card-kicker {
  font-size: 12px;
  color: var(--muted, #667085);
}
.module-catalog-status {
  font-size: 12px;
  color: var(--muted, #667085);
}
.module-catalog-detail {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #d7dde8);
}
.module-catalog-detail h3 {
  margin: 0 0 8px;
}
.platform-help-train {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

/* Module marketplace */
.module-marketplace {
  display: grid;
  gap: 16px;
}
.module-marketplace-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.module-offer-grid {
  display: grid;
  gap: 10px;
}
.module-offer-card {
  text-align: left;
  border: 1px solid var(--border, #d7dde8);
  background: var(--surface, #fff);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  color: inherit;
  font: inherit;
}
.module-offer-card.is-selected,
.module-offer-card:hover {
  border-color: color-mix(in srgb, var(--modum-accent, #c4a574) 70%, #333);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--modum-accent, #c4a574) 40%, transparent);
}
.module-offer-no {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #667085);
}
.module-offer-status {
  font-size: 12px;
  color: var(--muted, #667085);
}
.module-marketplace-detail {
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--modum-accent, #c4a574) 14%, transparent), transparent 55%),
    linear-gradient(180deg, #fff 0%, #faf8f4 100%);
  border: 1px solid var(--border, #d7dde8);
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 40px rgba(28, 25, 23, 0.05);
}
.module-pitch-scope {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8a6a3a;
}
.module-pitch-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b07a2a;
  margin-bottom: 8px;
}
.module-pitch-title {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 750;
}
.module-pitch-tagline {
  margin: 0 0 28px;
  font-size: 17px;
  line-height: 1.5;
  color: #3a3f49;
  max-width: 44rem;
  font-weight: 500;
}
.module-pitch-block {
  margin: 0 0 26px;
}
.module-pitch-block h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}
.module-pitch-list,
.module-pitch-how {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 10px;
  color: #2b303b;
  line-height: 1.5;
  font-size: 15px;
}
.module-pitch-how-block {
  max-width: 40rem;
}
.module-pitch-gets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.module-pitch-get {
  position: relative;
  border: 1px solid color-mix(in srgb, #c4a574 28%, #e8e4dc);
  border-radius: 16px;
  padding: 18px 18px 16px;
  background: linear-gradient(165deg, #fff 0%, #f7f3ec 100%);
  min-height: 100%;
  display: grid;
  gap: 8px;
  align-content: start;
}
.module-pitch-get-index {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  color: #9a7a45;
}
.module-pitch-get-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #1c1917;
}
.module-pitch-get-lead {
  margin: 0;
  color: #5b6472;
  font-size: 14px;
  line-height: 1.45;
}
.module-pitch-cta {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, #c4a574 22%, #e8e4dc);
}
.module-pitch-note {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  max-width: 40rem;
  color: #3a3f49;
}
.module-pitch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}
.module-pitch-support-link {
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #5b4a2e;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.module-pitch-request-status {
  margin: 10px 0 0;
}
.module-pitch-enabled {
  margin: 0 0 10px;
  font-weight: 600;
}
@media (max-width: 900px) {
  .module-pitch-gets {
    grid-template-columns: 1fr;
  }
}
.module-connected-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.module-connected-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border, #d7dde8);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #fff 0%, #faf9f7 100%);
}
.module-connected-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.module-connected-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.module-connected-title {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.module-connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 11px 5px 9px;
  line-height: 1.2;
}
.module-connected-badge.is-on {
  color: #146b3c;
  background: color-mix(in srgb, #1f8a4c 12%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1f8a4c 28%, transparent);
}
.module-connected-badge.is-core {
  color: #6b5428;
  background: color-mix(in srgb, #c4a574 16%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #a8844a 26%, transparent);
}
.module-connected-badge.is-demo {
  color: #8a5a12;
  background: color-mix(in srgb, #d4a017 14%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c48a12 30%, transparent);
}
.module-demo-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #c4a574 35%, #e8e4dc);
  background: linear-gradient(135deg, #fff8ee 0%, #fff 70%);
}
.module-demo-banner strong {
  display: block;
  margin-bottom: 4px;
}
.module-demo-banner p {
  margin: 0;
  color: #5b6472;
  font-size: 14px;
  line-height: 1.4;
  max-width: 48rem;
}
.module-demo-banner.is-expired {
  border-color: color-mix(in srgb, #b45309 35%, #e8e4dc);
  background: linear-gradient(135deg, #fff4eb 0%, #fff 70%);
}
.timesheet-period-ask {
  border-color: color-mix(in srgb, #b45309 30%, var(--line));
  background: color-mix(in srgb, #fffbeb 90%, #fff);
}
.timesheet-period-ask[hidden] {
  display: none !important;
}
.module-pitch-demo-live,
.module-pitch-demo-ended {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.module-pitch-demo-live {
  color: #8a5a12;
  background: color-mix(in srgb, #d4a017 14%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c48a12 28%, transparent);
}
.module-pitch-demo-ended {
  color: #9a3412;
  background: color-mix(in srgb, #ea580c 12%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c2410c 24%, transparent);
}
.module-offer-card.is-expired .module-offer-status {
  color: #9a3412;
  font-weight: 600;
}
.module-connected-badge-mark {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.module-connected-train {
  flex: 0 0 auto;
  border: 1px solid #cfd5de;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.module-connected-train:hover {
  border-color: #9aa3b2;
  background: #f8f9fb;
}
.module-connected-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
}
.module-connected-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #cfd5de;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
}
.module-connected-more:hover,
.module-connected-card.is-open .module-connected-more {
  border-color: #9aa3b2;
  background: #f8f9fb;
}
.module-connected-more-icon {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -4px;
}
.module-connected-card.is-open .module-connected-more-icon {
  transform: rotate(225deg);
  margin-top: 2px;
}
.module-connected-body {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid #e4dfd4;
}
.module-inline-settings .settings-company-lead {
  margin-top: 0;
}
.module-inline-settings .settings-company-form {
  margin-top: 12px;
}
@media (max-width: 640px) {
  .module-connected-card {
    flex-direction: column;
    align-items: stretch;
  }
  .module-connected-head {
    flex-direction: column;
    align-items: stretch;
  }
  .module-connected-train {
    width: 100%;
  }
  .module-connected-actions {
    width: 100%;
  }
  .module-connected-more {
    margin-left: auto;
  }
}
@media (max-width: 900px) {
  .module-marketplace-layout {
    grid-template-columns: 1fr;
  }
}

/* Platform AI assistant floating widget */
.modum-assistant-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 170;
  font-family: inherit;
}
.modum-assistant-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modum-assistant-fab-label {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.modum-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line, #e7e5e4);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.modum-assistant-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #e7e5e4);
  background: #f8fafc;
}
.modum-assistant-head p {
  margin: 2px 0 0;
  font-size: 0.85rem;
}
.modum-assistant-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modum-assistant-messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fff;
}
.modum-assistant-msg {
  display: flex;
}
.modum-assistant-msg.is-user {
  justify-content: flex-end;
}
.modum-assistant-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f3f4f6;
  white-space: normal;
  line-height: 1.35;
  font-size: 0.92rem;
}
.modum-assistant-msg.is-user .modum-assistant-bubble {
  background: #dbeafe;
}
.modum-assistant-pending {
  padding: 0 12px 8px;
  display: grid;
  gap: 8px;
}
.modum-assistant-confirm {
  border: 1px solid #93c5fd;
  background: #eff6ff;
  border-radius: 12px;
  padding: 10px;
}
.modum-assistant-compose {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line, #e7e5e4);
}
.modum-assistant-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
}
.messenger-thread-assistant {
  border: 1px solid color-mix(in srgb, var(--line) 70%, #94a3b8);
  background: color-mix(in srgb, #f8fafc 85%, #fff);
}
.messenger-thread-assistant.is-active {
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 35%, var(--line));
  background: color-mix(in srgb, var(--accent, #b91c1c) 6%, #fff);
}
.messenger-thread-support {
  border: 1px solid color-mix(in srgb, var(--line) 70%, #94a3b8);
  background: color-mix(in srgb, #fff7ed 70%, #fff);
}
.messenger-thread-support.is-active {
  border-color: color-mix(in srgb, var(--accent, #b91c1c) 35%, var(--line));
  background: color-mix(in srgb, var(--accent, #b91c1c) 6%, #fff);
}
.messenger-support-head {
  align-items: flex-start;
}
.messenger-support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.messenger-support-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid color-mix(in srgb, var(--line, #e7e1d6) 88%, #94a3b8);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.messenger-support-switch-btn {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 16px;
  font: inherit;
  font-weight: 650;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.messenger-support-switch-btn + .messenger-support-switch-btn {
  border-left: 1px solid color-mix(in srgb, var(--line, #e7e1d6) 88%, #94a3b8);
}
.messenger-support-switch-btn.is-active {
  background: var(--modum-ink, #161a20);
  color: #fff;
}
.messenger-main-body.is-support-feed {
  padding: 0;
}
.messenger-support-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.messenger-support-feed > .messenger-empty-state {
  margin: auto;
  padding: 28px 18px;
}
.messenger-support-feed-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: #fff;
  padding: 12px 16px;
  cursor: pointer;
  color: inherit;
}
.messenger-support-feed-item:hover {
  background: color-mix(in srgb, var(--line) 35%, #fff);
}
.messenger-support-feed-item.is-active {
  background: color-mix(in srgb, var(--accent, #b91c1c) 8%, #fff);
}
.messenger-support-popover-wrap {
  position: relative;
}
.messenger-support-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: min(360px, 78vw);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}
.messenger-support-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, #f8fafc 88%, #fff);
}
.messenger-support-popover-list {
  max-height: 12.5rem; /* ~3–4 строки, остальное — скролл */
  overflow: auto;
  overscroll-behavior: contain;
}
.messenger-support-popover-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
  min-height: 3.05rem;
}
.messenger-support-popover-item:hover {
  background: color-mix(in srgb, var(--line) 35%, #fff);
}
.messenger-support-popover-item.is-active {
  background: color-mix(in srgb, var(--accent, #b91c1c) 8%, #fff);
}
.messenger-support-popover-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.messenger-support-popover-item-top strong {
  font-size: 0.92rem;
  line-height: 1.25;
}
.messenger-support-popover-empty {
  padding: 14px 12px;
}
.messenger-support-popover-hint {
  margin: 0;
  padding: 8px 12px 10px;
  font-size: 0.78rem;
  border-top: 1px solid var(--line);
  background: #fafafa;
}
.messenger-support-new-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.28);
}
.messenger-support-new-overlay[hidden] {
  display: none !important;
}
.messenger-support-new-card {
  width: min(440px, 100%);
  max-height: calc(100% - 8px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  padding: 14px 16px 16px;
}
.messenger-support-new-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.messenger-support-new-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
#messengerSupportBody .support-chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.messenger-assistant-head-note {
  margin: 4px 0 0;
  max-width: 42rem;
}
.messenger-assistant-chat {
  gap: 12px;
}
.messenger-assistant-welcome {
  border-color: color-mix(in srgb, var(--line) 80%, #cbd5e1);
  background: color-mix(in srgb, #f8fafc 90%, #fff);
}
.messenger-assistant-pending {
  margin: 10px 0 4px;
  display: grid;
  gap: 10px;
}
.messenger-assistant-confirm {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.messenger-assistant-form {
  display: grid;
  gap: 8px;
}
.messenger-assistant-form .field {
  margin: 0;
}
.messenger-assistant-compose-shell {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, #c4a574);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.messenger-assistant-form textarea {
  width: 100%;
  min-height: 112px;
  max-height: 220px;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 4px 2px;
  box-shadow: none;
  outline: none;
  line-height: 1.5;
  font: inherit;
}
.messenger-assistant-form textarea:focus {
  border: 0;
  box-shadow: none;
}
.messenger-assistant-compose-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.messenger-assistant-compose-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.messenger-assistant-textarea-field {
  flex: 1;
  margin: 0;
  min-width: 0;
}
.messenger-assistant-compose-bar .support-composer-attach {
  flex: 0 0 auto;
  margin: 0;
}
.messenger-assistant-compose-bar .primary-button {
  flex: 0 0 auto;
  margin: 0;
  min-width: 0;
  padding: 8px 16px;
}
.messenger-attach-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
}
.messenger-assistant-compose .primary-button {
  width: auto;
  justify-self: start;
  min-width: 0;
}
.messenger-assistant-compose-hint {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  line-height: 1.3;
}
.support-chat-msg.is-pending .support-chat-body {
  opacity: 0.92;
}
.support-chat-msg.is-typing .support-chat-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.assistant-typing-label {
  color: var(--muted, #64748b);
  font-size: 0.92rem;
}
.messenger-assistant-chat .support-chat-msg.is-admin .support-chat-body {
  white-space: normal;
}
.messenger-assistant-chat .assistant-heading {
  display: block;
  margin: 0.85em 0 0.35em;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  color: var(--ink, #0f172a);
}
.messenger-assistant-chat .assistant-heading:first-child {
  margin-top: 0;
}
.messenger-assistant-chat .support-chat-body ol,
.messenger-assistant-chat .support-chat-body ul {
  margin: 0.35em 0 0.55em;
  padding-left: 1.35em;
}
.messenger-assistant-chat .support-chat-body li {
  margin: 0.2em 0;
  line-height: 1.45;
}
.messenger-assistant-chat .support-chat-body strong {
  font-weight: 650;
  color: color-mix(in srgb, var(--ink, #0f172a) 92%, var(--accent, #b91c1c));
}
.messenger-term {
  display: inline;
  font-weight: 650;
  color: color-mix(in srgb, var(--ink, #0f172a) 88%, var(--accent, #b91c1c) 12%);
  background: color-mix(in srgb, var(--accent, #b91c1c) 8%, #fff);
  border-radius: 4px;
  padding: 0.05em 0.28em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.assistant-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 1em;
}
.assistant-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, #b91c1c) 55%, #94a3b8);
  animation: assistant-typing-bounce 1.05s ease-in-out infinite;
}
.assistant-typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.assistant-typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes assistant-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}
/* Legacy FAB (removed from UI) — hide if an old cached shell left it in DOM */
.modum-assistant-root {
  display: none !important;
}

.adaptation-plan-card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line, #e5e7eb) 80%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel, #fff) 92%, #f8fafc);
}

.adaptation-plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.adaptation-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.adaptation-plan-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
}

.adaptation-plan-item.is-done {
  opacity: 0.72;
}

.adaptation-plan-item.is-overdue {
  border-color: color-mix(in srgb, #b91c1c 35%, var(--line, #e5e7eb));
  background: color-mix(in srgb, #b91c1c 6%, #fff);
}

.adaptation-plan-item-title {
  font-weight: 650;
  line-height: 1.4;
}

.adaptation-plan-block-title {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.adapt-workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.adapt-template-side {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.adapt-editor-panel {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

.adapt-template-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.adapt-template-card {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.adapt-template-card.is-active {
  border-color: var(--ink, #111827);
  box-shadow: 0 0 0 1px var(--ink, #111827);
}

.adapt-template-card.is-add {
  border-style: dashed;
}

.adapt-editor-wrap {
  margin: 14px 0 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  overflow: visible;
  background: #fff;
}

.adapt-editor {
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: #fff;
  counter-reset: adapt-item;
}

.adapt-editor-head,
.adapt-editor-row {
  display: grid;
  grid-template-columns:
    36px
    var(--adapt-col-kind, 128px)
    var(--adapt-col-title, 280px)
    var(--adapt-col-owner, 190px)
    var(--adapt-col-due, 88px)
    40px;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
}

.adapt-editor-row {
  counter-increment: adapt-item;
}

.adapt-editor-head {
  background: #f4f1ea;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted, #64748b);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.adapt-editor-head > div,
.adapt-editor-cell {
  border-right: 1px solid var(--line, #e5e7eb);
  border-bottom: 1px solid var(--line, #e5e7eb);
  display: flex;
  align-items: stretch;
  min-width: 0;
  padding: 0;
}

.adapt-editor-head > div {
  position: relative;
  padding: 9px 12px;
  align-items: center;
}

.adapt-editor-head > div:last-child,
.adapt-editor-cell:last-child {
  border-right: none;
}

.adapt-editor-row:last-child .adapt-editor-cell {
  border-bottom: none;
}

.adapt-editor-num {
  align-items: center;
  justify-content: center;
  color: var(--muted, #64748b);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  background: #faf8f4;
}

.adapt-editor-row .adapt-editor-num::before {
  content: counter(adapt-item);
}

.adapt-editor-section-title {
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #111827;
  color: #f8fafc;
}

.adapt-editor-empty {
  padding: 12px 14px;
  color: var(--muted, #64748b);
  font-size: 13px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}

.adapt-owner-sep {
  padding: 6px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.adapt-owner-combo,
.adapt-title-combo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  width: 100%;
  min-height: 40px;
}

.action-form .adapt-owner-combo input,
.adapt-owner-combo input,
.action-form .adapt-title-combo textarea,
.adapt-title-combo textarea {
  min-height: 40px;
  padding-right: 4px;
}

.adapt-owner-toggle {
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.adapt-owner-toggle[aria-expanded="true"] {
  color: #111827;
}

.adapt-owner-menu,
.compact-people-list {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 8;
  margin: 0;
  padding: 2px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow: auto;
}

.adapt-owner-menu button,
.compact-people-list button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adapt-owner-menu button:hover,
.adapt-owner-menu button:focus {
  background: #f4f1ea;
}

.action-form .adapt-editor-cell select,
.action-form .adapt-editor-cell textarea,
.action-form .adapt-editor-cell input,
.adapt-editor-cell select,
.adapt-editor-cell textarea,
.adapt-editor-cell input {
  width: 100%;
  height: 100%;
  min-height: 40px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font: inherit;
  line-height: 1.4;
  padding: 10px 12px;
  resize: none;
  box-sizing: border-box;
}

.action-form .adapt-editor-cell textarea,
.adapt-editor-cell textarea {
  min-height: 52px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.action-form .adapt-editor-due input,
.adapt-editor-due input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.adapt-col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 3;
  user-select: none;
  touch-action: none;
}

.adapt-col-resizer:hover,
.adapt-editor.is-resizing .adapt-col-resizer {
  background: color-mix(in srgb, var(--modum-accent, #c4a574) 55%, transparent);
}

.adapt-editor.is-resizing,
.adapt-editor.is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.adapt-editor-remove {
  justify-content: stretch;
}

.adapt-editor-remove .ghost-button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.adapt-duration {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  justify-content: flex-start;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid #1f2937;
  border-radius: 0;
  background: #111827;
  color: #f8fafc;
  font-size: 13px;
}

.adapt-duration strong {
  flex: 1 1 100%;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.adapt-duration span {
  color: rgba(248, 250, 252, 0.78);
}

.adapt-print-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.adapt-board-stats {
  display: flex;
  gap: 24px;
  margin: 12px 0 16px;
}

.adapt-board-stats strong {
  display: block;
  font-size: 1.35rem;
}

.adapt-mentor-combo {
  position: relative;
}
.adapt-mentor-pop {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface, #fff);
  box-shadow: 0 16px 36px rgba(14, 17, 20, 0.16);
}
.adapt-mentor-search,
.adapt-mentor-pop input[type="search"] {
  width: 100%;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  line-height: 1.3;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
.adapt-mentor-search::-webkit-search-decoration,
.adapt-mentor-search::-webkit-search-cancel-button,
.adapt-mentor-search::-webkit-search-results-button,
.adapt-mentor-search::-webkit-search-results-decoration,
.adapt-mentor-pop input[type="search"]::-webkit-search-decoration,
.adapt-mentor-pop input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.adapt-mentor-search:focus,
.adapt-mentor-pop input[type="search"]:focus {
  border-color: var(--brand-amber, #c4a574);
}
.adapt-mentor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}
.adapt-mentor-list li {
  margin: 0;
}
.adapt-mentor-empty {
  padding: 10px 8px;
}
.adapt-mentor-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.adapt-mentor-option:hover,
.adapt-mentor-option:focus {
  background: #f7f4ee;
}
.adapt-mentor-option.is-checked {
  border-color: #f0c7a0;
  background: #fff7ed;
}
.adapt-mentor-check {
  width: 18px;
  height: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #c2410c;
  flex: 0 0 auto;
  margin-top: 0;
  background: #fff;
}
.adapt-mentor-option.is-checked .adapt-mentor-check {
  border-color: #ea580c;
  background: #ffedd5;
}
.adapt-mentor-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.adapt-mentor-copy strong {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adapt-mentor-copy span {
  color: var(--muted, #6b7280);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adapt-mentor-pop-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.adapt-mentor-status.is-ok { color: #166534; }
.adapt-mentor-status.is-failed { color: #b91c1c; }

.people-fio-suggest-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}
.people-fio-suggest-row strong {
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.people-fio-suggest-row .muted {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adapt-progress {
  height: 8px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
  min-width: 88px;
}

.adapt-progress-fill {
  display: block;
  height: 100%;
  background: var(--ink, #111827);
}

.adapt-progress.is-overdue .adapt-progress-fill {
  background: #b91c1c;
}

.adapt-progress-label {
  margin-top: 4px;
  font-size: 12px;
}

.adapt-page-tabs .ghost-button.is-active {
  background: var(--ink, #111827);
  color: #fff;
}

@media (max-width: 900px) {
  .adapt-workspace {
    grid-template-columns: 1fr;
  }
  .adapt-editor-head,
  .adapt-editor-row {
    grid-template-columns: 36px minmax(240px, 1fr);
    width: 100%;
  }
  .adapt-col-resizer {
    display: none;
  }
  .adapt-editor-head {
    display: none;
  }
}

/* —— Public entrance (getmodum.ru /) —— */
html.modum-home-active {
  scroll-behavior: smooth;
}

html.modum-home-active,
html.modum-home-active body,
html.modum-home-active #app {
  background: #0c0d10;
  min-height: 100%;
}

.modum-home {
  --home-ink: #0c0d10;
  --home-paper: #f3efe6;
  --home-gold: #c4a574;
  --home-gold-2: #e4d0a8;
  --home-mute: rgba(243, 239, 230, 0.62);
  --home-line: rgba(243, 239, 230, 0.12);
  position: relative;
  min-height: 100vh;
  color: var(--home-paper);
  background: var(--home-ink);
  font-family: Manrope, "Segoe UI", sans-serif;
  overflow-x: clip;
}

.modum-home-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 40% at 80% -10%, rgba(196, 165, 116, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 35% at 0% 30%, rgba(196, 165, 116, 0.08), transparent 50%),
    linear-gradient(180deg, #101218 0%, #0c0d10 38%, #090a0c 100%);
}

.modum-home-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 10%, transparent 72%);
}

.modum-home-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.modum-home-orb {
  position: absolute;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  left: 55%;
  top: 8%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(228, 208, 168, 0.35), rgba(196, 165, 116, 0.08) 42%, transparent 70%);
  filter: blur(8px);
  animation: modum-home-drift 18s ease-in-out infinite;
}

.modum-home-orb.is-two {
  left: -8%;
  top: 48%;
  width: 28vw;
  height: 28vw;
  opacity: 0.55;
  animation-duration: 24s;
  animation-direction: reverse;
}

@keyframes modum-home-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-4%, 6%, 0) scale(1.08); }
}

.modum-home > main,
.modum-home-nav,
.modum-home-foot {
  position: relative;
  z-index: 1;
}

.modum-home-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 56px);
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.modum-home-nav.is-stuck {
  background: rgba(12, 13, 16, 0.78);
  border-bottom: 1px solid var(--home-line);
  backdrop-filter: blur(16px);
}

.modum-home-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.modum-home-logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--home-gold);
  color: #1a140c;
  font-size: 14px;
  font-weight: 800;
}

.modum-home-nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.modum-home-nav-links a {
  color: var(--home-mute);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.modum-home-nav-links a:hover {
  color: var(--home-paper);
}

.modum-home-nav-actions {
  display: flex;
  gap: 10px;
  margin-left: 8px;
}

.modum-home-solid,
.modum-home-ghost {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modum-home-solid {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #d4b68a 0%, var(--home-gold) 55%, #b08d55 100%);
  color: #1a140c;
  box-shadow: 0 10px 28px rgba(196, 165, 116, 0.22);
}

.modum-home-solid::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 36%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-18deg);
  animation: modum-home-shine 4.8s ease-in-out infinite;
}

.modum-home-solid:hover {
  background: var(--home-gold-2);
}

.modum-home-ghost {
  background: transparent;
  color: var(--home-paper);
  border: 1px solid var(--home-line);
}

.modum-home-ghost:hover {
  border-color: rgba(196, 165, 116, 0.55);
  color: var(--home-gold);
}

.modum-home-solid.is-lg,
.modum-home-ghost.is-lg {
  min-height: 48px;
  padding: 0 22px;
  font-size: 14px;
}

.modum-home-hero {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) 0 36px;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.24fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.modum-home-eyebrow {
  margin: 0 0 18px;
  color: var(--home-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modum-home h1,
.modum-home h2,
.modum-home h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  letter-spacing: 0.028em;
  font-kerning: normal;
  font-feature-settings: "kern" 1;
  font-optical-sizing: auto;
  font-variation-settings: "WONK" 0, "SOFT" 20, "opsz" 72;
  line-height: 1.14;
  margin: 0;
  color: var(--home-paper);
}

.modum-home-cards h3,
.modum-home-modules h3,
.modum-home-steps li strong,
.modum-home-banner h2 {
  color: var(--home-paper);
}

.modum-home-hero h1 {
  font-size: clamp(34px, 5.8vw, 68px);
  max-width: 16ch;
  letter-spacing: 0.034em;
  font-variation-settings: "WONK" 0, "SOFT" 12, "opsz" 96;
  animation: modum-home-rise 900ms ease both;
}

.modum-home-voice {
  max-width: 46ch;
  margin: 22px 0 14px;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.45;
  color: var(--home-paper);
  animation: modum-home-rise 900ms ease 60ms both;
}

.modum-home-lead {
  max-width: 48ch;
  margin: 0 0 16px;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  color: var(--home-mute);
  animation: modum-home-rise 900ms ease 90ms both;
}

.modum-home-lead strong {
  color: var(--home-paper);
  font-weight: 650;
}

.modum-home-promise {
  max-width: 42ch;
  margin: 0 0 20px;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 520;
  letter-spacing: 0.02em;
  font-kerning: normal;
  font-variation-settings: "WONK" 0, "SOFT" 20, "opsz" 36;
  line-height: 1.4;
  color: var(--home-gold);
  animation: modum-home-rise 900ms ease 110ms both;
}

.modum-home-offer {
  max-width: 46ch;
  margin: 0 0 22px;
  padding: 14px 16px 15px;
  border-radius: 16px;
  border: 1px solid rgba(196, 165, 116, 0.42);
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.16), rgba(196, 165, 116, 0.05));
  animation: modum-home-rise 900ms ease 125ms both;
}

.modum-home-offer span {
  display: block;
  margin: 0 0 6px;
  color: var(--home-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modum-home-offer strong {
  display: block;
  color: var(--home-paper);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
}

.modum-home-offer em {
  display: block;
  margin: 6px 0 0;
  color: var(--home-mute);
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
}

.modum-home-modules article.is-learn .modum-home-kicker {
  color: var(--home-gold);
}

.modum-home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: modum-home-rise 900ms ease 140ms both;
}

.modum-home-fine {
  margin: 16px 0 0;
  font-size: 13px;
  color: rgba(243, 239, 230, 0.45);
}

@keyframes modum-home-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.modum-home-stage {
  margin-top: 8px;
  min-height: 540px;
  border: 1px solid rgba(196, 165, 116, 0.4);
  border-radius: 22px;
  overflow: hidden;
  background: #f3f1ec;
  box-shadow:
    0 0 0 1px rgba(196, 165, 116, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.5);
  animation: modum-home-rise 1.1s ease 180ms both;
}

.modum-home-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(0, 0, 0, 0.38);
  border-bottom: 1px solid rgba(196, 165, 116, 0.22);
}

.modum-home-chrome i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a3d42;
}

.modum-home-chrome i:nth-child(1) { background: #c47878; }
.modum-home-chrome i:nth-child(2) { background: #c4a574; }
.modum-home-chrome i:nth-child(3) { background: #7d9a78; }

.modum-home-chrome em {
  margin-left: 8px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-mute);
}

.modum-home-office {
  min-height: 490px;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(196, 165, 116, 0.07), transparent 55%),
    #f3f1ec;
  color: #14181d;
  font-family: Manrope, "Segoe UI", sans-serif;
}

.modum-home-office-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
  border-bottom: 1px solid color-mix(in srgb, #c4a574 35%, #e2e0d8);
}

.modum-home-office-logo {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d4b68a, #c4a574);
  color: #1a140c;
  font-size: 12px;
  font-weight: 800;
}

.modum-home-office-menu {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e2e0d8;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.modum-home-office-top .name-plate {
  margin-left: 2px;
}

.modum-home-office-tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.modum-home-office-tools i {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #e2e0d8;
  background: #fff;
}

.modum-home-office-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 10px 12px 0;
  padding: 4px;
  border-radius: 12px;
  background: #eceae4;
}

.modum-home-office-tabs button {
  appearance: none;
  border: 0;
  border-radius: 9px;
  min-height: 34px;
  background: transparent;
  color: #687385;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.modum-home-office-tabs button[aria-selected="true"] {
  background: #fff;
  color: #0e1114;
  box-shadow: 0 1px 4px rgba(14, 17, 20, 0.08);
}

.modum-home-office-view {
  position: relative;
  min-height: 390px;
}

.modum-home-office-pane {
  position: absolute;
  inset: 0;
  padding: 12px 12px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.modum-home-office-pane.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.modum-home-office-page {
  margin: 0 2px 10px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0e1114;
}

.modum-home-office-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.modum-home-office-kpis article {
  padding: 10px 10px 8px;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  border-top: 3px solid #d6d3c8;
  background: linear-gradient(180deg, #ffffff 0%, #f7f5f0 100%);
}

.modum-home-office-kpis .is-people { border-top-color: #3b82f6; }
.modum-home-office-kpis .is-learn { border-top-color: #c4a574; }
.modum-home-office-kpis .is-warn { border-top-color: #c2410c; }

.modum-home-office-kpis span {
  display: block;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modum-home-office-kpis b {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: #0e1114;
}

.modum-home-office-card,
.modum-home-office-doc {
  padding: 12px;
  border: 1px solid #e2e0d8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(14, 17, 20, 0.06);
}

.modum-home-office-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.modum-home-office-card-head strong,
.modum-home-office-doc strong {
  font-size: 13px;
  color: #14181d;
}

.modum-home-office-card-head em,
.modum-home-office-doc span,
.modum-home-office-card p,
.modum-home-office-rows em {
  font-style: normal;
  color: #6b7280;
  font-size: 12px;
}

.modum-home-office-bar {
  height: 8px;
  margin: 10px 0 8px;
  border-radius: 99px;
  background: #eceae4;
  overflow: hidden;
}

.modum-home-office-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c4a574, #3b82f6);
}

.modum-home-office-rows {
  display: grid;
  gap: 0;
  border: 1px solid #e2e0d8;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.modum-home-office-rows article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e0d8;
}

.modum-home-office-rows article:last-child { border-bottom: 0; }

.modum-home-office-grid {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e0d8;
  border-radius: 12px;
  overflow: hidden;
  font-size: 12px;
}

.modum-home-office-grid th,
.modum-home-office-grid td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #eceae4;
}

.modum-home-office-grid th {
  background: #fbfaf7;
  color: #6b7280;
  font-weight: 700;
}

.modum-home-office-grid td:first-child,
.modum-home-office-grid th:first-child {
  text-align: left;
  padding-left: 12px;
  font-weight: 650;
}

.modum-home-office-action {
  display: inline-flex;
  margin-top: 12px;
  min-height: 34px;
  padding: 0 14px;
  align-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #d4b68a, #c4a574);
  color: #1a140c;
  font-size: 12px;
  font-weight: 800;
}

.modum-home-office-doc {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.modum-home-people {
  display: grid;
  gap: 0;
  border: 1px solid #e2e0d8;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.modum-home-people article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e0d8;
}

.modum-home-people article:last-child { border-bottom: 0; }

.modum-home-people b {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: #14181d;
}

.modum-home-people em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  color: #6b7280;
  font-size: 12px;
}

.modum-home-people i {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e2e0d8;
  color: #6b7280;
  background: #f7f5f0;
}

.modum-home-people .is-ok {
  color: #15803d;
  border-color: #bbf7d0;
  background: #dcfce7;
}

.modum-home-people .is-wait {
  color: #926c2c;
  border-color: rgba(196, 165, 116, 0.45);
  background: rgba(196, 165, 116, 0.16);
}

.modum-home-shift {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background: #fff8ee;
  color: #14181d;
  font-size: 13px;
  font-weight: 700;
}

.modum-home-shift b {
  width: 42%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #c4a574 66%, #eceae4 66%);
}

.modum-home-marquee {
  overflow: hidden;
  border-block: 1px solid var(--home-line);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.modum-home-marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  padding: 16px 0;
  animation: modum-home-marquee 32s linear infinite;
}

.modum-home-marquee-track span {
  color: var(--home-mute);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.modum-home-marquee-track span::before {
  content: "·";
  margin-right: 48px;
  color: var(--home-gold);
}

.modum-home-notthis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.modum-home-notthis li {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--home-line);
  color: var(--home-mute);
  font-size: 13px;
}

[data-home-reveal] {
  opacity: 0;
  transform: translateY(18px);
}

[data-home-reveal].is-in {
  animation: modum-home-rise 0.85s ease both;
}

.modum-home-stage-bar {
  display: flex;
  gap: 18px;
  padding: 14px 20px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-mute);
  border-bottom: 1px solid var(--home-line);
}

.modum-home-stage-bar .is-gold { color: var(--home-gold); }

.modum-home-section {
  scroll-margin-top: 92px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 10vh, 108px) 0;
}

.modum-home-section-head {
  max-width: 38rem;
  margin-bottom: 36px;
}

.modum-home-section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 14px;
}

.modum-home-section-head p:last-child {
  color: var(--home-mute);
  font-size: 16px;
  line-height: 1.55;
}

.modum-home-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.modum-home-cards article,
.modum-home-modules article {
  padding: 28px 24px;
  border-radius: 20px;
  border: 1px solid var(--home-line);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.modum-home-cards article:hover,
.modum-home-modules article:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 165, 116, 0.38);
  background: rgba(196, 165, 116, 0.06);
}

.modum-home-cards span {
  color: var(--home-gold);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.modum-home-cards h3,
.modum-home-modules h3 {
  margin: 12px 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.modum-home-cards p,
.modum-home-modules p {
  margin: 0;
  color: var(--home-mute);
  line-height: 1.5;
}

.modum-home-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.modum-home-kicker {
  margin: 0 0 8px;
  color: var(--home-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modum-home-modules ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.modum-home-modules li {
  padding: 8px 0;
  border-top: 1px solid var(--home-line);
  font-size: 14px;
}

.modum-home-modules .is-learn {
  background: linear-gradient(180deg, rgba(196, 165, 116, 0.1), rgba(255, 255, 255, 0.02));
}

.modum-home-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--home-line);
}

.modum-home-steps li {
  display: grid;
  grid-template-columns: minmax(180px, 0.4fr) 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--home-line);
  counter-increment: home-step;
}

.modum-home-steps li strong {
  font-size: 20px;
}

.modum-home-steps li span {
  color: var(--home-mute);
  line-height: 1.5;
}

.modum-home-banner {
  margin-top: 48px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 24px;
  border: 1px solid rgba(196, 165, 116, 0.28);
  background:
    radial-gradient(ellipse 80% 80% at 100% 0%, rgba(196, 165, 116, 0.16), transparent 50%),
    rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 22px;
}

.modum-home-banner h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  margin-bottom: 10px;
}

.modum-home-banner p {
  margin: 0;
  color: var(--home-mute);
  max-width: 46ch;
}

.modum-home-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
  color: rgba(243, 239, 230, 0.45);
  font-size: 13px;
  border-top: 1px solid var(--home-line);
}

.modum-home-foot button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--home-gold);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

@media (max-width: 900px) {
  .modum-home-nav-links { display: none; }
  .modum-home-hero,
  .modum-home-cards,
  .modum-home-modules {
    grid-template-columns: 1fr;
  }
  .modum-home-stage,
  .modum-home-office { min-height: 0; }
  .modum-home-office-view { min-height: 420px; }
  .modum-home-people article { align-items: flex-start; }
  .modum-home-shift { flex-wrap: wrap; }
  .modum-home-steps li { grid-template-columns: 1fr; gap: 8px; }
  .modum-home-hero h1 { max-width: none; }
}

@keyframes modum-home-shine {
  0%, 55% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: translateX(420%) skewX(-18deg); opacity: 0; }
}

@keyframes modum-home-marquee {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .modum-home-orb,
  .modum-home-hero h1,
  .modum-home-voice,
  .modum-home-lead,
  .modum-home-promise,
  .modum-home-offer,
  .modum-home-cta,
  .modum-home-stage,
  .modum-home-solid::after,
  .modum-home-marquee-track,
  [data-home-reveal],
  [data-home-reveal].is-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .modum-home-office-pane {
    transition: none;
  }
}

/* Manager messenger floating dock */
.modum-messenger-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 168;
  font-family: inherit;
  pointer-events: none;
}
.modum-messenger-dock > * {
  pointer-events: auto;
}
.modum-messenger-fab {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--brand-graphite, #1a1d24);
  color: #fff;
  box-shadow: 0 12px 28px rgba(26, 29, 36, 0.32), 0 0 0 4px rgba(196, 165, 116, 0.28);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.modum-messenger-fab:hover,
.modum-messenger-fab.is-open {
  transform: translateY(-2px);
  background: #11141a;
  box-shadow: 0 16px 34px rgba(26, 29, 36, 0.38), 0 0 0 4px rgba(196, 165, 116, 0.42);
}
.modum-messenger-fab-icon {
  width: 24px;
  height: 24px;
  display: block;
}
.modum-messenger-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-red, #b91c1c);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.modum-messenger-dock-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(420px, calc(100vw - 28px));
  height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line, #e7e5e4);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}
.modum-messenger-dock-panel[hidden] {
  display: none !important;
}
.modum-messenger-dock-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line, #e7e5e4);
  background: #f8fafc;
}
.modum-messenger-dock-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-steel, #5b6573);
}
.modum-messenger-dock-head strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}
.modum-messenger-dock-actions {
  display: flex;
  gap: 4px;
}
.modum-messenger-dock-iconbtn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-steel, #5b6573);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modum-messenger-dock-iconbtn svg {
  width: 16px;
  height: 16px;
}
.modum-messenger-dock-iconbtn:hover {
  background: #eef2f7;
  color: var(--brand-graphite, #1a1d24);
}
.modum-messenger-dock-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line, #e7e5e4);
  background: #fff;
}
.modum-messenger-dock-tab {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--brand-steel, #5b6573);
  cursor: pointer;
}
.modum-messenger-dock-tab.is-active {
  background: var(--brand-graphite, #1a1d24);
  color: #fff;
}
.modum-messenger-dock-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.modum-messenger-dock-loading,
.modum-messenger-dock-placeholder {
  padding: 18px 16px;
}
.modum-messenger-dock-placeholder p {
  margin: 0 0 12px;
}
.modum-messenger-dock-assistant {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.modum-messenger-dock-assistant .messenger-main-head {
  display: none;
}
.modum-messenger-dock-assistant .messenger-main-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}
.modum-messenger-dock-assistant .messenger-assistant-compose-hint {
  display: block;
  font-size: 0.72rem;
}
.modum-messenger-dock-assistant .messenger-main-compose {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line, #e7e5e4);
}
.modum-messenger-dock-assistant .messenger-assistant-form textarea {
  min-height: 112px;
}
.modum-messenger-dock-thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}
.modum-messenger-dock-compose {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line, #e7e5e4);
}
.modum-messenger-dock-compose .support-composer-bar textarea {
  min-height: 72px;
}
@media (max-width: 720px) {
  .modum-messenger-dock {
    right: 12px;
    bottom: 12px;
  }
  .modum-messenger-dock-panel {
    width: min(100vw - 16px, 420px);
    height: min(78vh, 640px);
  }
}

.supply-contacts {
  margin-top: 18px;
}
.supply-contacts h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.supply-contact-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(110px, 0.9fr) minmax(160px, 1.2fr) minmax(120px, 0.8fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.supply-contact-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.supply-mail-thread {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.supply-mail-item {
  border: 1px solid var(--line, #e7e5e4);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafafa;
}
.supply-mail-item.is-out {
  background: #f3f7ff;
}
.supply-mail-item h4 {
  margin: 6px 0;
}
.supply-mail-item p {
  margin: 0;
  white-space: pre-wrap;
}
.supply-mail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
}
.supply-mail-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.supply-unit-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.supply-unit-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.supply-unit-primary input {
  max-width: 140px;
}
.supply-unit-extra {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.92em;
}
.supply-unit-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}
.supply-unit-extra input[name="extraUnit"] {
  width: 72px;
  max-width: 22vw;
  flex: 0 0 auto;
}
.supply-unit-extra input[name="extraFactor"] {
  width: 8.5rem;
  min-width: 7.5rem;
  max-width: 36vw;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.supply-unit-eq {
  white-space: nowrap;
  font-weight: 600;
}
.supply-unit-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}
.supply-unit-why {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border, #c8cdd6);
  background: #fff;
  color: #445;
  font: 600 13px/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}
.supply-unit-why[aria-expanded="true"] {
  background: #111;
  color: #fff;
  border-color: #111;
}
.supply-unit-popover {
  position: fixed;
  z-index: 90;
  left: 12px;
  right: auto;
  top: auto;
  width: max-content;
  min-width: min(280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border, #d8dde6);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(20, 24, 32, 0.14);
  display: none;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9em;
  color: #223;
  line-height: 1.35;
}
.supply-unit-popover:not([hidden]) {
  display: flex;
}
body > .supply-unit-popover,
.supply-unit-popover.is-portaled {
  z-index: 90;
}
.supply-unit-help-formula {
  margin: 0;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: #f4f6f8;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.supply-unit-help-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.supply-unit-help-table th,
.supply-unit-help-table td {
  text-align: left;
  padding: 5px 0;
  border-bottom: 1px solid #eef1f4;
  font-weight: 400;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.supply-unit-help-table th {
  color: #667;
  width: 38%;
  padding-right: 10px;
}
.supply-unit-help-link {
  display: block;
  color: inherit;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.supply-mailbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.supply-mailbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.supply-mail-hosts {
  margin: 8px 0;
}
@media (max-width: 900px) {
  .supply-contact-row {
    grid-template-columns: 1fr;
  }
}

.supply-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.supply-filters input,
.supply-filters select {
  min-width: 180px;
  flex: 1 1 180px;
}
[data-supply-table] .table-wrap {
  overflow-x: auto;
}
.supply-variants > span {
  display: block;
  margin-bottom: 4px;
}
.supply-variant-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  width: 100%;
}
.field .supply-variant-toolbar {
  margin: 0;
}
.supply-variant-toolbar .supply-char-select,
.supply-char-select {
  min-width: 160px;
  max-width: 280px;
  flex: 1 1 180px;
}
.field .supply-variant-toolbar .supply-char-select {
  max-width: none;
  width: 100%;
}
.supply-variant-panel {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
}
.supply-variant-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.8fr) auto;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 10px;
}
.supply-variant-fields .field {
  margin: 0;
}
.supply-variant-remove {
  margin-bottom: 10px;
  justify-self: start;
}
.supply-nom-title {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: var(--modum-ink, var(--text));
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(196, 165, 116, 0.45);
  border-radius: 0;
  box-shadow: none;
}
.supply-nom-title:hover {
  color: #000;
  border-bottom-color: var(--modum-accent);
}
.table-wrap .supply-char-select {
  max-width: none;
  min-width: 140px;
  padding: 8px 10px;
}
@media (max-width: 700px) {
  .supply-variant-fields {
    grid-template-columns: 1fr;
  }
}
.supply-nom-scroll {
  max-height: 96px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(340px, 42vw);
  padding: 2px 0;
}
.supply-nom-chip {
  appearance: none;
  border: 1px solid var(--line, #e7e5e4);
  background: #fafafa;
  border-radius: 999px;
  padding: 2px 8px;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.35;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supply-nom-chip:hover {
  background: #fff;
}
.supply-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 180px;
}
.supply-group-chip {
  display: inline-block;
  border-radius: 999px;
  background: #f5f0e6;
  padding: 2px 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.supply-card-shell .card-tabs {
  position: sticky;
  top: 62px;
  z-index: 4;
  background: #fff;
  padding-bottom: 8px;
}
.supply-manual-line {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 0.8fr) minmax(110px, 0.5fr) minmax(90px, auto) auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.supply-catalog-pick {
  position: relative;
  z-index: 6;
}
.supply-catalog-pick.is-open {
  z-index: 30;
}
.supply-catalog-list {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid var(--line, #e7e5e4);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(14, 17, 20, 0.08);
  padding: 4px;
}
body > .supply-catalog-list,
.supply-catalog-list.is-portaled {
  z-index: 240;
  right: auto;
}
.supply-catalog-option {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 2px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.supply-catalog-option:hover {
  background: #faf7f1;
}
.supply-catalog-empty {
  padding: 8px 10px;
}
.supply-qty-unit {
  display: flex;
  gap: 6px;
  align-items: center;
}
.supply-qty-unit input,
.supply-qty-unit select {
  min-width: 0;
}
.supply-qty-unit-label {
  white-space: nowrap;
  color: var(--muted, #6b6560);
  font-size: 0.9rem;
}
.supply-avg-hint {
  font-size: 0.82rem;
}
@media (max-width: 900px) {
  .supply-manual-line {
    grid-template-columns: 1fr;
  }
}
.supply-work-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.supply-work-people {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) auto auto;
  gap: 8px 18px;
  align-items: start;
}
.supply-work-people a {
  color: inherit;
}
.supply-legal summary {
  cursor: pointer;
  font-weight: 600;
}
.supply-legal .muted {
  margin: 8px 0 14px;
}
.supply-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}
.supply-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.supply-manual-price {
  margin: 12px 0;
}
.supply-manual-price strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.supply-delta.is-up {
  color: #b42318;
}
.supply-delta.is-down {
  color: #067647;
}
.supply-preview,
.supply-invoice-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.supply-invoice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line, #e7e5e4);
}
.supply-link-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.supply-link-item select {
  min-width: 220px;
  flex: 1;
}
.supply-flag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 4px 0 14px;
}
.supply-flag-grid-single {
  grid-template-columns: 1fr;
}
.supply-flag-card [data-delivery-amount-wrap] {
  margin-top: 10px;
}
.supply-vat-compact {
  display: grid;
  align-content: start;
  gap: 6px;
}
.supply-vat-compact > span {
  font-size: 0.85rem;
  font-weight: 600;
}
.supply-flag-picks.is-compact {
  display: flex;
  gap: 6px;
}
.supply-flag-picks.is-compact .supply-flag-pick {
  flex: 0 1 auto;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.supply-vat-compact .supply-flag-hint,
.supply-delivery-bar .supply-flag-hint {
  margin-top: 2px;
  min-height: 1.15em;
}
.supply-delivery-bar {
  display: grid;
  grid-template-columns: auto auto minmax(9rem, 1fr);
  align-items: center;
  gap: 6px 10px;
  margin: 4px 0 12px;
}
.supply-delivery-bar > span {
  font-size: 0.85rem;
  font-weight: 600;
}
.supply-delivery-bar .supply-flag-hint {
  grid-column: 1 / -1;
  margin: 0;
}
.supply-delivery-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  justify-self: end;
}
.supply-delivery-amount span {
  font-size: 0.82rem;
  white-space: nowrap;
}
.supply-delivery-amount input {
  width: 7.5rem;
}
.supply-delivery-amount.is-off {
  visibility: hidden;
  pointer-events: none;
}
.supply-flag-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px 12px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(14, 17, 20, 0.04);
}
.supply-flag-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.supply-flag-picks {
  display: flex;
  gap: 8px;
}
.supply-flag-pick {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.supply-flag-pick.is-on {
  background: var(--modum-ink);
  border-color: var(--modum-ink);
  color: var(--modum-text);
}
.supply-flag-hint {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-size: 0.82rem;
}
.supply-preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin: 16px 0 10px;
}
.supply-preview-head strong {
  font-size: 1rem;
}
.supply-check-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.supply-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 1px 0 rgba(14, 17, 20, 0.04);
}
.supply-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.supply-pill.is-ok {
  background: #e7f6ee;
  color: #14532d;
}
.supply-pill.is-ok .supply-pill-dot {
  background: #22c55e;
}
.supply-pill.is-warn {
  background: #fff6e5;
  color: #9a3412;
}
.supply-pill.is-warn .supply-pill-dot {
  background: #f59e0b;
}
.supply-pill.is-info {
  background: #eef3ff;
  color: #1e3a8a;
}
.supply-pill.is-info .supply-pill-dot {
  background: #3b82f6;
}
.supply-check-note {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: var(--surface-soft);
}
.supply-check-note.is-ok {
  background: var(--ok-soft);
}
.supply-check-note.is-warn {
  background: var(--warn-soft);
}
.supply-check-note.is-info {
  background: #eef2ff;
}
.supply-miss {
  color: #b42318;
  font-weight: 700;
}
.supply-in-account {
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.supply-line-account {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 10rem;
}
.supply-add-account {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: var(--modum-ink);
  color: var(--modum-text);
  cursor: pointer;
}
.supply-add-account:hover {
  filter: brightness(1.08);
}
.supply-preview-head + .supply-check-notes + table input,
.supply-preview-head + .supply-check-notes + table textarea,
[data-invoice-preview-box] table input,
[data-invoice-preview-box] table textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
}
[data-invoice-preview-box] td:first-child {
  min-width: 14rem;
  max-width: 22rem;
}
[data-invoice-preview-box] td:first-child textarea {
  min-height: 2.8rem;
  resize: vertical;
  line-height: 1.35;
}
.supply-line-qty {
  white-space: nowrap;
}
.supply-line-qty input {
  width: 5.5rem;
  display: inline-block;
}
.preview-modal.supply-nom-dialog {
  width: min(520px, 100%);
}
.supply-nom-close {
  float: right;
}
.supply-bom h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.supply-card-shell .supply-bom {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(14, 17, 20, 0.08);
}
.supply-bom-add {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 16px;
}
.supply-bom-add[hidden] {
  display: none !important;
}
.supply-bom-add .supply-catalog-pick {
  flex: 1 1 16rem;
  min-width: 12rem;
}
.supply-bom-add [data-bom-add-qty] {
  width: 5.5rem;
}
.supply-bom-line {
  border-top: 1px solid rgba(14, 17, 20, 0.08);
  padding: 10px 0;
}
.supply-bom-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.supply-bom-qty input {
  width: 4.5rem;
  font: inherit;
}
.supply-bom-nested {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 6px;
  font-size: 0.92rem;
}
.supply-bom-tag {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eef3ff;
  color: #1e3a8a;
}
.supply-bom-sum {
  margin-left: auto;
}
.supply-bom-total {
  margin-top: 12px;
  font-weight: 700;
}
@media (max-width: 800px) {
  .supply-work-people,
  .supply-inline-fields,
  .supply-flag-grid,
  .supply-delivery-bar {
    grid-template-columns: 1fr;
  }
  .supply-delivery-amount {
    justify-self: start;
  }
  .supply-bom-sum {
    margin-left: 0;
  }
}
