/* ============================================
   FONT — force CDN load, bypass local Inter install
   ============================================ */
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/InterVariable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   COLOR TOKENS
   ============================================ */
:root {
  --color-bg:             #ffffff;
  --color-surface:        #EFF1F3;
  --color-surface-2:      #F4F5F6;
  --color-surface-3:      #E5E8EB;
  --color-text:           #191C1E;
  --color-text-secondary: #666E74;
  --color-text-muted:     #9BA1A6;
  --color-border:         #DEE3E7;
  --color-border-hover:   #C8CDD2;
  --color-divider:        #DEE3E7;
  --color-send-btn:       #191C1E;
  --color-send-btn-hover: #3a3d40;
}

[data-theme="dark"] {
  --color-bg:             #111416;
  --color-surface:        #1A1E20;
  --color-surface-2:      #1E2326;
  --color-surface-3:      #252B2E;
  --color-text:           #F0F2F3;
  --color-text-secondary: #8C9398;
  --color-text-muted:     #5C6368;
  --color-border:         #272C2F;
  --color-border-hover:   #363C40;
  --color-divider:        #272C2F;
  --color-send-btn:       #F0F2F3;
  --color-send-btn-hover: #d0d4d6;
}

/* Theme transition — only active during switch, doesn't affect hover states */
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    fill 0.4s ease,
    stroke 0.4s ease,
    left 0.25s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Exclude the work panel (its own GPU layer via transform on mobile) from
   the animated theme transition — an in-flight background-color transition
   can get baked into that layer and show a stale color when it slides in.
   Only applies where the panel is an off-screen drawer (xs breakpoint). */
@media (max-width: 543px) {
  .theme-transitioning .panel-right,
  .theme-transitioning .panel-right *,
  .theme-transitioning .panel-right *::before,
  .theme-transitioning .panel-right *::after {
    transition: none !important;
  }
}

/* ============================================
   PAGE LOAD — hide animated elements before JS runs
   ============================================ */
#greeting-heading,
#greeting-body,
#chips,
.input-wrap-outer,
#work-header,
.work-card {
  opacity: 0;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: 'ss03' 1, 'zero' 1, 'cv01' 1, 'cv02' 1, 'cv03' 1, 'cv04' 1, 'cv05' 1, 'cv09' 1;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-feature-settings: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-optical-sizing: inherit;
  resize: none;
  outline: none;
  border: none;
  background: transparent;
}

/* ============================================
   LAYOUT
   ============================================ */
.app {
  display: grid;
  grid-template-columns: 1fr 1px minmax(300px, 360px);
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ============================================
   LEFT PANEL
   ============================================ */
.panel-left {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  background: var(--color-bg);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px;
  flex-shrink: 0;
  background: var(--color-bg);
}

.wordmark {
  position: relative;
  display: flex;
  align-items: center;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1;
  text-decoration: none;
}

.wordmark-logo {
  height: 30px;
  width: 64px;
  flex-shrink: 0;
  margin-left: -6px;
}

.wordmark-text {
  position: absolute;
  left: -6px;
  top: 50%;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.25s cubic-bezier(1, 0, 0.875, 1), opacity 0.25s cubic-bezier(0.36, 0, 0.64, 1);
  pointer-events: none;
}

@media (min-width: 769px) {
  .wordmark:hover .wordmark-text {
    opacity: 1;
    transition: transform 0.25s cubic-bezier(0.125, 0, 0, 1), opacity 0.25s cubic-bezier(0.36, 0, 0.64, 1);
    transform: translateY(-50%) translateX(70px);
  }
}

.how-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  padding: 0;
  transition: color 0.15s ease;
}

.how-link:hover {
  color: var(--color-text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  padding: 0;
}

.theme-toggle__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  background: var(--color-surface);
  padding: 0 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.theme-toggle:hover .theme-toggle__track {
  background: var(--color-border);
}

.theme-toggle:hover .theme-toggle__sun,
.theme-toggle:hover .theme-toggle__moon {
  color: var(--color-text);
}

.theme-toggle__sun,
.theme-toggle__moon {
  position: relative;
  z-index: 2;
  color: var(--color-text-secondary);
  transition: color 0.25s ease;
  flex-shrink: 0;
  pointer-events: none;
}

.theme-toggle__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: 0 1px 2px 0 rgba(25, 28, 30, 0.36);
  z-index: 1;
  transition: left 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] .theme-toggle__knob {
  left: 28px;
}

