:root {
  /* Tuned to Claude Desktop CDS light tokens */
  --ink: #1f1f1e;
  --ink-soft: #5f5e5a;
  --paper: #f6f6f4;
  --paper-2: #f0efec;
  --sand: #e7e6e1;
  --clay: #d97757;
  --clay-deep: #c6613f;
  --chat-bg: #f9f9f7;
  --sidebar: #ffffff;
  --sidebar-ink: #383835;
  --muted: #898781;
  --line: color-mix(in oklab, #0b0b0b 8%, transparent);
  --composer-bg: #ffffff;
  --shadow: 0 0 0 1px color-mix(in oklab, #0b0b0b 6%, transparent),
    0 4px 24px color-mix(in oklab, #0b0b0b 6%, transparent);
  --radius: 18px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

.view {
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Homepage —— */

.view-home {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, #f0d2b0 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, #d9e0d4 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 10% 70%, #e8d5c4 0%, transparent 45%),
    linear-gradient(165deg, #fbf7f0 0%, #efe6d8 48%, #e7ddd0 100%);
  z-index: 0;
}

.home-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.home-main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(2rem, 6vw, 4rem) 1.25rem 3rem;
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
  width: 100%;
  animation: home-enter 0.7s ease-out both;
}

@keyframes home-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.home-tagline {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 26rem;
}

.home-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: rgba(196, 92, 38, 0.12);
  color: var(--clay-deep);
  font-size: 0.9rem;
}

.create-form {
  margin-top: 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.create-form textarea,
.create-form input[type="text"] {
  width: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(26, 24, 20, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.create-form textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.create-form textarea:focus,
.create-form input[type="text"]:focus {
  border-color: rgba(196, 92, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.create-form textarea::placeholder,
.create-form input[type="text"]::placeholder {
  color: #8a8174;
}

.truncate-warning {
  margin: 0;
  font-size: 0.85rem;
  color: var(--clay-deep);
  text-align: left;
}

.create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.btn {
  appearance: none;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: #f8f3ea;
}

.btn-primary:hover {
  background: #2c2822;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(26, 24, 20, 0.22);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px dashed rgba(26, 24, 20, 0.2);
}

.btn-ghost:hover {
  color: var(--ink);
  border-style: solid;
}

.copy-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1rem 1.25rem 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #8a8174;
  max-width: 36rem;
  margin: 0 auto;
}

.ask-disclaimer {
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  z-index: 5;
  width: min(calc(100% - 3.5rem), 54rem);
  transform: translateX(-50%);
  padding: 0;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #6e6b64;
  pointer-events: none;
}

/* —— Claude Desktop mock (dark empty state) —— */

.view-ask {
  position: relative;
  background: #141413;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: #f5f4ef;
}

.desktop-shell {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  animation: shell-in 0.45s ease-out both;
}

@keyframes shell-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  min-height: 0;
  padding: 0 10px 10px;
  border-radius: 0;
  background: #191918;
  border: none;
  border-right: 0.5px solid rgba(255, 255, 255, 0.08);
  color: #d8d5cc;
  overflow: hidden;
}

.sidebar-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 2px 4px;
  flex-shrink: 0;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 4px;
}

.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.tl-close {
  background: #ff5f57;
}

.tl-min {
  background: #febc2e;
}

.tl-max {
  background: #28c840;
}

.sidebar-chrome-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.chrome-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #8a8780;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #121211;
}

.sidebar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #8a8780;
}

.sidebar-tab.is-active {
  background: #2c2c2a;
  color: #f0eee6;
}

.sidebar-new {
  appearance: none;
  border: none;
  background: #2a2a28;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #f0eee6;
  text-align: left;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.sidebar-new-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #f0eee6;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 2px;
}

.sidebar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  color: #c4c0b6;
}

.sidebar-row svg,
.sidebar-item svg {
  color: #8a8780;
  flex-shrink: 0;
}

.sidebar-beta {
  margin-left: auto;
  font-size: 11px;
  color: #8a8780;
  font-weight: 500;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}

.sidebar-recents {
  flex: 1;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-recents::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.sidebar-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 4px;
}

.sidebar-label {
  font-size: 12px;
  font-weight: 500;
  color: #8a8780;
  padding: 0;
}

.sidebar-filter {
  color: #8a8780;
}

.sidebar-item {
  padding: 8px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  color: #c4c0b6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  pointer-events: auto;
}

a.sidebar-item {
  cursor: pointer;
}

a.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f0eee6;
}

.sidebar-item svg {
  margin-top: 2px;
}

.sidebar-bottom {
  margin-top: auto;
  margin-left: -10px;
  margin-right: -10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.12);
}

.sidebar-bottom > .sidebar-row {
  margin: 0;
  padding: 10px 18px;
  border-radius: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 18px;
  border-radius: 0;
  min-width: 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.12);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2c2c2a;
  color: #f0eee6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.user-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: #f0eee6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dot {
  color: #8a8780;
  flex-shrink: 0;
}

.user-plan {
  font-size: 12px;
  color: #8a8780;
  flex-shrink: 0;
}

.user-caret {
  color: #8a8780;
  flex-shrink: 0;
}

