/* Executive Assistant — премиальный минимальный дизайн.
   Тёплые нейтральные тона, единый тёмный акцент, без градиентов. */

:root {
  --ink-50:  #fafaf9;
  --ink-100: #f5f5f4;
  --ink-200: #e7e5e4;
  --ink-300: #d6d3d1;
  --ink-400: #a8a29e;
  --ink-500: #78716c;
  --ink-700: #44403c;
  --ink-900: #1c1917;
  --accent-err: #991b1b;
  --accent-err-bg: #fef2f2;
  --accent-err-border: #fecaca;
  --sidebar-width: 220px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--ink-50);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
}

/* ─── Сайдбар ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--ink-200);
  padding: 28px 16px;
  overflow-y: auto;
  z-index: 50;
}
.sidebar-brand {
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 16px;
}
.brand-eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-400);
  font-weight: 500;
}
.brand-name {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-500);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.sidebar-link:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}
.sidebar-link.active {
  background: var(--ink-900);
  color: white;
  font-weight: 500;
}

/* ─── Основной контент ───────────────────────────────── */
.app {
  margin-left: var(--sidebar-width);
  padding: 32px 32px;
  min-height: 100vh;
  max-width: 860px;
}

/* На узких экранах — сайдбар свёрнут в полоску сверху */
@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--ink-200);
    padding: 14px 16px;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .sidebar-link {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 12px;
  }
  .app {
    margin-left: 0;
    padding: 20px 18px;
  }
}

header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-200);
  margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
header .eyebrow {
  font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-400); font-weight: 500;
}
header h1 {
  margin: 4px 0 0 0;
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
}
header .subtitle {
  margin-top: 6px; font-size: 13px; color: var(--ink-500);
}
header .reset {
  background: none; border: none; color: var(--ink-500);
  font-size: 13px; cursor: pointer; padding: 8px 0;
  font-family: inherit; transition: color 0.15s;
}
header .reset:hover { color: var(--ink-900); }

#transcript {
  flex: 1; overflow-y: auto; padding-right: 4px;
  display: flex; flex-direction: column; gap: 24px;
}

.welcome {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; text-align: center;
}
.welcome .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink-900); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  margin-bottom: 20px;
}
.welcome h2 {
  font-size: 24px; font-weight: 600; color: var(--ink-900);
  margin: 0 0 8px 0; letter-spacing: -0.01em;
}
.welcome p {
  font-size: 14px; color: var(--ink-500);
  max-width: 420px; line-height: 1.5; margin: 0 0 32px 0;
}
.welcome .suggestions {
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column; gap: 8px;
}
.suggestion {
  text-align: left;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  font-size: 14px; font-family: inherit;
  color: var(--ink-700);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.suggestion:hover {
  border-color: var(--ink-400);
  background: var(--ink-100);
}
.suggestion .arrow { color: var(--ink-300); transition: color 0.15s; }
.suggestion:hover .arrow { color: var(--ink-500); }

.msg-user {
  align-self: flex-end; max-width: 80%;
  background: var(--ink-900); color: white;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-wrap: break-word;
}

.msg-assistant {
  align-self: flex-start; max-width: 85%;
}
.msg-assistant .label {
  font-size: 10px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-500);
  font-weight: 500; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.msg-assistant .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink-900); color: white;
  font-size: 9px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0.05em;
}
.msg-assistant .body {
  font-size: 14px; line-height: 1.6; color: var(--ink-900);
  white-space: pre-wrap; word-wrap: break-word;
}
.msg-assistant .body h3 {
  font-size: 15px; font-weight: 600; margin: 16px 0 8px 0;
}
.msg-assistant .body ul, .msg-assistant .body ol {
  padding-left: 20px; margin: 8px 0;
}
.msg-assistant .body li { margin: 4px 0; }
.msg-assistant .body code {
  background: var(--ink-100); padding: 2px 6px;
  border-radius: 4px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.msg-error {
  align-self: flex-start; max-width: 80%;
  background: var(--accent-err-bg);
  border: 1px solid var(--accent-err-border);
  color: var(--accent-err);
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; line-height: 1.5;
}
.msg-error .label {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 4px;
}

.thinking {
  align-self: flex-start;
  display: flex; gap: 6px; align-items: center;
  color: var(--ink-400); font-size: 13px;
  padding: 8px 0;
}
.dot {
  width: 6px; height: 6px;
  background: var(--ink-400); border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.composer {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--ink-200);
}
.input-wrap {
  position: relative;
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  transition: border-color 0.15s;
}
.input-wrap:focus-within { border-color: var(--ink-500); }
#input {
  width: 100%; min-height: 48px; max-height: 200px;
  padding: 14px 76px 14px 16px;
  border: none; background: transparent;
  resize: none; font-family: inherit;
  font-size: 14px; line-height: 1.5;
  color: var(--ink-900); outline: none;
}
#input::placeholder { color: var(--ink-400); }
#send {
  position: absolute; right: 8px; bottom: 8px;
  padding: 8px 18px;
  background: var(--ink-900); color: white;
  border: none; border-radius: 8px;
  font-size: 12px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
#send:hover:not(:disabled) { background: var(--ink-700); }
#send:disabled { opacity: 0.3; cursor: not-allowed; }
.hint {
  margin-top: 8px; font-size: 11px; color: var(--ink-400);
}