/* Chat area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 36px;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

.chat-area::-webkit-scrollbar {
  width: 0;
}

/* Greeting — centered in available space */
.greeting {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-bottom: 0;
}

.greeting-heading {
  font-size: 49px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 16px;
}

.greeting-body {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  max-width: 660px;
}

.greeting-body strong {
  font-weight: 500;
  color: var(--color-text);
}

/* Input area */
.input-area {
  flex-shrink: 0;
  padding: 0 36px 28px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

/* Chips */
.chips {
  margin-bottom: 12px;
}

.chips-label {
  display: none;
}

.chips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chip {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text);
  text-align: left;
  line-height: 1;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 1px 3px 0 rgba(25, 28, 30, 0.09);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  background: var(--color-surface);
  border-color: var(--color-border-hover);
  box-shadow: none;
}

.chip:active {
  background: var(--color-surface-3);
  box-shadow: none;
}

/* Chips hidden state */
.chips.hidden {
  display: none;
}

/* Input wrap */
.input-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 16px 16px 16px 24px;
  min-height: 120px;
  cursor: text;
}

.input-field {
  flex: 1;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.5;
  min-height: 88px;
  max-height: 240px;
  overflow-y: auto;
}

.input-field::placeholder {
  color: var(--color-text-muted);
}

.input-field:focus-visible {
  outline: none;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--color-send-btn);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.15s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.send-btn:disabled {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

.send-btn:hover {
  background: var(--color-send-btn-hover);
}

.send-btn:active {
  transform: scale(0.95);
}

/* ============================================
   PANEL DIVIDER
   ============================================ */
.panel-divider {
  background: var(--color-divider);
  width: 1px;
  height: 100dvh;
}

/* ============================================
   RIGHT PANEL (WORK)
   ============================================ */
.panel-right {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  background: var(--color-bg);
  position: relative;
}

/* Work header */
.work-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 36px;
  flex-shrink: 0;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--color-bg);
}

/* Sticky overlay for back/close buttons over the detail thumb */
.panel-right-overlay {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 100;
}

.work-title-icon {
  flex-shrink: 0;
}

.work-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.back-btn[hidden] {
  display: none;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--color-text-secondary);
  background: transparent;
  flex-shrink: 0;
  transition: opacity 0.15s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.back-btn.disc-visible,
.detail-close-btn {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px 0 rgba(25, 28, 30, 0.48);
  backdrop-filter: blur(6px);
  color: var(--color-text-secondary);
}

.back-btn.disc-visible:hover,
.detail-close-btn:hover {
  background: rgba(239, 241, 243, 0.85);
  opacity: 1;
}

[data-theme="dark"] .back-btn.disc-visible,
[data-theme="dark"] .detail-close-btn {
  background: rgba(25, 28, 30, 0.85);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.48);
  color: var(--color-text-secondary);
}

[data-theme="dark"] .back-btn.disc-visible:hover,
[data-theme="dark"] .detail-close-btn:hover {
  background: rgba(37, 43, 46, 0.85);
}

.back-btn:hover {
  opacity: 0.7;
}

/* Detail view close (xs drawer only) — top-right, mirrors the back button */
.detail-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  transition: opacity 0.15s ease, background 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 768px) {
  .panel-right.detail-active .detail-close-btn {
    display: flex;
  }
}

/* Detail active — collapse header so thumb fills from top */
.panel-right.detail-active .work-header {
  height: 0;
  padding: 0;
  min-height: 0;
  overflow: visible;
}

.panel-right.detail-active .work-panel-close {
  display: none;
}

/* Back button is a direct child of panel-right, floats over the thumb */
.back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
}

/* Detail active — main card is display only, not interactive */
.panel-right.detail-active .work-items .work-card {
  pointer-events: none;
  cursor: default;
}

