:root {
  color-scheme: light;
  --app-height: 100dvh;
  --app-offset-top: 0px;
  --brand-ink: #13201b;
  --brand-green: #147a5d;
  --brand-green-dark: #0c5742;
  --brand-mint: #35d8c8;
  --green-950: var(--brand-ink);
  --green-900: var(--brand-green-dark);
  --green-800: #11684f;
  --green-700: #147a5d;
  --green-600: #1b9270;
  --green-500: var(--brand-mint);
  --mint-50: #f7fffc;
  --mint-100: #eaf8f3;
  --text: var(--brand-ink);
  --muted: #5c6963;
  --line: rgba(20, 122, 93, 0.16);
  --danger: #b83a2f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: none;
}

body {
  background: linear-gradient(180deg, #f7fffc 0%, #fbfcfa 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-shell > *,
.screen-green > *,
.workspace > *,
.main-pane > *,
.chat-stack > *,
.onboarding-header > *,
.step-title > *,
.answer-box > *,
.chat-input > * {
  min-width: 0;
  max-width: 100%;
}

img,
svg,
video {
  max-width: 100%;
}

#app {
  position: fixed;
  top: var(--app-offset-top);
  left: 0;
  width: 100%;
  max-width: 100%;
  height: var(--app-height);
  overflow: hidden;
}

.screen-green {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(145deg, var(--green-700) 0%, var(--green-900) 50%, var(--green-950) 100%);
  color: #fff;
  overflow: hidden;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 56px;
}

.brand.sidebar-brand {
  margin: 0;
}

.workspace .sidebar-brand {
  gap: 11px;
  flex: 0 0 auto;
}

.workspace .sidebar-brand .brand-name {
  display: inline;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 420;
  letter-spacing: 0;
}

.workspace .sidebar-brand .brand-mark {
  width: 43px;
  height: 43px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.mint-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.screen-green .mint-logo,
.workspace .sidebar-brand .mint-logo {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.workspace .main-pane .mint-logo {
  filter: none;
  opacity: 1;
}

.brand-name {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.onboarding-card {
  width: min(100%, 520px);
  min-height: 0;
  overflow-y: auto;
  padding-inline: 8px;
  scrollbar-gutter: stable both-edges;
  text-align: center;
}

.welcome-title {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: 0;
}

.welcome-subtitle {
  margin: 6px 0 52px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.step-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 30px;
  text-align: left;
}

.step-number {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-weight: 650;
}

.step-copy {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
}

.primary-cta,
.ghost-cta,
.send-button,
.add-doc-button,
.delete-button {
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.primary-cta,
.ghost-cta {
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.primary-cta {
  background: #fff;
  color: var(--green-900);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.24);
}

.primary-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

.ghost-cta {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.76);
}

.ghost-cta:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.15);
}

.auth-screen {
  justify-content: center;
  padding-block: 24px;
}

.auth-screen .brand {
  margin-bottom: 20px;
}

.auth-view {
  width: min(100%, 420px);
  max-height: calc(100% - 80px);
  overflow-y: auto;
  padding: 4px 8px 12px;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
  scrollbar-width: thin;
}

.auth-heading {
  margin-bottom: 18px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 420;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 8px auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.legal-gate {
  width: min(100%, 520px);
  margin: auto;
  padding: 24px 8px;
}

.legal-consents {
  display: grid;
  gap: 12px;
  margin: 2px 0 6px;
  padding: 0;
  border: 0;
}

.legal-consents legend {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 650;
}

.consent-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.83rem;
  line-height: 1.45;
  cursor: pointer;
}

.consent-checkbox a {
  color: #fff;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.consent-checkbox input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: #fff;
}

.consent-checkbox input:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.field-group {
  display: grid;
  gap: 6px;
  text-align: left;
}

.field-group > label {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 650;
}

.field-group input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  outline: 0;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.field-group input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.field-group input:focus {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 68px;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 58px;
  height: 40px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 700;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.password-help {
  margin: -6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  text-align: left;
}

.auth-message {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 6px 8px;
  color: transparent;
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

.auth-message.visible {
  color: #ffe5e1;
}

.caps-lock-status {
  min-height: 18px;
  margin: -8px 0 2px;
  color: #fff2b8;
  font-size: 0.78rem;
  text-align: center;
  visibility: hidden;
}

.caps-lock-status.visible {
  visibility: visible;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  content: "";
}

.auth-link,
.auth-text-button {
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link:hover,
.auth-text-button:hover {
  color: #fff;
}

.auth-link-end {
  justify-self: end;
  margin-top: -6px;
}

.auth-text-button {
  width: 100%;
  min-height: 32px;
}

.auth-screen :is(.primary-cta, .ghost-cta, .password-toggle, .auth-link, .auth-text-button, .google-placeholder):focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}

.google-placeholder {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-weight: 650;
}

.auth-view .primary-cta,
.auth-view .ghost-cta {
  min-height: 48px;
  border-radius: 8px;
}

.auth-view .google-button-slot {
  min-height: 44px;
  margin-top: 0;
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 44px;
}

.progress-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.progress-dot.active {
  width: 28px;
  background: #fff;
}

.step-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.step-nav-bottom {
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  margin: 44px auto 0;
  padding: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.step-nav-button {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.68rem;
  font-weight: 800;
}

.step-nav-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.step-nav-button.active {
  min-width: 38px;
  background: #fff;
  color: var(--green-900);
  opacity: 1;
}

.step-nav-button.locked {
  opacity: 0.35;
}

.step-nav-compact {
  margin: 0 0 0 10px;
  border-color: var(--line);
  background: var(--mint-50);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
}

.step-nav-compact .step-nav-button {
  color: var(--muted);
}

.step-nav-compact .step-nav-button:hover:not(:disabled) {
  background: rgba(22, 163, 74, 0.08);
  color: var(--green-900);
}

.step-nav-compact .step-nav-button.active {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
}

.floating-error {
  width: min(100%, 520px);
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffe3df;
  text-align: left;
}

.documents-inline {
  margin-bottom: 20px;
}

.upload-strip {
  display: grid;
  gap: 10px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.attached-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.attached-file {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  text-align: left;
}

.attached-file > span:not(.file-chip) {
  min-width: 0;
  display: grid;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 850;
}

.file-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.84rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-button {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
}

.delete-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.onboarding-header {
  width: min(100%, 560px);
  flex: 0 0 auto;
  margin-bottom: 26px;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.step-heading {
  flex: 1;
}

.step-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: 0;
}

.step-count {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.9rem;
  font-weight: 750;
}

.step-heading p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.46);
  font-size: 0.85rem;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transform-origin: left center;
  transition: transform 220ms ease-out;
}

.chat-stack {
  width: min(100%, 560px);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.question-card {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 18px;
  padding-right: 14px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.78) transparent;
}

.question-card::-webkit-scrollbar {
  width: 6px;
}

.question-card::-webkit-scrollbar-track {
  background: transparent;
}

.question-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.question-card::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.9);
}

.question-card .message-row {
  margin-bottom: 12px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.bubble {
  min-width: 0;
  max-width: min(82%, 640px);
  border-radius: 20px;
  padding: 13px 16px;
  font-size: 0.92rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.assistant .bubble {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.user .bubble {
  border-bottom-right-radius: 5px;
  background: #fff;
  color: var(--green-900);
  font-weight: 400;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.mini-avatar {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.mini-avatar .mint-logo {
  width: 100%;
  height: 100%;
}

.answer-box {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.answer-box:focus-within {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
}

.answer-box label,
.chat-input label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.answer-box textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 54px;
  max-height: 120px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #fff;
  font-size: 0.92rem;
}

.answer-box textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.send-button {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  color: var(--green-900);
  font-size: 1rem;
  font-weight: 850;
}

.send-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.send-button:disabled .send-icon {
  opacity: 0.4;
}

.answer-box .send-button {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
}

.thinking-row {
  align-items: center;
}

.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px 18px 18px 5px;
  background: rgba(255, 255, 255, 0.12);
}

.thinking-bubble span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  animation: thinking-dot 0.9s ease-in-out infinite;
}

.thinking-bubble span:nth-child(2) {
  animation-delay: 0.12s;
}

.thinking-bubble span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes thinking-dot {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.working-card {
  width: min(100%, 460px);
  min-height: 0;
  overflow-y: auto;
  text-align: center;
}

.working-card h2 {
  margin: 18px 0 8px;
  color: #fff;
  font-weight: 300;
}

.working-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
}

.loader {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

.workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  overflow: hidden;
  background: #fff;
}

.workspace.files-collapsed {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: linear-gradient(180deg, var(--green-700), var(--green-900));
  color: #fff;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-head {
  padding: 18px 14px;
}

.sidebar.collapsed .sidebar-body,
.sidebar.collapsed .sidebar-footer {
  display: none;
}

.files-head-actions {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.files-toggle {
  min-width: 0;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 420;
  line-height: 1;
  white-space: nowrap;
}

.files-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

.files-scrim {
  display: none;
}

.files-toggle-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 16px;
}

.documents-dialog-head {
  display: none;
}

.documents-sidebar {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.documents-count {
  align-self: center;
  margin: 16px 0 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 420;
  letter-spacing: 0;
  text-align: center;
}

.dialog-upload-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 8px;
  margin-top: 0;
  padding: 0 16px;
  border: 1px solid #fff;
  border-radius: 14px;
  background: #fff;
  color: var(--green-900);
  font-size: 0.86rem;
  font-weight: 420;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.dialog-upload-button:hover {
  border-color: rgba(255, 255, 255, 0.92);
  background: var(--mint-50);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.dialog-upload-button:active {
  background: var(--mint-100);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(1px) scale(0.99);
}

.dialog-upload-button.disabled,
.dialog-upload-button[aria-disabled="true"],
.primary-cta.disabled,
.primary-cta[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.dialog-upload-button.disabled:hover,
.dialog-upload-button[aria-disabled="true"]:hover,
.primary-cta.disabled:hover,
.primary-cta[aria-disabled="true"]:hover {
  background: #fff;
  box-shadow: none;
  transform: none;
}

.upload-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  color: currentColor;
}

.empty-docs {
  width: 100%;
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
}

.sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.34);
  font-size: 0.72rem;
}

.main-pane {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.account-control {
  position: relative;
  margin-left: auto;
  color: var(--text);
  z-index: 12;
}

.screen-green > .account-control {
  position: absolute;
  top: calc(22px + env(safe-area-inset-top));
  right: 22px;
}

.account-menu-toggle {
  max-width: min(320px, 46vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px 0 6px;
  background: #fff;
  color: var(--green-900);
}

.screen-green > .account-control .account-menu-toggle {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.account-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--mint-100);
  color: var(--green-900);
  font-size: 0.8rem;
  font-weight: 800;
}

.account-email {
  min-width: 0;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(10, 51, 25, 0.2);
}

.account-menu-email {
  overflow: hidden;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu button {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  text-align: left;
}

.account-menu button span {
  float: right;
  color: var(--muted);
  font-size: 0.76rem;
}

.account-menu button:hover,
.account-menu button:focus-visible {
  outline: 0;
  background: var(--mint-100);
}

.account-menu #logout {
  color: var(--danger);
}

.account-menu .account-delete-action {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  color: var(--danger);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green-500);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.72);
}

.main-title {
  font-size: 0.92rem;
  font-weight: 750;
}

.doc-count {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--mint-50);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 28px 24px;
  background: linear-gradient(180deg, #fff, #fbfffd);
}

.messages-inner {
  max-width: 880px;
  margin: 0 auto;
}

.profile-update-feed {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.profile-update-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(15, 69, 38, 0.07);
}

.profile-update-panel[aria-busy="true"] {
  border-color: rgba(22, 143, 74, 0.34);
}

.profile-update-result {
  border-top: 3px solid var(--green-600);
}

.profile-update-paywall {
  border-top: 3px solid var(--green-900);
}

.profile-update-panel p,
.profile-update-panel ul {
  margin: 0;
}

.profile-update-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.profile-update-heading h2 {
  margin: 3px 0 0;
  color: var(--green-950);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-update-kicker {
  display: block;
  color: var(--green-600);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.profile-update-badge,
.profile-update-price {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 5px 8px;
  background: var(--mint-100);
  color: var(--green-800);
  font-size: 0.75rem;
  font-weight: 800;
}

.profile-update-badge.warning {
  background: #fff6e5;
  color: #8a5a00;
}

.profile-update-price {
  background: var(--green-900);
  color: #fff;
  font-size: 0.9rem;
}

.profile-update-includes {
  display: grid;
  gap: 5px;
  padding-left: 20px;
  color: var(--text);
  font-size: 0.86rem;
}

.profile-update-content {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.profile-update-content p,
.profile-update-content ul {
  margin: 0 0 0.75rem;
}

.profile-update-content > :last-child {
  margin-bottom: 0;
}

.profile-update-footnote {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-update-action {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--mint-100);
  color: var(--green-900);
  font-weight: 780;
}

.profile-update-action:hover:not(:disabled),
.profile-update-action:focus-visible {
  outline: 0;
  background: #d9f3e4;
  box-shadow: 0 0 0 3px rgba(22, 143, 74, 0.12);
}

.primary-profile-update-action {
  background: var(--green-800);
  color: #fff;
}

.primary-profile-update-action:hover:not(:disabled),
.primary-profile-update-action:focus-visible {
  background: var(--green-900);
}

.profile-update-status,
.profile-update-error {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(20, 122, 93, 0.24);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--mint-50);
  color: var(--green-900);
  font-size: 0.82rem;
}

.profile-update-error {
  border-color: rgba(184, 58, 47, 0.3);
  background: #fff6f4;
  color: var(--danger);
}

.inline-loader {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid rgba(22, 143, 74, 0.2);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.empty-chat {
  min-height: 56vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-chat-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  margin-bottom: 14px;
  background: transparent;
}

.empty-chat-icon .mint-logo {
  width: 100%;
  height: 100%;
}

.workspace .message-row {
  margin-bottom: 14px;
}

.workspace .assistant .bubble {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 16px rgba(22, 163, 74, 0.08);
}

.workspace .user .bubble {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
}

.workspace .mini-avatar {
  border: 0;
  background: transparent;
}

.chatbar {
  position: relative;
  flex: 0 0 auto;
  padding: 18px 28px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  z-index: 3;
}

.question-balance {
  max-width: 880px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.question-balance strong {
  color: var(--green-900);
  font-size: 0.86rem;
}

.question-balance.depleted,
.question-balance.depleted strong {
  color: var(--danger);
}

.chat-input {
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 0 auto;
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}

.chat-input:focus-within {
  border-color: rgba(22, 163, 74, 0.45);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.08);
}

.chat-input textarea {
  min-height: 44px;
  max-height: 140px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--green-950);
}

.sidebar-body:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: -5px;
}

.chat-input textarea::placeholder {
  color: var(--muted);
}

.chat-input .send-button {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
}

.fine-print {
  margin: 10px auto 0;
  max-width: 880px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.ghost-light-cta {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--green-900);
  font-weight: 750;
}

.google-button-slot {
  min-height: 44px;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.google-button-slot > div {
  max-width: 100%;
}

.health-data-consent {
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 12px;
  padding-inline: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.health-data-consent span {
  text-align: left;
}

.health-data-consent input {
  appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  margin: 1px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.health-data-consent input::before {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--green-900);
  border-left: 2px solid var(--green-900);
  content: "";
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 120ms ease;
}

.health-data-consent:hover input {
  border-color: rgba(255, 255, 255, 0.92);
}

.health-data-consent input:checked {
  border-color: #fff;
  background: #fff;
}

.health-data-consent input:checked::before {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.health-data-consent input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.document-group {
  margin-top: 14px;
}

.document-group + .document-group {
  margin-top: 18px;
}

.document-group .attached-list {
  margin-top: 7px;
}

.document-group-label {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 720;
  text-transform: uppercase;
}

.alert {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 12px;
  background: rgba(184, 58, 47, 0.12);
  color: #ffe5e1;
}

.documents-onboarding > .alert {
  margin: 12px 0;
}

.workspace .alert {
  max-width: 880px;
  margin: 14px auto 0;
  border-color: rgba(184, 58, 47, 0.18);
  background: #fff6f4;
  color: var(--danger);
}

.bubble p {
  margin: 0 0 0.75rem;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble h1,
.bubble h2,
.bubble h3 {
  margin: 1rem 0 0.45rem;
  color: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
}

.bubble h1:first-child,
.bubble h2:first-child,
.bubble h3:first-child {
  margin-top: 0;
}

.bubble ul {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.25rem;
}

.bubble li {
  margin: 0.18rem 0;
}

.bubble strong {
  font-weight: 800;
}

.bubble pre,
.bubble table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  input,
  textarea {
    max-width: 100%;
    min-width: 0;
  }

  .workspace {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
    background: linear-gradient(50deg, var(--green-700), var(--green-900));
  }

  .sidebar:not(.collapsed) .files-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    min-width: 0;
    height: auto;
    border: 0;
    border-radius: 0;
    background: rgba(5, 18, 11, 0.52);
    color: transparent;
  }

  .sidebar.collapsed .files-scrim {
    display: none;
  }

  .sidebar-head {
    min-height: 60px;
    padding: 14px 16px;
  }

  .workspace .sidebar-brand {
    gap: 10px;
  }

  .workspace .sidebar-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .workspace .sidebar-brand .brand-name {
    font-size: 0.9rem;
  }

  .files-head-actions {
    display: flex;
  }

  .files-toggle {
    display: inline-flex;
    height: 35px;
    padding: 0 13px;
    border-radius: 15px;
    font-size: 0.78rem;
  }

  .sidebar.collapsed .sidebar-head {
    min-height: 54px;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
  }

  .sidebar-body {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 21;
    max-height: min(72vh, 560px);
    min-height: 220px;
    overflow: auto;
    padding: 18px 16px 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    background: linear-gradient(180deg, var(--green-700), var(--green-900));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  }

  .sidebar-body .attached-list {
    flex: 0 1 auto;
    max-height: 36vh;
    overflow: auto;
  }

  .documents-sidebar {
    gap: 0;
  }

  .documents-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: -5px;
    margin-bottom: 21px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 420;
  }

  .documents-count {
    display: none;
  }

  .documents-sidebar .dialog-upload-button {
    margin-top: 26px;
  }

  .documents-dialog-head .dialog-close {
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    position: relative;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
  }

  .documents-dialog-head .dialog-close::before,
  .documents-dialog-head .dialog-close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 13px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
  }

  .documents-dialog-head .dialog-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .documents-dialog-head .dialog-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  .dialog-upload-button {
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .welcome-subtitle {
    margin-bottom: 34px;
  }

  .step-row {
    margin-bottom: 22px;
  }

  .step-copy {
    line-height: 1.5;
  }

  .documents-inline {
    margin-bottom: 14px;
  }

  .step-nav-bottom {
    margin-top: 28px;
  }

  .attached-list {
    grid-template-columns: 1fr;
  }

  .main-pane {
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .messages,
  .chatbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .profile-update-panel {
    padding: 15px;
  }

  .profile-update-heading {
    gap: 10px;
  }

  .question-balance {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .bubble {
    max-width: 86%;
  }

  .screen-green {
    justify-content: flex-start;
    padding-block: calc(18px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-bottom));
    padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
  }

  .auth-screen .brand {
    margin-bottom: 18px;
  }

  .auth-view {
    width: min(100%, 420px);
    max-height: calc(100% - 62px);
    padding-inline: 2px;
  }

  .field-group input {
    font-size: 16px;
  }

  .screen-green > .account-control {
    top: calc(16px + env(safe-area-inset-top));
    right: 14px;
  }

  .account-email {
    display: none;
  }

  .account-menu-toggle {
    width: 40px;
    padding: 0 6px;
  }

  .main-topbar {
    height: 52px;
    padding: 0 16px;
  }

  .brand {
    margin-bottom: 24px;
  }

  .onboarding-header {
    margin-bottom: 16px;
  }

  .chat-stack {
    max-height: none;
  }

  .question-card {
    max-height: none;
  }

  .answer-box textarea,
  .chat-input textarea {
    font-size: 16px;
    resize: none;
  }

  .chatbar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

}

/* Health Profile workspace */
.profile-header-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.compact-cta {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  width: auto;
}

.compact-cta .control-icon {
  height: 18px;
  width: 18px;
}

.header-profile-link {
  background: transparent;
  border: 0;
  color: var(--ink-muted, #587064);
  cursor: pointer;
  min-height: 40px;
  padding: 0 8px;
}

.profile-update-detail {
  background: #f5faf7;
  border-bottom: 1px solid #dbe9e0;
  color: #133b29;
  flex: 0 0 auto;
  max-height: min(34vh, 310px);
  overflow: auto;
  padding: 16px clamp(18px, 4vw, 44px);
  scrollbar-color: #7fa18f transparent;
  scrollbar-width: thin;
}

.profile-update-detail-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.profile-update-detail-head span:first-child {
  color: #648072;
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}

.profile-update-detail-head h2 {
  font-size: 16px;
  line-height: 1.3;
  margin: 0;
}

.profile-update-documents,
.profile-update-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-update-document,
.profile-update-file-list > span {
  align-items: center;
  background: #fff;
  border: 1px solid #d4e5da;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
}

.profile-update-document b,
.profile-update-file-list b {
  color: #178a4c;
  flex: 0 0 auto;
  font-size: 10px;
}

.profile-update-document span,
.profile-update-file-list span span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-update-result {
  font-size: 14px;
  line-height: 1.55;
  margin-top: 12px;
}

.profile-update-marker {
  align-items: center;
  align-self: center;
  background: transparent;
  border: 0;
  color: #668074;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: center;
  margin: 12px auto;
  max-width: 100%;
  padding: 6px 10px;
  text-align: center;
}

.profile-update-marker::before,
.profile-update-marker::after {
  background: #d4e3da;
  content: "";
  height: 1px;
  width: 34px;
}

.profile-chat-empty {
  color: #587064;
  margin: auto;
  max-width: 430px;
  padding: 34px 18px;
  text-align: center;
}

.profile-chat-empty h2 {
  color: #123b29;
  font-size: 19px;
  margin: 12px 0 6px;
}

.profile-chat-empty p {
  line-height: 1.5;
  margin: 0;
}

.initial-report-status {
  width: min(100%, 520px);
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: auto;
  padding: 20px;
  color: var(--green-800);
  text-align: left;
}

.initial-report-status > div {
  display: grid;
  gap: 3px;
}

.initial-report-status strong {
  color: var(--green-950);
  font-size: 0.9rem;
}

.initial-report-status span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.profile-update-dialog #profile-update-files {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.profile-update-file-list {
  margin: 0;
  min-height: 42px;
}

.profile-update-file-list p {
  color: #6a7e73;
  font-size: 13px;
  margin: 10px 0;
}

.workspace-alert {
  margin: 10px clamp(18px, 4vw, 44px) 0;
}

@media (max-width: 820px) {
  .profile-header-actions .header-profile-link {
    display: none;
  }

  .compact-cta span {
    display: none;
  }

  .compact-cta {
    height: 40px;
    justify-content: center;
    padding: 0;
    width: 40px;
  }

  .profile-update-detail {
    max-height: 30vh;
    padding: 13px 16px;
  }
}

@media (max-width: 380px) {
  .profile-update-document,
  .profile-update-file-list > span {
    width: 100%;
  }

  .profile-update-document span,
  .profile-update-file-list span span {
    max-width: calc(100vw - 112px);
  }

  .profile-update-marker::before,
  .profile-update-marker::after {
    width: 16px;
  }
}

/* Application drawer and chat-level profile controls */
.workspace-sidebar {
  width: min(280px, 88vw);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 46;
  overflow: hidden;
  background: var(--green-900);
  color: #fff;
  box-shadow: 18px 0 52px rgba(5, 30, 16, 0.28);
  transform: translateX(-102%);
  transition: transform 180ms ease;
}

.profile-update-workspace.sidebar-open .workspace-sidebar {
  transform: translateX(0);
}

.workspace-sidebar[inert] {
  visibility: hidden;
}

.workspace-sidebar-scrim {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 45;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: rgba(5, 18, 11, 0.52);
}

.workspace-sidebar-scrim[hidden] {
  display: none;
}

.workspace-sidebar-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace-sidebar .sidebar-brand {
  margin: 0;
}

.workspace-sidebar-close,
.workspace-sidebar-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 6px;
}

.workspace-sidebar-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.workspace-sidebar-close:hover,
.workspace-sidebar-close:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.18);
}

.workspace-sidebar-toggle {
  border: 1px solid #d4e2da;
  background: #f6faf7;
  color: #285b42;
}

.workspace-sidebar-toggle:hover,
.workspace-sidebar-toggle:focus-visible {
  outline: 0;
  border-color: #83af98;
  background: #edf7f0;
}

.workspace-sidebar-nav {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 16px 12px;
}

.workspace-sidebar-nav button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.84rem;
  text-align: left;
}

.workspace-sidebar-nav button:hover,
.workspace-sidebar-nav button:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.workspace-sidebar-nav button span {
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
}

.workspace-sidebar-account {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace-sidebar-account .account-control {
  margin: 0;
}

.workspace-sidebar-account .account-menu-toggle {
  width: 100%;
  max-width: none;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.workspace-sidebar-account .account-email {
  display: block;
  flex: 1;
  text-align: left;
}

.workspace-sidebar-account .account-menu {
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 0;
}

.chatbar-controls {
  max-width: 880px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 8px;
}

.chatbar-controls .question-balance {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
}

.chatbar-update-profile {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 1px solid #c9ddd0;
  border-radius: 6px;
  padding: 0 11px;
  background: #f3faf6;
  color: var(--green-800);
  font-size: 0.76rem;
  font-weight: 750;
}

.chatbar-update-profile:hover,
.chatbar-update-profile:focus-visible {
  outline: 0;
  border-color: #83af98;
  background: #e8f5ec;
}

.chatbar-update-profile .control-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 620px) {
  .profile-update-header {
    padding-inline: 10px;
  }

  .profile-update-identity {
    flex-basis: auto;
  }

  .chatbar-controls {
    align-items: flex-start;
  }

  .chatbar-controls .question-balance {
    display: grid;
    gap: 2px;
  }

  .chatbar-update-profile {
    min-height: 40px;
  }
}

/* Unified Health Profile chat outline */
.profile-update-workspace {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.profile-update-workspace.outline-open {
  grid-template-columns: minmax(0, 1fr) 240px;
}

.profile-update-workspace .main-pane {
  min-width: 0;
}

.document-outline-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border: 1px solid #d4e2da;
  border-radius: 6px;
  padding: 0;
  background: #f6faf7;
  color: #285b42;
}

.document-outline-toggle:hover {
  border-color: #83af98;
  background: #edf7f0;
}

.document-outline-toggle:focus-visible {
  outline: 3px solid var(--green-700);
  outline-offset: 2px;
  border-color: var(--green-700);
  background: #edf7f0;
  box-shadow: none;
}

.document-outline-panel {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #dbe9e0;
  background: #f5faf7;
  color: #173c2c;
}

.document-outline-heading,
.document-outline-sheet-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe9e0;
}

.document-outline-heading h2,
.document-outline-sheet-head h2 {
  margin: 0;
  font-size: 0.9rem;
  color: #173c2c;
}

.document-outline-heading > span {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #dff1e6;
  color: #176a40;
  font-size: 0.72rem;
  font-weight: 750;
  text-align: center;
}

.document-outline-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  padding: 10px;
}

.document-outline-entry {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 9px;
  background: transparent;
  color: #285b42;
  text-align: left;
}

.document-outline-entry > span,
.document-outline-entry small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-outline-entry > span {
  font-size: 0.8rem;
  font-weight: 700;
}

.document-outline-entry small {
  color: var(--green-700);
  font-size: 0.68rem;
}

.document-outline-entry:hover,
.document-outline-entry.active {
  border-color: #b9ddc7;
  background: #e8f5ec;
  color: #124d31;
}

.document-outline-entry:focus-visible {
  outline: 3px solid var(--green-700);
  outline-offset: 2px;
  border-color: var(--green-700);
  background: #e8f5ec;
  color: #124d31;
}

.document-outline-empty {
  margin: 8px;
  color: var(--green-700);
  font-size: 0.8rem;
  line-height: 1.45;
}

.profile-update-marker {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  justify-content: stretch;
  justify-items: stretch;
  cursor: default;
  gap: 12px;
  margin: 20px auto;
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: #fff;
  box-shadow: 0 10px 28px rgba(17, 77, 49, 0.16);
  text-align: left;
}

.profile-update-marker::before,
.profile-update-marker::after {
  display: none;
}

.profile-update-marker:focus-visible {
  outline: 3px solid var(--green-700);
  outline-offset: 2px;
}

.profile-update-marker-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-update-document-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.profile-update-document-icon svg {
  width: 22px;
  height: 22px;
}

.profile-update-marker-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-update-marker-head strong {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 750;
}

.profile-update-marker-files {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 100%;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.profile-update-marker .profile-update-document {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow: hidden;
  border: 1px solid #cce4d4;
  border-radius: 5px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #124d31;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-update-marker time {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
}

.profile-update-marker-summary {
  display: grid;
  gap: 6px;
}

.profile-update-marker-summary > span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.profile-update-marker-summary > div {
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.55;
}

.profile-update-marker-summary p {
  margin: 0;
}

.profile-update-marker-summary p + p,
.profile-update-marker-summary ul,
.profile-update-marker-summary ol {
  margin-top: 8px;
}

.document-outline-sheet,
.document-outline-backdrop {
  display: none;
}

@media (max-width: 820px) {
  .profile-update-workspace,
  .profile-update-workspace.outline-open {
    display: block;
    overflow: hidden;
  }

  .profile-update-workspace.outline-open .main-pane {
    pointer-events: none;
  }

  .document-outline-panel {
    display: none;
  }

  .document-outline-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .document-outline-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 42;
    border: 0;
    background: rgba(5, 18, 11, 0.52);
  }

  .document-outline-backdrop[hidden] {
    display: none;
  }

  .document-outline-sheet {
    width: 100%;
    max-height: min(70vh, 560px);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 43;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: #f5faf7;
    box-shadow: 0 -16px 44px rgba(5, 30, 16, 0.24);
  }

  .document-outline-sheet[hidden] {
    display: none;
  }

  .document-outline-sheet-head button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border: 0;
    border-radius: 6px;
    background: #e8f5ec;
    color: #285b42;
  }

  .document-outline-sheet .document-outline-list {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .profile-update-marker {
    width: 100%;
    margin: 16px auto;
  }
}

/* Profile Update workspace */
.profile-update-workspace {
  grid-template-columns: 260px minmax(0, 1fr);
  background: #f8fbf9;
}

.profile-update-history {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0d5634;
  color: #fff;
}

.history-scrim,
.history-close,
.history-mobile-button {
  display: none;
}

.history-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-head .brand {
  margin: 0;
}

.new-profile-update-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 14px 8px;
  border-radius: 6px;
  padding: 0 13px;
  background: #fff;
  color: #0d5634;
  font-size: 0.86rem;
  font-weight: 750;
}

.control-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

.history-list {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 10px 18px;
}

.history-group + .history-group {
  margin-top: 17px;
}

.history-group h2 {
  margin: 0 8px 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.67rem;
  font-weight: 750;
  text-transform: uppercase;
}

.history-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  gap: 5px;
  overflow: hidden;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
}

