/* ------------------------------------------------------------------
   Dedicated assistant page — clean product surface
   ------------------------------------------------------------------ */

:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-soft: #fafaf8;
  --surface-muted: #f2f4f7;
  --ink: #101828;
  --muted: #667085;
  --muted-light: #98a2b3;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --accent: #ff3b1f;
  --accent-text: #c22e16;
  --accent-soft: #fff1ed;
  --pink: #f6a6bf;
  --pink-strong: #c43c68;
  --green: #2f9e5b;
  --font: "Familjen Grotesk", "Segoe UI", sans-serif;
  --header-height: 64px;
  --sidebar-width: 260px;
  --chat-width: 760px;
  --shadow-soft: 0 12px 32px rgba(16, 24, 40, 0.08);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: var(--accent-text); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* Header ----------------------------------------------------------- */

.app-header {
  position: relative;
  z-index: 10;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.app-header__inner {
  width: min(100% - 40px, 1440px);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.page-brand__mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.page-brand__word {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  white-space: nowrap;
}
.page-brand__word .pink { color: var(--pink-strong); }
.page-brand__word .red { color: var(--accent); }

.app-header__divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}
.app-header__context {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.header-link {
  padding: 6px 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color 0.2s ease;
}
.header-link:hover { color: var(--ink); }

.header-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.header-widget svg { width: 14px; height: 14px; }
.header-widget:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

/* Layout ----------------------------------------------------------- */

.assistant {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: calc(100dvh - var(--header-height));
  overflow: hidden;
}

.assistant__sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  padding: 26px 20px 20px;
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.assistant__sidebar::-webkit-scrollbar { width: 6px; }
.assistant__sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--border-strong);
  background-clip: padding-box;
}

.sidebar-kicker {
  margin-bottom: 8px;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sidebar-copy {
  max-width: 30ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.side-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.fact-list { display: grid; gap: 12px; }
.fact-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.fact-list strong { color: var(--ink); font-weight: 600; }
.fact-mark {
  width: 5px;
  height: 5px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--pink);
}

.side-links { display: grid; gap: 6px; }
.side-links a {
  color: var(--muted);
  font-size: 12px;
  transition: color 0.2s ease;
}
.side-links a:hover { color: var(--ink); }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.2s ease;
}
.sidebar-bottom a:hover { color: var(--ink); }
.sidebar-bottom svg { width: 12px; height: 12px; }

/* Workspace -------------------------------------------------------- */

.assistant__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.conversation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 60px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.conversation-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.conversation-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid #ffe0d8;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.conversation-avatar svg { width: 16px; height: 16px; }
.conversation-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.conversation-status {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
}
.conversation-status span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.new-chat svg { width: 13px; height: 13px; }
.new-chat:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.conversation-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* Empty state ------------------------------------------------------ */

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 28px 24px;
  background: var(--surface);
}
.empty-state[hidden] { display: none !important; }

.empty-state__inner {
  width: 100%;
  max-width: 650px;
  margin-block: auto;
  padding: 8px 0 24px;
  text-align: center;
}

.empty-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border: 1px solid #ffe0d8;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: 0 8px 22px rgba(255, 59, 31, 0.08);
}
.empty-avatar svg { width: 26px; height: 26px; }

.empty-eyebrow {
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.empty-state h2 {
  max-width: 36ch;
  margin: 8px auto 0;
  font-size: clamp(1.7rem, 2.7vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.empty-lead {
  max-width: 42ch;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
  text-align: left;
}

.suggestions button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}
.suggestions button:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}

.suggestion-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--accent-text);
}
.suggestion-icon svg { width: 16px; height: 16px; }

