.account-space {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 23px;
}
.account-space > div {
  flex: 1;
}
.account-space strong,
.account-space small {
  display: block;
}
.account-space strong {
  font-size: calc(19px + var(--font-plus));
}
.account-space small {
  font-size: calc(12px + var(--font-plus));
  color: var(--muted);
  margin-top: 5px;
}
.account-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 5px;
  overflow-x: auto;
  margin-bottom: 25px;
}
.account-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: calc(12px + var(--font-plus));
  white-space: nowrap;
  padding: 13px 10px;
  border-bottom: 2px solid transparent;
  min-height: 46px;
}
.account-tabs button[aria-selected="true"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}
.account-content {
  animation: fade-in 0.2s ease;
}
.account-content h3 {
  font-size: calc(20px + var(--font-plus));
}
.account-content > .muted {
  font-size: calc(13px + var(--font-plus));
}
.account-content > .button-row {
  margin-top: 24px;
}
.account-id {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 22px 0 12px;
}
.account-id strong,
.account-id small {
  display: block;
}
.account-id small {
  margin-top: 5px;
  color: var(--muted);
  font-size: calc(12px + var(--font-plus));
}
.employee-list {
  margin: 16px 0;
}
.employee-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  margin-bottom: 10px;
  padding: 17px;
}
.employee-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.employee-title > div {
  flex: 1;
  min-width: 0;
}
.employee-title strong,
.employee-title small {
  display: block;
  overflow-wrap: anywhere;
}
.employee-title strong {
  font-size: calc(13px + var(--font-plus));
}
.employee-title small {
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
  margin-top: 5px;
}
.employee-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: calc(11px + var(--font-plus));
}
.employee-actions > span {
  color: var(--muted);
  margin-right: auto;
}
.employee-actions .text-link {
  font-size: calc(11px + var(--font-plus));
  min-height: 35px;
}
.account-content > p.small {
  margin-top: 18px;
}
.invitation-code {
  padding: 25px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin: 22px 0;
  background: var(--surface-alt);
}
.invitation-code small {
  letter-spacing: 0.09em;
  font-size: calc(9px + var(--font-plus));
  color: var(--muted);
}
.invitation-code code {
  font-size: calc(23px + var(--font-plus));
  font-weight: 700;
  color: var(--brand);
}
.bot-illustration {
  width: 95px;
  height: 105px;
  position: relative;
  margin: 0 0 16px;
}
.bot-illustration > .mascot {
  width: 74px;
  height: 91px;
  background: #fff;
  border-radius: 18px;
  padding: 4px;
}
.bot-illustration > span {
  position: absolute;
  right: 0;
  bottom: 0;
  background: var(--blue-soft);
  padding: 9px;
  border-radius: 13px;
  border: 3px solid var(--surface);
  color: var(--brand);
}
.account-second-button {
  margin-left: 9px;
}
.connected-bot {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  margin: 20px 0;
  background: var(--surface-alt);
  flex-wrap: wrap;
}
.connected-bot > div {
  flex: 1;
}
.connected-bot strong,
.connected-bot small {
  display: block;
}
.connected-bot strong {
  font-size: calc(14px + var(--font-plus));
  overflow-wrap: anywhere;
}
.connected-bot small {
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
  margin-top: 6px;
}
.flow-title {
  margin: 20px 0 15px;
}
.setup-steps {
  padding-left: 24px;
  color: var(--text);
  font-size: calc(14px + var(--font-plus));
  line-height: 1.9;
}
.setup-steps li {
  padding: 8px 0 8px 5px;
}
.setup-steps a {
  color: var(--brand);
  font-weight: 700;
}
.setup-steps a > svg {
  display: inline;
}
.setup-steps code {
  background: var(--blue-soft);
  padding: 3px 5px;
  border-radius: 4px;
}
.account-back {
  margin: 0 0 18px;
}
.security-setting {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.setting-icon {
  padding: 11px;
  background: var(--blue-soft);
  border-radius: 12px;
  color: var(--brand);
  display: flex;
}
.security-setting > div {
  flex: 1;
}
.security-setting strong,
.security-setting small {
  display: block;
}
.security-setting strong {
  font-size: calc(13px + var(--font-plus));
}
.security-setting small {
  font-size: calc(11px + var(--font-plus));
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}
.toggle {
  width: 44px;
  height: 26px;
  border-radius: 20px;
  background: hsl(calc(var(--accent-h) + 5) calc(20.3% * var(--accent-s)) 76.9%);
  position: relative;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.toggle:after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 4px #0002;
  transition: transform 0.2s;
}
.toggle.on {
  background: var(--brand-strong);
}
.toggle.on:after {
  transform: translateX(18px);
}
.security-session {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 22px 0;
  margin-top: 15px;
}
.security-session > span {
  flex: 1;
}
.security-session strong,
.security-session small {
  display: block;
}
.security-session strong {
  font-size: calc(12px + var(--font-plus));
}
.security-session small {
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
  margin-top: 5px;
}
.security-session > svg {
  color: var(--success);
}
.account-content > .security-setting + .button {
  margin-top: 20px;
}
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 30px;
  margin: 22px auto;
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  border-radius: 17px;
  max-width: 290px;
}
.qr-placeholder > svg {
  color: var(--brand);
}
.qr-placeholder strong {
  font-size: calc(14px + var(--font-plus));
}
.qr-placeholder small {
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
}
.otp-input {
  letter-spacing: 0.3em;
  font-size: calc(23px + var(--font-plus)) !important;
  max-width: 250px;
}
.recovery-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 22px;
  border-radius: 13px;
  background: var(--surface-alt);
  margin: 22px 0;
}
.recovery-codes code {
  font-size: calc(16px + var(--font-plus));
  color: var(--brand);
  text-align: center;
}
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-page > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 5vw;
}
.auth-page > header > div:last-child {
  display: flex;
  align-items: center;
  gap: 16px;
}
.auth-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 8vw;
  align-items: center;
  width: min(1110px, 90vw);
  margin: 30px auto 45px;
}
.auth-story h1 {
  font-size: calc(48px + var(--font-plus));
  line-height: 1.2;
  margin: 19px 0;
}
.auth-story > p {
  font-size: calc(16px + var(--font-plus));
  color: var(--muted);
}
.auth-story .eyebrow {
  font-size: calc(10px + var(--font-plus));
  letter-spacing: 0.14em;
}
.auth-mascot {
  width: 280px;
  height: 215px;
  position: relative;
  margin: 30px 0;
}
.auth-mascot:before {
  content: "";
  position: absolute;
  inset: 5px 20px;
  border: 1px solid hsl(calc(var(--accent-h) + -1) calc(45.2% * var(--accent-s)) 69.2% / 0.259);
  border-radius: 50%;
}
.auth-mascot:after {
  content: "";
  position: absolute;
  inset: -15px 0;
  border: 1px dashed hsl(calc(var(--accent-h) + -1) calc(45.2% * var(--accent-s)) 69.2% / 0.29);
  border-radius: 50%;
  z-index: -1;
}
.auth-mascot > .mascot {
  width: 130px;
  height: 160px;
  position: absolute;
  left: 74px;
  top: 28px;
  background: white;
  border-radius: 27px;
  padding: 10px;
  box-shadow: 0 10px 50px hsl(var(--accent-h) calc(91.2% * var(--accent-s)) 31.4% / 0.071);
}
.auth-mascot > span {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 12px 15px;
  background: var(--surface);
  border-radius: 13px;
  font-size: calc(17px + var(--font-plus));
  font-weight: 700;
  box-shadow: 0 4px 20px hsl(var(--accent-h) calc(91.2% * var(--accent-s)) 31.4% / 0.039);
  transform: rotate(-8deg);
  color: #c89638;
}
.auth-mascot > span:nth-of-type(2) {
  left: auto;
  right: 0;
  top: 130px;
  transform: rotate(8deg);
  color: var(--brand);
}
.auth-mascot > span:nth-of-type(3) {
  left: auto;
  right: 2px;
  top: 0;
  color: var(--success);
  transform: rotate(6deg);
}
.auth-benefits {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: calc(12px + var(--font-plus));
}
.auth-benefits > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.auth-benefits svg {
  width: 15px;
  color: var(--success);
}
.auth-card {
  padding: 36px;
  border-radius: 22px;
  box-shadow: 0 16px 60px hsl(calc(var(--accent-h) + 7) calc(63.9% * var(--accent-s)) 23.9% / 0.063);
}
.auth-card h2 {
  font-size: calc(26px + var(--font-plus));
  margin: 22px 0 10px;
}
.auth-card > .muted {
  font-size: calc(12px + var(--font-plus));
  margin-bottom: 25px;
}
.auth-lock {
  display: inline-flex;
  padding: 13px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--brand);
}
.auth-card .field {
  margin-bottom: 18px;
}
.auth-card form > .button,
.auth-card > .button {
  width: 100%;
  min-height: 46px;
  margin-top: 5px;
}
.auth-card .field input {
  font-size: calc(14px + var(--font-plus));
}
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  font-size: calc(10px + var(--font-plus));
}
.auth-options label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.auth-options input {
  accent-color: var(--brand-strong);
  width: 15px;
  height: 15px;
}
.auth-options .text-link {
  font-size: calc(10px + var(--font-plus));
}
.auth-bottom {
  text-align: center;
  margin: 22px 0 0;
  font-size: calc(11px + var(--font-plus));
}
.auth-bottom .text-link {
  font-size: calc(11px + var(--font-plus));
  display: inline-flex;
}
.auth-demo-note {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin: 24px 0 0;
  text-align: center;
  font-size: calc(10px + var(--font-plus));
  color: var(--muted);
}
.auth-page > footer {
  text-align: center;
  font-size: calc(10px + var(--font-plus));
  color: var(--muted);
  padding: 15px 15px 25px;
}
@media (max-width: 800px) {
  .account-tabs {
    gap: 0;
    margin-inline: -5px;
  }
  .account-tabs button {
    font-size: calc(11px + var(--font-plus));
    padding: 12px 8px;
  }
  .account-tabs button svg {
    display: none;
  }
  .account-space {
    gap: 11px;
  }
  .account-space strong {
    font-size: calc(17px + var(--font-plus));
  }
  .account-space small {
    font-size: calc(10px + var(--font-plus));
  }
  .account-content h3 {
    font-size: calc(19px + var(--font-plus));
  }
  .account-content > .muted {
    font-size: calc(12px + var(--font-plus));
  }
  .account-content .detail-stat strong {
    max-width: 190px;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .account-second-button {
    margin: 10px 0 0;
  }
  .employee-card {
    padding: 13px;
  }
  .employee-title .badge {
    font-size: calc(8px + var(--font-plus));
  }
  .employee-actions .text-link {
    min-height: 44px;
  }
  .employee-title small {
    font-size: calc(10px + var(--font-plus));
  }
  .employee-actions > span {
    width: 100%;
  }
  .employee-actions {
    gap: 0 15px;
    margin-top: 10px;
  }
  .security-setting {
    gap: 10px;
  }
  .security-setting .setting-icon {
    padding: 8px;
  }
  .security-setting .button {
    font-size: calc(10px + var(--font-plus));
    padding-inline: 9px;
  }
  .security-setting small {
    font-size: calc(10px + var(--font-plus));
  }
  .security-setting strong {
    font-size: calc(12px + var(--font-plus));
  }
  .account-id small {
    font-size: calc(10px + var(--font-plus));
  }
  .recovery-codes {
    padding: 18px 10px;
    gap: 18px 8px;
  }
  .recovery-codes code {
    font-size: calc(14px + var(--font-plus));
  }
  .auth-page > header {
    padding: 19px 20px;
  }
  .auth-page > header .brand strong {
    font-size: calc(24px + var(--font-plus));
  }
  .auth-page > header .brand small {
    font-size: calc(6px + var(--font-plus));
  }
  .auth-page > header .brand-mark {
    width: 31px;
    height: 37px;
  }
  .auth-page > header .brand {
    gap: 9px;
  }
  .auth-page > header > div:last-child {
    gap: 6px;
  }
  .auth-layout {
    display: block;
    width: min(480px, calc(100% - 30px));
    margin: 18px auto 20px;
  }
  .auth-story {
    display: none;
  }
  .auth-card {
    padding: 27px 24px;
    border-radius: 18px;
  }
  .auth-card h2 {
    font-size: calc(25px + var(--font-plus));
  }
  .auth-card .field input {
    font-size: calc(16px + var(--font-plus));
  }
  .auth-options {
    font-size: calc(10px + var(--font-plus));
  }
  .auth-card .field small {
    font-size: calc(10px + var(--font-plus));
  }
  .auth-card .field {
    margin-bottom: 21px;
  }
  .auth-page > footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .account-content {
    animation: none;
  }
  .toggle:after {
    transition: none;
  }
}

:root {
  --blue: var(--brand);
}
.web-shell {
  display: flex;
  min-height: 100dvh;
  background: var(--bg);
}
.web-sidebar {
  width: 260px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.web-sidebar .brand {
  margin: 0 12px 20px;
}
.web-sidebar-label {
  font-size: calc(10px + var(--font-plus));
  letter-spacing: 0.16em;
  color: var(--muted);
  padding: 0 12px;
}
.web-sidebar nav {
  display: grid;
  gap: 7px;
}
.web-sidebar nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}
.web-sidebar nav button.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.web-sidebar-help {
  margin-top: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  font-size: calc(12px + var(--font-plus));
  line-height: 1.65;
}
.web-sidebar-help strong {
  display: block;
  margin-top: 9px;
}
.web-sidebar-help p {
  color: var(--muted);
  margin-bottom: 0;
}
.web-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: calc(12px + var(--font-plus));
}
.web-user strong {
  display: block;
}
.web-user small {
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
}
.web-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}
.web-workspace {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
}
.web-topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  gap: 14px;
  background: var(--surface);
}
.web-topbar > div {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: calc(12px + var(--font-plus));
}
.web-topbar span:not(.badge) {
  font-size: calc(10px + var(--font-plus));
  letter-spacing: 0.1em;
  color: var(--muted);
}
.web-content {
  padding: 36px 40px 20px;
  max-width: 1400px;
  margin: auto;
  animation: web-appear 0.25s ease-out;
}
.web-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.web-heading h1 {
  font-size: calc(30px + var(--font-plus));
  letter-spacing: -1px;
  margin: 8px 0 10px;
  line-height: 1.2;
}
.web-heading p {
  color: var(--muted);
  margin: 0;
  font-size: calc(13px + var(--font-plus));
}
.web-heading.small {
  margin-bottom: 18px;
}
.web-heading.small h2 {
  font-size: calc(18px + var(--font-plus));
  margin: 0 0 6px;
}
.web-heading.small h3 {
  margin: 0 0 5px;
}
.web-eyebrow {
  font-size: calc(10px + var(--font-plus));
  letter-spacing: 0.17em;
  font-weight: 800;
  color: var(--blue);
}
.web-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.web-grid.thirds {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.web-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  margin-bottom: 20px;
  min-width: 0;
  box-shadow: 0 3px 10px hsl(calc(var(--accent-h) + 4) calc(59.5% * var(--accent-s)) 15.5% / 0.012);
}
.web-card h2 {
  font-size: calc(18px + var(--font-plus));
}
.web-card h3 {
  font-size: calc(15px + var(--font-plus));
}
.web-card p {
  font-size: calc(13px + var(--font-plus));
  line-height: 1.65;
}
.web-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  text-align: left;
  color: var(--text);
}
.web-stat svg {
  color: var(--blue);
  grid-column: 2;
  grid-row: 1 / 3;
}
.web-stat strong {
  font-size: calc(29px + var(--font-plus));
  font-weight: 800;
  line-height: 1.3;
}
.web-stat span {
  font-size: calc(12px + var(--font-plus));
  color: var(--muted);
}
.web-stat:disabled {
  opacity: 1;
  cursor: default;
}
.web-admin-bot {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border: 1px solid hsl(calc(var(--accent-h) + 2) calc(49.4% * var(--accent-s)) 82.9%);
  border-radius: 18px;
  background: var(--blue-soft);
  margin: 3px 0 25px;
}
.web-admin-bot p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: calc(12px + var(--font-plus));
}
.web-grow {
  flex: 1;
  min-width: 0;
}
.web-grow > strong,
.web-grow > small {
  display: block;
}
.web-grow > small {
  margin-top: 6px;
  color: var(--muted);
  font-size: calc(11px + var(--font-plus));
}
.web-icon-box {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--blue);
  flex-shrink: 0;
}
.web-tenant-row {
  width: 100%;
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 20px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: none;
  color: var(--text);
  transition: background 0.15s;
}
.web-tenant-row:hover {
  background: var(--bg);
}
.web-tenant-row:last-child {
  border: 0;
}
.web-tenant-row strong {
  font-size: calc(14px + var(--font-plus));
}
.web-tenant-row > svg {
  color: var(--muted);
}
.web-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: calc(12px + var(--font-plus));
}
.web-row:last-child {
  border: 0;
}
.web-row > svg {
  color: var(--muted);
  flex-shrink: 0;
}
.web-row.compact {
  border: 0;
  padding: 0;
}
.web-row p {
  margin: 5px 0;
  font-size: calc(11px + var(--font-plus));
}
.web-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  color: var(--muted);
  max-width: 260px;
}
.web-search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  padding: 11px 0;
  color: var(--text);
  font-size: calc(12px + var(--font-plus));
}
.web-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.web-actions .button {
  white-space: normal;
}
.web-form {
  display: grid;
  gap: 18px;
}
.web-form .field {
  margin: 0;
}
.web-alert {
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 15px 17px;
  font-size: calc(12px + var(--font-plus));
  line-height: 1.65;
  margin: 12px 0;
}
.web-alert.error {
  background: #fff0ef;
  color: #922d2d;
  border-color: #efc8c4;
}
.web-wrap {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.web-footer {
  padding: 18px 40px 28px;
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
  letter-spacing: 0.04em;
}
.web-menu {
  display: none;
}
.web-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
  margin-bottom: 22px;
}
.web-breadcrumb button {
  border: 0;
  background: none;
  color: var(--blue);
  padding: 0;
  font-size: inherit;
}
.web-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.web-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 13px 17px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: calc(12px + var(--font-plus));
}
.web-tabs button.active {
  border-bottom-color: var(--blue);
  color: var(--blue);
}
.web-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: linear-gradient(110deg, var(--blue-soft), var(--surface));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  margin-bottom: 22px;
}
.web-hero h2 {
  font-size: calc(25px + var(--font-plus));
  letter-spacing: -0.7px;
  margin: 10px 0;
}
.web-hero p {
  max-width: 520px;
  font-size: calc(13px + var(--font-plus));
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}
.web-hero-icon {
  color: var(--blue);
  padding: 20px;
  opacity: 0.7;
}
.web-coming {
  display: flex;
  gap: 15px;
  align-items: center;
}
.web-coming > div {
  flex: 1;
}
.web-coming h3,
.web-coming p {
  margin: 4px 0;
}
.web-whitelist {
  margin-top: 22px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
}
.web-whitelist h4 {
  font-size: calc(12px + var(--font-plus));
}
.web-member {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.web-member:last-child {
  border: 0;
}
.web-member select {
  max-width: 180px;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: calc(12px + var(--font-plus));
}
.web-member p {
  font-size: calc(11px + var(--font-plus));
  margin: 5px 0;
}
.web-steps {
  display: flex;
  gap: 10px;
  font-size: calc(10px + var(--font-plus));
  font-weight: 700;
  color: var(--blue);
}
.web-steps span {
  background: var(--blue-soft);
  border-radius: 8px;
  padding: 10px;
}
.web-qr {
  display: block;
  margin: 0 auto;
  width: 230px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.web-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}
.web-codes code {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}
.web-loading {
  display: grid;
  gap: 35px;
  place-items: center;
  min-height: 100dvh;
  align-content: center;
  color: var(--muted);
}
.web-loading > svg {
  animation: spin 1s linear infinite;
}
.web-auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.web-auth-story {
  background: linear-gradient(160deg, hsl(calc(var(--accent-h) + -3) calc(61.5% * var(--accent-s)) 94.9%), hsl(calc(var(--accent-h) + -2) calc(57.1% * var(--accent-s)) 97.3%));
  padding: 55px 60px 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.web-auth-story .brand {
  margin-bottom: 80px;
}
.web-auth-story h1 {
  font-size: calc(38px + var(--font-plus));
  letter-spacing: -1.7px;
  line-height: 1.3;
  color: hsl(calc(var(--accent-h) + 4) calc(59.5% * var(--accent-s)) 15.5%);
}
.web-auth-story p {
  max-width: 380px;
  line-height: 1.8;
  color: hsl(calc(var(--accent-h) + 1) calc(18.0% * var(--accent-s)) 47.8%);
  font-size: calc(14px + var(--font-plus));
}
.web-auth-story > .mascot {
  align-self: flex-end;
  width: 220px;
  height: 235px;
  object-fit: contain;
  margin-top: 16px;
  mix-blend-mode: multiply;
}
.web-auth-story > small {
  margin-top: auto;
  color: hsl(calc(var(--accent-h) + 3) calc(16.4% * var(--accent-s)) 52.2%);
  font-size: calc(10px + var(--font-plus));
}
.web-auth-main {
  display: grid;
  place-items: center;
  padding: 40px 30px;
  background: var(--surface);
}
.web-auth-card {
  width: 100%;
  max-width: 385px;
}
.web-auth-card h1 {
  font-size: calc(28px + var(--font-plus));
  letter-spacing: -0.8px;
  margin: 12px 0;
}
.web-auth-card > p {
  font-size: calc(13px + var(--font-plus));
  line-height: 1.7;
  margin-bottom: 26px;
}
.web-auth-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 25px;
}
.web-auth .web-actions > .button {
  width: 100%;
}
.web-auth-links {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
}
.web-auth-links button {
  border: 0;
  background: none;
  font-size: calc(12px + var(--font-plus));
  color: var(--blue);
  padding: 0;
}
.web-local-note {
  display: block;
  margin-top: 32px;
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
  line-height: 1.5;
}
.web-auth-card.enroll {
  max-width: 440px;
}
.web-enroll {
  display: grid;
  gap: 14px;
}
.web-enroll-progress {
  display: flex;
  gap: 6px;
  margin: 2px 0 4px;
}
.web-enroll-progress span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  transition: background 0.25s ease;
}
.web-enroll-progress span.is-current,
.web-enroll-progress span.is-done {
  background: var(--brand);
}
.web-enroll-title {
  font-size: calc(16px + var(--font-plus));
  letter-spacing: -0.2px;
  margin: 4px 0 0;
}
.web-enroll-lead {
  margin: 0;
  color: var(--muted);
  font-size: calc(12px + var(--font-plus));
  line-height: 1.7;
}
.web-enroll [data-enroll-step] {
  display: grid;
  gap: 14px;
}
.web-enroll [data-enroll-step][hidden] {
  display: none;
}
.web-enroll .web-form {
  gap: 14px;
}
.web-enroll .web-actions > .button {
  width: 100%;
  justify-content: center;
}
.web-enroll-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  width: fit-content;
  margin: 0 auto;
}
.web-enroll-qr img {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 8px;
}
.web-enroll-secret {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
}
.web-enroll-secret code {
  flex: 1;
  min-width: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: calc(13px + var(--font-plus));
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}
.web-enroll [name="code"] {
  letter-spacing: 0.32em;
  font-variant-numeric: tabular-nums;
  font-size: calc(17px + var(--font-plus));
  font-weight: 650;
}
.web-enroll-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
}
.web-enroll-codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: calc(13px + var(--font-plus));
  letter-spacing: 0.14em;
  text-align: center;
  padding: 7px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.web-enroll-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: calc(11px + var(--font-plus));
  line-height: 1.65;
}
.web-backdrop {
  display: none;
}
.web-form input,
.web-form select {
  width: 100%;
  min-width: 0;
}
.web-form[data-bank-review] { padding: 18px; }
.web-form[data-bank-review] .check-option { display: flex; align-items: flex-start; gap: 10px; }
.web-form[data-bank-review] input[type="checkbox"] { width: auto; flex: 0 0 auto; margin-top: 5px; }
.web-form[data-bank-review] .form-error { color: var(--red, #b42318); }
.web-card .button,
.web-admin-bot .button {
  font-size: calc(11px + var(--font-plus));
}
.web-content > .web-alert {
  margin: 0 0 22px;
}
.web-card > svg {
  color: var(--blue);
}
@keyframes web-appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (min-width: 1500px) {
  .web-content {
    padding-top: 45px;
  }
  .web-heading h1 {
    font-size: calc(34px + var(--font-plus));
  }
}
@media (max-width: 1050px) {
  .web-sidebar {
    width: 225px;
    padding: 28px 15px;
  }
  .web-workspace {
    margin-left: 225px;
  }
  .web-content {
    padding: 28px 24px;
  }
  .web-topbar {
    padding: 0 24px;
  }
  .web-heading {
    align-items: flex-start;
  }
  .web-auth-story {
    padding: 45px 35px;
  }
  .web-auth-story h1 {
    font-size: calc(31px + var(--font-plus));
  }
  .web-card {
    padding: 21px;
  }
  .web-member > .web-actions {
    width: 100%;
  }
}
@media (max-width: 800px) {
  .web-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 270px;
  }
  .web-sidebar.open {
    transform: none;
  }
  .web-workspace {
    margin-left: 0;
  }
  .web-menu {
    display: grid;
  }
  .web-topbar {
    height: 64px;
    padding: 0 18px;
  }
  .web-topbar > div:first-of-type {
    margin-right: auto;
  }
  .web-topbar > div:first-of-type > span {
    display: none;
  }
  .web-topbar .badge {
    font-size: calc(9px + var(--font-plus));
    padding: 4px 7px;
  }
  .web-content {
    padding: 26px 20px;
  }
  .web-heading h1 {
    font-size: calc(27px + var(--font-plus));
  }
  .web-heading {
    gap: 16px;
    flex-wrap: wrap;
  }
  .web-heading > .button {
    width: auto;
  }
  .web-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: hsl(calc(var(--accent-h) + 4) calc(59.5% * var(--accent-s)) 15.5% / 0.333);
    z-index: 29;
  }
  .web-auth {
    grid-template-columns: 1fr;
  }
  .web-auth-story {
    display: none;
  }
  .web-auth-main {
    min-height: 100dvh;
  }
  .web-hero {
    padding: 25px;
  }
  .web-hero-icon {
    display: none;
  }
  .web-grid.thirds {
    gap: 10px;
  }
  .web-stat {
    padding: 18px 15px;
  }
  .web-stat strong {
    font-size: calc(25px + var(--font-plus));
  }
  .web-stat span {
    font-size: calc(10px + var(--font-plus));
  }
  .web-stat svg {
    width: 17px;
  }
  .web-footer {
    padding: 14px 20px 26px;
  }
}
@media (max-width: 520px) {
  .web-content {
    padding: 22px 16px;
  }
  .web-heading h1 {
    font-size: calc(25px + var(--font-plus));
  }
  .web-heading p {
    font-size: calc(12px + var(--font-plus));
    line-height: 1.6;
  }
  .web-card {
    padding: 18px;
    border-radius: 16px;
  }
  .web-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .web-grid.thirds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .web-stat {
    padding: 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .web-stat svg {
    display: none;
  }
  .web-stat strong {
    font-size: calc(23px + var(--font-plus));
  }
  .web-admin-bot {
    padding: 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .web-admin-bot > .button {
    margin-left: 56px;
  }
  .web-search {
    max-width: none;
    width: 100%;
  }
  .web-tenant-row {
    padding: 18px 0;
  }
  .web-heading.small {
    gap: 13px;
    flex-wrap: wrap;
  }
  .web-tabs {
    margin-left: -3px;
    margin-right: -3px;
  }
  .web-tabs button {
    padding: 12px 10px;
    font-size: calc(11px + var(--font-plus));
    gap: 6px;
  }
  .web-tabs svg {
    width: 16px;
  }
  .web-member {
    gap: 10px;
  }
  .web-member select {
    width: 100%;
    max-width: none;
  }
  .web-member > .web-grow {
    flex-basis: calc(100% - 50px);
  }
  .web-row {
    flex-wrap: wrap;
  }
  .web-row > small {
    margin-left: 31px;
  }
  .web-row.compact {
    flex-wrap: nowrap;
  }
  .web-coming {
    align-items: flex-start;
  }
  .web-auth-main {
    padding: 28px 24px;
  }
  .web-auth-card h1 {
    font-size: calc(25px + var(--font-plus));
  }
  .web-topbar strong {
    font-size: calc(11px + var(--font-plus));
  }
  .web-hero h2 {
    font-size: calc(22px + var(--font-plus));
  }
}
@media (prefers-reduced-motion: reduce) {
  .web-content,
  .web-sidebar {
    animation: none;
    transition: none;
  }
}

/* ---- Stage 4: shell in the prototype style, motion and subscriptions ---- */
.web-app .admin-main {
  max-width: 1400px;
}
.reveal {
  animation: fade-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.surface {
  transition:
    transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.25s,
    border-color 0.25s;
}
.metric.surface:hover,
.connection-card:hover,
.bot-card:hover,
.security-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px hsl(calc(var(--accent-h) + 4) calc(59.5% * var(--accent-s)) 15.5% / 0.071);
  border-color: hsl(calc(var(--accent-h) + 2) calc(49.4% * var(--accent-s)) 82.9%);
}
button.metric {
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.client-row {
  transition: background 0.18s, transform 0.18s;
}
.client-row:hover {
  background: var(--surface-alt);
}
.client-row:hover > svg:last-child {
  transform: translateX(3px);
  transition: transform 0.18s;
}
.nav-item {
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-item:hover {
  transform: translateX(2px);
}
.hero-mascot {
  animation: float 5s ease-in-out infinite;
}
.orbit-tag {
  animation: float 6s ease-in-out infinite;
}
.orbit-tag.crm-tag {
  animation-delay: -2s;
}
.orbit-tag.ai-tag {
  animation-delay: -4s;
}
.surface.pad {
  padding: 22px 24px;
}
.surface.pad h2 {
  font-size: calc(17px + var(--font-plus));
  margin: 0 0 6px;
}
.surface.pad h3 {
  font-size: calc(14px + var(--font-plus));
  margin: 0 0 4px;
}
.surface.pad .section-heading {
  padding: 0;
  margin-bottom: 16px;
}
.surface.pad .section-heading p {
  margin: 4px 0 0;
}
.surface.pad + .surface.pad,
.detail-page .surface + .surface {
  margin-top: 18px;
}
.attention-empty {
  padding: 14px 18px 20px;
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
  line-height: 1.6;
}
.attention-icon.blue {
  background: var(--blue-soft);
  color: var(--brand);
}
.admin-bot-card {
  padding: 20px;
  margin-bottom: 16px;
}
.admin-bot-card .section-heading {
  padding: 0;
  margin-bottom: 14px;
}
.admin-bot-card .section-heading p {
  margin: 4px 0 0;
  font-size: calc(11px + var(--font-plus));
}
.admin-bot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  font-size: calc(12px + var(--font-plus));
}
.overview-aside .attention-card .section-heading {
  padding: 18px 18px 10px;
}
.page-crumb {
  margin-bottom: 18px;
  font-size: calc(11px + var(--font-plus));
}
.page-crumb .text-link {
  font-size: calc(11px + var(--font-plus));
}
.page-top {
  margin-bottom: 20px;
}
.page-top h2 {
  font-size: calc(26px + var(--font-plus));
  letter-spacing: -0.8px;
}
.page-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: calc(12px + var(--font-plus));
}
.page-tabs {
  margin-bottom: 24px;
  gap: 4px;
}
.page-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  font-size: calc(12px + var(--font-plus));
  border-radius: 10px 10px 0 0;
  transition: color 0.18s, background 0.18s;
}
.page-tabs button:hover {
  background: var(--surface-alt);
}
.detail-page {
  animation: fade-in 0.35s ease-out both;
}
.detail-page .detail-stats {
  margin-bottom: 20px;
}
.detail-stats button {
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.detail-stats button:hover {
  transform: translateY(-2px);
}
.tenant-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
}
.tenant-grid aside {
  display: grid;
  gap: 16px;
}
.tenant-grid aside .note {
  margin: 0;
}
.banner-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: #fff0ef;
  color: #922d2d;
  border: 1px solid #efc8c4;
}
.banner-button > svg:last-child {
  margin-left: auto;
}
.banner-button strong {
  display: block;
}
.banner-button p {
  margin: 4px 0 0;
  font-size: calc(12px + var(--font-plus));
  color: inherit;
  opacity: 0.85;
}
.section-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.connection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.connection-card {
  padding: 20px;
}
.connection-card.coming {
  border-style: dashed;
  opacity: 0.85;
}
.connection-card .source-setting {
  display: grid;
  gap: 9px;
  padding: 0;
  border: 0;
  margin: 0;
}
.connection-card .source-setting > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.connection-card p {
  margin: 0;
  font-size: calc(12px + var(--font-plus));
  color: var(--muted);
  line-height: 1.6;
}
.connection-card small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
}
.head-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.head-metrics > div {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.head-metrics span {
  display: block;
  color: var(--muted);
  font-size: calc(9px + var(--font-plus));
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.head-metrics strong { font-size: calc(14px + var(--font-plus)); }
#updates progress { width: 100%; height: 10px; accent-color: var(--brand); }
.update-log { max-height: 180px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--line); font-size: calc(11px + var(--font-plus)); white-space: pre-wrap; }
.model-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.model-chips:empty { display: none; }
.model-chips .button { max-width: 100%; white-space: normal; text-align: left; }
.bot-card .detail-stat {
  padding: 10px 0;
}
.bot-card .button-row {
  margin-top: 14px;
}
.subscription-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 12px;
}
.subscription-controls .field {
  margin: 0;
}
.subscription-controls[data-set-term] > .button {
  align-self: center;
  justify-self: start;
}
.subscription-history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.subscription-history h4 {
  font-size: calc(11px + var(--font-plus));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.history-row {
  display: grid;
  grid-template-columns: 112px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: calc(12px + var(--font-plus));
}
.history-row:last-child {
  border: 0;
}
.history-row time,
.history-row small {
  color: var(--muted);
  font-size: calc(10px + var(--font-plus));
}
.security-card {
  display: grid;
  gap: 10px;
  align-content: start;
}
.security-card .attention-icon {
  margin-bottom: 4px;
}
.security-card p {
  margin: 0;
  font-size: calc(12px + var(--font-plus));
  line-height: 1.65;
}
.web-grid + .surface,
.web-grid .surface {
  margin-bottom: 0;
}
.web-grid {
  margin-bottom: 18px;
}
.auth-mascot {
  animation: float 5s ease-in-out infinite;
}
.event-list .empty-state {
  padding: 30px;
}
.event-row p span {
  color: var(--muted);
  padding: 0 4px;
}
.web-whitelist .member-row {
  padding: 10px 0;
}
.web-whitelist .member-row:last-child {
  border: 0;
}
[data-theme="dark"] .web-auth-story {
  background: linear-gradient(160deg, hsl(calc(var(--accent-h) + 7) calc(55.2% * var(--accent-s)) 13.1%), hsl(calc(var(--accent-h) + 6) calc(55.1% * var(--accent-s)) 17.5%));
}
[data-theme="dark"] .web-auth-story h1 {
  color: hsl(calc(var(--accent-h) + 5) calc(61.5% * var(--accent-s)) 94.9%);
}
[data-theme="dark"] .web-auth-story p,
[data-theme="dark"] .web-auth-story > small {
  color: hsl(calc(var(--accent-h) + 4) calc(27.2% * var(--accent-s)) 70.4%);
}
[data-theme="dark"] .banner-button {
  background: #3a1e1e;
  color: #f3c7c3;
  border-color: #6a3232;
}
[data-theme="dark"] .metric.surface:hover,
[data-theme="dark"] .connection-card:hover,
[data-theme="dark"] .bot-card:hover,
[data-theme="dark"] .security-card:hover {
  box-shadow: 0 12px 30px #00000055;
  border-color: hsl(calc(var(--accent-h) + 4) calc(39.7% * var(--accent-s)) 28.6%);
}
@media (max-width: 1100px) {
  .tenant-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .web-app .admin-main {
    padding-bottom: 90px;
  }
  .subscription-controls {
    grid-template-columns: 1fr;
  }
  .history-row {
    grid-template-columns: 1fr auto;
  }
  .history-row span {
    grid-column: 1 / -1;
  }
  .page-top h2 {
    font-size: calc(22px + var(--font-plus));
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .detail-page,
  .hero-mascot,
  .orbit-tag,
  .auth-mascot {
    animation: none;
  }
  .surface,
  .client-row,
  .nav-item,
  .detail-stats button {
    transition: none;
  }
}
.detail-page .detail-stats > button {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.detail-page .detail-stats > button svg {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  color: var(--brand);
}
.detail-page .detail-stats > button strong {
  font-size: calc(24px + var(--font-plus));
  line-height: 1.1;
}
.detail-page .detail-stats > button span {
  font-size: calc(11px + var(--font-plus));
  color: var(--muted);
}
@media (max-width: 800px) {
  .detail-page .detail-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .detail-page .detail-stats > button:last-child {
    grid-column: 1 / -1;
  }
  .page-top {
    flex-wrap: wrap;
  }
}
.source-badge.demo {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--line);
}
.event-row time {
  width: 92px;
  flex-shrink: 0;
}
.event-row > div {
  flex: 1;
  min-width: 0;
}
.section-heading .button-row {
  flex-wrap: nowrap;
  align-items: center;
}
.section-heading select {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: calc(12px + var(--font-plus));
}

/* ---- server-rendered panel: anchors used where the SPA had buttons ---- */
a.nav-item, a.client-row, a.attention-row, a.notification-row, a.icon-button, a.banner-button, .detail-stats > a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.nav-item { width: 100%; box-sizing: border-box; }
.admin-sidebar nav a.nav-item { display: flex; }
a.icon-button { display: inline-flex; align-items: center; justify-content: center; }
.mobile-bottom-nav a { text-decoration: none; }
.page-tabs a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--muted); }
.page-tabs a.selected { color: var(--brand); }
.detail-page .detail-stats > a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.detail-page .detail-stats > a:hover { transform: translateY(-2px); }
.detail-page .detail-stats > a svg { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--brand); }
.detail-page .detail-stats > a strong { font-size: calc(24px + var(--font-plus)); line-height: 1.1; }
.detail-page .detail-stats > a span { font-size: calc(11px + var(--font-plus)); color: var(--muted); }
@media (max-width: 800px) {
  .detail-page .detail-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .detail-page .detail-stats > a:last-child { grid-column: 1 / -1; }
}
.theme-dark { display: none; }
[data-theme="dark"] .theme-dark { display: inline-flex; }
[data-theme="dark"] .theme-light { display: none; }
.icon-button > span { display: inline-flex; }
.nav-scrim[hidden] { display: none; }
.web-form button[type="submit"] span { margin-left: 6px; }
.dialog .web-form { margin-top: 4px; }
.toast:not(.visible) { pointer-events: none; }
.web-auth-links a { font-size: calc(12px + var(--font-plus)); color: var(--blue); text-decoration: none; }
.web-auth-links button { border: 0; background: none; font-size: calc(12px + var(--font-plus)); color: var(--blue); padding: 0; }
.page-tabs a {
  font-size: calc(12px + var(--font-plus));
  white-space: nowrap;
  padding: 12px 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
}
.page-tabs a.selected {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}
.icon-button > .theme-dark { display: none; }
.icon-button > .theme-light { display: inline-flex; }
[data-theme="dark"] .icon-button > .theme-dark { display: inline-flex; }
[data-theme="dark"] .icon-button > .theme-light { display: none; }
@media (max-width: 800px) {
  .mobile-bottom-nav > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: calc(9px + var(--font-plus));
    font-weight: 600;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 10px;
  }
  .mobile-bottom-nav > a.active { color: var(--brand); background: var(--blue-soft); }
}

