@font-face {
  font-family: Golos;
  src: url("/golos-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Golos;
  src: url("/golos-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: Golos;
  src: url("/golos-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: Golos;
  src: url("/golos-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  --bg: #f3f5f8;
  --surface: #fdfefe;
  --ink: #243244;
  --muted: #536274;
  --line: #d5dce5;
  --accent: #245bb4;
  --soft: #eaf0fa;
  --green: #226548;
  --green-bg: #edf6f0;
  --amber: #8b540b;
  --amber-bg: #fff3dd;
  --red: #a73838;
  --red-bg: #fceeed;
  --radius: 8px;
  font-family: Golos, "Segoe UI", sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button,
.button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: #edf1f6;
  border-color: #bdc8d7;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.primary:hover {
  background: #194b99;
  border-color: #194b99;
}
.danger {
  color: var(--red);
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.icon-button {
  width: 40px;
  padding: 8px;
  flex-shrink: 0;
}
.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #bec9d6;
  border-radius: 7px;
  background: var(--surface);
  padding: 8px 11px;
  min-height: 40px;
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}
input::placeholder,
textarea::placeholder {
  color: #687788;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
label {
  display: grid;
  gap: 6px;
  font-weight: 500;
}
label small {
  font-weight: 400;
}
p {
  margin: 0 0 14px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 620;
  line-height: 1.25;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.65px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.25px;
}
h3 {
  font-size: 15px;
}
a {
  color: var(--accent);
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 13px;
}
.initial {
  padding: 40px;
}
.app-shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #eef1f6;
  border-right: 1px solid var(--line);
  padding: 26px 14px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 30px;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  width: 34px;
  height: 34px;
}
.brand strong {
  font-size: 19px;
  letter-spacing: -0.4px;
}
.brand small {
  font-size: 11px;
  letter-spacing: 1.5px;
  display: block;
  line-height: 1.2;
}
.nav-caption {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  padding: 6px 12px 8px;
  font-weight: 600;
}
.nav {
  display: grid;
  gap: 3px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}
.nav a:hover {
  background: #e4eaf3;
}
.nav a.active {
  color: #194d98;
  background: #dce6f7;
}
.nav-gap {
  height: 22px;
}
.nav .count {
  margin-left: auto;
  font-size: 12px;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.user-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 8px;
  white-space: normal;
  background: transparent;
  border: 0;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #dce4ef;
  color: #395471;
  font-weight: 600;
  flex-shrink: 0;
}
.user-info {
  overflow: hidden;
  line-height: 1.4;
}
.user-info strong,
.user-info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace {
  min-width: 0;
}
.topbar {
  height: 62px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar .breadcrumb {
  color: var(--muted);
  font-size: 13px;
}
.topbar .mode {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8591a1;
  display: inline-block;
}
.dot.live {
  background: #35865d;
}
.menu-button {
  display: none;
}
.content {
  padding: 25px 28px 30px;
  max-width: 1920px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}
.heading-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #edf2f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
  color: #42556e;
}
.notice.warning {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: #ead6b0;
}
.notice .icon {
  margin-top: 2px;
}
.notice p {
  margin: 0;
}
.notice a {
  color: inherit;
}
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  gap: 16px;
  overflow: auto;
}
.tab {
  height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 10px 2px;
  background: transparent;
  font-weight: 500;
  color: var(--muted);
}
.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.tab:hover {
  background: transparent;
  color: var(--accent);
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.filters select {
  width: auto;
  max-width: 210px;
}
.filters input[type="search"] {
  flex: 1;
  min-width: 180px;
}
.filters input[type="date"] {
  width: 145px;
}
.filter-extra {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters label {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  background: #f7f9fb;
  white-space: nowrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid #e6ebf1;
  vertical-align: middle;
  font-size: 14px;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f7f9fc;
}
.data-row {
  cursor: pointer;
}
.data-row.selected {
  background: #edf3fd;
}
.time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  line-height: 1.45;
}
.time strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
}
.cell-main {
  min-width: 220px;
  max-width: 620px;
}
.cell-title {
  font-weight: 450;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.cell-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}
.clip {
  max-width: 240px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.market {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.1px;
  font-weight: 600;
  white-space: nowrap;
}
.market i {
  font-style: normal;
  background: #edf0f5;
  padding: 2px 5px;
  border-radius: 4px;
  color: #415674;
}
.market.wildberries i {
  background: #f4eaf9;
  color: #7b378e;
}
.market.ozon i {
  background: #eaf0ff;
  color: #2455a3;
}
.market.yandex i {
  background: #fff1d5;
  color: #805819;
}
.market.detmir i {
  background: #e4f4f4;
  color: #277273;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 12px;
  background: #edf1f6;
  color: #536274;
  white-space: nowrap;
}
.badge.answered,
.badge.connected,
.badge.active,
.badge.done {
  background: var(--green-bg);
  color: var(--green);
}
.badge.draft,
.badge.running {
  background: #eaf0fc;
  color: #2e5797;
}
.badge.attention,
.badge.partial,
.badge.review,
.badge.conflict,
.badge.unknown,
.badge.pending {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge.error,
.badge.failed,
.badge.rejected {
  background: var(--red-bg);
  color: var(--red);
}
.stars {
  color: #936410;
  font-size: 13px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
}
.pagination .actions {
  gap: 4px;
}
.pagination button {
  min-height: 34px;
  padding: 5px 10px;
}
.empty {
  padding: 62px 24px;
  text-align: center;
  max-width: 530px;
  margin: auto;
}
.empty .empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #edf2f8;
  border-radius: 10px;
  margin: 0 auto 16px;
  color: #6680a1;
}
.empty h2 {
  font-size: 18px;
  margin-bottom: 9px;
}
.empty p {
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 18px;
}
.empty button {
  margin: auto;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  align-items: start;
  gap: 16px;
}
.split .cell-main {
  min-width: 160px;
}
.split .optional {
  display: none;
}
.detail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}
.detail-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-section {
  padding: 17px 18px;
  border-bottom: 1px solid #e3e9f0;
}
.detail-section:last-child {
  border: 0;
}
.detail .prose {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.6;
  margin: 14px 0 0;
  overflow-wrap: anywhere;
}
.detail h3 {
  margin-bottom: 8px;
}
.detail .meta-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.detail .reason {
  color: var(--amber);
  font-size: 13px;
  padding-top: 10px;
}
.detail textarea {
  font-size: 15px;
  min-height: 146px;
  margin-top: 12px;
}
.detail .actions {
  margin-top: 12px;
}
.detail small {
  display: block;
  margin-top: 8px;
}
.kb-snippet {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}
.kb-snippet:last-child {
  padding-bottom: 0;
}
.kb-snippet p {
  font-size: 13px;
  margin: 5px 0 0;
  color: var(--muted);
}
.form-layout {
  max-width: 1120px;
  display: grid;
  gap: 14px;
}
.form-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.section-intro p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.form-fields {
  display: grid;
  gap: 10px;
}
.form-grid,
.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  --field-label-width: 118px;
}
.field-row {
  display: grid;
  grid-template-columns: var(--field-label-width, 156px) minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  min-width: 0;
}
.field-row > * {
  min-width: 0;
}
.field-label {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.field-label small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.field-row:has(> textarea) {
  align-items: start;
}
.field-row:has(> textarea) > .field-label {
  padding-top: 8px;
}
.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.form-grid > .full {
  --field-label-width: 156px;
}
#settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  --field-label-width: 150px;
}
#settings-form > .form-foot {
  grid-column: 1 / -1;
}
#profile-form {
  max-width: 780px;
}
#settings-form .ratings {
  gap: 4px;
}
#settings-form .ratings label {
  padding: 6px 5px;
  gap: 4px;
  min-height: 40px;
}
#settings-form .ratings input {
  margin: 0;
}
#settings-form textarea {
  min-height: 88px;
}
#settings-form .section-divider {
  display: none;
}
#settings-form .switch-row small {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 0;
}
.ai-connections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  --field-label-width: 124px;
}
.active-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.active-connection p {
  margin: 4px 0 0;
}
.active-ai-form {
  display: flex;
  align-items: center;
  gap: 8px;
  --field-label-width: 100px;
}
.active-ai-form select {
  width: 180px;
}
.ai-form .actions {
  justify-content: flex-start;
  margin-left: calc(var(--field-label-width) + 12px);
  flex-wrap: wrap;
}
.ai-form .error-message {
  margin-bottom: 0;
}
.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.switch-row span {
  display: block;
}
.switch-row small {
  display: block;
  font-weight: 400;
  margin-top: 3px;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 36px !important;
  height: 21px !important;
  border-radius: 20px !important;
  background: #b3becc !important;
  border: 0 !important;
  position: relative;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  height: 15px;
  width: 15px;
  background: white;
  border-radius: 100%;
  transition: transform 0.15s;
}
.switch:checked {
  background: var(--accent) !important;
}
.switch:checked::after {
  transform: translateX(15px);
}
.ratings {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.ratings label {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
}
.radio-options {
  display: grid;
  gap: 10px;
}
.radio-options label {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.radio-options label:has(:checked) {
  border-color: var(--accent);
  background: #f3f7fd;
}
.radio-options input {
  margin-top: 2px;
  flex-shrink: 0;
}
.radio-options small {
  display: block;
  margin-top: 3px;
}
.form-foot {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 0 10px;
}
.form-foot small {
  font-size: 12px;
}
.password-wrap {
  position: relative;
  display: block;
}
.password-wrap input {
  padding-right: 44px;
}
.password-wrap button {
  position: absolute;
  right: 1px;
  top: 1px;
  border: 0;
  background: transparent;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 9px;
}
.error-message {
  padding: 11px 14px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: 7px;
  font-size: 13px;
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}
.field-help {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 1px;
}
.connection-list {
  display: grid;
  gap: 14px;
}
.connection {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.connection-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.connection-top h2 {
  display: flex;
  gap: 10px;
  align-items: center;
}
.connection-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
}
.connection p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
  max-width: 750px;
}
.connection .substatus {
  font-size: 12px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.connection .actions {
  justify-content: flex-end;
}
.split-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #eef2f7;
}
.auth-card {
  width: min(590px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 35px #29436508;
}
.auth-card .brand {
  padding: 0 0 16px;
}
.auth-card h1 {
  font-size: 24px;
}
.auth-card .subtitle {
  color: var(--muted);
  margin: 8px 0 16px;
}
.auth-card form {
  display: grid;
  gap: 10px;
}
.auth-card button[type="submit"] {
  margin-top: 4px;
}
.auth-foot {
  font-size: 12px;
  color: var(--muted);
  margin: 14px 0 0;
}
.auth-card .error-message {
  margin: 0;
}
.staff-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.staff-name strong {
  font-weight: 550;
}
.staff-name small {
  display: block;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 80px #162b4a30;
  padding: 0;
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  color: var(--ink);
  background: var(--surface);
}
dialog.account-dialog,
dialog.knowledge-dialog {
  width: min(820px, calc(100vw - 32px));
  --field-label-width: 118px;
}
.knowledge-dialog .form-grid > .full {
  --field-label-width: 118px;
}
dialog::backdrop {
  background: #18294166;
  backdrop-filter: blur(2px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-body {
  padding: 16px 18px;
  display: grid;
  gap: 10px;
}
.modal-body .error-message {
  margin: 0;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.modal-body .notice {
  margin: 0;
  font-size: 13px;
}
.full {
  grid-column: 1/-1;
}
.activity td {
  font-size: 13px;
}
.activity .detail-cell {
  max-width: 420px;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: calc(50% + 108px);
  transform: translateX(-50%) translateY(10px);
  background: #243244;
  color: white;
  border-radius: 9px;
  padding: 12px 18px;
  max-width: min(600px, calc(100vw - 32px));
  box-shadow: 0 8px 35px #18314a22;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: 0.16s;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%);
}
.skeleton {
  padding: 26px;
  color: var(--muted);
}
.scope {
  font-size: 12px;
  color: var(--muted);
}
.nowrap {
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mobile-back {
  display: none;
}
.error-screen {
  padding: 32px;
}
.lock-note {
  font-size: 12px;
  color: var(--amber);
  padding-top: 8px;
}
.section-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}
.connection-form {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.inline-status {
  font-size: 12px;
  color: var(--muted);
}
.text-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.history-entry p {
  margin: 6px 0;
}
.mobile-title {
  display: none;
}
@media (min-width: 1500px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 450px;
  }
  .split .optional {
    display: table-cell;
  }
}
@media (max-width: 1150px) {
  .split {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .split .market-col {
    display: none;
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
  .connection-body {
    grid-template-columns: 1fr;
  }
  .connection .actions {
    justify-content: flex-start;
  }
  .form-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .ai-connections {
    grid-template-columns: minmax(0, 1fr);
    --field-label-width: 156px;
  }
  .active-connection {
    flex-wrap: wrap;
  }
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 190px 1fr;
  }
  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }
  .nav a {
    padding: 10px;
  }
  .content {
    padding: 24px 20px;
  }
  .topbar {
    padding: 0 20px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .form-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #settings-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-layout {
    max-width: 100%;
  }
  .split {
    display: block;
  }
  .split > .surface:first-child {
    display: none;
  }
  .detail {
    position: static;
    max-height: none;
  }
  .mobile-back {
    display: inline-flex;
  }
  .split .detail {
    width: 100%;
  }
  .optional {
    display: none;
  }
  #toast {
    left: calc(50% + 95px);
  }
}
@media (max-width: 650px) {
  .app-shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    width: 240px;
    box-shadow: 12px 0 40px #1e344333;
  }
  .sidebar.open {
    display: flex;
  }
  .topbar {
    height: 58px;
    padding: 0 16px;
  }
  .menu-button {
    display: inline-flex;
  }
  .topbar .breadcrumb {
    display: none;
  }
  .mobile-title {
    display: block;
    font-weight: 600;
  }
  .topbar .mode {
    font-size: 12px;
  }
  .content {
    padding: 22px 16px;
  }
  .page-heading {
    gap: 14px;
    margin-bottom: 18px;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .heading-actions {
    width: 100%;
  }
  .heading-actions button {
    flex: 1;
  }
  .filters {
    padding: 12px;
    gap: 8px;
  }
  .filters input[type="search"] {
    flex-basis: 100%;
  }
  .filters select {
    flex: 1;
    max-width: 100%;
    width: 100%;
  }
  .tabs {
    gap: 16px;
    padding: 0 12px;
  }
  .tab {
    height: 48px;
  }
  .surface {
    border-radius: 8px;
  }
  button,
  .button {
    min-height: 44px;
  }
  input,
  select {
    min-height: 44px;
  }
  th,
  td {
    padding: 10px 12px;
  }
  .market-col {
    display: none;
  }
  .time-col {
    display: none;
  }
  .cell-main {
    min-width: 180px;
  }
  .cell-meta {
    flex-wrap: wrap;
    gap: 5px;
  }
  .cell-meta .clip {
    max-width: 180px;
  }
  .form-section {
    padding: 14px;
  }
  .form-grid,
  .field-pair {
    grid-template-columns: 1fr;
    gap: 10px;
    --field-label-width: 110px;
  }
  .field-row,
  .form-grid > .full,
  #settings-form,
  .ai-connections {
    --field-label-width: 110px;
  }
  .field-row {
    column-gap: 8px;
  }
  .field-row:has(> textarea),
  .field-row:has(> .ratings) {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 6px;
  }
  .field-row:has(> textarea) > .field-label {
    padding-top: 0;
  }
  .active-ai-form {
    flex-wrap: wrap;
    width: 100%;
  }
  .active-ai-form .field-row {
    flex: 1 1 100%;
  }
  .active-ai-form select {
    width: 100%;
  }
  .active-ai-form > div {
    margin-left: 118px;
  }
  .ai-form .actions {
    margin-left: 0;
  }
  .ratings {
    gap: 5px;
  }
  .ratings label {
    padding: 8px;
  }
  #settings-form .ratings label {
    min-height: 44px;
  }
  .form-foot {
    position: sticky;
    bottom: 0;
    padding: 12px 0;
    background: var(--bg);
    z-index: 3;
  }
  .form-foot button {
    flex: 1;
  }
  .form-foot small {
    display: none;
  }
  .connection {
    padding: 14px;
  }
  .connection-top {
    align-items: flex-start;
  }
  .connection-top h2 {
    font-size: 17px;
    flex-wrap: wrap;
  }
  .connection .actions {
    gap: 6px;
  }
  .connection .actions button {
    flex: 1;
    font-size: 13px;
  }
  .pagination {
    padding: 10px 12px;
  }
  .empty {
    padding: 44px 18px;
  }
  .auth-screen {
    padding: 16px;
  }
  .auth-card {
    padding: 20px 16px;
  }
  .auth-card h1 {
    font-size: 23px;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .modal-body {
    gap: 10px;
  }
  .modal-foot {
    flex-wrap: wrap;
  }
  .modal-foot button {
    flex: 1;
  }
  .password-wrap button {
    width: 44px;
    height: 44px;
    min-height: 44px;
    top: 0;
    right: 0;
  }
  .switch-row,
  .check-row {
    min-height: 44px;
  }
  .icon-button {
    width: 44px;
  }
  .detail-header {
    padding: 13px 16px;
  }
  .detail-section {
    padding: 16px;
  }
  .detail .prose {
    font-size: 16px;
  }
  .notice {
    padding: 12px;
    font-size: 13px;
  }
  .staff-name .avatar {
    display: none;
  }
  #toast {
    left: 50%;
    bottom: 16px;
    width: max-content;
  }
  .activity table {
    min-width: 670px;
  }
  .kb-table .cell-main {
    min-width: 190px;
  }
  .staff-table {
    min-width: 580px;
  }
  .filters input[type="date"] {
    width: calc(50% - 20px);
  }
  .filter-extra label {
    flex: 1;
  }
  .filter-extra label input {
    width: 100%;
  }
}
[hidden] {
  display: none !important;
}
.response-heading {
  margin-top: 18px !important;
}
.full-width {
  max-width: none;
}
.block {
  display: block;
}
.connection-list + .split-note,
.surface + .split-note {
  margin-top: 16px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Dense rows preserve the complete reading area in the detail pane. */
td {
  padding-top: 7px;
  padding-bottom: 7px;
}
.compact-account {
  display: none;
}
.split .compact-account {
  display: inline;
}
.split .market-col {
  display: none;
}
@media (max-width: 900px) {
  .compact-account {
    display: inline;
  }
}
@media (max-width: 650px) {
  td.cell-main {
    min-width: 0;
    width: 65%;
  }
  .cell-meta .compact-account {
    font-size: 11px;
  }
  .cell-meta {
    line-height: 1.35;
  }
  .cell-title {
    -webkit-line-clamp: 3;
  }
  .table-scroll table {
    table-layout: auto;
  }
  .kb-table .cell-main {
    min-width: 0;
  }
  .detail .actions button.primary {
    flex: 1;
  }
}
@media (max-width: 900px) {
  .market-col {
    display: none;
  }
}