.suggestion-copy { min-width: 0; flex: 1; }
.suggestion-copy strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.suggestion-copy small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.suggestion-arrow {
  width: 12px;
  height: 12px;
  flex: none;
  color: var(--muted-light);
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.suggestions button:hover .suggestion-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.empty-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

/* Conversation ----------------------------------------------------- */

.chat-log--page {
  width: 100%;
  max-width: var(--chat-width);
  margin-inline: auto;
  padding: 26px 24px 8px;
  gap: 20px;
}

.chat-log--page .chat-message {
  animation: assistantRise 0.32s var(--ease) both;
}
.chat-log--page .chat-message--agent { align-items: flex-start; }
.chat-log--page .chat-message__avatar {
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border: 1px solid #ffe0d8;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.chat-log--page .chat-message__avatar svg { width: 13px; height: 13px; }
.chat-log--page .chat-message__body { max-width: min(84%, 620px); }

.chat-log--page .chat-message--agent .chat-bubble {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.65;
}

.chat-log--page .chat-message--user {
  max-width: min(82%, 540px);
}
.chat-log--page .chat-message--user .chat-bubble {
  padding: 9px 13px;
  border: 1px solid #eaecf0;
  border-radius: 16px 16px 4px 16px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.chat-log--page .chat-actions { margin-top: 9px; }
.chat-log--page .chat-action {
  min-height: 32px;
  padding: 0.34rem 0.65rem;
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 11.5px;
}
.chat-log--page .chat-action:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.chat-log--page .chat-action--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.chat-log--page .chat-action--primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}
.chat-log--page .chat-chips { margin-top: 8px; }
.chat-log--page .chat-chip {
  min-height: 28px;
  padding: 0.3rem 0.55rem;
  border-color: var(--border);
  color: var(--muted);
  font-size: 10.5px;
}
.chat-log--page .chat-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.chat-log--page .chat-typing__bubble {
  min-height: 30px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
}
.chat-log--page .chat-typing__bubble span {
  width: 4px;
  height: 4px;
  background: var(--muted);
}

/* Composer --------------------------------------------------------- */

.chat-composer--page {
  width: 100%;
  max-width: var(--chat-width);
  margin-inline: auto;
  padding: 0 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 0;
  background: transparent;
}
.chat-composer--page .chat-input-wrap {
  padding: 7px 7px 7px 15px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-composer--page .chat-input-wrap:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(255, 59, 31, 0.07), var(--shadow-soft);
}
.chat-composer--page .chat-input {
  min-height: 30px;
  padding: 5px 0;
  font-size: 14px;
}
.chat-composer--page .chat-input::placeholder { color: var(--muted); }
.chat-composer--page .chat-send {
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
}
.chat-composer--page .chat-send:hover:not(:disabled) {
  background: var(--accent);
  color: var(--ink);
}
.chat-composer--page .chat-send:disabled {
  opacity: 0.22;
}
.chat-composer--page .chat-send svg { width: 14px; height: 14px; }
.chat-composer--page .chat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

@keyframes assistantRise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Responsive ------------------------------------------------------- */

@media (max-width: 980px) {
  :root { --header-height: 56px; }

  .assistant { grid-template-columns: 1fr; }
  .assistant__sidebar { display: none; }
  .app-header__inner { width: calc(100% - 32px); }
  .app-header__context,
  .app-header__divider,
  .header-link--home { display: none; }

  .conversation-bar { min-height: 52px; padding: 0 16px; }
  .conversation-name { font-size: 12.5px; }
  .conversation-status { font-size: 10px; }
  .new-chat {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .new-chat span { display: none; }

  .empty-state { padding: 24px 18px; }
  .empty-state h2 { font-size: clamp(1.55rem, 7vw, 2rem); }
  .empty-lead { font-size: 13px; }
  .suggestions { margin-top: 22px; }

  .chat-log--page {
    max-width: none;
    padding: 20px 16px 8px;
    gap: 18px;
  }
  .chat-log--page .chat-message__body { max-width: 90%; }
  .chat-log--page .chat-message--user { max-width: 90%; }
  .chat-log--page .chat-message--agent .chat-bubble { font-size: 14px; }
  .chat-log--page .chat-message--user .chat-bubble { font-size: 13.5px; }

  .chat-composer--page {
    max-width: none;
    padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  }
  .chat-composer--page .chat-note { font-size: 9.5px; }
}

@media (max-width: 380px) {
  .suggestions { grid-template-columns: 1fr; }
  .empty-state h2 { font-size: 1.5rem; }
  .header-widget span { display: none; }
  .header-widget { width: 34px; padding: 0; justify-content: center; }
}

@media (max-height: 700px) and (max-width: 980px) {
  .empty-avatar { width: 48px; height: 48px; }
  .empty-avatar svg { width: 22px; height: 22px; }
  .empty-state h2 { margin-top: 5px; }
  .empty-lead { display: none; }
  .suggestions { margin-top: 16px; }
  .empty-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