/* ---- Stage 5: task chat ------------------------------------------------- */
.client-app .chat-action-menu[hidden] { display: none; }
.client-app .chat-action-menu > button { display: flex; align-items: center; gap: 9px; }
.client-app .chat-sidebar .profile { display: flex; align-items: center; gap: 10px; }
.client-app .chat-sidebar .profile > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.client-app .chat-sidebar .profile strong { font-size: calc(12px + var(--font-plus)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-app .chat-sidebar .profile small { font-size: calc(10px + var(--font-plus)); color: var(--muted); }
.archive-link { margin: 10px 8px 0; font-size: calc(11px + var(--font-plus)); }
.client-app .chat-nav-row > button.chat-remove-delete { color: var(--danger) !important; }
.client-app .chat-action-menu > .chat-menu-sep { display: block; height: 1px; margin: 6px 4px; background: var(--line); }
.archive-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.archive-actions .button.small { padding: 6px 9px; }
.archive-delete { width: 32px; height: 32px; }
.delete-chat-question { font-weight: 600; overflow-wrap: anywhere; }
.delete-chat-warning { margin: 10px 0 14px; padding: 11px 13px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.delete-chat-confirm { margin: 14px 0 12px; }
.delete-chat-actions { margin-top: 16px; }
/* A 409 while a request is running: the server text stays, and (only for a safe request) a secondary way forward. */
.delete-chat-busy { margin: 12px 0 0; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line)); border-radius: 12px; background: var(--warning-bg); }
.delete-chat-hint { margin: 0; font-size: calc(12px + var(--font-plus)); line-height: 1.6; }
.delete-chat-hint:empty { display: none; }
.delete-chat-stop { width: 100%; margin-top: 10px; color: var(--danger); background: var(--surface); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.delete-chat-stop:hover:not(:disabled):not(.is-busy) { background: var(--danger-bg); }
.delete-chat-stop[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack .notification-row { width: 100%; text-align: left; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: inherit; font: inherit; cursor: pointer; }
.stack .notification-row.active { border-color: var(--brand); }
.stack .notification-row > span:nth-child(2) { flex: 1; min-width: 0; }
.stack .notification-row .button { flex-shrink: 0; }
.dialog-subheading { margin: 18px 0 8px; font-size: calc(12px + var(--font-plus)); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.button.small { padding: 6px 10px; font-size: calc(12px + var(--font-plus)); }
.task-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.task-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: calc(12px + var(--font-plus)); cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.task-chip:hover { background: var(--surface-alt); transform: translateY(-1px); }
.task-chip.selected { background: var(--blue-soft); border-color: var(--brand); color: var(--brand); }
.attachment-chip { display: inline-flex; align-items: center; gap: 8px; margin: 10px 14px 0; padding: 6px 10px; border-radius: 10px; background: var(--blue-soft); color: var(--brand); font-size: calc(12px + var(--font-plus)); max-width: calc(100% - 28px); }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; }
.composer-bottom label.icon-button { cursor: pointer; }
.user-file { display: inline-flex; align-items: center; gap: 6px; font-size: calc(11px + var(--font-plus)); opacity: 0.85; margin-bottom: 4px; }
.message-time { display: block; font-size: calc(10px + var(--font-plus)); opacity: 0.6; margin-top: 4px; text-align: right; }
.answer-text { white-space: pre-wrap; word-break: break-word; }
.report-table-wrap { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: calc(12px + var(--font-plus)); min-width: 100%; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.data-table th { position: sticky; top: 0; background: var(--surface-alt); color: var(--muted); font-size: calc(10px + var(--font-plus)); text-transform: uppercase; letter-spacing: 0.06em; }
.data-table tbody tr:hover { background: var(--surface-alt); }
.report-notes { margin: 12px 0 0; padding-left: 18px; font-size: calc(12px + var(--font-plus)); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.assistant-content .note { margin-top: 6px; }
.composer-gate[hidden], [data-chat-composer][hidden], .chat-welcome[hidden], .messages[hidden], .connection-banner[hidden], .attachment-chip[hidden] { display: none; }
.stat-chat { border-color: var(--brand) !important; }
.chat-list [data-group] { display: flex; flex-direction: column; }
@media (max-width: 800px) {
  .task-chips { padding: 8px 10px 0; overflow-x: auto; flex-wrap: nowrap; }
  .task-chip { flex-shrink: 0; }
}

/* ---- Stage 6: modules and sources ------------------------------------------ */
.kind-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.kind-chips span { font-size: calc(11px + var(--font-plus)); padding: 3px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--brand); }
.module-catalog { margin-top: 16px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.module-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface-alt); transition: transform 0.2s, box-shadow 0.2s; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-card h3 { margin: 10px 0 4px; font-size: calc(14px + var(--font-plus)); }
.module-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-list { margin: 8px 0 0; padding-left: 18px; font-size: calc(12px + var(--font-plus)); display: flex; flex-direction: column; gap: 3px; }
.module-list.muted { color: var(--muted); }
.check-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface-alt); }
.check-row:has(input:checked) { border-color: var(--brand); background: var(--blue-soft); }
.check-row > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.check-row small { color: var(--muted); font-size: calc(11px + var(--font-plus)); }
.source-option { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); color: inherit; font: inherit; cursor: pointer; }
.source-option.selected { border-color: var(--brand); background: var(--blue-soft); }
.source-option > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.source-option small { color: var(--muted); font-size: calc(11px + var(--font-plus)); }
.source-option .source-badge { flex-shrink: 0; }
.starter-prompts > button[hidden] { display: none; }

/* ---- Cabinets: registered users list ------------------------------------------ */
.user-head, .user-row { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(110px, 0.7fr) minmax(200px, 1.4fr) minmax(110px, 0.8fr) 210px; align-items: center; gap: 12px; padding: 0 20px; }
.user-head { background: var(--surface-alt); color: var(--muted); font-size: calc(8px + var(--font-plus)); height: 34px; border-block: 1px solid var(--line); text-transform: uppercase; letter-spacing: 0.08em; }
.user-row { min-height: 74px; border-bottom: 1px solid var(--line); background: var(--surface); transition: background 0.15s; }
.user-row:hover { background: var(--surface-alt); }
.user-row:last-child { border-bottom: 0; }
.user-row .sources-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.user-row .sources-cell strong { width: 100%; }
.user-row .company-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1150px) {
  .user-head { display: none; }
  .user-row { grid-template-columns: 1fr; padding: 14px 16px; gap: 8px; }
}
.user-row[hidden] { display: none; }

