/* Operate surface: Space Grotesk, graphite, silver and purposeful ice blue. */
.assist {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--assist-keyboard, 0px));
  z-index: 60;
  font-family: var(--sans, 'Space Grotesk', sans-serif);
  color: var(--text, #f1f3f4);
  font-size: 14px;
  line-height: 1.5;
  color-scheme: dark;
}
.assist [hidden] { display: none !important; }
.assist *, .assist *::before, .assist *::after { box-sizing: border-box; }
.assist button, .assist textarea { font: inherit; }
.assist button { cursor: pointer; touch-action: manipulation; }
.assist button:disabled { opacity: .55; cursor: default; }
.assist button:focus-visible, .assist textarea:focus-visible, .assist a:focus-visible {
  outline: 2px solid var(--blue, #9bd8f3);
  outline-offset: 3px;
}
.assist ::selection { background: #9bd8f3; color: #101216; }
.assist-launcher {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line, #353d48);
  border-radius: 12px;
  background: var(--plane, #181c22);
  color: var(--text, #f1f3f4);
  font-weight: 600;
}
.assist-launcher:hover { border-color: var(--blue, #9bd8f3); }
.assist-panel {
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 40px));
  height: min(720px, calc(var(--assist-height, 100dvh) - 40px));
  max-height: calc(var(--assist-height, 100dvh) - 40px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--plane, #181c22);
  box-shadow: 0 20px 64px rgb(0 0 0 / 48%);
}
.assist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; flex: 0 0 auto; border-bottom: 1px solid var(--line, #353d48); }
.assist-head h2 { margin: 0; font: inherit; font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; }
.assist-head p { margin: 3px 0 0; color: var(--muted, #acb6c3); font-size: 12px; }
.assist-close, .assist-toolbar button {
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #acb6c3);
  font-size: 12px;
}
.assist-close:hover, .assist-toolbar button:hover { background: var(--deep, #090b0e); color: var(--text, #f1f3f4); }
.assist-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 4px; scrollbar-color: #353d48 #181c22; }
.assist-privacy { margin-bottom: 24px; font-size: 12px; color: var(--muted, #acb6c3); }
.assist-privacy strong { font-weight: 500; color: var(--text, #f1f3f4); }
.assist-continuity, .assist-storage { margin: 6px 0 0; }
.assist-storage { color: var(--blue, #9bd8f3); }
.assist-welcome h3 { margin: 0 0 8px; font: inherit; font-size: 23px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; }
.assist-welcome p { margin: 0; color: var(--muted, #acb6c3); }
.assist-prompts { display: grid; gap: 8px; margin-top: 20px; }
.assist-chip, .assist-follow-up {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line, #353d48);
  border-radius: 10px;
  background: transparent;
  color: var(--text, #f1f3f4);
  text-align: left;
  line-height: 1.4;
}
.assist-chip:hover:not(:disabled), .assist-follow-up:hover:not(:disabled) { border-color: var(--blue, #9bd8f3); background: rgb(155 216 243 / 7%); }
.assist-log { display: flex; flex-direction: column; gap: 18px; }
.assist-bubble { overflow-wrap: anywhere; }
.assist-user { align-self: flex-end; max-width: 90%; padding: 10px 14px; border-radius: 12px; background: var(--deep, #090b0e); white-space: pre-wrap; }
.assist-assistant { align-self: stretch; padding: 0; }
.assist-mode { margin: 0 0 8px; color: var(--muted, #acb6c3); font-size: 12px; }
.assist-answer { margin: 0 0 12px; white-space: pre-wrap; font-size: 15px; line-height: 1.65; }
.assist-answer:last-child { margin-bottom: 0; }
.assist-sources { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 2px; }
.assist-source { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue, #9bd8f3); text-underline-offset: 4px; font-size: 13px; }
.assist-source:hover { color: var(--text, #f1f3f4); }
.assist-follow-ups { display: flex; flex-wrap: wrap; gap: 8px; }
.assist-follow-up { font-size: 12px; }
.assist-pending { color: var(--muted, #acb6c3); padding: 4px 0 12px; }
.assist-feedback { margin: 14px 0 8px; color: var(--text, #f1f3f4); font-size: 13px; }
.assist-toolbar { flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 0 10px; }
.assist-toolbar .assist-retry { color: var(--blue, #9bd8f3); }
.assist-warn { flex: 0 0 auto; margin: 0; padding: 0 20px 10px; font-size: 12px; line-height: 1.45; color: var(--muted, #acb6c3); }
.assist-form { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 10px; padding: 0 20px 20px; }
.assist textarea {
  flex: 1 1 auto;
  width: 0;
  min-height: 64px;
  max-height: 128px;
  padding: 10px 12px;
  border: 1px solid var(--line, #353d48);
  border-radius: 10px;
  background: var(--deep, #090b0e);
  color: var(--text, #f1f3f4);
  caret-color: var(--blue, #9bd8f3);
  font-size: 16px;
  line-height: 1.4;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assist textarea::placeholder { color: var(--muted, #acb6c3); }
.assist-send { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--blue, #9bd8f3); color: var(--canvas, #101216); font-weight: 600; }
.assist-send:hover:not(:disabled) { background: var(--text, #f1f3f4); }
.assist button:active:not(:disabled) { transform: translateY(1px); }
.assist-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; }
@media (max-width: 520px) {
  .assist { right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--assist-keyboard, 0px)); }
  .assist-panel { width: calc(100vw - 24px); height: min(720px, calc(var(--assist-height, 100dvh) - 24px)); max-height: calc(var(--assist-height, 100dvh) - 24px); }
  .assist-head { padding: 14px 16px 10px; }
  .assist-scroll { padding: 16px 16px 4px; }
  .assist-warn { padding-right: 16px; padding-left: 16px; }
  .assist-form { padding: 0 16px 16px; }
}
@media (max-height: 500px) {
  .assist-head { padding-top: 8px; padding-bottom: 6px; }
  .assist-head p { display: none; }
  .assist-warn { font-size: 12px; }
  .assist-form { padding-bottom: 10px; }
  .assist textarea { min-height: 44px; max-height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .assist *, .assist *::before, .assist *::after { scroll-behavior: auto; animation: none; transition: none; }
  .assist button:active:not(:disabled) { transform: none; }
}

/* A compact assistant that reads as part of Vaultary, with its own layout. */
.assist .assist-panel {
  width: min(404px, calc(100vw - 40px));
  height: min(680px, calc(var(--assist-height, 100dvh) - 40px));
  max-height: calc(var(--assist-height, 100dvh) - 40px);
  background: #10151b;
  border-radius: 16px;
  box-shadow: 0 24px 72px rgb(0 0 0 / 55%);
}
.assist .assist-head {
  width: 100%; max-width: none; min-height: 0; margin: 0;
  padding: 16px 18px; gap: 12px;
  background: #18232c; border-bottom: 1px solid #34434e;
}
.assist .assist-identity { display: grid; grid-template-columns: 36px 1fr; column-gap: 11px; align-items: center; }
.assist .assist-identity::before {
  content: ''; grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px;
  background: #253b49 url(/assets/brand-mark.47554269be.svg) center / 15px 19px no-repeat;
}
.assist .assist-head h2 { margin: 0; color: #f1f5f7; font: 600 17px/1.2 var(--sans, 'Space Grotesk', sans-serif); letter-spacing: -.02em; }
.assist .assist-head p { margin: 3px 0 0; color: #b4c3cd; font-size: 12px; line-height: 1.35; }
.assist .assist-close { min-width: 44px; min-height: 44px; padding: 8px; color: #ccd7dd; border-radius: 9px; }
.assist .assist-close:hover, .assist .assist-toolbar button:hover { background: #253b49; color: #fff; }
.assist .assist-scroll { padding: 18px 18px 10px; scrollbar-color: #425764 #10151b; }
.assist .assist-privacy { margin-bottom: 22px; padding: 12px 14px; background: #19242c; border-radius: 10px; color: #c1cbd2; line-height: 1.5; }
.assist .assist-privacy strong { display: flex; align-items: center; gap: 8px; color: #d5eef9; font-size: 12px; font-weight: 600; }
.assist .assist-privacy strong::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #9bd8f3; }
.assist .assist-continuity, .assist .assist-storage { margin-top: 5px; }
.assist .assist-welcome h3 { font-size: 24px; line-height: 1.2; letter-spacing: -.03em; color: #f4f7f8; }
.assist .assist-welcome p { color: #b6c2ca; font-size: 14px; line-height: 1.55; }
.assist .assist-prompts { gap: 7px; margin-top: 16px; }
.assist .assist-chip, .assist .assist-follow-up { min-height: 44px; padding: 10px 13px; border: 1px solid #3b4a55; border-radius: 9px; background: #172028; color: #eef4f6; }
.assist .assist-chip:hover:not(:disabled), .assist .assist-follow-up:hover:not(:disabled) { border-color: #9bd8f3; background: #21333e; }
.assist .assist-log { gap: 16px; }
.assist .assist-user { padding: 11px 14px; background: #253d4a; color: #effaff; border-radius: 12px 12px 3px 12px; }
.assist .assist-mode { color: #9bd8f3; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.assist .assist-answer { color: #e0e8ec; font-size: 14px; line-height: 1.65; }
.assist .assist-source { color: #a6def6; }
.assist .assist-follow-ups { gap: 7px; }
.assist .assist-follow-up { font-size: 12px; }
.assist .assist-pending { color: #c4d9e4; padding: 8px 0; }
.assist .assist-feedback { color: #f1f5f7; background: #29343c; border-radius: 8px; padding: 10px 12px; }
.assist .assist-toolbar { padding: 0 10px; border-top: 1px solid #273640; }
.assist .assist-toolbar button { color: #c1ced5; }
.assist .assist-toolbar .assist-retry { color: #b7e7fa; }
.assist .assist-warn { padding: 0 18px 10px; color: #b8c5cc; font-size: 12px; line-height: 1.4; }
.assist .assist-form { padding: 0 18px 18px; gap: 8px; }
.assist textarea { min-height: 50px; border-color: #40515e; background: #090e13; border-radius: 9px; color: #f6fafb; }
.assist textarea::placeholder { color: #b4c1ca; opacity: 1; }
.assist .assist-send { min-height: 50px; background: #9bd8f3; color: #101820; border-radius: 9px; }
.assist .assist-launcher { width: 56px; min-height: 56px; padding: 7px 5px; gap: 3px; flex-direction: column; justify-content: center; border: 0; border-radius: 14px; background: #9bd8f3; color: #101820; box-shadow: 0 10px 30px rgb(0 0 0 / 38%); font-size: 0; line-height: 1; }
.assist .assist-launcher::before { content: ''; width: 18px; height: 15px; border: 2px solid currentColor; border-radius: 5px; }
.assist .assist-launcher::after { content: 'Ask'; font-size: 11px; font-weight: 700; }
.assist .assist-launcher:hover { background: #d9f2fc; }
body.landing-page .assist.is-collapsed.assist-floating { position: fixed; display: block; max-width: none; margin: 0; padding: 0; right: max(12px, env(safe-area-inset-right)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--assist-keyboard, 0px)); }
.assist.is-collapsed.assist-suppressed .assist-launcher { visibility: hidden; pointer-events: none; }
@media (max-width: 520px) {
  .assist .assist-panel { width: calc(100vw - 24px); height: min(680px, calc(var(--assist-height, 100dvh) - 24px)); max-height: calc(var(--assist-height, 100dvh) - 24px); }
  .assist .assist-head { padding: 12px 14px; }
  .assist .assist-scroll { padding: 14px 14px 8px; }
  .assist .assist-warn { padding: 0 14px 8px; }
  .assist .assist-form { padding: 0 14px 14px; }
}
@media (max-height: 500px) {
  .assist .assist-head { padding-top: 7px; padding-bottom: 7px; }
  .assist .assist-identity { grid-template-columns: 30px 1fr; }
  .assist .assist-identity::before { width: 30px; height: 30px; }
  .assist .assist-form { padding-bottom: 9px; }
  .assist textarea { min-height: 44px; max-height: 80px; }
  .assist .assist-send { min-height: 44px; }
}

@media (max-width: 430px) {
  .assist.is-collapsed.assist-phone-visible .assist-launcher { visibility: hidden; pointer-events: none; }
}

/* Assist: a quiet, purpose-built support surface. */
.assist .assist-panel {
  width: min(412px, calc(100vw - 40px));
  height: min(690px, calc(var(--assist-height, 100dvh) - 40px));
  max-height: calc(var(--assist-height, 100dvh) - 40px);
  border: 1px solid #34414b;
  border-radius: 18px;
  background: #10161c;
  box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
  transform-origin: calc(100% - 28px) 100%;
  animation: assist-arrive 280ms cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes assist-arrive {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.assist .assist-head {
  padding: 19px 20px;
  background: #151f27;
  border-bottom: 1px solid #2b3943;
}
.assist .assist-identity { grid-template-columns: 40px 1fr; column-gap: 12px; }
.assist .assist-identity::before {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: #243945;
  background-size: 17px 22px;
}
.assist .assist-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.assist .assist-head p { margin-top: 4px; color: #b2c4ce; font-size: 12px; }
.assist .assist-close {
  display: grid;
  place-items: center;
  padding: 0 10px;
  background: #202d36;
  color: #d6e3e9;
  font-size: 12px;
  font-weight: 500;
}
.assist .assist-scroll { padding: 22px 20px 14px; scrollbar-color: #526874 #10161c; }
.assist .assist-privacy {
  margin: 0 0 26px;
  padding: 14px 15px;
  border: 1px solid #30414b;
  border-radius: 12px;
  background: #17242d;
  color: #c7d4da;
  font-size: 12px;
  line-height: 1.55;
}
.assist .assist-privacy strong { display: block; color: #ddf2fb; font-weight: 600; }
.assist .assist-privacy strong::before { content: none; }
.assist .assist-continuity, .assist .assist-storage { margin-top: 6px; }
.assist .assist-welcome h3 {
  max-width: 280px;
  margin-bottom: 9px;
  color: #f4f8fa;
  font-size: 25px;
  line-height: 1.17;
  letter-spacing: -.025em;
}
.assist .assist-welcome p { max-width: 320px; color: #bfccd3; font-size: 14px; line-height: 1.55; }
.assist .assist-prompts { gap: 8px; margin-top: 20px; }
.assist .assist-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 11px 14px;
  border-color: #34434d;
  border-radius: 11px;
  background: #18222a;
  color: #eff5f7;
  font-size: 13px;
  font-weight: 500;
}
.assist .assist-chip::after {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 3px;
  border-top: 1.5px solid #a9d9eb;
  border-right: 1.5px solid #a9d9eb;
  transform: rotate(45deg);
}
.assist .assist-chip:hover:not(:disabled), .assist .assist-follow-up:hover:not(:disabled) {
  border-color: #82b5ca;
  background: #20323d;
}
.assist .assist-log { gap: 20px; }
.assist .assist-user { max-width: 88%; padding: 12px 15px; background: #25404d; line-height: 1.55; }
.assist .assist-mode { color: #a8dff4; font-size: 11px; letter-spacing: .015em; }
.assist .assist-answer { font-size: 14px; line-height: 1.7; }
.assist .assist-follow-up { background: #18252e; border-color: #40515c; border-radius: 10px; }
.assist .assist-toolbar { gap: 4px; padding: 5px 10px 0; border-top: 1px solid #2c3b44; }
.assist .assist-toolbar button { font-weight: 500; }
.assist .assist-warn { padding: 1px 20px 12px; color: #b7c7cf; line-height: 1.45; }
.assist .assist-form { gap: 9px; padding: 0 20px 20px; }
.assist .assist-input {
  min-height: 54px;
  padding: 14px;
  border-color: #40525e;
  border-radius: 11px;
  background: #0c1217;
  line-height: 1.45;
}
.assist .assist-input:focus { border-color: #9bd8f3; }
.assist .assist-send { min-height: 54px; padding: 10px 18px; border-radius: 11px; }
.assist .assist-launcher {
  width: 56px;
  min-height: 56px;
  border: 1px solid #c5e9f8;
  border-radius: 16px;
  background: #a9dff4;
  box-shadow: 0 12px 32px rgb(0 0 0 / 38%);
  transition: transform 180ms ease-out, background-color 180ms ease-out, box-shadow 180ms ease-out;
}
.assist .assist-launcher::before { width: 19px; height: 16px; border-radius: 6px; }
.assist .assist-launcher::after { font-size: 10px; letter-spacing: .01em; }
@media (hover: hover) and (pointer: fine) {
  .assist .assist-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgb(0 0 0 / 45%); }
  .assist .assist-chip, .assist .assist-follow-up, .assist .assist-close, .assist .assist-send {
    transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
  }
}
@media (max-width: 520px) {
  .assist .assist-panel {
    width: calc(100vw - 24px);
    height: min(690px, calc(var(--assist-height, 100dvh) - 24px));
    max-height: calc(var(--assist-height, 100dvh) - 24px);
    border-radius: 16px;
  }
  .assist .assist-head { padding: 14px 16px; }
  .assist .assist-scroll { padding: 18px 16px 10px; }
  .assist .assist-privacy { margin-bottom: 22px; }
  .assist .assist-warn { padding: 1px 16px 10px; }
  .assist .assist-form { padding: 0 16px 16px; }
}
@media (max-height: 500px) {
  .assist .assist-head { padding-top: 8px; padding-bottom: 8px; }
  .assist .assist-form { padding-bottom: 10px; }
  .assist .assist-input, .assist .assist-send { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .assist .assist-panel { animation: none; }
  .assist .assist-launcher, .assist .assist-chip, .assist .assist-follow-up, .assist .assist-close, .assist .assist-send { transition: none; }
  .assist .assist-launcher:hover { transform: none; }
}

/* Keep the welcome and privacy context comfortably visible on laptop screens. */
@media (min-width: 521px) and (max-height: 760px) {
  .assist .assist-head { padding-top: 14px; padding-bottom: 14px; }
  .assist .assist-scroll { padding-top: 16px; padding-bottom: 8px; }
  .assist .assist-privacy { padding: 11px 13px; margin-bottom: 18px; }
  .assist .assist-welcome h3 { font-size: 22px; margin-bottom: 7px; }
  .assist .assist-prompts { gap: 6px; margin-top: 14px; }
  .assist .assist-chip { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
  .assist .assist-warn { padding-bottom: 8px; }
  .assist .assist-form { padding-bottom: 15px; }
}
@media (min-width: 521px) and (max-height: 760px) {
  .assist .assist-head { padding: 10px 18px; }
  .assist .assist-scroll { padding: 12px 18px 4px; }
  .assist .assist-privacy { padding: 10px 12px; margin-bottom: 12px; line-height: 1.4; }
  .assist .assist-continuity, .assist .assist-storage { margin-top: 4px; }
  .assist .assist-welcome h3 { max-width: none; font-size: 20px; line-height: 1.2; }
  .assist .assist-welcome p { max-width: none; font-size: 13px; line-height: 1.4; }
  .assist .assist-prompts { gap: 4px; margin-top: 10px; }
  .assist .assist-toolbar { padding-top: 0; }
  .assist .assist-warn { line-height: 1.35; }
  .assist .assist-form { padding-bottom: 12px; }
}