.history-item:hover,
.history-item:focus-visible,
.history-item.selected {
  outline: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.history-item:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.history-item-title,
.history-item-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-title {
  font-size: 0.82rem;
  font-weight: 680;
}

.history-item-meta {
  display: flex;
  gap: 5px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.69rem;
}

.history-empty {
  margin: 24px 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.history-delete-profile-update {
  min-height: 36px;
  margin: 0 14px 8px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.76rem;
  text-align: left;
}

.history-delete-profile-update:hover,
.history-delete-profile-update:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.history-account {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.history-account .account-control {
  margin: 0;
}

.history-account .account-menu-toggle {
  width: 100%;
  max-width: none;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.profile-update-header {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  padding: 10px 20px 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  z-index: 8;
}

.profile-update-identity {
  min-width: 100px;
  flex: 1 1 240px;
  overflow: hidden;
}

.profile-update-identity h1 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: #173c2c;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-update-identity p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  margin: 4px 0 0;
  color: #708078;
  font-size: 0.7rem;
  white-space: nowrap;
}

.header-status {
  overflow: hidden;
  border-radius: 4px;
  padding: 3px 6px;
  background: #e3f4ea;
  color: #137044;
  font-weight: 750;
  text-overflow: ellipsis;
}

.header-status.status-processing,
.header-status.status-ready {
  background: #eef3f0;
  color: #52655b;
}

.header-status.status-failed_retryable,
.header-status.status-needs_reupload {
  background: #fff4e3;
  color: #845500;
}

.profile-update-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex: 0 1 auto;
  margin-left: auto;
}

.context-control {
  width: auto;
  height: 38px;
  min-width: 0;
  max-width: 192px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 192px;
  overflow: hidden;
  border: 1px solid #d4e2da;
  border-radius: 6px;
  padding: 0 9px;
  background: #f6faf7;
  color: #285b42;
}

.context-control:hover,
.context-control:focus-visible {
  outline: 0;
  border-color: #83af98;
  box-shadow: 0 0 0 3px rgba(22, 134, 83, 0.1);
}

.context-control.unavailable {
  color: #6f6258;
  background: #faf7f4;
}

.context-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #168653;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
}

.context-copy {
  min-width: 0;
  display: grid;
  text-align: left;
}

.context-copy span {
  color: #7a8981;
  font-size: 0.53rem;
  line-height: 1;
  text-transform: uppercase;
}

.context-copy strong {
  min-width: 0;
  overflow: hidden;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-popover {
  width: min(410px, calc(100vw - 32px));
  max-height: min(420px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% - 2px);
  right: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(10, 51, 25, 0.18);
}

.context-popover-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--green-950);
  font-size: 0.82rem;
}