/* ---- Operator support view: clients' chats (read-only) ------------------------- */
.support-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.support-list { padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 220px); overflow: hidden; }
.support-filter { display: flex; flex-direction: column; gap: 8px; }
.support-filter select { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 10px; font: inherit; font-size: calc(13px + var(--font-plus)); }
.support-filter .search-box { width: 100%; }
.support-items { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.support-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid transparent; color: inherit; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.support-item:hover { background: var(--surface-alt); }
.support-item.active { background: var(--blue-soft); border-color: var(--brand); }
.support-item-top { display: flex; justify-content: space-between; gap: 8px; }
.support-item-top strong { font-size: calc(13px + var(--font-plus)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item-top small, .support-item-meta { font-size: calc(11px + var(--font-plus)); color: var(--muted); }
.danger-text { color: var(--danger); font-weight: 600; }
.support-view { padding: 20px 24px; min-height: 420px; }
.ticket-actions { margin-top: 2px; }
.ticket-actions .button { white-space: normal; }
.ticket-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-task { margin-top: 18px; }
.support-layout[data-loading] .support-view { opacity: .55; }
.support-messages { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; padding: 0; max-width: none; }
@media (max-width: 1000px) { .support-layout { grid-template-columns: 1fr; } .support-list { max-height: none; } }

/* CRM deals picker and AI conclusion */
.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.two[hidden] { display: none; }
@media (max-width: 560px) { .form-grid.two { grid-template-columns: 1fr; } }
.report-conclusion { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); font-size: calc(14px + var(--font-plus)); line-height: 1.5; }
.report-conclusion svg { flex: none; margin-top: 2px; color: var(--blue, hsl(calc(var(--accent-h) + 18) calc(90.3% * var(--accent-s)) 59.6%)); }
.report-conclusion p { margin: 0; }

/* Saved templates above the composer */
.template-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.template-chips[hidden] { display: none; }
.template-chip { border-style: dashed; display: inline-flex; align-items: center; gap: 5px; }
.template-manage { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); background: transparent; color: inherit; cursor: pointer; }
.change-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }
/* Chat page: the page itself never scrolls; only the message list and the sidebar do. */
html.chat-page,
body.chat-page { height: 100%; overflow: hidden; }
body.chat-page .client-app { height: 100%; min-height: 0; overflow: hidden; }
body.chat-page .chat-sidebar { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; }
body.chat-page .chat-main { height: 100%; min-height: 0; }

