:root {
  font-family: Arial, sans-serif;
  color: #202927;
  background: #f5f7f6;
  font-size: 14px;
  letter-spacing: 0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d9dfdc;
  border-radius: 5px;
  background: white;
  color: #26332c;
  padding: 10px 13px;
  cursor: pointer;
  min-height: 40px;
}
button:hover {
  background: #eff4f1;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.primary {
  background: #19734d;
  border-color: #19734d;
  color: white;
}
.primary:hover {
  background: #145d3e;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #19734d;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  border-right: 1px solid #dce4df;
  background: white;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 9px;
  font-size: 16px;
}
.brand svg {
  width: 23px;
  color: #19734d;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
nav button {
  justify-content: flex-start;
  background: none;
  border-color: transparent;
  padding: 12px;
}
nav .active {
  background: #e6f2eb;
  color: #145d3e;
  font-weight: bold;
}
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 0 10px;
  color: #67726d;
  font-size: 12px;
}
.status-dot {
  width: 7px;
  height: 7px;
  background: #19734d;
  border-radius: 50%;
}
main {
  min-width: 0;
  max-width: 1180px;
  width: 100%;
  padding: 30px 38px;
  margin: 0 auto;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid #dce4df;
  padding-bottom: 24px;
  margin-bottom: 20px;
}
.eyebrow {
  color: #77807c;
  font-size: 10px;
}
h1 {
  font-size: 25px;
  margin: 6px 0 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 18px;
}
h3 {
  font-size: 15px;
  margin: 20px 0 12px;
}
.badge {
  font-size: 12px;
  background: #e6f2eb;
  border-radius: 4px;
  padding: 8px;
  line-height: 1.4;
}
.notice,
#error {
  padding: 12px 15px;
  border-left: 3px solid #ceaa38;
  background: #fffae9;
  color: #675020;
  line-height: 1.6;
  margin-bottom: 18px;
}
#error {
  border-color: #b94844;
  background: #fff1ef;
  color: #913d38;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.scope {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.scope button {
  border-radius: 0;
  min-width: 70px;
  padding: 9px 12px;
}
.scope button:first-child {
  border-radius: 5px 0 0 5px;
}
.scope button:last-child {
  border-radius: 0 5px 5px 0;
}
.scope button + button {
  border-left: 0;
}
.scope button.selected {
  background: #e6f2eb;
  border-bottom: 2px solid #19734d;
}
.swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.wb {
  background: #c82ab3;
}
.ym {
  background: #e4b128;
}
.ozon {
  background: #1463e7;
}
.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  flex: none;
}
.chat-log {
  height: clamp(260px, calc(100dvh - 310px), 680px);
  min-height: 260px;
  overflow: auto;
  padding: 20px 0;
  border-top: 1px solid #e1e6e3;
  border-bottom: 1px solid #e1e6e3;
  margin-bottom: 16px;
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #76817b;
  text-align: center;
}
.empty > svg {
  width: 38px;
  height: 38px;
  margin-bottom: 20px;
  color: #83a18f;
}
.empty h2 {
  color: #35483d;
  margin-bottom: 0;
}
.empty p {
  max-width: 340px;
  line-height: 1.6;
}
.message {
  padding: 12px 0;
  max-width: 90%;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user {
  margin-left: auto;
  text-align: right;
  color: #19734d;
}
.message.assistant {
  border-bottom: 1px solid #e5e9e7;
}
.message small {
  display: block;
  color: #89938d;
  font-size: 11px;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.composer textarea {
  flex: 1;
  min-width: 0;
  resize: vertical;
  max-height: 200px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section-heading h2 {
  margin: 0;
}
.form-panel {
  border-top: 1px solid #dce4df;
  padding: 20px 0;
  margin-top: 18px;
  max-width: 540px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 17px;
  line-height: 1.5;
}
input,
select,
textarea {
  padding: 11px;
  border: 1px solid #ccd6cf;
  border-radius: 4px;
  background: white;
  width: 100%;
  min-width: 0;
  color: #26332c;
}
textarea {
  resize: vertical;
  min-height: 65px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.check {
  flex-direction: row;
  align-items: flex-start;
}
.check input,
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: none;
  margin: 2px 0;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 15px 0;
}
fieldset label {
  display: inline-flex;
  flex-direction: row;
  margin-right: 15px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #dce4df;
  padding: 18px 0;
  min-width: 0;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-weight: bold;
  overflow-wrap: anywhere;
}
.row p {
  color: #758078;
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.row-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.details {
  margin: 0 0 25px;
  max-width: 600px;
}
.details > div {
  display: flex;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid #dce4df;
  line-height: 1.5;
}
.details dt {
  color: #758078;
  width: 110px;
  flex: none;
}
.details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.muted {
  color: #77817b;
  line-height: 1.6;
}
.danger-zone {
  margin-top: 35px;
  border-top: 1px solid #dce4df;
  padding: 20px 0;
}
.danger-zone button {
  color: #a3433d;
}
.receipt {
  border-bottom: 1px solid #dce4df;
  padding: 20px 0;
}
.receipt pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px Arial;
  line-height: 1.6;
  color: #63736a;
}
.receipt .check {
  margin-top: 14px;
}
.receipt input {
  max-width: 420px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 750px) {
  .shell {
    display: block;
  }
  aside {
    padding: 15px;
    border-right: 0;
    border-bottom: 1px solid #dce4df;
    gap: 15px;
  }
  .brand {
    padding: 0;
  }
  .sidebar-bottom {
    display: none;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }
  nav button {
    flex: none;
    font-size: 12px;
    padding: 8px;
  }
  nav button svg {
    width: 16px;
  }
  main {
    padding: 22px 16px;
  }
  header {
    padding-bottom: 18px;
    margin-bottom: 16px;
  }
  .eyebrow {
    font-size: 9px;
  }
  h1 {
    font-size: 23px;
  }
  .badge {
    max-width: 150px;
  }
  .scope button {
    min-width: 57px;
    padding: 9px 10px;
    font-size: 12px;
  }
  .chat-log {
    height: calc(100dvh - 350px);
  }
  .row {
    flex-wrap: wrap;
  }
  .row-main {
    min-width: 160px;
  }
  .row-actions {
    margin-left: auto;
  }
  .message {
    max-width: 100%;
  }
  .section-heading h2 {
    font-size: 16px;
  }
  .section-heading button {
    font-size: 12px;
    padding: 8px;
  }
  .details dt {
    width: 85px;
  }
}
body:has(#chat:not([hidden])) .shell {
  height: 100dvh;
  min-height: 0;
}
main:has(#chat:not([hidden])) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
main:has(#chat:not([hidden])) header,
main:has(#chat:not([hidden])) .notice,
main:has(#chat:not([hidden])) #error {
  flex-shrink: 0;
}
#chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#chat .toolbar,
#chat .composer {
  flex-shrink: 0;
}
#chat .chat-log {
  flex: 1;
  height: auto;
  min-height: 100px;
}
@media (max-width: 750px) {
  body:has(#chat:not([hidden])) .shell {
    display: flex;
    flex-direction: column;
  }
  body:has(#chat:not([hidden])) aside {
    flex-shrink: 0;
  }
  main:has(#chat:not([hidden])) {
    flex: 1;
    height: auto;
  }
}
@media (max-width: 400px) {
  #chat .scope button {
    min-width: 43px;
    padding: 8px;
    font-size: 11px;
  }
  #chat .toolbar {
    gap: 5px;
  }
  #chat .scope button {
    gap: 6px;
  }
}