.context-popover-head button,
.new-profile-update-dialog-head button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.context-popover-head button:hover,
.new-profile-update-dialog-head button:hover {
  background: var(--mint-100);
  color: var(--green-900);
}

.context-file-list {
  min-height: 0;
  overflow-y: auto;
  padding: 7px;
}

.context-file-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 6px;
}

.context-file-row + .context-file-row {
  border-top: 1px solid #edf2ef;
}

.context-file-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
}

.context-file-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-file-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
}

.context-delete-file {
  min-height: 30px;
  border-radius: 5px;
  padding: 0 7px;
  background: transparent;
  color: var(--danger);
  font-size: 0.67rem;
}

.context-delete-file:hover,
.context-delete-file:focus-visible {
  outline: 0;
  background: #fff3f1;
}

.context-empty {
  margin: 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.workspace-state {
  flex: 1;
  min-height: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.workspace-state .loader {
  width: 34px;
  height: 34px;
  border-color: rgba(22, 134, 83, 0.16);
  border-top-color: var(--green-700);
}

.profile-update-empty-state h1 {
  margin: 0;
  color: var(--green-950);
  font-size: 1.25rem;
}

.profile-update-empty-state p {
  max-width: 390px;
  margin: 0;
  line-height: 1.5;
}

.profile-update-empty-state .primary-cta {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  border-radius: 6px;
  padding: 0 18px;
}

.empty-profile-update-header {
  display: none;
  color: var(--green-950);
  font-size: 0.86rem;
  font-weight: 750;
}

.profile-update-transcript {
  padding-top: 24px;
}

.profile-update-transcript .profile-update-feed {
  margin-bottom: 26px;
}

.profile-update-conversation-prompt {
  min-height: 110px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(5, 18, 11, 0.52);
}

.new-profile-update-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100% - 28px);
  display: grid;
  gap: 16px;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 31;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(5, 30, 16, 0.28);
  color: var(--text);
  transform: translate(-50%, -50%);
}

