/* Robo wears the same clothes as Remote Unlimited: the GPT-Lab palette, Plus
   Jakarta Sans, and the two shadows that separate a card from the page. Tokens
   here, components below — the names match app/web/tailwind.config.js in the
   remote_coding_tool checkout so the two products read as one family. */
:root {
  --purple: #4b0096;
  --purple-dark: #36006b;
  --purple-light: #6b1fb0;
  --purple-50: #f3edfa;
  --purple-100: #e7d9f4;
  --gold: #c9a227;
  --ink: #1f1f2e;
  --muted: #5f5f70;
  --line: #e4e2ec;
  --surface: #faf9fc;
  --paper: #ffffff;
  --err: #c5221f;
  --warn: #b06000;
  --soft: 0 1px 2px rgba(31, 31, 46, .04), 0 4px 16px rgba(31, 31, 46, .06);
  --lift: 0 8px 28px rgba(75, 0, 150, .13);
  font-family: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  font-synthesis: none;
  color-scheme: light;
}
* { box-sizing: border-box }
body { margin: 0; min-width: 320px; height: 100dvh; display: flex; flex-direction: column; background: var(--surface) }
button, input, select, textarea { font: inherit }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent }
button { cursor: pointer; transition: background .15s, transform .15s, box-shadow .15s }
button:disabled { cursor: default }
button:not(:disabled):active { transform: scale(.97) }
[hidden] { display: none !important }
a { color: inherit; text-decoration: none }
:focus-visible { outline: 3px solid var(--purple-light); outline-offset: 3px }
svg { width: 24px; height: 24px; flex-shrink: 0 }

/* Header — the purple band that reaches under the status bar on a phone. */
.topbar {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top) 5.5% 0; height: calc(64px + env(safe-area-inset-top));
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #fff; box-shadow: var(--soft);
}
.brand { display: flex; align-items: center; font-size: 23px; font-weight: 800; letter-spacing: -.7px; color: #fff }
.brand-dot { color: var(--gold) }
.brand-icon {
  background: rgba(255, 255, 255, .14); color: #fff; width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 11px;
  font-size: 22px; letter-spacing: -3px; margin-right: 10px; padding-right: 4px; line-height: 1;
  border: 1px solid rgba(255, 255, 255, .22);
}
.brand-icon span { font-size: 15px; margin-top: 10px; color: var(--gold) }
.topbar .icon-button { border-color: rgba(255, 255, 255, .28); color: #fff }
.topbar .icon-button:hover { background: rgba(255, 255, 255, .14) }
.icon-button {
  border: 1px solid var(--line); background: transparent; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; font-size: 24px; color: var(--muted);
}
.icon-button:hover { background: var(--purple-50) }

/* Conversation */
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; width: min(100%, 860px); margin: auto }
.conversation {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 28px;
  scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--purple-100) transparent;
}
.welcome { min-height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 36px 0 44px }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--purple-light) }
.welcome-mark { display: flex; align-items: flex-end; gap: 5px; height: 52px; margin-bottom: 22px }
.welcome-mark span { display: block; width: 6px; height: 17px; background: var(--purple-100); border-radius: 6px }
.welcome-mark span:nth-child(2), .welcome-mark span:nth-child(4) { height: 31px; background: var(--purple-light) }
.welcome-mark span:nth-child(3) { height: 47px; background: var(--purple) }
h1 { font-size: clamp(34px, 4.6vw, 50px); font-weight: 800; letter-spacing: -1.6px; line-height: 1.1; margin: 18px 0 }
h1 em { color: var(--purple); font-style: normal }
.welcome p, .login > p { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0 }

