@font-face {
  font-family: "Instrument Serif";
  src: url("/ask-assets/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/ask-assets/InstrumentSans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #fdfcf9;
  --ink: #242321;
  --muted: #706d67;
  --border: #dedbd4;
  --field-border: #928d85;
  --focus: #242321;
  --soft: #eae7e0;
  --error: #a93729;
  --invert: 0;
  font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #1a1917;
    --ink: #ece9e2;
    --muted: #aaa69e;
    --border: #393630;
    --field-border: #777267;
    --focus: #b7b2a8;
    --soft: #25231f;
    --error: #ee9584;
    --invert: 1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110;
  --surface: #1a1917;
  --ink: #ece9e2;
  --muted: #aaa69e;
  --border: #393630;
  --field-border: #777267;
  --focus: #b7b2a8;
  --soft: #25231f;
  --error: #ee9584;
  --invert: 1;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  min-width: 280px;
  min-height: var(--viewport-height, 100svh);
  margin: 0;
  display: flex;
  flex-direction: column;
}
button,
input,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
summary {
  cursor: pointer;
}
button {
  border: 0;
  background: none;
  padding: 0;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button,
a,
summary {
  touch-action: manipulation;
}
button,
summary,
input,
textarea {
  border-radius: 8px;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-fill {
  fill: currentColor;
  stroke: none;
}
h1,
h2,
p {
  margin: 0;
}
h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
}
p {
  overflow-wrap: anywhere;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
}
.site-header {
  width: 100%;
  max-width: 1600px;
  min-height: 108px;
  margin-inline: auto;
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
}
.fabric-logo {
  display: grid;
  width: 92px;
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
}
.fabric-wordmark {
  display: block;
  width: 100%;
  aspect-ratio: 31 / 11.6;
  overflow: hidden;
}
.fabric-wordmark img {
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-20%);
  filter: invert(var(--invert));
}
.fabric-subline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 550;
  line-height: 1;
  letter-spacing: 0.18em;
}
.fabric-subline span {
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}
.ask-wordmark {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(68px, 8vw, 100px);
  letter-spacing: -0.045em;
  word-spacing: 0.05em;
  line-height: 1.15;
  white-space: nowrap;
}
.header-wordmark {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
}
body[data-conversation="true"] .header-wordmark {
  display: block;
}
.header-actions,
.session-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  transition:
    color 0.15s,
    background 0.15s;
}
.icon-button:hover:enabled,
summary.icon-button:hover {
  background: var(--soft);
  color: var(--ink);
}
.menu,
.theme-control {
  position: relative;
}
summary {
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px #0000000c;
}
.menu-panel button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
  font-size: 14px;
  white-space: nowrap;
}
.menu-panel button:hover:enabled,
.menu-panel button[aria-pressed="true"] {
  background: var(--soft);
}
.menu-panel svg {
  width: 18px;
  height: 18px;
}
#theme-options {
  min-width: 136px;
}
#theme-toggle .theme-sun,
#theme-toggle .theme-moon {
  display: none;
}
#theme-toggle[data-mode="light"] .theme-sun,
#theme-toggle[data-mode="dark"] .theme-moon {
  display: block;
}
#theme-toggle[data-mode="light"] .theme-auto,
#theme-toggle[data-mode="dark"] .theme-auto {
  display: none;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 32px;
}
main:focus {
  outline: none;
}
.welcome {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 48px 120px;
}
.welcome-content {
  text-align: center;
  width: 100%;
  max-width: 680px;
}
.greeting {
  margin-top: 18px;
  font-size: clamp(19px, 2.2vw, 23px);
  letter-spacing: -0.035em;
  line-height: 1.4;
  font-weight: 400;
}
.auth-panel {
  max-width: 440px;
  margin: 36px auto 0;
}
.entry-surface {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 9px;
  padding-left: 20px;
  min-height: 64px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
  transition: border-color 0.15s;
}
.entry-surface:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus);
}
.entry-surface input,
.entry-surface textarea {
  padding: 9px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  width: 100%;
  min-width: 0;
  outline: none;
  box-shadow: none;
  font-size: 17px;
  line-height: 26px;
  caret-color: var(--ink);
}
.entry-surface input::placeholder,
.entry-surface textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.entry-surface input:focus,
.entry-surface textarea:focus {
  outline: none;
}
.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.send-button:active:enabled {
  transform: scale(0.95);
}
.send-button:hover:enabled {
  opacity: 0.8;
}
.hint,
.form-status {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
#email-help {
  margin-bottom: 12px;
}
.form-status {
  margin-top: 12px;
  overflow-wrap: anywhere;
}
.form-status:empty {
  display: none;
}
.form-status.error {
  color: var(--error);
}
#link-help {
  margin-top: 16px;
}
.text-button {
  min-height: 44px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 13px;
}
.text-button:hover:enabled {
  color: var(--ink);
}
.notice {
  max-width: 680px;
  width: 100%;
  margin: 12px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
}
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}
.conversation {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-empty {
  text-align: center;
  padding: 48px 0 38px;
}
.conversation[data-empty="true"] .chat-empty {
  margin-top: auto;
}
.conversation[data-empty="true"] .composer-dock {
  margin-bottom: auto;
}
.messages {
  list-style: none;
  padding: 32px 0 16px;
  margin: 0;
  display: grid;
  align-content: start;
  gap: 34px;
  flex: none;
}
.conversation[data-empty="true"] .messages {
  display: none;
}
.message {
  min-width: 0;
}
.message-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.message-text {
  font-size: 17px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assistant .message-text {
  white-space: normal;
}
.assistant .message-text > * + * {
  margin-top: 16px;
}
.assistant .message-text h1,
.assistant .message-text h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
}
.assistant .message-text h3,
.assistant .message-text h4,
.assistant .message-text h5,
.assistant .message-text h6 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}
.assistant .message-text ul,
.assistant .message-text ol {
  padding-left: 1.5em;
}
.assistant .message-text li + li,
.assistant .message-text li > p + p {
  margin-top: 7px;
}
.assistant .message-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--muted);
}
.assistant .message-text a:hover {
  text-decoration-color: var(--ink);
}
.assistant .message-text blockquote {
  border-left: 2px solid var(--field-border);
  padding-left: 18px;
  color: var(--muted);
}
.assistant .message-text code {
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.84em;
  background: var(--soft);
  border-radius: 3px;
  padding: 2px 5px;
}
.assistant .message-text pre {
  position: relative;
  white-space: pre;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding: 18px 20px;
  padding-top: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 15px;
  line-height: 1.65;
  scrollbar-width: thin;
}
.assistant .message-text pre code {
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
}
.code-copy {
  position: absolute;
  top: 4px;
  right: 8px;
  min-height: 30px;
  padding: 4px 8px;
  font-family: "Instrument Sans", sans-serif;
  color: var(--muted);
  font-size: 11px;
}
.markdown-table {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.markdown-table table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 15px;
  text-align: left;
}
.markdown-table th,
.markdown-table td {
  min-width: 9rem;
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: normal;
}
.markdown-table th {
  font-weight: 600;
}
.assistant .message-text hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 24px;
}
.message-delivery {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.message-delivery button {
  padding-block: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  margin: 0 0 20px;
  color: var(--muted);
  animation: thinking-enter 180ms ease-out both;
}
.thinking-weave {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-dasharray: 22 4 16 4 17;
  stroke-linecap: round;
  animation: thinking-orbit 3.8s linear infinite;
}
.thinking-weave ellipse {
  animation: thinking-breathe 2.4s ease-in-out infinite alternate;
}
.thinking-weave ellipse:nth-child(2) {
  animation-delay: -0.8s;
}
.thinking-weave ellipse:nth-child(3) {
  animation-delay: -1.6s;
}
.thinking-word {
  font-family: "Instrument Serif", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.3;
}
.jump-latest {
  position: sticky;
  bottom: 150px;
  z-index: 2;
  align-self: center;
  min-height: 36px;
  margin-top: -36px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
}
@keyframes thinking-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes thinking-breathe {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}
@keyframes thinking-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .thinking,
  .thinking-weave,
  .thinking-weave ellipse {
    animation: none;
  }
}
.message.user {
  justify-self: end;
  background: var(--soft);
  border-radius: 10px;
  padding: 16px 20px;
  max-width: 88%;
}
.message.user .message-label {
  display: none;
}
.composer-dock {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 20px 0 12px;
  background: var(--bg);
}
.composer-dock::before {
  content: "";
  position: absolute;
  inset: -20px 0 auto;
  height: 20px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.composer textarea {
  display: block;
  resize: none;
  min-height: 44px;
  max-height: min(234px, 40dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.composer .send-button:disabled {
  background: transparent;
  color: var(--muted);
  opacity: 0.65;
}
#message-status {
  margin-top: 8px;
}
footer {
  display: flex;
  justify-content: center;
  padding: 10px 24px max(18px, env(safe-area-inset-bottom));
}
footer .text-button {
  font-size: 11px;
  letter-spacing: 0.015em;
  color: var(--muted);
}
@media (max-height: 600px) {
  .composer-dock {
    padding-block: 12px 4px;
  }
  footer {
    padding-block: 0 env(safe-area-inset-bottom);
  }
}
.dialog {
  width: min(520px, calc(100% - 32px));
  max-height: min(740px, calc(100dvh - 40px));
  margin: auto;
  padding: 22px 24px 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  overflow-y: auto;
}
.dialog::backdrop {
  background: #00000055;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.dialog-heading .icon-button {
  margin: -6px -10px -6px 0;
  flex-shrink: 0;
}
.dialog-description,
.privacy-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.dialog-description {
  margin-bottom: 20px;
}
.privacy-copy {
  display: grid;
  gap: 18px;
}
.dialog textarea {
  display: block;
  width: 100%;
  min-height: 140px;
  max-height: 35dvh;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  resize: vertical;
  font-size: 16px;
  line-height: 1.6;
}
.checkbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.checkbox input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 2px 0;
  accent-color: var(--ink);
}
.primary-button {
  background: var(--ink);
  color: var(--bg);
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
}
.conversation-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}
.conversation-list button {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  text-align: left;
  font-size: 14px;
}
.conversation-list button:hover:enabled,
.conversation-list button[aria-current="true"] {
  background: var(--soft);
}
.history-dialog {
  max-width: 420px;
}
@media (max-width: 650px) {
  .site-header {
    padding: 20px 20px 16px;
    min-height: 92px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .fabric-logo {
    width: 76px;
  }
  .fabric-subline {
    font-size: 8px;
    gap: 6px;
  }
  .header-actions,
  .session-actions {
    gap: 0;
  }
  .site-header .header-wordmark {
    display: none;
    position: static;
    transform: none;
    order: 3;
    flex-basis: 100%;
    font-size: 30px;
    text-align: center;
    margin-top: 8px;
  }
  main {
    padding-inline: 20px;
  }
  .welcome {
    padding-block: 32px 100px;
  }
  .ask-wordmark {
    font-size: clamp(60px, 14vw, 80px);
  }
  .greeting {
    font-size: 19px;
    margin-top: 16px;
    letter-spacing: -0.035em;
  }
  .auth-panel {
    margin-top: 30px;
  }
  .entry-surface {
    padding-left: 16px;
    gap: 8px;
  }
  .entry-surface input,
  .entry-surface textarea {
    font-size: 16px;
  }
  .messages {
    gap: 28px;
    padding-top: 20px;
  }
  .message-text {
    font-size: 16px;
  }
  .message.user {
    max-width: 92%;
    padding: 12px 16px;
  }
  .chat-empty {
    padding-block: 28px;
  }
  .composer-dock {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .dialog {
    padding: 20px;
  }
  footer {
    padding-top: 2px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 350px) {
  .site-header {
    padding-inline: 16px;
  }
  .fabric-logo {
    width: 68px;
  }
  main {
    padding-inline: 16px;
  }
  .icon-button {
    width: 42px;
  }
  .ask-wordmark {
    font-size: 60px;
  }
  .greeting {
    font-size: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