.new-profile-update-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.new-profile-update-dialog-head span {
  color: var(--green-600);
  font-size: 0.68rem;
  font-weight: 780;
  text-transform: uppercase;
}

.new-profile-update-dialog-head h2 {
  margin: 3px 0 0;
  color: var(--green-950);
  font-size: 1.1rem;
}

.new-profile-update-dialog > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.new-profile-update-file {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--green-700);
  border-radius: 6px;
  background: var(--green-800);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}

.new-profile-update-file.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.new-profile-update-dialog #file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.new-profile-update-dialog #file-input:focus-visible + .new-profile-update-file {
  outline: 3px solid #176b4a;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}

.dialog-consent {
  justify-content: flex-start;
  margin: 0;
  color: var(--muted);
}

.dialog-consent input {
  border-color: #8fa39a;
  background: #fff;
}

.dialog-consent:hover input {
  border-color: var(--green-700);
}

.dialog-consent input:checked {
  border-color: var(--green-700);
  background: var(--green-700);
}

.dialog-consent input:checked::before {
  border-color: #fff;
}

.new-profile-update-dialog .alert {
  margin: 0;
  border-color: rgba(184, 58, 47, 0.18);
  background: #fff6f4;
  color: var(--danger);
}

.health-profile-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.support-page {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow-y: auto;
  background: var(--paper, #f7f7f2);
  color: var(--ink, #173c34);
  padding: clamp(24px, 5vw, 64px);
}

.support-page-header,
.support-form {
  width: min(720px, 100%);
  margin-inline: auto;
}

.support-page-header {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 40px;
}

.support-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.035em;
}

.support-page-header p { margin: 0; max-width: 58ch; line-height: 1.55; }
.support-back { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0; background: #e4eee8; color: inherit; }
.support-back svg { width: 20px; height: 20px; }
.support-form fieldset { margin: 0; padding: 0; border: 0; }
.support-form legend { margin-bottom: 14px; font-weight: 700; }

.support-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.support-category-grid label { position: relative; }
.support-category-grid input { position: absolute; opacity: 0; }
.support-category-grid span {
  display: block;
  padding: 15px 16px;
  border: 1px solid #b8cbc2;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.support-category-grid input:checked + span { border-color: #176b55; background: #dff0e7; box-shadow: 0 5px 16px rgba(23, 107, 85, .12); }
.support-category-grid input:focus-visible + span { outline: 3px solid #f2b84b; outline-offset: 2px; }
.support-field { display: grid; gap: 9px; font-weight: 700; }
.support-field textarea { width: 100%; resize: vertical; min-height: 160px; padding: 16px; border: 1px solid #9fb8ad; border-radius: 14px; font: inherit; line-height: 1.5; color: inherit; background: #fff; }
.support-field textarea:focus { outline: 3px solid #f2b84b; outline-offset: 2px; border-color: #176b55; }
.support-account { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0; padding: 14px 0; border-bottom: 1px solid #cbd9d2; }
.support-account span { color: #496b61; }
#support-files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.support-file-picker { display: flex; align-items: center; gap: 12px; width: fit-content; padding: 12px 15px; border-radius: 12px; background: #e4eee8; cursor: pointer; font-weight: 700; }
.support-file-picker svg { width: 22px; }
.support-file-picker small { display: block; margin-top: 2px; color: #496b61; font-weight: 500; }
.support-file-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.support-file-list span { padding: 7px 10px; border-radius: 8px; background: #fff; overflow-wrap: anywhere; }
.support-success { margin: 14px 0; padding: 14px; border-radius: 12px; background: #dff0e7; color: #174f40; }
.support-form .primary-cta { width: 100%; margin-top: 8px; }

@media (max-width: 600px) {
  .support-page { padding: 20px 16px 32px; }
  .support-page-header { grid-template-columns: 40px 1fr; gap: 12px; margin-bottom: 30px; }
  .support-category-grid { grid-template-columns: 1fr; }
  .support-account { display: grid; gap: 4px; }
}

.health-profile-dialog .health-profile-count {
  color: var(--green-800);
  font-weight: 700;
}

.health-profile-list {
  min-height: 92px;
  max-height: min(440px, 55vh);
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
}

.health-profile-file {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--mint-50);
}

.health-profile-file .file-chip {
  border-radius: 6px;
  background: var(--mint-100);
  color: var(--green-800);
}

.health-profile-file .file-title {
  color: var(--green-950);
}

.health-profile-file small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.health-profile-file .delete-button {
  border-radius: 6px;
  color: var(--danger);
}

.health-profile-file .delete-button:hover:not(:disabled),
.health-profile-file .delete-button:focus-visible {
  outline: 0;
  background: #fff0ed;
  color: var(--danger);
}

.health-profile-loading {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .profile-update-header {
    gap: 10px;
    padding-inline: 16px;
  }

  .context-control {
    max-width: 150px;
  }

}

@media (max-width: 820px) {
  .profile-update-workspace {
    height: 100%;
    display: block;
    position: relative;
    overflow: hidden;
  }

  .profile-update-history {
    width: min(320px, 88vw);
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 42;
    box-shadow: 18px 0 52px rgba(5, 30, 16, 0.28);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .profile-update-workspace.history-open .profile-update-history {
    transform: translateX(0);
  }

  .history-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 41;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: rgba(5, 18, 11, 0.52);
  }

  .profile-update-workspace.history-open .history-scrim {
    display: block;
  }

  .history-close,
  .history-mobile-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 6px;
  }

  .history-close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .history-mobile-button {
    background: var(--mint-50);
    color: var(--green-900);
  }

  .profile-update-workspace .main-pane {
    width: 100%;
    height: 100%;
  }

  .profile-update-header {
    min-height: 64px;
    gap: 8px;
    padding: 8px 10px;
  }

  .profile-update-identity {
    flex: 1 1 auto;
  }

  .profile-update-identity h1 {
    font-size: 0.91rem;
  }

  .profile-update-identity p {
    gap: 5px;
    font-size: 0.61rem;
  }

  .profile-update-header-actions {
    flex: 0 0 auto;
    gap: 5px;
  }

  .context-control {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    flex: 0 0 38px;
    justify-content: center;
    padding: 0;
  }

  .context-control .context-copy {
    display: none;
  }

  .context-control .context-icon {
    width: 24px;
    height: 24px;
  }

  .context-popover {
    top: calc(100% - 1px);
    right: 8px;
  }

  .empty-profile-update-header {
    display: flex;
  }

  .profile-update-transcript,
  .profile-update-workspace .chatbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .profile-update-transcript .profile-update-panel {
    padding: 15px;
  }

  .profile-update-workspace .question-balance {
    max-height: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 2px;
  }

  .profile-update-workspace .question-balance span:last-child {
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .new-profile-update-dialog {
    padding: 18px;
  }

  .context-file-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .context-delete-file {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 440px) {
  .profile-update-identity p time,
  .profile-update-identity p > span[aria-hidden="true"] {
    display: none;
  }

  .profile-update-transcript .bubble {
    max-width: 90%;
  }
}

.account-deletion-dialog {
  width: min(420px, calc(100vw - 28px));
  max-height: calc(100% - 28px);
  display: grid;
  gap: 14px;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 31;
  overflow-y: auto;
  border: 1px solid rgba(184, 58, 47, 0.24);
  border-radius: 8px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(39, 12, 10, 0.28);
  color: var(--text);
  transform: translate(-50%, -50%);
}

.account-deletion-dialog > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.account-deletion-form {
  display: grid;
  gap: 9px;
}

.account-deletion-form label {
  color: var(--green-950);
  font-size: 0.78rem;
}

.account-deletion-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.account-deletion-form input:focus-visible {
  outline: 3px solid rgba(22, 101, 52, 0.2);
  border-color: var(--green-700);
}

.account-deletion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.account-deletion-actions button {
  min-height: 44px;
  border-radius: 6px;
  font-weight: 750;
}

.account-deletion-actions .secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
}

.account-deletion-actions .danger-button {
  background: var(--danger);
  color: #fff;
}

.account-deletion-actions button:disabled,
.account-deletion-form input:disabled {
  cursor: wait;
  opacity: 0.62;
}

.plus-header-action {
  color: var(--green-800);
  font-weight: 750;
}

.capacity-choice {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.capacity-choice-copy {
  display: grid;
  gap: 3px;
}

.capacity-choice-copy strong {
  color: var(--green-950);
  font-size: 0.88rem;
}

.capacity-choice-copy span,
.capacity-option small {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.capacity-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid var(--line);
}

.capacity-option {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px 14px;
}

.capacity-option + .capacity-option {
  border-left: 1px solid var(--line);
}

.capacity-option > span {
  color: var(--green-950);
  font-size: 0.82rem;
  font-weight: 760;
}

.capacity-option .profile-update-action {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border-radius: 6px;
}

.capacity-choice-compact {
  max-width: 880px;
  margin: 10px auto 0;
}

.subscription-dialog {
  width: min(480px, calc(100vw - 28px));
}

.subscription-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-block: 1px solid var(--line);
  padding: 12px 0;
}

.subscription-price strong {
  color: var(--green-950);
  font-size: 1.35rem;
}

.subscription-price span,
.subscription-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.subscription-allowance-list {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.8rem;
}

.subscription-allowance-list span::before {
  content: "\2713";
  margin-right: 8px;
  color: var(--green-700);
  font-weight: 800;
}

.subscription-current {
  display: grid;
  gap: 12px;
  border-block: 1px solid var(--line);
  padding: 12px 0;
}

.subscription-current > div:first-child {
  display: grid;
  gap: 3px;
}

.subscription-current > div:first-child span {
  color: var(--muted);
  font-size: 0.75rem;
}

.subscription-current.status-warning > div:first-child strong {
  color: var(--danger);
}

.subscription-current dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.subscription-current dl div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.subscription-current dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.subscription-current dd {
  margin: 0;
  color: var(--green-950);
  font-size: 1rem;
  font-weight: 780;
}

.subscription-actions {
  display: grid;
  gap: 8px;
}

.subscription-actions .primary-cta {
  border-color: var(--green-800);
  background: var(--green-800);
  color: #fff;
  box-shadow: none;
}

.subscription-cancel {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--danger);
  font-weight: 720;
}

@media (max-width: 620px) {
  .profile-header-actions .header-profile-link:not(.plus-header-action) {
    display: none;
  }

  .profile-header-actions .plus-header-action {
    display: inline-flex;
    min-height: 38px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .capacity-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .capacity-option + .capacity-option {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .capacity-choice-compact .capacity-choice-copy span {
    display: none;
  }
}

@media (max-width: 380px) {
  .subscription-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100% - 16px);
    padding: 16px;
  }

  .subscription-current dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subscription-price {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

/* Unified Health Profile chat final cascade */
@media (min-width: 1101px) {
  .profile-update-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-update-workspace.outline-open {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .document-outline-panel[inert] {
    display: none;
  }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .profile-update-workspace,
  .profile-update-workspace.outline-open {
    display: block;
    overflow: hidden;
  }

  .profile-update-workspace.outline-open .main-pane {
    pointer-events: none;
  }

  .document-outline-panel {
    display: none;
  }

  .document-outline-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 42;
    border: 0;
    background: rgba(5, 18, 11, 0.52);
  }

  .document-outline-backdrop[hidden] {
    display: none;
  }

  .document-outline-sheet {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: auto;
    z-index: 43;
    overflow: hidden;
    border-radius: 8px;
    background: #f5faf7;
    box-shadow: -16px 0 44px rgba(5, 30, 16, 0.24);
  }

  .document-outline-sheet[hidden] {
    display: none;
  }

  .document-outline-sheet-head button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border: 0;
    border-radius: 6px;
    background: #e8f5ec;
    color: #285b42;
  }
}

.profile-update-recovery {
  width: min(100%, 620px);
  display: grid;
  gap: 12px;
  margin: 12px auto 20px;
  padding: 14px;
  border: 1px solid #d4e5da;
  border-radius: 6px;
  background: #f5faf7;
}

.profile-update-recovery.warning {
  border-color: #e2c56f;
  background: #fff7df;
}

.profile-update-recovery-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.profile-update-recovery-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-update-recovery strong {
  color: #173c2c;
  font-size: 0.82rem;
}

.profile-update-recovery-copy span {
  overflow: hidden;
  color: var(--green-700);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-update-recovery-actions {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.profile-update-recovery-actions .profile-update-action {
  width: 100%;
}

.checkout-disclosure {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.checkout-disclosure p {
  margin: 0;
  color: var(--green-900);
  font-size: 0.82rem;
  line-height: 1.45;
}

.checkout-disclosure .checkout-policy-link {
  font-size: 0.75rem;
}

.checkout-policy-link a {
  color: var(--green-700);
  text-underline-offset: 2px;
}

.profile-update-recovery.warning .profile-update-action {
  background: #f2dfaa;
  color: #5d4300;
}

.profile-update-recovery.warning .profile-update-action:hover:not(:disabled),
.profile-update-recovery.warning .profile-update-action:focus-visible {
  background: #ead38f;
  box-shadow: 0 0 0 3px rgba(139, 98, 0, 0.14);
}

.profile-update-recovery-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding-top: 11px;
  border-top: 1px solid #e8d597;
  color: #664900;
}

.profile-update-warning-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
}

.profile-update-warning-icon svg {
  width: 100%;
  height: 100%;
}

.profile-update-recovery-warning p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

.profile-update-recovery-error {
  max-width: 240px;
  margin: 0;
  color: var(--danger);
  font-size: 0.74rem;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .profile-update-workspace,
  .profile-update-workspace.outline-open {
    display: block;
    overflow: hidden;
  }

  .profile-update-workspace.outline-open .main-pane {
    pointer-events: none;
  }

  .document-outline-panel {
    display: none;
  }

  .profile-update-recovery {
    gap: 12px;
  }

  .profile-update-recovery-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .profile-update-recovery-actions,
  .profile-update-recovery-actions .profile-update-action {
    width: 100%;
  }

  .profile-update-recovery-error {
    max-width: none;
  }
}

@media (pointer: coarse) {
  .step-nav-button,
  .delete-button,
  .send-button,
  .files-toggle,
  .dialog-close {
    min-width: 44px;
    min-height: 44px;
  }

  .delete-button,
  .send-button,
  .dialog-close {
    width: 44px;
    height: 44px;
  }

  .step-nav-bottom {
    gap: 4px;
    padding: 3px;
  }
}

@media (max-width: 900px) and (max-height: 560px) {
  .screen-green {
    padding-block: calc(10px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-bottom));
  }

  .brand {
    margin-bottom: 14px;
  }

  .welcome-title {
    font-size: clamp(2rem, 7vw, 2.6rem);
  }

  .welcome-subtitle {
    margin-bottom: 18px;
  }

  .step-row {
    margin-bottom: 14px;
  }

  .primary-cta,
  .ghost-cta {
    min-height: 48px;
  }

  .auth-secondary {
    margin-top: 8px;
  }

  .sidebar-body {
    bottom: 8px;
    max-height: calc(100dvh - 16px);
  }

  .messages {
    padding-top: 16px;
    padding-bottom: 14px;
  }

  .chatbar {
    padding-top: 10px;
  }
}
