:root {
  --paper: #fbfbf8;
  --canvas: #f5f5ef;
  --line: #e4e5dc;
  --ink: #223a33;
  --text: #313b36;
  --muted: #7a837b;
  --accent: #496d55;
  --soft: #e7eddf;
  --white: #fff;
  --serif: Georgia, "Times New Roman", serif;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  font-size: 14px;
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #82977b;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
a {
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
.brand {
  font-family: var(--serif);
  font-size: 37px;
  letter-spacing: -2px;
  text-decoration: none;
  color: var(--ink);
}
.brand-dot {
  color: #8fa577;
}
.icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.icon:hover {
  background: var(--soft);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 600;
  color: var(--muted);
}
.muted,
.small {
  color: var(--muted);
}
.small {
  font-size: 12px;
  line-height: 1.65;
}
.primary {
  background: var(--ink);
  color: #fff;
  padding: 13px 20px;
  border-radius: 9px;
  font-weight: 550;
  display: flex;
  gap: 22px;
  justify-content: space-between;
  align-items: center;
}
.primary:hover {
  background: #385347;
}
.outline {
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--paper);
}
.outline:hover {
  background: var(--soft);
}
.outline span {
  color: var(--muted);
  margin-left: 9px;
}
.error {
  color: #9f453d;
  font-size: 13px;
}
.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-story {
  background: #e9eddf;
  padding: 50px 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 60px);
  line-height: 1.15;
  letter-spacing: -2px;
}
.login-story p {
  line-height: 1.8;
  color: #667261;
}
.login-form {
  width: min(370px, 85%);
  margin: auto;
}
.login-form h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.6px;
}
.login-form label {
  display: block;
  margin-top: 23px;
  font-size: 12px;
}
.login-form input {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.login-form .primary {
  width: 100%;
  margin-top: 28px;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: var(--paper);
  color: var(--text);
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #a9bba1;
  outline-offset: 1px;
}
.workspace {
  height: 100dvh;
  display: flex;
  overflow: hidden;
}
.sidebar {
  width: 245px;
  flex: none;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  padding: 25px 17px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 27px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #d5dccc;
  background: #edf0e5;
  padding: 11px 13px;
  border-radius: 9px;
  text-align: left;
  font-size: 12px;
}
.new-chat span {
  font-size: 19px;
}
.new-chat kbd {
  margin-left: auto;
  color: var(--muted);
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 23px 9px 9px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  min-height: 25px;
}
.clients {
  overflow-y: auto;
  max-height: 32vh;
}
.client-button {
  display: flex;
  width: 100%;
  gap: 11px;
  align-items: center;
  text-align: left;
  padding: 11px 10px;
  border-radius: 8px;
  margin: 2px 0;
  font-size: 12px;
}
.client-button.active {
  background: #e4eadb;
  color: #274b35;
}
.client-button:hover {
  background: #e9ecdf;
}
.client-monogram {
  height: 28px;
  width: 28px;
  background: #f7f8f2;
  border: 1px solid #dbe2d3;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex: none;
}
.client-button .client-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.threads {
  overflow-y: auto;
  flex: 1;
}
.thread-button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  color: #7b8179;
  text-align: left;
  border-radius: 6px;
}
.thread-button.active {
  color: var(--ink);
  background: #eeefe8;
}
.sidebar-bottom {
  margin-top: 20px;
}
.telegram-link {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 13px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.telegram-link small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}
.telegram-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #d8ded0;
  border-radius: 50%;
  font-size: 18px;
}
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 8px;
  font-size: 12px;
}
.account .icon {
  margin-left: auto;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d9e1cd;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}