/* Detail active — edge-to-edge thumb */
.panel-right.detail-active .work-items .work-card .work-thumb {
  margin-left: -36px;
  margin-right: -36px;
  width: calc(100% + 72px);
  border-radius: 0;
  transition:
    margin-left 0.4s cubic-bezier(0.125, 0, 0, 1),
    margin-right 0.4s cubic-bezier(0.125, 0, 0, 1),
    width 0.4s cubic-bezier(0.125, 0, 0, 1),
    border-radius 0.3s ease;
}

@media (max-width: 543px) {
  .panel-right.detail-active .work-items .work-card .work-thumb {
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
  }
}

/* Work items */
.work-items {
  padding: 0 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* Work card */
.work-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  text-align: left;
  transition: opacity 0.15s ease;
  width: 100%;
}

.work-card:active .work-thumb img {
  transform: scale(1.02);
}

/* Work card active/selected state */
.work-card.active .work-thumb {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Work thumbnail */
.work-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--color-surface);
  overflow: hidden;
  border-radius: 12px;
}

.work-thumb img,
.work-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-card:hover .work-thumb img {
  transform: scale(1.10);
}

/* Detail active — main thumb is not a hoverable list item, never zoom it */
.panel-right.detail-active .work-items .work-card:hover .work-thumb img {
  transform: none;
}

.work-card.is-opening .work-thumb img {
  transform: scale(1) !important;
  transition: transform 0.4s ease-out !important;
}

/* Placeholder thumbnail color */
.work-thumb--spark,
.work-thumb--nav,
.work-thumb--docs,
.work-thumb--getthrough,
.work-thumb--branding,
.work-thumb--rtifex {
  background: var(--color-surface-2);
}

/* Work card meta */
.work-card-meta {
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
}

.work-card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}

.work-card-sub {
  display: none;
}

/* Mobile work panel trigger (hidden at desktop) */
.work-panel-btn {
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  padding: 0;
  margin-left: 8px;
  transition: color 0.15s ease;
}

.work-panel-btn:hover {
  color: var(--color-text);
}

/* Mobile work panel close button (hidden at desktop) */
.work-panel-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-left: auto;
  transition: color 0.15s ease;
  transform: translate(4px, 2px);
}

.work-panel-close:hover {
  color: var(--color-text);
}

@media (max-width: 768px) {
  .work-panel-btn  { display: flex; }
  .work-panel-close { display: flex; }
}

.work-header-default[hidden] {
  display: none;
}

.work-header-default {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

/* Work detail view */
.work-detail {
  padding: 0 36px 36px;
  columns: 1;
  column-gap: 24px;
}

.work-detail .work-card {
  break-inside: avoid;
  margin-bottom: 24px;
  width: 100%;
  display: block;
}

.work-detail .work-thumb {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ============================================
   CONVERSATION MESSAGES
   ============================================ */
.message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
  border-bottom: none;
}

.message:last-child {
  border-bottom: none;
}

.message--user {
  align-items: flex-end;
}

.message--agent {
  align-items: flex-start;
}

.message-bubble {
  max-width: 85%;
  font-size: 16px;
  line-height: 1.6;
}

.message--user .message-bubble {
  background: var(--color-surface);
  border-radius: 18px 18px 18px 18px;
  padding: 12px 16px;
  color: var(--color-text);
  font-size: 15px;
  animation: bubble-grow-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: bottom right;
}

@keyframes bubble-grow-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.message--agent .message-bubble {
  color: var(--color-text);
  font-size: 16px;
  max-width: 100%;
}

.message--agent .message-bubble p {
  margin-bottom: 12px;
}

.message--agent .message-bubble p:last-child {
  margin-bottom: 0;
}

.message--agent .message-bubble ul {
  margin: 8px 0 12px 0;
  padding-left: 0;
  list-style: none;
}

.message--agent .message-bubble ul li {
  padding: 3px 0 3px 16px;
  position: relative;
  font-size: 15px;
  line-height: 1.55;
}

.message--agent .message-bubble ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing-pulse 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-pulse {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================
   INLINE IMAGE IN CONVERSATION
   ============================================ */
.inline-image {
  display: block;
  width: 100%;
  max-width: 480px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  position: relative;
  cursor: zoom-in;
}

.inline-image img {
  width: 100%;
  height: auto;
  display: block;
}

.inline-image-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.inline-image:hover .inline-image-expand {
  opacity: 1;
}

.inline-image-expand svg {
  color: #ffffff;
}

/* ============================================
   HOW THIS WORKS MODAL
   ============================================ */
.how-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  isolation: isolate;
  transform: translateZ(0);
}

.how-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.how-modal {
  position: relative;
  background: var(--color-bg);
  border-radius: 16px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(48px) translateZ(0);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
}

[data-theme="dark"] .how-modal {
  background: #25282b;
}

.how-modal-overlay.open .how-modal {
  transform: translateY(0) translateZ(0);
  opacity: 1;
}

.how-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.how-modal-close:hover {
  color: var(--color-text);
}

.how-modal-heading {
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1.2;
}

.how-modal-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
}