.user-download {
  color: #8a8780;
  display: inline-flex;
  flex-shrink: 0;
}

.chat-stage {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.75rem 2.75rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #141413;
}

.chat-hero {
  width: 100%;
  max-width: 54rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.greeting-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.starburst {
  color: #d97757;
  flex-shrink: 0;
  display: block;
}

.chat-greeting {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  font-weight: 400;
  color: #f0eee6;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.composer-wrap {
  width: 100%;
  max-width: 100%;
}

.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  width: 100%;
  height: 8rem;
  min-height: 8rem;
  max-height: 8rem;
  padding: 1rem 1rem 0.75rem;
  border-radius: 22px;
  background: #212120;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.composer.focused {
  border-color: rgba(217, 119, 87, 0.35);
  box-shadow:
    0 0 0 3px rgba(217, 119, 87, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.28);
}

.composer-top {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.composer-text {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overflow-x: hidden;
  font-size: 1.05rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: #f5f4ef;
  text-align: left;
  min-width: 0;
  width: 100%;
}

.composer-text.has-caret::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: #f5f4ef;
  animation: caret-blink 0.9s steps(1) infinite;
}

@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}

.composer-placeholder {
  position: absolute;
  left: 0;
  top: 0;
  color: #8a8780;
  font-size: 1.05rem;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.composer-placeholder.hidden {
  opacity: 0;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}

.composer-tools,
.composer-trailing,
.voice-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #a8a59c;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: #2a2a28;
  gap: 0;
}

.mode-pill {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: #9c998f;
}

.mode-pill.is-active {
  background: #3a3a37;
  color: #f0eee6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.model-chip {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #c4c0b6;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: default;
}

.model-chip svg {
  color: #8a8780;
}

.send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f5f4ef;
  color: #141413;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.send-btn.armed {
  box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.28);
  transform: scale(1.06);
  background: #d97757;
  color: #141413;
}

.send-btn.pressed {
  transform: scale(0.92);
  background: #c6613f;
}

/* Fake cursor */

.fake-cursor {
  position: fixed;
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-top: -2px;
  pointer-events: none;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='22' viewBox='0 0 18 22'%3E%3Cpath fill='%23f5f4ef' stroke='%23141413' stroke-width='1.2' d='M1.2 1.2l15.2 9.1-7.1 1.7 2.4 7.2-3.2 1.1-2.5-7.5L1.2 16.2V1.2z'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

.fake-cursor.visible {
  opacity: 1;
}

.fake-cursor.clicking {
  transform: scale(0.88);
}

/* Fallback panel */

.fallback-panel {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 10, 9, 0.55);
  backdrop-filter: blur(8px);
  animation: panel-in 0.35s ease-out both;
}

@keyframes panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fallback-inner {
  position: relative;
  width: min(100%, 26rem);
  background: #1c1c1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.75rem 1.5rem 1.35rem;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  animation: panel-rise 0.4s ease-out both;
  color: #f5f4ef;
}

.fallback-close {
  appearance: none;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8a8780;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.fallback-close:hover {
  color: #f0eee6;
  background: rgba(255, 255, 255, 0.06);
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.fallback-joke {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  font-style: normal;
  color: #f0eee6;
  line-height: 1.2;
}

.fallback-body {
  margin: 0.75rem 0 0;
  color: #a8a59c;
  font-size: 0.95rem;
  line-height: 1.45;
}

.fallback-actions {
  margin-top: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.view-ask .btn-primary {
  background: #f5f4ef;
  color: #141413;
}

.view-ask .btn-primary:hover {
  background: #fff;
}

.view-ask .btn-secondary {
  color: #f5f4ef;
  border-color: rgba(255, 255, 255, 0.16);
}

.view-ask .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.view-ask .btn-ghost {
  color: #a8a59c;
  border-color: rgba(255, 255, 255, 0.14);
}

.view-ask .btn-ghost:hover {
  color: #f5f4ef;
}

.view-ask .copy-status {
  color: #a8a59c;
}

.fallback-home {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #a8a59c;
}

.fallback-home:hover {
  color: #f5f4ef;
}

@media (max-width: 760px) {
  .view-ask,
  .desktop-shell {
    overflow: auto;
  }

  .desktop-shell {
    grid-template-columns: 1fr;
    padding: 0;
    height: auto;
    min-height: 100%;
  }

  .sidebar {
    display: none;
  }

  .chat-stage {
    height: auto;
    min-height: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 18vh 1rem 4.5rem;
    overflow: visible;
  }

  .chat-hero {
    align-items: stretch;
    width: 100%;
  }

  .chat-greeting {
    font-size: 1.65rem;
  }

  .greeting-row {
    justify-content: center;
  }

  .composer {
    height: auto;
    min-height: 7.25rem;
    max-height: none;
    overflow: visible;
    border-radius: 18px;
  }

  .composer-top {
    flex: 0 0 auto;
    overflow: visible;
    min-height: 1.5rem;
  }

  .composer-text {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .model-chip {
    font-size: 12px;
  }

  .ask-disclaimer {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.75rem;
    width: auto;
    max-width: none;
    transform: none;
    margin: 0;
    padding: 0;
    text-align: center;
  }
}