.topbar {
  min-height: 88px;
  padding: 20px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 15px;
}
.context-label {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.context > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.context strong {
  font-size: 13px;
  font-weight: 550;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context select {
  padding: 3px 20px 3px 0;
  border: 0;
  font-size: 12px;
  max-width: 200px;
}
.separator {
  color: #c3c9bc;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mode {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.mode:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8ba77a;
  margin-right: 6px;
}
.demo-banner {
  padding: 8px 20px;
  text-align: center;
  font-size: 10px;
  background: #f1f2e8;
  color: #66705d;
  border-bottom: 1px solid var(--line);
}
.demo-banner span {
  color: #88917e;
}
.chat {
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
  padding: 20px 32px 30px;
}
.welcome {
  max-width: 730px;
  margin: clamp(30px, 9vh, 110px) auto 45px;
  text-align: center;
}
.spark {
  color: #809565;
  font-size: 42px;
  margin-bottom: 25px;
}
.welcome h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 400;
  letter-spacing: -1.2px;
  margin: 18px 0 15px;
  color: var(--ink);
}
.welcome > p:not(.eyebrow) {
  line-height: 1.8;
  color: var(--muted);
  font-size: 13px;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 38px;
  text-align: left;
}
.suggestions button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  background: #fffefa;
  text-align: left;
  transition: 0.15s;
}
.suggestions button:hover {
  transform: translateY(-2px);
  border-color: #a3b397;
  background: #f5f7ee;
}
.suggestions span {
  display: block;
  color: #829871;
  font-size: 20px;
  margin-bottom: 18px;
}
.suggestions strong {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin-bottom: 7px;
}
.suggestions small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  display: block;
}
.messages {
  max-width: 760px;
  margin: auto;
}
.message {
  margin: 25px 0;
}
.message.user {
  display: flex;
  justify-content: flex-end;
}
.message.user .bubble {
  background: #edf0e6;
  border-radius: 16px 16px 3px 16px;
  max-width: 87%;
  padding: 14px 18px;
}
.bubble {
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.assistant-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}
.assistant-name span {
  font-size: 20px;
  color: #83946e;
}
.message.assistant {
  padding-right: 20px;
}
.message.assistant .bubble {
  padding-left: 29px;
}
.files {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 0 28px;
}
.file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  max-width: 100%;
  font-size: 11px;
}
.file-card:hover {
  border-color: #9cac8d;
}
.file-icon {
  background: #edf2e8;
  color: #637954;
  border-radius: 6px;
  padding: 9px;
  font-size: 9px;
  flex: none;
}
.file-card strong {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.file-card small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.job-line {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #708264;
  font-size: 12px;
  margin: 20px 0 20px 29px;
}
.job-line button {
  margin-left: auto;
  font-size: 11px;
  text-decoration: underline;
}
.pulse {
  width: 6px;
  height: 6px;
  background: #839b70;
  border-radius: 50%;
  animation: pulse 1.7s ease infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
.composer-wrap {
  width: min(824px, 100%);
  padding: 0 32px;
  margin: 0 auto;
}
.composer {
  border: 1px solid #dce2d3;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 3px 18px #2b442708;
  padding: 14px 14px 10px;
}
.composer textarea {
  resize: none;
  border: 0;
  padding: 4px 6px;
  background: transparent;
  outline: 0;
  width: 100%;
  font-size: 13px;
  line-height: 1.7;
  min-height: 57px;
  max-height: 160px;
}
.composer textarea::placeholder {
  color: #9aa192;
}
.composer-bottom {
  display: flex;
  gap: 10px;
  align-items: center;
}
.composer-bottom > span {
  font-size: 10px;
  color: #929b88;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.send {
  background: var(--ink);
  color: #fff;
  border-radius: 9px;
  width: 33px;
  height: 33px;
  font-size: 20px;
}
.composer-foot {
  text-align: center;
  font-size: 9px;
  color: #a0a694;
  margin: 12px 0 17px;
}
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.attachment-chip {
  font-size: 10px;
  background: #edf1e5;
  border-radius: 7px;
  padding: 6px 8px;
  margin-bottom: 6px;
}
.reply-state {
  font-size: 11px;
  padding: 9px 13px;
  margin-bottom: 8px;
  border-radius: 7px;
  background: #eef0e6;
}
.records-panel {
  width: 350px;
  flex: none;
  border-left: 1px solid var(--line);
  background: #f8f9f3;
  display: flex;
  flex-direction: column;
}
.panel-heading {
  padding: 26px 22px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.panel-heading h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin: 8px 0;
}
.tabs {
  display: flex;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.tabs button {
  padding: 12px 0;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--ink);
  border-color: var(--ink);
}
.records-content {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
}
.panel-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.panel-tools button {
  font-size: 11px;
}
.record {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.record h3 {
  font-weight: 500;
  font-size: 12px;
  margin: 0 0 8px;
  line-height: 1.5;
}
.record p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
}
.record small {
  font-size: 9px;
  color: var(--muted);
}
.record .actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.record .actions button,
.record .actions a {
  font-size: 10px;
  text-decoration: underline;
  padding: 0;
}
.tag {
  display: inline-block;
  font-size: 9px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #e9eedf;
  color: #70805f;
  margin-right: 4px;
}
.record.retired {
  opacity: 0.65;
}
.empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin: 24px 8px;
}
.empty strong {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--text);
  padding: 25px;
  width: min(470px, calc(100% - 32px));
  box-shadow: 0 20px 100px #18271925;
}
dialog::backdrop {
  background: #1b2a2540;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.dialog-heading h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  margin: 0;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
#dialog-body label {
  display: block;
  margin: 15px 0;
  font-size: 12px;
}
#dialog-body input:not([type="checkbox"]),
#dialog-body textarea,
#dialog-body select {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#dialog-body p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
#dialog-body code {
  display: block;
  font-size: 11px;
  background: var(--soft);
  padding: 14px;
  overflow-wrap: anywhere;
  user-select: all;
}
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  padding: 13px 19px;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  box-shadow: 0 5px 20px #0002;
  font-size: 12px;
  z-index: 100;
}
.mobile {
  display: none;
}
@media (min-width: 1600px) {
  .sidebar {
    width: 270px;
  }
  .records-panel {
    width: 390px;
  }
}
@media (max-width: 1150px) {
  .records-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    box-shadow: -10px 0 60px #18271910;
  }
  .topbar {
    padding: 18px 23px;
  }
  .sidebar {
    width: 220px;
  }
  .chat {
    padding: 20px 24px;
  }
  .composer-wrap {
    padding: 0 24px;
  }
}
@media (max-width: 760px) {
  .mobile {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    z-index: 30;
    box-shadow: 20px 0 80px #0002;
    transform: translateX(-120%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar {
    min-height: 74px;
    padding: 12px 15px;
    gap: 8px;
  }
  .topbar .context {
    flex: 1;
    min-width: 0;
  }
  .context > div {
    gap: 6px;
  }
  .context strong {
    max-width: 115px;
    font-size: 11px;
  }
  .context select {
    max-width: 90px;
    font-size: 10px;
  }
  .context .icon {
    width: 22px;
  }
  .header-actions {
    gap: 6px;
  }
  .mode {
    display: none;
  }
  .header-actions .outline {
    font-size: 10px;
    padding: 7px;
  }
  .welcome {
    margin: 45px auto 30px;
  }
  .welcome h1 {
    font-size: 33px;
  }
  .welcome .eyebrow {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
  .chat {
    padding: 10px 19px 20px;
  }
  .spark {
    margin-bottom: 20px;
  }
  .suggestions {
    gap: 7px;
    margin-top: 28px;
  }
  .suggestions button {
    padding: 13px 10px;
  }
  .suggestions small {
    display: none;
  }
  .suggestions strong {
    font-size: 10px;
    line-height: 1.5;
  }
  .suggestions span {
    margin-bottom: 12px;
  }
  .composer-wrap {
    padding: 0 15px;
  }
  .composer-foot {
    font-size: 8px;
  }
  .records-panel {
    width: min(100%, 370px);
  }
  .demo-banner {
    font-size: 9px;
    line-height: 1.5;
    padding: 6px;
  }
  .demo-banner span {
    display: none;
  }
  .login-screen {
    display: block;
    padding: 30px 0;
  }
  .login-story {
    padding: 0 30px;
    background: transparent;
  }
  .login-story > div,
  .login-story > .small {
    display: none;
  }
  .login-form {
    margin: 70px auto 30px;
  }
  .message.assistant .bubble {
    padding-left: 0;
  }
  .files {
    margin-left: 0;
  }
  .message.assistant {
    padding-right: 0;
  }
  .bubble {
    font-size: 12px;
  }
  .context-label {
    font-size: 8px;
  }
  .file-card {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.thread-button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