/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .panel-divider {
    display: none;
  }

  .panel-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 66%;
    height: 100dvh;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
  }

  .panel-right.work-panel-open {
    transform: translateX(0);
    box-shadow: -1px 0 9px 0 rgba(18, 19, 21, 0.23);
  }

  .panel-left {
    height: 100dvh;
  }

  .header {
    padding: 16px 20px;
  }

  .chat-area {
    padding: 0 20px;
  }

  .input-area {
    padding: 0 20px 20px;
  }

  .greeting-heading {
    font-size: 36px;
  }

  .greeting-body {
    font-size: 20px;
  }

}

/* ============================================
   TRANSITIONS
   ============================================ */
.work-items {
  transition: opacity 0.2s ease;
}

.work-items.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

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

/* ============================================
   GREETING STATE — full center layout
   ============================================ */
.panel-left.greeting-state {
  display: flex;
  flex-direction: column;
}

.panel-left.greeting-state .chat-area {
  display: none;
}

.panel-left.greeting-state .greeting-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  gap: 24px;
}

.greeting-center > * {
  width: 100%;
  max-width: 684px;
}

.greeting-center .greeting-heading {
  font-size: 49px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 36px;
}

.greeting-center .greeting-body {
  font-size: 25px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.03em;
  color: var(--color-text-secondary);
  max-width: 580px;
  margin: 0;
}

.greeting-center .chips {
  margin-bottom: 24px;
  margin-top: 24px;
}

.greeting-center .input-wrap-outer {
  width: 100%;
}

.greeting-bottom {
  width: 100%;
  max-width: 684px;
  display: flex;
  flex-direction: column;
}

/* When conversation starts, restore normal layout */
.panel-left.conversation-state .greeting-center {
  display: none;
}

.panel-left.conversation-state .chat-area {
  display: flex;
}

.panel-left.conversation-state .input-area {
  display: block;
}

/* Conversation state input area — hidden in greeting state */
#input-area-bottom {
  display: none;
}

.panel-left.conversation-state #input-area-bottom {
  display: block;
}

.panel-left.greeting-state .greeting-center .input-wrap {
  width: 100%;
}

/* ============================================
   XS — 543px and below
   ============================================ */
@media (max-width: 543px) {
  .work-header {
    padding: 20px 24px;
  }

  /* Tighten the gap between messages/responses by 24px total */
  .message {
    padding: 8px 0;
  }

  .work-items,
  .work-detail {
    padding-left: 24px;
    padding-right: 24px;
  }

  .panel-left.greeting-state .greeting-center .greeting-heading {
    font-size: 39px;
  }

  .panel-left.greeting-state .greeting-center .greeting-body {
    font-size: 20px;
  }

  /* Greeting text block: centered in space above the fixed bar */
  .panel-left.greeting-state .greeting-center {
    justify-content: center;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: calc(234px + env(safe-area-inset-bottom, 0px));
  }

  /* Fixed bottom bar: chips + input pinned to viewport bottom */
  .greeting-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    background: var(--color-bg);
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
  }

  /* Chips: horizontal scrollable row, extending to viewport edges
     without affecting .greeting-bottom's padding for other elements */
  .greeting-center .chips {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
  }

  .chips-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
    padding-left: 24px;
    padding-right: 24px;
  }

  .chips-list::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
  }
}
