/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-header .logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
  text-decoration: none;
}
.site-header nav a {
  margin-left: 20px;
  color: var(--color-muted);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--color-text); }

/* Hero */
.hero {
  padding: 96px 0;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.5rem); margin: 0 0 16px; }
.hero .lead { font-size: 1.2rem; color: var(--color-muted); margin: 0 0 32px; }

/* Button */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { opacity: 0.9; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Chat widget */
chat-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  font-size: 0.95rem;
}
.chat-launcher {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.chat-launcher:hover { transform: scale(1.06); }
chat-widget.is-open .chat-launcher { display: none; }

.chat-panel {
  width: 360px;
  height: min(540px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-accent);
  color: #fff;
}
.chat-head span { display: block; font-size: 0.8rem; opacity: 0.85; }
.chat-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--color-border);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--color-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.summary { font-size: 0.88rem; border-left: 3px solid var(--color-accent); }
.chat-msg.typing { color: var(--color-muted); font-style: italic; }

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
}
.chat-actions:not(:empty) { padding-bottom: 14px; }
.chat-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chat-btn.primary { background: var(--color-accent); color: #fff; }

.chat-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px;
  border-top: 1px solid var(--color-border);
}
.chat-form[hidden] { display: none; }
.chat-input {
  flex: 1;
  resize: none;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
  max-height: 120px;
}
.chat-input:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
.chat-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.chat-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 480px) {
  chat-widget { right: 12px; bottom: 12px; }
  chat-widget.is-open { inset: 0; }
  chat-widget.is-open .chat-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
}
