:root {
  --brand: #c03531;
  --brand-dark: #9d2623;
  --ink: #101827;
  --charcoal: #292c35;
  --muted: #637083;
  --faint: #9198a2;
  --warm: #f3c48c;
  --line: #dbe3ee;
  --surface: #ffffff;
  --soft: #f3f6fa;
  --soft-red: #fff0ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.84);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.brand span,
.fine-print,
.context-strip span,
.app-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

nav {
  display: grid;
  gap: 10px;
}

nav a,
.logout {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
}

.logout {
  margin-top: auto;
  text-align: center;
}

.content {
  width: min(1180px, 100%);
  padding: 44px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.flash {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--soft-red);
  border: 1px solid #fac7c4;
  color: var(--brand-dark);
}

.login-panel,
.hero,
.context-strip,
.app-list,
.chat-layout {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.login-panel {
  max-width: 720px;
  padding: 42px;
}

.hero {
  padding: 34px 38px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.35rem;
}

.lede,
.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.login-form,
.ask-form {
  display: grid;
  gap: 12px;
}

label {
  color: #344154;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

button {
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.context-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  overflow: hidden;
}

.context-strip div {
  padding: 22px;
  background: var(--surface);
}

.context-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.app-list {
  padding: 28px;
  margin-bottom: 24px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.app-grid article {
  padding: 18px;
  border-radius: 18px;
  background: var(--soft);
}

.chat-layout {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.chat-window {
  display: grid;
  gap: 14px;
  max-height: 480px;
  overflow: auto;
  padding: 4px;
}

.message {
  max-width: 860px;
  padding: 18px 20px;
  border-radius: 22px;
  line-height: 1.55;
}

.message p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.message.assistant {
  background: var(--soft);
}

.message.user {
  justify-self: end;
  background: var(--brand);
  color: white;
}

.askbar-home {
  min-height: 100vh;
  background:
    radial-gradient(circle at 90% 90%, rgba(243, 196, 140, 0.18), transparent 34%),
    linear-gradient(180deg, #f6f7f9 0%, #e7e9ed 100%);
}

.askbar-home .shell {
  display: block;
  min-height: 100vh;
}

.askbar-home .sidebar {
  display: none;
}

.askbar-home .content {
  width: 100%;
  min-height: 100vh;
  padding: clamp(22px, 3vw, 42px) clamp(18px, 4vw, 64px);
}

.askbar-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - clamp(56px, 8vw, 116px));
  padding: clamp(18px, 3vw, 34px) 0;
}

.askbar-shell {
  width: 100%;
  max-width: 920px;
  min-height: min(620px, calc(100vh - 130px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: max-width 0.24s ease, min-height 0.24s ease, justify-content 0.24s ease;
}

.askbar-home.has-chat .askbar-shell {
  min-height: calc(100vh - clamp(84px, 10vw, 136px));
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.2s ease, margin 0.2s ease;
}

.assistant-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.empty-state h1 {
  margin: 0;
  color: var(--charcoal);
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.empty-helper {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.6;
}

.askbar-home.has-chat .empty-state {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.prompt-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 0;
  transition: opacity 0.16s ease, transform 0.16s ease, max-height 0.16s ease;
}

.askbar-home.has-chat .prompt-stack {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.prompt-chip {
  width: fit-content;
  max-width: min(100%, 360px);
  padding: 10px 16px;
  border: 1px solid rgba(192, 53, 49, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(21, 24, 31, 0.08);
  color: var(--charcoal);
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: left;
}

.prompt-chip:hover,
.prompt-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(192, 53, 49, 0.34);
  background: #fff;
  color: var(--brand-dark);
  outline: 3px solid rgba(192, 53, 49, 0.16);
  outline-offset: 2px;
}

.chat-window {
  display: none;
  gap: 16px;
  align-content: end;
  flex: 1;
  max-height: none;
  margin: 0 0 18px;
  overflow: visible;
  padding: 0 2px 4px;
}

.askbar-home.has-chat .chat-window {
  display: grid;
}

.askbar-home .message {
  width: fit-content;
  max-width: min(740px, 100%);
  padding: 14px 18px;
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(21, 24, 31, 0.07);
  font-size: clamp(0.98rem, 1.05vw, 1.05rem);
}

.askbar-home .message.assistant {
  border: 1px solid rgba(219, 227, 238, 0.95);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.askbar-home .message.user {
  justify-self: end;
  max-width: min(620px, 86vw);
  background: var(--charcoal);
  color: white;
}

.askbar-home .message-body {
  display: grid;
  gap: 10px;
}

.askbar-home .message.assistant p {
  margin: 0;
  white-space: normal;
}

.askbar-home .message.assistant ul {
  margin: 0;
  padding-left: 18px;
}

.askbar-home .message.assistant li {
  margin: 4px 0;
}

.askbar-home .message.assistant a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.askbar-home .message.assistant strong {
  font-weight: 900;
}

.askbar-home .message.loading {
  color: var(--muted);
}

.thinking-dots::after {
  content: ".";
  animation: thinking-dots 1.2s infinite steps(4, end);
}

@keyframes thinking-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-action-chip {
  width: fit-content;
  padding: 9px 13px;
  border: 1px solid rgba(192, 53, 49, 0.18);
  border-radius: 999px;
  background: #fff8f7;
  color: var(--brand-dark);
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
}

.quick-action-chip:hover,
.quick-action-chip:focus-visible {
  border-color: rgba(192, 53, 49, 0.42);
  background: #fff;
  outline: 3px solid rgba(192, 53, 49, 0.15);
  outline-offset: 2px;
}

.quick-action-chip:disabled {
  cursor: wait;
  opacity: 0.68;
}

.response-image {
  display: block;
  max-width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.askbar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-height: 64px;
  padding: 6px 8px 6px 22px;
  border: 3px solid var(--warm);
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 12px 36px rgba(243, 196, 140, 0.34),
    0 24px 54px rgba(23, 30, 44, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.2s ease;
}

.askbar-form:focus-within {
  border-color: #dca560;
  box-shadow:
    0 12px 38px rgba(243, 196, 140, 0.4),
    0 24px 54px rgba(23, 30, 44, 0.1),
    0 0 0 4px rgba(192, 53, 49, 0.08);
}

.askbar-form textarea {
  min-height: 44px;
  max-height: 168px;
  padding: 10px 10px 10px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(1rem, 1.18vw, 1.18rem);
  font-weight: 400;
  line-height: 1.45;
  resize: none;
}

.askbar-form textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}

.askbar-form button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: #808287;
  color: white;
  font-size: 1.85rem;
  font-weight: 300;
  line-height: 1;
}

.askbar-form button:hover,
.askbar-form button:focus-visible {
  background: var(--brand);
  outline: 3px solid rgba(192, 53, 49, 0.18);
  outline-offset: 2px;
}

.askbar-form button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.privacy-note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: clamp(0.86rem, 1vw, 1rem);
  text-align: center;
}

.privacy-note a {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 860px) {
  .shell {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 24px;
  }

  .context-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .askbar-home .content {
    padding: 28px 18px;
  }

  .askbar-canvas {
    align-items: center;
    min-height: calc(100vh - 56px);
  }

  .prompt-stack {
    gap: 10px;
    margin-left: 0;
  }

  .prompt-chip {
    padding: 12px 16px;
    font-size: 0.98rem;
  }

  .askbar-form {
    min-height: 64px;
    padding: 7px 8px 7px 18px;
    border-width: 3px;
  }

  .askbar-form button {
    width: 48px;
    height: 48px;
    font-size: 1.85rem;
  }

  .askbar-form textarea {
    font-size: 1rem;
  }

  .askbar-home.has-chat .askbar-shell {
    min-height: calc(100vh - 72px);
  }

  .askbar-home .message {
    max-width: 100%;
  }

  .quick-actions {
    gap: 7px;
  }
}