.messages { display: flex; flex-direction: column; gap: 22px; padding: 30px 0 12px }
.messages:empty { padding: 0 }
.message { display: flex; flex-direction: column; align-items: flex-start; max-width: 90%; align-self: flex-start }
.message.user { align-items: flex-end; align-self: flex-end }
.message-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin: 0 4px 7px }
.message-meta strong { font-size: 11px; letter-spacing: .3px; font-weight: 700; color: var(--purple) }
.bubble {
  border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 16px 18px;
  background: var(--paper); color: var(--ink); text-align: left; max-width: 100%;
  font-size: 16px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--soft);
}
.user .bubble { background: var(--purple); border-color: var(--purple); color: #fff; border-radius: 16px 4px 16px 16px; box-shadow: var(--lift) }
.bubble:hover { border-color: var(--purple-light) }
.bubble.playing { outline: 2px solid var(--purple-light); outline-offset: 3px }
.audio-caption { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); margin: 7px 5px 0 }
.audio-caption svg { width: 12px; height: 12px }
.thinking { font-size: 13px; color: var(--muted); padding: 18px 5px 28px; display: flex; align-items: center; gap: 10px }
.pulse { width: 8px; height: 8px; background: var(--purple); border-radius: 100%; animation: glow 1.8s ease-in-out infinite }