/* Chat answer cards: keep the action row and status text on the same inner grid as the card content. */
.report-card > .change-actions { padding: 0 18px; margin: 12px 0 4px; }
.report-card > .report-footer { justify-content: flex-start; }
.report-card > .report-footer > .button-row { margin-left: 0; }
@media (max-width: 640px) {
  .report-card > .change-actions { padding: 0 12px; }
}
.web-form .field[hidden], .web-form [hidden] { display: none !important; }

/* Field picker: search, checkboxes, chosen chips */
.field-picker { display: grid; gap: 8px; }
.field-picker > span { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.picker-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); border-radius: 10px; background: var(--surface, transparent); }
.picker-search input { border: 0 !important; outline: 0; background: transparent; flex: 1; min-height: 40px; padding: 0 !important; box-shadow: none !important; }
.picker-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); border-radius: 10px; padding: 4px; display: grid; gap: 2px; }
.picker-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: calc(14px + var(--font-plus)); }
.picker-option:hover { background: var(--blue-soft); }
.picker-option.on { background: var(--blue-soft); font-weight: 600; }
.picker-option input { width: 16px; height: 16px; min-height: 0 !important; margin: 0; flex: none; accent-color: var(--blue, hsl(calc(var(--accent-h) + 14) calc(77.0% * var(--accent-s)) 53.9%)); }
.picker-option:has(input:disabled) { opacity: .5; cursor: default; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chips:empty { display: none; }
.picker-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); background: var(--blue-soft); color: inherit; font-size: calc(12px + var(--font-plus)); cursor: pointer; }

/* Memory of rules (stage 7) */
.memory-row.off { opacity: .6; }
.memory-row .button-row { flex-wrap: nowrap; }
.memory-stale { color: var(--warning, #b45309); display: block; }
.memory-add { border: 1px dashed var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.memory-add summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.memory-add[open] summary { margin-bottom: 10px; }
.memory-row { display: grid !important; grid-template-columns: auto 1fr; align-items: start; column-gap: 12px; row-gap: 6px; }
.memory-row > span:nth-child(2) { min-width: 0; }
.memory-row > .button-row { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; gap: 4px; }
.memory-row small { display: block; overflow-wrap: anywhere; }
.report-period { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); font-size: calc(12px + var(--font-plus)); font-weight: 600; }
.period-hint { display: block; margin-top: -4px; }
.report-explain { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); border-radius: 12px; font-size: calc(13px + var(--font-plus)); }
.report-explain summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.report-explain ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); }
.report-explain b { color: var(--text, inherit); font-weight: 600; }

/* Stage 11: AI pool */
.ai-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 22px; border-bottom: 1px solid var(--line); }
.ai-tab { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ai-tab:hover { color: var(--text); }
.ai-tab[aria-selected="true"] { color: var(--brand, var(--blue)); border-bottom-color: var(--brand, var(--blue)); }
.ai-tab:focus-visible { outline: 2px solid var(--brand, var(--blue)); outline-offset: -2px; border-radius: 8px 8px 0 0; }
.ai-tab-panel[hidden] { display: none; }
.ai-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.ai-fold > summary::-webkit-details-marker { display: none; }
.ai-fold > summary::marker { content: ""; }
.ai-fold > summary strong { font-size: calc(14px + var(--font-plus)); }
.ai-fold > summary small { display: block; color: var(--muted); font-size: calc(12px + var(--font-plus)); }
.ai-fold > summary svg { color: var(--muted); transition: transform .18s ease; flex: none; }
.ai-fold[open] > summary svg { transform: rotate(180deg); }
.ai-fold-body { padding-top: 14px; }
.ai-search { max-width: 380px; margin: 0 0 14px; }
.ai-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.ai-page { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: calc(12px + var(--font-plus)); cursor: pointer; }
.ai-page:hover:not(:disabled) { border-color: var(--brand, var(--blue)); }
.ai-page[aria-current="page"] { background: var(--brand, var(--blue)); border-color: var(--brand, var(--blue)); color: #fff; }
.ai-page:disabled { opacity: .45; cursor: default; }
.ai-page-info { color: var(--muted); font-size: calc(12px + var(--font-plus)); margin-left: 4px; }
.ai-user-block { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.ai-user-block .ai-assign-subheading { margin-top: 0; }
.ai-user-block .ai-search { margin-bottom: 12px; }
.ai-assign-cell[hidden], .ai-user-row[hidden] { display: none !important; }
.ai-assign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.ai-assign > .ai-assign-cell { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.ai-assign > .ai-assign-cell:hover { border-color: var(--brand, var(--blue)); }
.ai-assign-toggle { flex: 1 1 auto; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ai-assign-toggle:hover { background: var(--surface); }
.ai-assign-toggle:focus-visible { outline: none; }
.ai-assign > .ai-assign-cell:focus-within { border-color: var(--brand, var(--blue)); box-shadow: 0 0 0 3px var(--blue-soft); }
.ai-assign-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-assign-name strong { overflow-wrap: anywhere; }
.ai-assign-name small { color: var(--muted); font-size: calc(11px + var(--font-plus)); }
.ai-assign-hint { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; color: var(--brand, var(--blue)); font-size: calc(12px + var(--font-plus)); white-space: nowrap; }
.ai-assign-hint svg { transition: transform .18s ease; }
.ai-assign-toggle[aria-expanded="true"] .ai-assign-hint svg { transform: rotate(180deg); }
.ai-assign > .ai-assign-cell:has(.ai-assign-toggle[aria-expanded="true"]) { grid-column: 1 / -1; border-color: var(--brand, var(--blue)); box-shadow: 0 0 0 3px var(--blue-soft); }
.ai-assign-editor { padding: 0 16px 14px; border-top: 1px solid var(--line); }
.ai-assign + .dialog-subheading, .ai-assign-subheading { margin-top: 44px; }
.ai-assign .web-form { grid-column: 1 / -1; border: 0; border-radius: 0; padding: 12px 0 0; }
.ai-assign-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(220px, 2fr); gap: 14px; align-items: start; }
.ai-assign-row small { display: block; color: var(--muted); }
.check-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media (max-width: 1200px) { .ai-assign { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ai-assign { grid-template-columns: 1fr; } .ai-assign-row { grid-template-columns: 1fr; } }
.ai-assign .web-form { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: end; }
.ai-assign .web-form .web-alert { grid-column: 1 / -1; }
.ai-assign .web-actions { margin: 0; }
.ai-check { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px + var(--font-plus)); padding: 6px 10px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 11) calc(30.6% * var(--accent-s)) 90.4%)); border-radius: 999px; cursor: pointer; }
.ai-check input { width: 15px; height: 15px; min-height: 0 !important; margin: 0; accent-color: var(--blue, hsl(calc(var(--accent-h) + 14) calc(77.0% * var(--accent-s)) 53.9%)); }
.ai-check:has(input:checked) { background: var(--blue-soft); font-weight: 600; }
.ai-assign-row .field > span:first-child { display: block; margin-bottom: 6px; }

/* Stage 12: SSH servers — live installation / sign-in job */
.ai-job { display: grid; gap: 10px; margin: 6px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.ai-job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-job-head small { color: var(--muted); }
.ai-login { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--warning-bg); }
.ai-login p { margin: 0; }
.ai-login-url { font-weight: 600; color: var(--brand); word-break: break-all; }
.ai-login-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-login-code strong { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .12em; color: var(--text); user-select: all; }
.ai-login small { color: var(--muted); }
.ai-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ai-step { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; color: var(--muted); }
.ai-step strong { font-weight: 600; }
.ai-step small { display: block; color: var(--muted); word-break: break-all; }
.ai-step-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); font-size: calc(12px + var(--font-plus)); color: var(--muted); }
.ai-step.done, .ai-step.running, .ai-step.waiting, .ai-step.failed { color: var(--text); }
.ai-step.done .ai-step-mark { background: var(--success-bg); color: var(--success); }
.ai-step.running .ai-step-mark { background: var(--blue-soft); color: var(--brand); animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-step.waiting .ai-step-mark { background: var(--warning-bg); color: var(--warning); }
.ai-step.failed .ai-step-mark { background: var(--danger-bg); color: var(--danger); }
.ai-log summary { cursor: pointer; color: var(--muted); font-size: calc(13px + var(--font-plus)); }
.ai-log pre { max-height: 220px; overflow: auto; margin: 6px 0 0; padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: calc(12px + var(--font-plus)); white-space: pre-wrap; word-break: break-all; }
.web-form textarea { width: 100%; font: inherit; line-height: 1.45; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; }
.web-form textarea[name=private_key] { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@keyframes ai-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ai-step.running .ai-step-mark { animation: none; } }
.ai-job [hidden] { display: none !important; }
.ai-step strong { font-size: calc(14px + var(--font-plus)); }
.ai-step small { font-size: calc(12px + var(--font-plus)); }

/* Stage 13: configuration profile of a 1C connection */
.profile-box { display: grid; gap: 12px; }
.profile-head h3 { margin: 0 0 4px; }
.coverage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.coverage-list li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.coverage-list li.ok strong { color: var(--success); }
.coverage-list li.no strong { color: var(--danger); }
.coverage-list small { display: block; color: var(--muted); }
.web-alert.warning { background: var(--warning-bg); color: var(--warning); }

/* Tickets */
.ticket-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ticket-filters .chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: calc(13px + var(--font-plus)); color: var(--muted); text-decoration: none; }
.ticket-filters .chip.active { background: var(--blue-soft); color: var(--brand); border-color: transparent; }
.ticket-body { display: grid; gap: 4px; margin-bottom: 8px; }
.ticket-text { white-space: pre-wrap; margin: 0 0 6px; }
.ticket-thread { display: grid; gap: 8px; margin-bottom: 12px; }
.ticket-msg { padding: 10px 12px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--line); }
.ticket-msg.admin { background: var(--blue-soft); border-color: transparent; }
.ticket-msg small { margin-left: 8px; color: var(--muted); }
.ticket-msg p { margin: 4px 0 0; white-space: pre-wrap; }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: calc(11px + var(--font-plus)); text-align: center; }
.blue-text { color: var(--brand); }
.link-button { background: none; border: 0; padding: 0; margin-top: 6px; cursor: pointer; text-decoration: underline; color: var(--muted); font: inherit; font-size: calc(13px + var(--font-plus)); }

/* Voice requests */
.mic-button.recording { color: #fff; background: var(--danger); border-radius: 50%; animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 78, 83, .45); } 50% { box-shadow: 0 0 0 8px rgba(192, 78, 83, 0); } }
@media (prefers-reduced-motion: reduce) { .mic-button.recording { animation: none; } }

/* Stage 25: progress of a request */
.progress-box { min-width: min(420px, 100%); }
.progress-track { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 4px; max-width: 420px; }
.progress-fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

/* Charts of grouped reports */
.report-chart { margin: 10px 0; }
.report-chart summary { cursor: pointer; color: var(--muted); font-size: calc(13px + var(--font-plus)); display: flex; gap: 6px; align-items: center; }
.chart-wrap { padding-top: 8px; }
.report-bars { display: grid; gap: 10px; max-width: 920px; margin-bottom: 8px; }
.report-bar { display: grid; grid-template-columns: minmax(140px, 32%) 1fr minmax(96px, auto); gap: 14px; align-items: center; font-size: calc(14px + var(--font-plus)); line-height: 1.3; }
.report-bar-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-track { height: 20px; border-radius: 6px; background: var(--surface-alt); overflow: hidden; }
.report-bar-fill { display: block; height: 100%; min-width: 3px; border-radius: 6px; background: var(--brand); transition: width .4s ease; }
.report-bar.neg .report-bar-fill { background: var(--danger); }
.report-bar-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .report-bar { grid-template-columns: 1fr auto; gap: 4px 10px; font-size: calc(13px + var(--font-plus)); }
  .report-bar-track { grid-column: 1 / -1; grid-row: 2; height: 14px; }
}
.bar-chart { width: 100%; max-width: 760px; min-width: 420px; font-size: calc(12px + var(--font-plus)); }
.bar-chart .bar { fill: var(--brand); }
.bar-chart .bar.neg { fill: var(--danger); }
.bar-chart .bar-label { fill: var(--text); }
.bar-chart .bar-value { fill: var(--muted); }

/* Stage 23: tariffs */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 14px; }
[data-ai-usage] [hidden] { display: none !important; }
[data-ai-usage] .form-grid { align-items: end; }
[data-ai-usage] .table-wrap { margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; }
[data-ai-usage] .table-wrap > p { padding: 12px; margin: 0; color: var(--muted); }
[data-ai-usage] .data-table td:first-child { white-space: normal; min-width: 180px; max-width: 320px; overflow-wrap: anywhere; }
[data-ai-usage] details { margin-top: 20px; }
[data-ai-usage] summary { cursor: pointer; font-weight: 700; }
.plan-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan-checks .check-row span, .check-row span { display: flex; flex-direction: column; }
.plan-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.plan-limit { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); overflow: hidden; }
.plan-limit span { color: var(--muted); font-size: calc(13px + var(--font-plus)); }
.plan-limit strong { font-size: calc(20px + var(--font-plus)); font-variant-numeric: tabular-nums; }
.plan-limit strong small { font-size: calc(12px + var(--font-plus)); font-weight: 400; color: var(--muted); }
.plan-limit i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--brand); }
.plan-limit.full i { background: var(--danger); }
.plan-limit.full strong { color: var(--danger); }
.plan-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; margin-top: 12px; }
.plan-feature { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.plan-feature > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.plan-feature small { color: var(--muted); font-size: calc(12px + var(--font-plus)); line-height: 1.35; }
.plan-feature > svg { flex: none; margin-top: 2px; }
.plan-feature.on > svg { color: var(--success, #2f9e6b); }
.plan-feature.off { opacity: .85; background: var(--surface-alt); }
.plan-feature.off > svg { color: var(--muted); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; }
.plan-card:not(.surface) { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: calc(13px + var(--font-plus)); line-height: 1.5; flex: 1; }
.plan-card.archived { opacity: .6; }
.plan-card .button { align-self: flex-start; }

/* Stage 24.1: dashboards */
.dash-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dash-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.dash-tab svg { width: 15px; height: 15px; }
.dash-tab.selected { background: var(--brand); border-color: var(--brand); color: #fff; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-head h2 { margin: 0 0 2px; }
.dash-phrase { display: flex; gap: 8px; margin-bottom: 16px; }
.dash-phrase input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.dash-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dash-card header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dash-card h3 { margin: 0 0 2px; font-size: calc(15px + var(--font-plus)); }
.dash-card-tools { display: flex; gap: 4px; align-items: center; flex: none; }
.dash-kind { font: inherit; font-size: calc(12px + var(--font-plus)); padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.dash-body { min-width: 0; }
.dash-number strong { display: block; font-size: calc(32px + var(--font-plus)); line-height: 1.15; font-variant-numeric: tabular-nums; }
.dash-number span { color: var(--muted); font-size: calc(13px + var(--font-plus)); }
.dash-table { overflow-x: auto; max-height: 320px; }
.dash-line { width: 100%; height: auto; display: block; }
.dash-line polyline { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; }
.dash-line circle { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.dash-line line { stroke: var(--line); stroke-width: 1; }
.line-with-scale { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem; }
.line-scale { display: flex; flex-direction: column; justify-content: space-between; padding: 1% 0; color: var(--muted); font-size: .78rem; }
.report-bar-track { position: relative; }
.report-bar-track .bar-zero { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--muted); }
.dash-line-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: calc(12px + var(--font-plus)); margin: 2px 0 4px; }
.report-bar.funnel .report-bar-fill { border-radius: 4px; }
.dash-skeleton { height: 64px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-alt), var(--line), var(--surface-alt)); background-size: 200% 100%; animation: dash-shimmer 1.4s linear infinite; }
@keyframes dash-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .dash-skeleton { animation: none; } }
.dash-draft-items { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.dash-draft-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.dash-draft-item.pending { border-style: dashed; }
.dash-draft-item .form-grid input, .dash-draft-item .form-grid select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.dash-draft-top { display: flex; gap: 8px; align-items: center; }
.dash-preview { padding: 10px; border-radius: 10px; background: var(--surface-alt); max-height: 260px; overflow: auto; }
.button-row.center { justify-content: center; }
@media (max-width: 640px) { .dash-phrase { flex-direction: column; } .dash-number strong { font-size: calc(26px + var(--font-plus)); } }
.dash-draft textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.dash-kind { max-width: 104px; }

/* Stage 24.2: automatic actions */
.auto-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.auto-card { display: flex; flex-direction: column; gap: 10px; }
.auto-card.off { opacity: .75; }
.auto-head, .auto-summary { display: flex; gap: 12px; align-items: flex-start; }
.auto-head h3 { margin: 0 0 4px; }
.auto-grow { flex: 1; min-width: 0; }
.auto-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-alt); color: var(--brand); }
.auto-last { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.auto-mode { font: inherit; font-size: calc(13px + var(--font-plus)); padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.auto-proposal { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.auto-proposal input, #auto-draft textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.auto-trial { padding: 12px; border-radius: 12px; background: var(--surface-alt); display: flex; flex-direction: column; gap: 6px; }
.auto-output:empty { display: none; }

/* Stage 27.1: AI caution — visible, calm */
.ai-caution { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--warning-text, #8a5a00); }
.ai-caution svg { flex: none; margin-top: 2px; }
p.ai-caution { display: flex; margin: 12px 0 0; }
.report-notes li.ai-caution-note { list-style: none; margin-left: -18px; padding: 8px 10px; border-radius: 10px; background: rgba(214, 158, 46, .12); color: var(--text); }
.usage-total { text-align: right; } .usage-total strong { display: block; font-size: calc(28px + var(--font-plus)); color: var(--brand); } .usage-total span { color: var(--muted); font-size: calc(12px + var(--font-plus)); }
.usage-bar { height: 4px; border-radius: 4px; background: var(--line); margin-top: 4px; overflow: hidden; max-width: 140px; }
.usage-bar i { display: block; height: 100%; width: var(--w); background: var(--success, #2f9e6b); }
.usage-table td { white-space: nowrap; }
.spend-wrap { max-height: 470px; overflow: auto; }
[data-ai-usage] [data-usage-table] { max-height: 280px; overflow: auto; }
.spend-table th { white-space: normal; vertical-align: bottom; }
.spend-table th.num, .spend-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.spend-table th small { display: block; margin-top: 2px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.spend-table td { white-space: nowrap; }
.spend-table td:first-child { white-space: normal; min-width: 150px; }
.spend-table td:nth-child(3) { min-width: 150px; }
.spend-table .usage-bar { max-width: 120px; margin-top: 5px; }
.spend-split { font-variant-numeric: tabular-nums; }
.spend-note { margin-top: 10px; }

/* UX: activity bar, busy buttons, gentle entrances (all respect reduced motion) */
.activity-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .2s; overflow: hidden; }
.activity-bar.on { opacity: 1; }
.activity-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: activity-run 1.1s ease-in-out infinite; }
@keyframes activity-run { to { left: 100%; } }
.button.is-busy, button.is-busy { position: relative; cursor: progress; }
.button.is-busy > svg:first-child, button.is-busy > svg:first-child { visibility: hidden; }
.button.is-busy::before, button.is-busy:not(.icon-button)::before { content: ""; position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; margin-top: -8px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.icon-button.is-busy > svg { animation: spin .9s linear infinite; visibility: visible; }
@keyframes spin { to { transform: rotate(360deg); } }
.invoice-operation:not([hidden]) { display:flex; align-items:center; gap:.65rem; font-weight:600; }
.invoice-operation::before { content:""; width:1em; height:1em; flex:none; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin 1s linear infinite; }
@media (prefers-reduced-motion:reduce) { .invoice-operation::before { animation:none; } }
.loading-rows { display: flex; flex-direction: column; gap: 10px; }
.loading-rows > i { display: block; height: 54px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-alt), var(--line), var(--surface-alt)); background-size: 200% 100%; animation: dash-shimmer 1.4s linear infinite; }
.loading-rows > i:nth-child(2) { opacity: .8; } .loading-rows > i:nth-child(3) { opacity: .6; }
.loading-caption { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: calc(13px + var(--font-plus)); }
.loading-caption::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); border-right-color: transparent; animation: spin .7s linear infinite; }
.pop-in { animation: pop-in .35s ease-out both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.example-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.example-chips button { font: inherit; font-size: calc(12.5px + var(--font-plus)); padding: 6px 10px; border-radius: 999px; border: 1px dashed var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.example-chips button:hover { border-color: var(--brand); color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .activity-bar::before, .button.is-busy::before, button.is-busy::before, .icon-button.is-busy > svg, .loading-rows > i, .loading-caption::before, .pop-in { animation: none; }
}
.button.is-busy:not(:has(> svg:first-child)) { padding-left: 38px; }

/* Updates on the fly: a quiet offer to refresh the page */
.update-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(10, 30, 60, .18); font-size: calc(14px + var(--font-plus)); }
.update-bar { animation: update-in .3s ease-out both; }
@keyframes update-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .update-bar { animation: none; } }

/* Chat mode: «Только чтение» / «Чтение и запись» */
.access-toggle { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); gap: 2px; }
.access-toggle button { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: calc(12px + var(--font-plus)); padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.access-toggle button svg { width: 13px; height: 13px; }
.access-toggle button.selected { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(10, 30, 60, .12); }
.access-toggle.writing button.selected { background: #fff4e0; color: #8a5a00; }
[data-theme="dark"] .access-toggle.writing button.selected { background: rgba(214, 158, 46, .18); color: #f2c46d; }
.access-toggle button:disabled { cursor: progress; opacity: .7; }
@media (max-width: 650px) { .composer-top { flex-wrap:wrap; } }

/* Smooth progress: creeping fill with moving stripes, percent and changing activity line */
.progress-line { display: flex; align-items: center; gap: 10px; max-width: 470px; }
.progress-line .progress-track { flex: 1; height: 6px; margin: 6px 0 4px; }
.progress-fill { transition: none; background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%); background-size: 14px 14px; animation: progress-stripes .8s linear infinite; box-shadow: 0 0 8px rgba(11, 92, 173, .35); }
@keyframes progress-stripes { to { background-position: 14px 0; } }
.progress-percent { font-size: calc(12px + var(--font-plus)); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 34px; text-align: right; }
.progress-activity { display: block; font-size: calc(12.5px + var(--font-plus)); }
.progress-activity.swap { animation: activity-swap .4s ease-out; }
@keyframes activity-swap { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .progress-fill { animation: none; transition: width .6s ease; } .progress-activity.swap { animation: none; } }

/* Stage 22.2: другой период, «что ещё спросить», поделиться ссылкой, страница отчёта по ссылке */
.hint-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line, hsl(calc(var(--accent-h) + 8) calc(30.0% * var(--accent-s)) 88.2%)); }
.hint-row > span { display: inline-flex; align-items: center; gap: 5px; margin-right: 2px; }
.hint-chip { animation: pop-in .25s ease both; }
.hint-chip:nth-child(3) { animation-delay: .05s; } .hint-chip:nth-child(4) { animation-delay: .1s; }
.repeat-periods, .share-days { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.share-days .task-chip.active { background: var(--brand, hsl(calc(var(--accent-h) + 5) calc(88.0% * var(--accent-s)) 36.1%)); color: #fff; border-color: transparent; }
.share-result { display: flex; gap: 8px; margin: 12px 0; }
.share-result input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line, hsl(calc(var(--accent-h) + 8) calc(30.0% * var(--accent-s)) 88.2%)); border-radius: 10px; background: var(--surface-2, hsl(calc(var(--accent-h) + 15) calc(37.5% * var(--accent-s)) 96.9%)); color: inherit; }
.share-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line, hsl(calc(var(--accent-h) + 10) calc(27.3% * var(--accent-s)) 91.4%)); }
.share-list:empty { display: none; }
.shared-report { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.shared-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-weight: 600; color: var(--muted, hsl(calc(var(--accent-h) + 10) calc(17.6% * var(--accent-s)) 43.3%)); }
.shared-title { font-size: 1.35rem; margin: 0 0 6px; }
.shared-table { max-height: none; overflow-x: auto; }
.shared-gone { text-align: center; padding: 40px 20px; }
@media (max-width: 640px) { .share-result { flex-direction: column; } .shared-title { font-size: 1.15rem; } }