/* Composer */
.composer-wrap { flex-shrink: 0; padding: 14px 28px max(20px, env(safe-area-inset-bottom)); background: var(--surface) }
.composer { padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--soft) }
.composer:focus-within { border-color: var(--purple-light); box-shadow: 0 0 0 4px rgba(107, 31, 176, .14) }
textarea {
  display: block; resize: none; width: 100%; min-height: 76px; max-height: 180px; background: transparent;
  border: 0; outline: none !important; line-height: 1.5; font-size: 19px; color: var(--ink); padding: 0;
}
textarea::placeholder { color: #9a9aad }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px }
#input-hint { font-size: 12px; color: var(--muted) }
.composer-actions { display: flex; align-items: center; gap: 10px }
.mic-button {
  display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--purple-100);
  border-radius: 16px; background: var(--purple-50); color: var(--purple); min-width: 138px; height: 62px;
  font-size: 16px; font-weight: 600;
}
.mic-button svg { width: 24px; height: 24px }
.mic-button:hover { background: var(--purple-100) }
.mic-button.recording { background: var(--purple); border-color: var(--purple); color: #fff; animation: glow 1.8s ease-in-out infinite }
.mic-button:disabled { opacity: .5 }
.send-button { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; border: 0; background: var(--purple); color: #fff; box-shadow: var(--lift) }
.send-button:hover:not(:disabled) { background: var(--purple-light) }
.send-button:disabled { background: var(--line); color: #a9a9bb; box-shadow: none }
.composer-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; color: var(--muted); margin: 13px 0 0 }
.composer-footnote svg { width: 14px; height: 14px }
.notice { background: #fff7ed; border: 1px solid #f0d9b5; padding: 12px 15px; border-radius: 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px; color: var(--warn) }
.notice button { margin-left: 8px }
.recording-preview { display: flex; align-items: center; justify-content: space-between; background: var(--purple-50); border: 1px solid var(--purple-100); border-radius: 16px; padding: 12px; margin-bottom: 10px; gap: 8px }
.recording-preview > div { min-width: 0; flex: 1 }
.record-label { display: block; font-size: 12px; margin: 2px 0 7px 10px; color: var(--purple) }
audio { display: block; width: 100% ; height: 40px }

/* Sign-in */
.login { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 30px }
.login h1 { font-size: clamp(38px, 7vw, 56px) }
.google-button {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; padding: 0 26px; height: 52px;
  border: 1px solid var(--line); border-radius: 26px; background: var(--paper); color: var(--ink);
  font-size: 15px; font-weight: 600; box-shadow: var(--soft);
}
.google-button:hover:not(:disabled) { box-shadow: var(--lift); border-color: var(--purple-100) }
.google-button:disabled { opacity: .6 }
.google-button svg { width: 18px; height: 18px }
.login .small { font-size: 13px; max-width: 290px; color: var(--muted) }
.small { font-size: 13px; color: var(--muted); line-height: 1.6 }
.error { color: var(--err) !important; font-size: 14px !important }
.loading { margin: auto; font-size: 14px; color: var(--muted) }

/* Settings, including the owner's access list */
dialog {
  border: 1px solid var(--line); border-radius: 22px; background: var(--paper); color: var(--ink);
  width: min(480px, calc(100% - 28px)); max-height: 90dvh; padding: 26px; box-shadow: 0 20px 90px rgba(31, 31, 46, .22);
}
dialog::backdrop { background: rgba(31, 31, 46, .38); backdrop-filter: blur(4px) }
.dialog-heading { display: flex; align-items: center; justify-content: space-between }
h2 { font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin: 6px 0 0 }
h3 { font-size: 15px; font-weight: 700; margin: 0 }
.settings-section { padding: 22px 0; border-bottom: 1px solid var(--line) }
.settings-section p { color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px }
.badge { font-size: 10px; background: var(--purple-50); padding: 5px 9px; border-radius: 20px; color: var(--purple); font-weight: 600; white-space: nowrap }
.text-button { border: 0; background: transparent; padding: 5px 0; color: var(--purple); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; min-height: 34px }
.settings-section label { display: block; font-size: 12px; margin: 16px 0 8px; font-weight: 600 }
.muted { color: var(--muted); font-weight: 400 }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface); color: inherit; font-size: 16px }
input:focus, select:focus { border-color: var(--purple-light); outline: none; box-shadow: 0 0 0 4px rgba(107, 31, 176, .14) }
.member-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column }
.member-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line) }
.member-email { font-size: 14px; overflow-wrap: anywhere }
.member-add { display: flex; gap: 8px; align-items: stretch }
.secondary-button { border: 1px solid var(--purple); background: var(--paper); color: var(--purple); border-radius: 10px; padding: 0 18px; font-size: 14px; font-weight: 600; white-space: nowrap }
.secondary-button:hover { background: var(--purple-50) }
.settings-note { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 18px 0 }
.primary-button { width: 100%; border: 0; background: var(--purple); color: #fff; border-radius: 12px; padding: 16px; font-size: 14px; font-weight: 600; box-shadow: var(--lift) }
.primary-button:hover:not(:disabled) { background: var(--purple-light) }
.primary-button:disabled { opacity: .5; box-shadow: none }
#settings-status { font-size: 12px; color: var(--muted); line-height: 1.5 }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 31, 176, .45) }
  50% { box-shadow: 0 0 0 5px rgba(107, 31, 176, 0) }
}
@media (min-width: 1000px) {
  .topbar { padding-left: 6%; padding-right: 6% }
  .composer-wrap { padding-bottom: 26px }
}
@media (max-width: 600px) {
  .topbar { height: calc(56px + env(safe-area-inset-top)); padding-left: 20px; padding-right: 20px }
  .brand { font-size: 21px }
  .brand-icon { width: 30px; height: 30px; font-size: 20px; border-radius: 10px }
  .conversation { padding: 0 18px }
  .composer-wrap { padding: 12px 14px max(15px, env(safe-area-inset-bottom)) }
  .composer { border-radius: 18px; padding: 16px 15px 12px }
  textarea { font-size: 18px; min-height: 72px }
  .mic-button { height: 60px; min-width: 132px }
  .send-button { width: 52px; height: 52px }
  #input-hint { max-width: 85px; line-height: 1.4; font-size: 11px }
  .welcome { padding: 22px 0 }
  .welcome-mark { margin-bottom: 16px; height: 44px }
  h1 { letter-spacing: -1.3px; margin: 16px 0 }
  .welcome p { font-size: 14px }
  .bubble { font-size: 15px; padding: 14px 16px }
  .message { max-width: 93% }
  .messages { gap: 20px; padding-top: 24px }
  dialog { padding: 22px }
}
@media (max-height: 700px) {
  .welcome-mark { display: none }
  .welcome { padding: 16px 0 }
  .welcome h1 { font-size: 34px; margin: 12px 0 }
  .welcome p { font-size: 13px }
  .composer-wrap { padding-top: 9px }
  textarea { min-height: 62px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important }
}