/* Stage 22.3: роль сотрудника и «только свои клиенты» */
.member-work { margin: -4px 0 14px 52px; }
.member-work > summary { cursor: pointer; color: var(--muted, hsl(calc(var(--accent-h) + 10) calc(17.6% * var(--accent-s)) 43.3%)); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.member-work[open] > summary { margin-bottom: 10px; }
@media (max-width: 640px) { .member-work { margin-left: 0; } }
.check-row > input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; }

/* Stage 24.3: автодействия по событию */
.auto-icon.live { background: var(--green-soft, #e3f6ea); color: var(--green, #1c8a4a); }
.auto-live { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22a55a; box-shadow: 0 0 0 0 rgba(34,165,90,.5); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,165,90,.45); } 70% { box-shadow: 0 0 0 8px rgba(34,165,90,0); } 100% { box-shadow: 0 0 0 0 rgba(34,165,90,0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.member-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 8px 0; }
.approvals-bar { margin: 0 0 8px; }
.approvals-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid #e8b04a; background: #fff6e2; color: #7a4b00; font: inherit; font-size: .88rem; cursor: pointer; animation: pop-in .3s ease both; }
[data-theme="dark"] .approvals-pill { background: #3a2a0a; color: #ffd27a; border-color: #8a6420; }

/* Stage 28: own reports — the dialog with the AI */
.builder-log { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; margin-bottom: 12px; }
.builder-log:empty { display: none; }
.builder-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.builder-msg p { margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--surface-alt); white-space: pre-wrap; }
.builder-msg.me { align-self: flex-end; }
.builder-msg.me p { background: var(--brand); color: #fff; }
.builder-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-alt); color: var(--brand); }
.builder-options { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 38px; }
.builder-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.builder-file { cursor: pointer; max-width: 100%; }
.builder-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.builder-result { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.builder-result input:not([type=checkbox]) { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.parser-explain summary { cursor: pointer; color: var(--muted); font-size: calc(13px + var(--font-plus)); }
.parser-explain ul { margin: 6px 0 0; }

/* Work-in-progress indicators keep moving even with «reduce motion» in the system. Windows Server (and many office
   PCs set for performance) turn animations off, the browser then reports prefers-reduced-motion and every spinner,
   progress stripe and «думаю» dots stood still — the page looked frozen while a request was running. Small, calm
   status indicators are not the motion this setting protects from; entrances, floats and pop-ins stay off. */
@media (prefers-reduced-motion: reduce) {
  .activity-bar::before { animation: activity-run 1.6s ease-in-out infinite !important; }
  .button.is-busy::before, button.is-busy:not(.icon-button)::before, .loading-caption::before { animation: spin 1s linear infinite !important; }
  .icon-button.is-busy > svg, .web-loading > svg { animation: spin 1.2s linear infinite !important; }
  .loading-rows > i, .dash-skeleton { animation: dash-shimmer 2s linear infinite !important; }
  .skeleton::after { animation: shimmer 2.2s infinite !important; }
  .progress-fill { animation: progress-stripes 1.2s linear infinite !important; transition: width .6s ease !important; }
  .typing-dots i { animation: pulse 1.2s infinite !important; }
  .typing-dots i:nth-child(2) { animation-delay: .2s !important; }
  .typing-dots i:nth-child(3) { animation-delay: .4s !important; }
  .ai-step.running .ai-step-mark { animation: ai-pulse 1.6s ease-in-out infinite !important; }
  .live-dot { animation: live-pulse 2.4s infinite !important; }
  .mic-button.recording { animation: mic-pulse 1.4s ease-in-out infinite !important; }
  .progress-activity.swap { animation: activity-swap .4s ease-out !important; }
}

/* Big requests in parts: the table grows while the rest is read; new rows light up for a moment */
.progress-partial:empty { display: none; }
.partial-card { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
.partial-head { margin: 0 0 6px; font-size: calc(13px + var(--font-plus)); }
.partial-card .report-table-wrap { max-height: 260px; overflow: auto; }
.partial-card tr.row-new td { animation: row-new 1.6s ease-out; }
@keyframes row-new { from { background: rgba(11, 92, 173, .16); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .partial-card tr.row-new td { animation: row-new 1.6s ease-out !important; } }

/* Test cabinets («песочница») and working cabinets of clients — always visible which is which */
.sandbox-badge { font-size: calc(11px + var(--font-plus)); vertical-align: middle; }
.sandbox-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; margin: 0 0 14px; border-radius: 14px;
  background: #fff6e2; border: 1px solid #e8b04a; color: #5c3d00; font-size: calc(20px + var(--font-plus)); }
.sandbox-banner strong { display: block; font-size: calc(14px + var(--font-plus)); } .sandbox-banner p { margin: 2px 0 0; font-size: calc(13px + var(--font-plus)); }
.sandbox-banner.production { background: var(--surface-alt); border-color: var(--line); color: var(--text); }
[data-theme="dark"] .sandbox-banner:not(.production) { background: rgba(214, 158, 46, .14); color: #f2c46d; }

/* Logout always reachable: the platform menu has ten items, on a short window the bottom of the sidebar (profile and
   «Выйти») was cut off by the fixed sidebar. The sidebar scrolls and gets compact; «Выйти» is also in the top bar. */
.admin-sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ffffff22 transparent; }
@media (max-height: 960px) and (min-width: 801px) {
  .admin-sidebar { padding-top: 20px; }
  .admin-sidebar .workspace-switch { margin: 18px 0 16px; padding: 9px; }
  .admin-sidebar .nav-item { min-height: 36px; padding: 7px 12px; margin: 2px 0; }
  .admin-sidebar .sidebar-tip { display: none; }
  .admin-sidebar .profile { margin-top: 12px; padding-top: 12px; }
}
.topbar .logout-button { color: var(--muted); }
.topbar .logout-button:hover { color: var(--danger, #c0392b); }
.danger-zone { margin-top: 18px; border-color: color-mix(in srgb, var(--danger, #c0392b) 35%, var(--line)); }
.danger-zone h2 { color: var(--danger, #c0392b); }
.deleted-cabinets { margin-top: 18px; }
.deleted-row { align-items: center; gap: 12px; }
.deleted-row > span { min-width: 0; }
#delete-cabinet button[type="submit"] { background: var(--danger); border-color: var(--danger); }

/* Stage 31: «Остановить» */
.stop-button { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--danger); background: var(--surface); }
.stop-button:hover:not(:disabled) { background: var(--danger-bg); }
.stop-button span[aria-hidden] { font-size: calc(12px + var(--font-plus)); line-height: 1; }
.stop-row { margin-top: 10px; }
.button + .stop-button { margin-left: 8px; }
.stopped-note p { color: var(--muted); }

/* Stage 33: «Частые просьбы» */
.learn-filter { margin: 4px 0 16px; }
.learn-list { display: grid; gap: 14px; }
.learn-card.frequent { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.learn-head { display: flex; gap: 14px; align-items: flex-start; }
.learn-grow { flex: 1; min-width: 0; }
.learn-grow h3 { margin: 0 0 4px; font-size: calc(15px + var(--font-plus)); }
.learn-count { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 8px; border-radius: 10px; background: var(--blue-soft); }
.learn-count b { font-size: calc(20px + var(--font-plus)); line-height: 1.1; }
.learn-count small { font-size: calc(10px + var(--font-plus)); color: var(--muted); }
.learn-examples { margin: 10px 0 0 66px; padding: 0; list-style: none; display: grid; gap: 4px; }
.learn-examples li { font-size: calc(12px + var(--font-plus)); color: var(--muted); }
.learn-examples li::before { content: "«"; } .learn-examples li::after { content: "»"; }
.learn-preview { margin-top: 12px; display: grid; gap: 8px; }
.learn-answer { margin-top: 12px; display: grid; gap: 8px; }
.learn-answer-row { display: flex; gap: 8px; }
.learn-answer-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: inherit; }
@media (max-width: 640px) { .learn-examples { margin-left: 0; } .learn-head { flex-wrap: wrap; } }

/* Stage 36: templates with parameters, library */
.param-form { display: grid; gap: 10px; }
.library { margin-top: 18px; }
.library-list { display: grid; gap: 8px; }
.library-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.library-item strong { margin-right: 8px; }
.library-item p { margin: 4px 0 0; }
@media (max-width: 640px) { .library-item { flex-wrap: wrap; } }

/* ===== Appearance settings (06.10.2026): text size, accent, panel widths, chat width, explanations ===== */
:root { --font-plus: 2pt; --brand-strong: var(--brand); --chat-width: 900px; --accent-h: 205; --accent-s: 1; }
/* The whole palette follows the accent: every blue tone of the design is hsl(var(--accent-h) …) (06.10.2026). */
:root[data-accent="teal"] { --accent-h: 176; }
:root[data-accent="green"] { --accent-h: 135; --accent-s: .85; }
:root[data-accent="violet"] { --accent-h: 262; }
:root[data-accent="orange"] { --accent-h: 24; --accent-s: 1.05; }
:root[data-accent="rose"] { --accent-h: 340; --accent-s: .95; }
:root[data-accent="graphite"] { --accent-h: 212; --accent-s: .22; }
:root[data-theme="dark"] { --brand-strong: hsl(var(--accent-h) calc(91.2% * var(--accent-s)) 31.4%); }
:root[data-font="0"] { --font-plus: 0pt; }
:root[data-font="2"] { --font-plus: 2pt; }
:root[data-font="4"] { --font-plus: 4pt; }
:root[data-font="6"] { --font-plus: 6pt; }

/* Panel widths: dragged by the edge, remembered per browser. Off-canvas menus on phones keep their size. */
@media (min-width: 801px) {
  .admin-sidebar { width: var(--sidebar-w, 228px); }
  .admin-workspace { margin-left: var(--sidebar-w, 228px); }
  .chat-sidebar { width: var(--chats-w, 258px); position: relative; }
  :root.chats-hidden .chat-sidebar { display: none; }
}
@media (min-width: 801px) and (max-width: 1220px) {
  .admin-sidebar { width: var(--sidebar-w, 204px); }
  .admin-workspace { margin-left: var(--sidebar-w, 204px); }
  .chat-sidebar { width: var(--chats-w, 235px); }
}
.panel-resizer { position: absolute; top: 0; right: -4px; bottom: 0; width: 8px; cursor: col-resize; z-index: 30; border: 0; padding: 0; background: transparent; touch-action: none; }
.panel-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.panel-resizer:hover::after, .panel-resizer:focus-visible::after, .panel-resizer.dragging::after { background: var(--focus); }
.panel-resizer:focus-visible { outline: none; }
:root.resizing, :root.resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 800px) { .panel-resizer, .panel-hint, .chats-reveal { display: none !important; } }
.panel-hint { position: fixed; z-index: 60; max-width: 260px; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--rail); color: hsl(calc(var(--accent-h) + 5) calc(44.4% * var(--accent-s)) 92.9%);
  box-shadow: 0 10px 30px #0003; font-size: calc(12px + var(--font-plus)); line-height: 1.45; display: flex; gap: 8px; align-items: flex-start; animation: pop-in .25s ease both; }
.panel-hint button { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font: inherit; padding: 0 2px; }
.panel-hint::before { content: ""; position: absolute; left: -6px; top: 18px; border: 6px solid transparent; border-left: 0; border-right-color: var(--rail); }
.chats-reveal { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 5; display: none; }
:root.chats-hidden .chats-reveal { display: inline-flex; }

/* Chat column width and density */
.messages { max-width: var(--chat-width); }
.composer-area { max-width: calc(var(--chat-width) + 180px); }
:root[data-chat-width="full"] .messages { max-width: none; }
:root[data-chat-width="full"] .composer-area { max-width: none; }
:root[data-density="compact"] .user-message { margin: 14px 0 16px; }
:root[data-density="compact"] .assistant-message { margin: 12px 0 18px; }
:root[data-density="compact"] .assistant-content > p, :root[data-density="compact"] .user-message p { line-height: 1.6; }

/* Explanations under an answer: folded by default, the summary says what is inside */
.report-explain summary { list-style: none; }
.report-explain summary::-webkit-details-marker { display: none; }
.report-explain summary::after { content: "Развернуть"; margin-left: auto; font-weight: 500; color: var(--brand); font-size: calc(11px + var(--font-plus)); }
.report-explain[open] summary::after { content: "Свернуть"; }

/* Settings dialog */
.ui-settings { display: grid; gap: 18px; }
.ui-settings fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.ui-settings legend { font-weight: 700; margin-bottom: 6px; font-size: calc(13px + var(--font-plus)); }
.ui-settings .hint { color: var(--muted); font-size: calc(11px + var(--font-plus)); margin: 0; }
.ui-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-seg button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 7px 13px; cursor: pointer; font: inherit; font-size: calc(12px + var(--font-plus)); }
.ui-seg button[aria-pressed="true"] { border-color: var(--brand); background: var(--blue-soft); color: var(--brand); font-weight: 700; }
.accent-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.accent-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.accent-swatches [data-value="blue"] { background: #075b99; } .accent-swatches [data-value="teal"] { background: #0f766e; }
.accent-swatches [data-value="green"] { background: #2f7d32; } .accent-swatches [data-value="violet"] { background: #6d4bc3; }
.accent-swatches [data-value="orange"] { background: #c2570c; } .accent-swatches [data-value="rose"] { background: #be2f5b; }
.accent-swatches [data-value="graphite"] { background: #3d4b5c; }
.ui-settings .range-row { display: flex; align-items: center; gap: 10px; }
.ui-settings .range-row input { flex: 1; accent-color: var(--brand); }
.ui-settings .range-row output { min-width: 56px; text-align: right; color: var(--muted); font-size: calc(12px + var(--font-plus)); }
.ui-preview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); background: var(--surface-alt); }
.ui-preview p { margin: 0; font-size: calc(12px + var(--font-plus)); line-height: 1.7; }

/* Composer: our buttons in a foldable tray, command suggestions while typing */
.composer-tray[hidden] { display: none; }
.composer-tray { border-bottom: 1px solid var(--line); padding: 6px 0 8px; max-height: 210px; overflow-y: auto; }
.composer-tray .tray-caption { display: block; padding: 6px 14px 0; font-size: calc(9px + var(--font-plus)); letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.composer-tray .tray-caption[hidden] { display: none; }
.composer-tray .template-chips { padding: 6px 14px 0; margin: 0; }
.composer-tray .task-chips { padding-top: 6px; }
.task-chips[hidden] { display: none; }
.tray-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px;
  height: 32px; padding: 0 11px; cursor: pointer; font: inherit; font-size: calc(11px + var(--font-plus)); }
.tray-toggle[aria-expanded="true"] { border-color: var(--brand); color: var(--brand); background: var(--blue-soft); }
.tray-toggle .chev { transition: transform .2s; display: inline-flex; }
.tray-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.selected-task { display: inline-flex; align-items: center; gap: 4px; margin: 8px 14px 0; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--brand);
  font-size: calc(11px + var(--font-plus)); font-weight: 600; }
.selected-task[hidden] { display: none; }
.selected-task button { border: 0; background: none; color: inherit; cursor: pointer; display: inline-flex; padding: 2px; }
/* P3-C2: «Авто / Команда / Свободно» — one message only. Same quiet pill language as the
   access toggle in the composer and the command chips, never a separate mode switcher. */
.override-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 14px 5px; min-height: 26px; }
.override-bar[hidden] { display: none; }
.override-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(8px + var(--font-plus)); line-height: 1.4; color: var(--muted); }
.override-caption-short { display: none; }
.override-options { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-alt); }
.override-options button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: calc(10px + var(--font-plus)); font-weight: 600; line-height: 1; min-height: 22px; padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.override-options button:hover:not(:disabled) { color: var(--text); }
.override-options button.selected { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(10, 30, 60, .12); }
.override-options button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.override-options button:disabled { cursor: default; opacity: .55; }
@media (max-width: 800px) {
  .override-bar { margin: 0 12px 4px; gap: 8px; }
  .override-caption-long { display: none; }
  .override-caption-short { display: inline; }
  .override-options button { font-size: calc(9px + var(--font-plus)); padding: 4px 8px; }
}
.composer form { position: relative; }
.command-suggest { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 34px hsl(calc(var(--accent-h) + 4) calc(59.5% * var(--accent-s)) 15.5% / 0.122); padding: 6px; display: grid; gap: 2px; }
.command-suggest[hidden] { display: none; }
.command-suggest .caption { padding: 4px 8px; font-size: calc(9px + var(--font-plus)); color: var(--muted); letter-spacing: .05em; font-weight: 700; display: flex; justify-content: space-between; }
.command-suggest button { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; color: var(--text); border-radius: 8px; padding: 7px 8px; cursor: pointer; font: inherit; }
.command-suggest button[aria-selected="true"], .command-suggest button:hover { background: var(--blue-soft); }
.command-suggest button span { display: grid; min-width: 0; }
.command-suggest strong { font-size: calc(12px + var(--font-plus)); }
.command-suggest small { font-size: calc(10px + var(--font-plus)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-suggest em { font-style: normal; font-size: calc(9px + var(--font-plus)); color: var(--muted); margin-left: auto; white-space: nowrap; }
.composer-top .desktop-only { display: none !important; }
.panel-resizer.fixed { position: fixed; right: auto; top: 0; bottom: 0; z-index: 26; }

/* User menu in the bottom-left corner: view settings, theme, cabinet, sign out (06.10.2026) */
.user-menu-wrap { position: relative; display: block !important; padding-top: 14px; }
.profile-button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  padding: 7px 8px; border-radius: 12px; cursor: pointer; }
.profile-button:hover, .profile-button[aria-expanded="true"] { background: hsl(var(--accent-h) calc(30% * var(--accent-s)) 50% / .12); }
.profile-button .profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-button strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-button .profile-chevron { flex-shrink: 0; opacity: .7; transform: rotate(180deg); transition: transform .2s; }
.profile-button[aria-expanded="true"] .profile-chevron { transform: none; }
.client-app .chat-sidebar .profile > .user-menu, .user-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 50; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px #0000002e; padding: 6px; display: grid; gap: 2px; animation: pop-in .18s ease both; min-width: 200px; }
.user-menu[hidden] { display: none !important; }
.user-menu > a, .user-menu > button { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; text-decoration: none;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: left; font-size: calc(12px + var(--font-plus)); }
.user-menu > button > span { display: inline-flex; align-items: center; gap: 10px; }
.user-menu > a:hover, .user-menu > button:hover, .user-menu > a:focus-visible, .user-menu > button:focus-visible { background: var(--blue-soft); outline: none; }
.user-menu > .danger { color: var(--danger); }
.user-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.user-menu [data-theme-toggle] .theme-dark { display: none; }
[data-theme="dark"] .user-menu [data-theme-toggle] .theme-dark { display: inline-flex; }
[data-theme="dark"] .user-menu [data-theme-toggle] .theme-light { display: none; }
.admin-sidebar .profile-button small { color: #ffffff99; }

/* Dashboards (06.10.2026): blocks like windows — width in twelfths, height in rows, maximize, drag the corner */
.dash-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(230px, auto); grid-auto-flow: row dense; }
.dash-card { position: relative; grid-column: span 4; grid-row: span 1; transition: box-shadow .15s; }
.dash-card[data-size^="w3"] { grid-column: span 3; } .dash-card[data-size^="w4"] { grid-column: span 4; }
.dash-card[data-size^="w6"] { grid-column: span 6; } .dash-card[data-size^="w8"] { grid-column: span 8; }
.dash-card[data-size^="w12"] { grid-column: 1 / -1; }
.dash-card[data-size$="h2"] { grid-row: span 2; } .dash-card[data-size$="h3"] { grid-row: span 3; }
.dash-card[data-size$="h2"] .dash-table, .dash-card[data-size$="h3"] .dash-table { max-height: none; }
.dash-card .dash-body { flex: 1; overflow: auto; }
.dash-card.resizing { box-shadow: 0 0 0 2px var(--focus); }
.dash-resize { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; opacity: .45;
  background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 58%, transparent 58%, transparent 70%, var(--muted) 70%, var(--muted) 78%, transparent 78%); }
.dash-card:hover .dash-resize, .dash-resize:hover { opacity: 1; }
.dash-card.maximized { position: fixed; inset: 16px; z-index: 70; grid-column: auto; overflow: auto; box-shadow: 0 30px 80px #0006; }
.dash-card.maximized .dash-table { max-height: none; }
.dash-card.maximized .dash-resize { display: none; }
:root.dash-max-open body::after { content: ""; position: fixed; inset: 0; background: #0008; z-index: 65; }
.dash-card header { flex-wrap: wrap; }
.dash-card header > div:first-child { flex: 1 1 140px; min-width: 0; }
.dash-card-tools { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.snap-menu { position: fixed; z-index: 80; width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px #0003; padding: 12px; display: grid; gap: 8px; animation: pop-in .16s ease both; }
.snap-menu strong { font-size: calc(11px + var(--font-plus)); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.snap-row { display: flex; gap: 6px; flex-wrap: wrap; }
.snap-tile { display: grid; justify-items: center; gap: 4px; width: 58px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); cursor: pointer; font: inherit; }
.snap-tile small { font-size: calc(9px + var(--font-plus)); line-height: 1.15; text-align: center; color: var(--muted); }
.snap-tile[aria-pressed="true"] { border-color: var(--brand); background: var(--blue-soft); }
.snap-tile:hover, .snap-tile:focus-visible { border-color: var(--brand); outline: none; }
.snap-shape { position: relative; width: 40px; height: 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-alt); display: block; }
.snap-shape i { position: absolute; left: 0; top: 0; background: var(--brand); border-radius: 3px; opacity: .8; }
.snap-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) { .dash-card, .dash-card[data-size] { grid-column: 1 / -1; } }

/* Answers: notes and follow-ups inside the card padding; the conclusion sentence by sentence */
.report-card > .report-notes { margin: 14px 20px 0; padding-left: 22px; gap: 6px; }
.report-card > .report-notes li { padding-left: 2px; }
.report-card > .report-notes li.ai-caution-note { margin-left: -22px; }
.report-card > .hint-row { padding: 10px 20px 14px; }
.report-card > .report-conclusion { margin: 12px 16px 4px; }
.report-conclusion p { max-width: 82ch; }
.report-conclusion p span { display: block; }
.report-conclusion p span + span { margin-top: 4px; }
.snap-kind { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.snap-kind .dash-kind { max-width: none; }
.empty-answer { border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 12px; background: var(--surface-alt); }
.empty-answer > p { margin: 0; display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; }
.empty-answer > p svg { flex: none; margin-top: 3px; color: var(--brand); }
.empty-answer .answer-text { min-width: 0; }

/* Агенты Osminog */
.agents-block { margin-top: 16px; }
.agent-row { align-items: center; gap: 12px; }
.agent-row > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.agent-row small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-install { margin-top: 16px; padding: 16px; border: 1px dashed var(--brand); border-radius: 14px; background: var(--blue-soft); display: grid; gap: 10px; }
.agent-install h3 { margin: 0; }
.agent-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: calc(18px + var(--font-plus)); letter-spacing: .08em; }
.agent-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.agent-cmd { display: grid; gap: 6px; }
.agent-cmd pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto;
  white-space: pre-wrap; word-break: break-all; font-size: calc(12px + var(--font-plus)); }
.agent-cmd .button { justify-self: start; }
/* Плагин 1С агента: базы на сервере (08.10.2026) */
.agent-card { display: grid; gap: 6px; }
.agent-bases { display: grid; gap: 6px; margin-left: 18px; padding: 8px 0 4px 14px; border-left: 2px solid var(--line); }
.agent-base { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.agent-base > span:nth-child(2) { flex: 1; min-width: 220px; display: grid; }
.agent-base small { color: var(--muted); }
.agent-base small.danger-text { color: var(--danger, #c0392b); }
.agent-credentials { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.agent-credentials label { display: grid; gap: 2px; min-width: 160px; }
.agent-credentials input { padding: 6px 8px; }
.agent-credentials small[role="status"] { flex-basis: 100%; }
.agent-credentials small.danger-text { color: var(--danger, #c0392b); }
.badge.muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
@media (max-width: 700px) { .agent-bases { margin-left: 4px; padding-left: 10px; } }
/* Primary documents: corrections remain readable on a phone. */
.invoice-review-dialog { width: min(1000px, calc(100vw - 24px)); max-height: 92dvh; overflow: auto; }
.invoice-review-form { padding: 20px; }
.invoice-review-form .web-alert { white-space: pre-line; }
.invoice-inn-field input[aria-invalid=true] { border-color:var(--danger, #b54740); }
.invoice-inn-field > small, .invoice-inn-picker small { display:block; margin:4px 0; }
.invoice-inn-field > small[hidden], .invoice-inn-status[hidden], .invoice-inn-picker[hidden] { display:none; }
.invoice-inn-picker { margin-top:6px; }
.invoice-inn-picker summary { cursor:pointer; color:var(--accent); }
.invoice-inn-choices { display:grid; gap:4px; }
.crm-transfer-rows { display:grid; gap:6px; max-height: min(48vh, 28rem); overflow:auto; }
.crm-transfer-rows label, .invoice-review-form label.check-line { display:flex; align-items:center; gap:.6rem; }
.invoice-review-form label.check-line input[type="checkbox"] { width:auto; flex:none; }
.invoice-review-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invoice-review-heading h2 { margin: 0; }
.invoice-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.invoice-review-line { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 10px; padding: 12px; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; }
.invoice-review-line input, .invoice-review-line select { min-width: 0; width: 100%; }
.invoice-review-original-units { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.invoice-ocr-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
@media (max-width: 650px) { .invoice-review-grid { grid-template-columns: 1fr; } .invoice-review-line { grid-template-columns: 1fr 1fr; } .invoice-review-line > :first-child { grid-column: 1 / -1; } }

/* Admin account creation and credential handoff */
#create-user, #user-credentials { width: min(620px, calc(100vw - 24px)); }
#create-user [hidden], #user-credentials [hidden] { display: none !important; }
.password-generator { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.password-generator legend { font-weight: 600; padding: 0 6px; }
.password-length { display: block; color: var(--text); }
.password-length output { font-weight: 700; font-variant-numeric: tabular-nums; }
.password-length input { display: block; width: 100%; margin: 14px 0; accent-color: var(--brand); }
.password-options { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.password-options label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; }
.password-options input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; padding: 0; margin: 0; accent-color: var(--brand); }
.password-generator .field input { font-family: monospace; }
.password-generator > small { display: block; margin-top: 12px; }
.credential-preview { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); padding: 18px; line-height: 1.9; margin: 12px 0 18px; overflow-wrap: anywhere; }
.credential-preview code { white-space: pre-wrap; user-select: all; }
#user-credentials .check-row { align-items: flex-start; font-size: 13px; line-height: 1.5; }
#user-credentials textarea { min-height: 105px; white-space: pre-wrap; }
.user-row .button-row { flex-wrap: wrap; }
.plan-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.plan-link svg { color: var(--muted); }
.plan-link:hover svg { color: var(--brand, var(--blue)); }
@media (min-width: 1151px) {
  .user-row > .button-row { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; max-width: none; }
  .user-row > .button-row .button { width: 100%; justify-content: flex-start; white-space: nowrap; }
}
@media (max-width: 600px) { #create-user, #user-credentials { width: 100%; } }

.answer-artifacts { margin: .65rem 0; max-width: 100%; min-width: 0; }
.compact-answer { display: grid; min-width: 0; gap: .35rem; }
.compact-answer .answer-text { margin: .3rem 0; white-space: pre-line; overflow-wrap: anywhere; }
.compact-answer .question-options { margin: .25rem 0; }
.answer-details summary, .chart-source summary { width: fit-content; cursor: pointer; color: var(--brand); font-size: .85rem; }
.answer-details[open] .button-row { margin-top: .5rem; }
.chart-source, .report-card .chart-primary { margin: .8rem 1rem; }
.chart-primary figcaption { font-size: .95rem; font-weight: 600; margin-bottom: .35rem; }
.chart-source .report-table-wrap { margin-top: .5rem; }
.answer-artifacts summary { cursor: pointer; font-size: .9rem; font-weight: 600; }
.artifact-list, .artifact-card { display: grid; gap: .4rem; min-width: 0; }
.artifact-card { margin: 0 0 .55rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .65rem; }
.artifact-card strong, .artifact-card small { overflow-wrap: anywhere; }
.artifact-card .link-button { justify-self: start; }
.artifact-card progress { max-width: 100%; }
.artifact-card .button-row, .artifact-picker { display: flex; flex-wrap: wrap; gap: .45rem .85rem; align-items: center; }
.artifact-picker { margin: .6rem 0; }
.artifact-picker label { display: inline-flex; align-items: center; gap: .3rem; }
.artifact-thumb { max-width: min(100%, 22rem); max-height: 16rem; object-fit: contain; }
.artifact-preview { width: min(90vw, 50rem); max-height: 85vh; overflow: auto; overflow-wrap: anywhere; }
.artifact-preview img { display: block; max-width: 100%; max-height: 63vh; object-fit: contain; margin: .7rem auto; }
.artifact-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.artifact-failure { font-weight: 600; }
.answer-feedback { margin-block: .75rem .3rem; }
.answer-feedback .button-row { align-items: center; flex-wrap: wrap; gap: .45rem; }
.answer-feedback .button-row + .button-row { margin-top: .4rem; }
[data-knowledge-review] { display: grid; gap: 1rem; }
[data-knowledge-review] summary { cursor: pointer; }
.tray-toggle[hidden] { display: none !important; }
[data-servers-section] .connection-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%, 430px),1fr)); align-items:start; }
[data-servers-section] .server-card { min-width:0; }
[data-servers-section] .server-card { padding: 12px 14px; }
[data-servers-section] .server-card .source-setting { position: relative; padding-right: 32px; grid-template-columns:minmax(0,1fr); gap: 4px; overflow-wrap:anywhere; }
[data-servers-section] .server-card h3 { margin: 0; font-size: calc(13px + var(--font-plus)); }
[data-servers-section] .server-card h3 + p { margin: 0; font-size: calc(11px + var(--font-plus)); }
[data-servers-section] .server-card .ai-node-fold > summary { position: absolute; top: 0; right: 0; width: 30px; height: 30px; margin: 0; padding: 0; border: 0; justify-content: center; }
[data-servers-section] .server-card .ai-node-fold > summary span { display: none; }
[data-servers-section] .server-card .source-setting > div:first-child { flex-wrap:wrap; justify-content:flex-start; }
[data-servers-section] .server-card .source-setting > * { min-width:0; }
[data-servers-section] .server-card .source-setting small { display:block; }
[data-servers-section] .server-card .button { max-width:100%; white-space:normal; }
.server-account,.server-ai-defaults { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; overflow-wrap:anywhere; }
.server-account summary,.server-ai-defaults summary { cursor:pointer; }
.server-account [data-account-routing] fieldset { min-width:0; border:0; margin:0; padding:0; }
.server-account [data-account-routing] .routing-check { display:flex; gap:8px; align-items:center; }
.server-account [data-account-routing] input[type=checkbox] { width:18px; min-height:0; height:18px; }
.server-account [data-account-routing] .routing-actions { display:flex; gap:8px; flex-wrap:wrap; }
.server-card [data-server-defaults] { margin-top:.75rem; }

/* P2 (11.11.2026): read-only write diagnostics on the health panel. */
.write-diag { display: grid; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); min-width: 0; }
.write-diag > *, .write-diag-cleanup > * { min-width: 0; }
.write-diag-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; min-width: 0; }
.write-diag-head > * { min-width: 0; }
.write-diag-head h2 { margin: 0; }
.write-diag-head p { margin: 4px 0 0; max-width: 72ch; }
.write-diag-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.write-diag-actions .button { white-space: nowrap; }
.write-diag-status { margin: 0; text-align: right; }
.write-diag-status:empty { display: none; }
.write-diag-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 0 0; }
.write-diag-stats span { min-height: 2.9em; margin-bottom: 6px; }
.write-diag-stats strong { font-size: calc(20px + var(--font-plus)); }
.write-diag-stats strong small { margin-left: .35em; }
.write-diag .dialog-subheading { margin: 26px 0 8px; }
.write-diag-cleanup { display: grid; gap: 10px; margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.write-diag-subtitle { margin: 0; font-size: calc(13px + var(--font-plus)); }
.write-diag-cleanup .dialog-subheading { margin: 14px 0 0; }
.write-diag-badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.write-diag-rule small { margin-left: .5em; }
@media (max-width: 1000px) {
  .write-diag-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .write-diag-head { flex-direction: column; align-items: stretch; }
  .write-diag-actions { align-items: stretch; }
  .write-diag-actions .button { width: 100%; justify-content: center; }
  .write-diag-status { text-align: left; }
  .write-diag-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .write-diag-cleanup { padding: 12px; }
  .write-diag .data-table { min-width: 0; }
  .write-diag .data-table th, .write-diag .data-table td { white-space: normal; }
  .write-diag .data-table th:last-child, .write-diag .data-table td:last-child { white-space: nowrap; width: 1%; text-align: right; }
  .write-diag .data-table th:first-child, .write-diag .data-table td:first-child { padding-right: 6px; }
  .write-diag .data-table th, .write-diag .data-table td { padding: 7px 6px; }
  .write-diag-rule small { display: block; margin-left: 0; }
}

/* P5a (19.11.2026): per-connection permissions replace the retired engine selector. */
.permission-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.permissions-form { gap: 16px; }
.permissions-intro { margin: -2px 0 0; color: var(--muted); font-size: calc(12px + var(--font-plus)); line-height: 1.65; }
.permissions-status { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.permissions-status-dot { width: 9px; height: 9px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px var(--surface); }
.permissions-status[data-state="read"] .permissions-status-dot { background: var(--success); }
.permissions-status[data-state="write"] .permissions-status-dot { background: var(--warning); }
.permissions-status-copy { display: grid; gap: 3px; min-width: 0; }
.permissions-status-copy strong { font-size: calc(13px + var(--font-plus)); line-height: 1.4; }
.permissions-status-copy small { color: var(--muted); font-size: calc(11px + var(--font-plus)); line-height: 1.55; }
.permissions-group { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.permissions-group > legend { padding: 0; margin: 2px 0 0; color: var(--muted); font-size: calc(10px + var(--font-plus)); font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.permissions-group.is-disabled { opacity: .58; }
.permissions-detail-note { margin: -4px 0 2px; color: var(--muted); font-size: calc(10px + var(--font-plus)); line-height: 1.5; }
.permission-option { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.permission-option:hover { border-color: var(--focus); }
.permission-option:has(input:checked) { border-color: var(--brand); background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--brand); }
.permission-option.is-disabled { cursor: not-allowed; background: var(--surface-alt); border-style: dashed; }
.permission-option.is-disabled:hover { border-color: var(--line); }
.permission-option input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--brand); }
.permission-option input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.permission-copy { display: grid; gap: 4px; min-width: 0; }
.permission-title { font-size: calc(13px + var(--font-plus)); font-weight: 700; line-height: 1.35; }
.permission-hint, .permission-warning { font-size: calc(11px + var(--font-plus)); line-height: 1.55; overflow-wrap: anywhere; }
.permission-hint { color: var(--muted); }
.permission-warning { margin-top: 2px; padding: 9px 11px; border-radius: 9px; background: var(--warning-bg); color: var(--warning); font-weight: 600; }
.permission-warning[hidden] { display: none; }
.permissions-legend { margin: 0; color: var(--muted); font-size: calc(11px + var(--font-plus)); line-height: 1.7; }
.permissions-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.permissions-actions small { max-width: 34ch; color: var(--muted); font-size: calc(10px + var(--font-plus)); line-height: 1.5; }
@media (max-width: 640px) {
  .permissions-actions { flex-direction: column; align-items: stretch; }
  .permissions-actions small { max-width: none; text-align: center; }
  .permissions-actions .button { width: 100%; justify-content: center; }
  .permission-option { padding: 12px 13px; }
  .permissions-status { padding: 12px 13px; }
}
