.ai-body {
  min-height: 100vh;
  background: #f3f4f1;
  background-image: none;
  color: #1d2829;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.branded-ai .ai-workspace.is-sidebar-collapsed .ai-sidebar-bottom {
  display: none;
}

.ai-proposal-button {
  max-width: 100%;
  margin-top: 8px;
  padding: 8px 11px;
  border: 1px solid #d8e0db;
  border-radius: 8px;
  background: #eef5ef;
  color: #365b40;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.ai-proposal-comparison {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dfe5df;
  border-radius: 10px;
  background: #fff;
}

.ai-proposal-comparison summary {
  cursor: pointer;
  color: #355a40;
  font-weight: 600;
}

.ai-proposal-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ai-proposal-columns pre {
  max-height: 260px;
  overflow: auto;
  padding: 9px;
  border-radius: 7px;
  background: #f3f5f2;
  color: #33423a;
  font: .78rem/1.45 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-body .is-hidden {
  display: none !important;
}

body.ai-body::before,
body.ai-body::after {
  display: none;
}

.ai-header .nav-shell {
  max-width: 1440px;
}

.ai-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-main {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.ai-auth-card {
  width: min(480px, 100%);
  margin: clamp(20px, 7vh, 68px) auto;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid #dfe4df;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(37, 49, 40, .07);
}

.ai-auth-card h1,
.ai-work-header h1 {
  margin: 0;
  color: #1e302d;
  font: 500 clamp(2.2rem, 6vw, 3.4rem)/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}

.ai-intro {
  margin: 13px 0 26px;
  color: #60706c;
}

.ai-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f3f0;
}

.ai-tab {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #61706b;
  font: inherit;
  cursor: pointer;
}

.ai-tab.is-active {
  background: #fff;
  color: #284a38;
  box-shadow: 0 2px 9px rgba(31, 48, 37, .08);
}

.ai-auth-form {
  display: grid;
  gap: 15px;
}

.ai-auth-form label,
.ai-project-picker {
  display: grid;
  gap: 7px;
  color: #566760;
  font-size: .9rem;
}

.ai-auth-form input,
.ai-project-picker select,
.ai-inline-form input,
.ai-file-tools select,
.ai-file-tools input,
.ai-file-editor input,
.ai-file-editor textarea,
.ai-composer textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #d8e0db;
  border-radius: 10px;
  outline-color: #537763;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-auth-form input {
  min-height: 46px;
}

.ai-auth-form .button {
  width: 100%;
  margin-top: 3px;
}

.ai-text-button {
  justify-self: center;
  border: 0;
  background: transparent;
  color: #536f5d;
  font: inherit;
  cursor: pointer;
}

.ai-password-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0ed;
}

.ai-password-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: #a95749;
  transition: width 180ms ease, background-color 180ms ease;
}

.ai-muted,
.ai-status {
  color: #687772;
  font-size: .88rem;
  line-height: 1.55;
}

.ai-muted.is-error {
  color: #a63f35;
}

.ai-status {
  min-height: 1.4em;
  margin: 12px 0 0;
}

.ai-status.is-error {
  color: #a63f35;
}

.ai-workspace-status.is-error {
  border: 1px solid #edc7c7;
  background: #fff2f1;
}

.ai-workspace {
  position: relative;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: min(820px, calc(100dvh - 140px));
  overflow: hidden;
  border: 1px solid #dfe4df;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(37, 49, 40, .06);
  transition: grid-template-columns 180ms ease;
}

.ai-workspace.is-sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.ai-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 12px;
  border-right: 1px solid #e6ebe7;
  background: #f8faf8;
}

.ai-workspace.is-sidebar-collapsed .ai-sidebar {
  align-items: center;
  padding-inline: 8px;
}

.ai-workspace.is-sidebar-collapsed .ai-sidebar-brand > span:last-child,
.ai-workspace.is-sidebar-collapsed .ai-nav-label,
.ai-workspace.is-sidebar-collapsed .ai-account-details,
.ai-workspace.is-sidebar-collapsed .ai-side-section {
  display: none;
}

.ai-workspace.is-sidebar-collapsed .ai-sidebar-top {
  flex-direction: column;
}

.ai-workspace.is-sidebar-collapsed .ai-account-card,
.ai-workspace.is-sidebar-collapsed .ai-full-button,
.ai-workspace.is-sidebar-collapsed .ai-nav-button {
  justify-content: center;
}

.ai-workspace.is-sidebar-collapsed .ai-account-card {
  padding: 8px 4px;
}

.ai-workspace.is-sidebar-collapsed .ai-full-button {
  min-height: 40px;
  padding-inline: 8px;
}

.ai-workspace.is-sidebar-collapsed .ai-nav-button {
  padding-inline: 6px;
}

.ai-sidebar-top,
.ai-sidebar-brand,
.ai-account-card,
.ai-work-toolbar,
.ai-chat-toolbar,
.ai-message-footer {
  display: flex;
  align-items: center;
}

.ai-sidebar-top {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 15px;
}

.ai-sidebar-brand {
  gap: 8px;
  min-width: 0;
  color: #273a32;
  font-weight: 700;
}

.ai-sidebar-brand .ai-welcome-mark {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0;
}

.ai-icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid #dfe5df;
  border-radius: 10px;
  background: #fff;
  color: #46564d;
  font: inherit;
  cursor: pointer;
}

.ai-account-card {
  gap: 10px;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid #e1e8e2;
  border-radius: 13px;
  background: #fff;
}

.ai-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 50%;
  background: #e7efe8;
  color: #315941;
  font: 600 1rem Georgia, serif;
}

.ai-account-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-account-details strong,
.ai-account-status {
  overflow: hidden;
  color: #314238;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-account-details .ai-muted {
  margin: 0;
  font-size: .75rem;
}

.ai-account-status {
  color: #61736a;
  font-size: .7rem;
}

.ai-full-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin: 12px 0;
}

.ai-nav-list {
  display: grid;
  gap: 4px;
}

.ai-nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #52635b;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ai-nav-button > span:first-child {
  display: grid;
  width: 20px;
  flex: 0 0 20px;
  place-items: center;
  font-size: 1.05rem;
}

.ai-nav-button:hover,
.ai-nav-button.is-active {
  border-color: #dce7de;
  background: #edf3ee;
  color: #284936;
}

.ai-nav-settings {
  margin-top: 14px;
}

.ai-side-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5ebe6;
}

.ai-history-search {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #dce4dd;
  border-radius: 9px;
  outline-color: #537763;
  background: #fff;
  color: #263b30;
  font: inherit;
  font-size: .84rem;
}

.ai-list {
  display: grid;
  gap: 4px;
  min-height: 0;
  margin-top: 9px;
  overflow-y: auto;
}

.ai-list button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #52635b;
  text-align: left;
  cursor: pointer;
}

.ai-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-list button time {
  color: #829087;
  font-size: .68rem;
}

.ai-list button:hover,
.ai-list button.is-active {
  border-color: #dce7de;
  background: #edf3ee;
  color: #284936;
}

.ai-history-empty {
  margin: 5px;
  font-size: .78rem;
}

.ai-work-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, 2.5vw, 28px);
}

.ai-work-toolbar {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.ai-work-toolbar .eyebrow {
  margin: 0 0 3px;
}

.ai-work-toolbar h1 {
  margin: 0;
  color: #273a32;
  font: 500 clamp(1.4rem, 3vw, 2rem) Georgia, "Times New Roman", serif;
}

.ai-mobile-menu {
  display: none;
}

.ai-view {
  min-width: 0;
  flex: 1;
}

.ai-chat-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ai-chat-toolbar {
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0ed;
}

.ai-chat-toolbar > p {
  margin: 0;
  color: #75817c;
  font-size: .83rem;
}

.ai-project-picker,
.ai-currency-picker {
  display: grid;
  gap: 5px;
  min-width: min(220px, 44%);
  color: #566760;
  font-size: .78rem;
}

.ai-project-picker select,
.ai-currency-picker select {
  min-width: 0;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid #d8e0db;
  border-radius: 9px;
  outline-color: #537763;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 260px;
  overflow: auto;
  padding: 20px 4px;
  scroll-behavior: smooth;
}

.ai-welcome {
  align-self: center;
  max-width: 440px;
  margin: auto;
  color: #64736d;
  text-align: center;
}

.ai-welcome-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 50%;
  background: #e8f0e9;
  color: #40674d;
  font: 500 1.3rem Georgia, serif;
}

.ai-welcome h2 {
  margin: 0 0 6px;
  color: #283c33;
  font: 500 1.55rem Georgia, serif;
}

.ai-message {
  width: fit-content;
  max-width: min(88%, 820px);
  min-width: min(0, 100%);
  padding: 13px 16px 9px;
  border: 1px solid #e5e9e5;
  border-radius: 14px;
  color: #35443d;
  overflow-wrap: anywhere;
}

.ai-message-user {
  align-self: flex-end;
  border-color: #dce9de;
  background: #eef5ef;
}

.ai-message-assistant {
  align-self: flex-start;
  background: #fafbf9;
}

.ai-message-content {
  white-space: normal;
  line-height: 1.65;
}

.ai-message-content > :first-child {
  margin-top: 0;
}

.ai-message-content > :last-child {
  margin-bottom: 0;
}

.ai-message-content p {
  margin: 0 0 .85em;
}

.ai-message-content ul {
  margin: .4em 0 .9em;
  padding-left: 1.35em;
}

.ai-message-content pre,
.ai-proposal-columns pre {
  max-width: 100%;
  overflow: auto;
  padding: 12px;
  border-radius: 9px;
  background: #eff2ef;
  color: #25342b;
  font: .84rem/1.55 Consolas, "Courier New", monospace;
  white-space: pre;
}

.ai-message-content code:not(pre code) {
  padding: .12em .35em;
  border-radius: 5px;
  background: #edf1ed;
  font: .9em Consolas, "Courier New", monospace;
}

.ai-message-content a {
  color: #376948;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ai-message-footer {
  justify-content: flex-start;
  gap: 10px;
  min-height: 30px;
  margin-top: 6px;
  color: #819087;
  font-size: .7rem;
}

.ai-message-action {
  margin-left: auto;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64756a;
  font: inherit;
  cursor: pointer;
}

.ai-message-action:hover {
  background: #e9eee9;
}

.ai-composer {
  flex: 0 0 auto;
  padding: 11px 12px;
  border: 1px solid #dfe5df;
  border-radius: 15px;
  background: #fbfcfa;
  box-shadow: 0 8px 24px rgba(31, 48, 37, .04);
}

.ai-composer textarea {
  min-height: 92px;
  max-height: 280px;
  border: 0;
  resize: vertical;
  background: transparent;
}

.ai-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #75817c;
  font-size: .78rem;
}

.ai-project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}

.ai-project-heading .eyebrow {
  margin: 0 0 4px;
}

.ai-project-heading h2,
.ai-view > h2 {
  margin: 0;
  color: #273a32;
  font: 500 clamp(1.25rem, 3vw, 1.65rem) Georgia, "Times New Roman", serif;
}

.ai-inline-form,
.ai-file-tools,
.ai-file-actions,
.ai-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-inline-form input,
.ai-file-editor input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d8e0db;
  border-radius: 10px;
  outline-color: #537763;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-inline-form input {
  width: min(260px, 55vw);
}

.ai-project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-top: 18px;
}

.ai-project-card,
.ai-plan-card {
  padding: 16px;
  border: 1px solid #e1e8e2;
  border-radius: 13px;
  background: #fff;
}

.ai-project-card h3 {
  margin: 0;
  color: #314238;
  font-size: 1rem;
}

.ai-project-card p {
  margin: 5px 0 14px;
  color: #687772;
  font-size: .82rem;
}

.ai-project-actions .button {
  flex: 1;
}

.ai-file-tools {
  align-items: center;
  margin: 15px 0 10px;
}

.ai-file-tools select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8e0db;
  border-radius: 10px;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-file-tools input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d8e0db;
  border-radius: 10px;
  background: #fff;
  color: #566760;
}

.ai-file-input {
  display: grid;
  flex: 1 1 220px;
  gap: 5px;
  color: #64736d;
  font-size: .78rem;
}

.ai-file-editor {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.ai-file-editor textarea {
  width: 100%;
  min-height: min(48vh, 500px);
  padding: 12px;
  border: 1px solid #d8e0db;
  border-radius: 10px;
  outline-color: #537763;
  background: #fbfcfa;
  color: #23332d;
  resize: vertical;
  font: .88rem/1.5 Consolas, "Courier New", monospace;
}

.ai-file-actions .button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ai-currency-picker {
  min-width: min(280px, 100%);
}

.ai-plans-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
  margin: 20px 0;
}

.ai-plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-plan-card strong {
  color: #2e4436;
  font-size: 1.1rem;
}

.ai-plan-card > span {
  min-height: 3.2em;
  color: #687772;
  font-size: .86rem;
  line-height: 1.5;
}

.ai-plan-card button {
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  border: 1px solid #d6e0d7;
  border-radius: 9px;
  background: #f2f6f2;
  color: #365642;
  font: inherit;
  cursor: pointer;
}

.ai-plan-card button:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.ai-plan-free {
  border-style: dashed;
}

.ai-password-settings {
  width: min(580px, 100%);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ai-password-settings summary {
  color: #314238;
  font-weight: 600;
  cursor: pointer;
}

.ai-password-settings form {
  display: grid;
  gap: 12px;
  margin-top: 15px;
}

.ai-password-settings label {
  display: grid;
  gap: 6px;
  color: #566760;
  font-size: .88rem;
}

.ai-password-settings input {
  min-height: 42px;
  padding: 10px;
  border: 1px solid #d8e0db;
  border-radius: 9px;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-settings-heading {
  margin-bottom: 22px;
}

.ai-settings-heading h2 {
  margin: 0;
  color: #273a32;
  font: 500 clamp(1.7rem, 3vw, 2.2rem) Georgia, "Times New Roman", serif;
}

.ai-settings-heading > p:last-child {
  margin: 8px 0 0;
  color: #75817c;
}

.ai-settings-card {
  width: min(720px, 100%);
  margin: 0 0 14px;
  padding: 20px;
  border: 1px solid #e2e8e2;
  border-radius: 14px;
  background: #fff;
}

.ai-settings-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-settings-card-heading h3 {
  margin: 0;
  color: #314238;
  font-size: 1rem;
}

.ai-settings-card-heading p,
.ai-settings-help {
  margin: 5px 0 0;
  color: #75817c;
  font-size: .85rem;
}

.ai-settings-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e8f0e9;
  color: #40674d;
  font-weight: 600;
}

.ai-account-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 19px 0;
}

.ai-account-summary div {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f5f7f4;
}

.ai-account-summary dt {
  color: #75817c;
  font-size: .78rem;
}

.ai-account-summary dd {
  margin: 5px 0 0;
  color: #314238;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ai-settings-select-label {
  display: block;
  margin: 18px 0 6px;
  color: #566760;
  font-size: .88rem;
}

.ai-settings-select {
  width: min(280px, 100%);
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d8e0db;
  border-radius: 9px;
  background: #fff;
  color: #23332d;
  font: inherit;
}

.ai-settings-logout {
  padding: 9px 0 0;
  border: 0;
  background: transparent;
  color: #a34a3d;
  font: inherit;
  cursor: pointer;
}

.ai-settings-policy-link {
  display: inline-block;
  margin-top: 16px;
  color: #536f5d;
  font-size: .88rem;
}

.ai-workspace-status {
  position: fixed;
  right: 18px;
  bottom: 12px;
  z-index: 60;
  display: none;
  max-width: min(500px, calc(100% - 36px));
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .1);
}

.ai-workspace-status.is-visible {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

html[data-theme="dark"] .ai-body {
  background: #111513;
  color: #e8ede8;
}

html[data-theme="dark"] .ai-auth-card,
html[data-theme="dark"] .ai-workspace,
html[data-theme="dark"] .ai-account-card,
html[data-theme="dark"] .ai-plan-card,
html[data-theme="dark"] .ai-message-assistant,
html[data-theme="dark"] .ai-proposal-comparison,
html[data-theme="dark"] .ai-project-card,
html[data-theme="dark"] .ai-password-settings {
  border-color: #303a34;
  background: #1a211d;
  color: #e2e8e3;
}

html[data-theme="dark"] .ai-auth-form input,
html[data-theme="dark"] .ai-password-settings input {
  border-color: #3a473f;
  background: #111713;
  color: #e7eee8;
}

html[data-theme="dark"] .ai-auth-tabs {
  background: #111713;
}

html[data-theme="dark"] .ai-tab {
  color: #a7b3aa;
}

html[data-theme="dark"] .ai-tab.is-active {
  background: #222b25;
  color: #e6eee8;
}

html[data-theme="dark"] .ai-sidebar,
html[data-theme="dark"] .ai-composer {
  border-color: #303a34;
  background: #171d19;
}

html[data-theme="dark"] .ai-sidebar-brand,
html[data-theme="dark"] .ai-account-details strong,
html[data-theme="dark"] .ai-account-status,
html[data-theme="dark"] .ai-work-toolbar h1,
html[data-theme="dark"] .ai-project-heading h2,
html[data-theme="dark"] .ai-view > h2,
html[data-theme="dark"] .ai-project-card h3,
html[data-theme="dark"] .ai-plan-card strong,
html[data-theme="dark"] .ai-password-settings summary,
html[data-theme="dark"] .ai-welcome h2 {
  color: #e7eee8;
}

html[data-theme="dark"] .ai-muted,
html[data-theme="dark"] .ai-chat-toolbar > p,
html[data-theme="dark"] .ai-project-card p,
html[data-theme="dark"] .ai-plan-card > span,
html[data-theme="dark"] .ai-message-footer,
html[data-theme="dark"] .ai-composer-footer {
  color: #a7b3aa;
}

html[data-theme="dark"] .ai-icon-button,
html[data-theme="dark"] .ai-history-search,
html[data-theme="dark"] .ai-project-picker select,
html[data-theme="dark"] .ai-currency-picker select,
html[data-theme="dark"] .ai-inline-form input,
html[data-theme="dark"] .ai-file-tools select,
html[data-theme="dark"] .ai-file-tools input,
html[data-theme="dark"] .ai-file-editor input,
html[data-theme="dark"] .ai-file-editor textarea {
  border-color: #3a473f;
  background: #111713;
  color: #e7eee8;
}

html[data-theme="dark"] .ai-nav-button,
html[data-theme="dark"] .ai-list button {
  color: #c1ccc4;
}

html[data-theme="dark"] .ai-nav-button:hover,
html[data-theme="dark"] .ai-nav-button.is-active,
html[data-theme="dark"] .ai-list button:hover,
html[data-theme="dark"] .ai-list button.is-active,
html[data-theme="dark"] .ai-message-action:hover {
  border-color: #3b4b40;
  background: #222d25;
  color: #e7eee8;
}

html[data-theme="dark"] .ai-message-user {
  border-color: #35523d;
  background: #1d3022;
  color: #e2e8e3;
}

html[data-theme="dark"] .ai-message-content pre,
html[data-theme="dark"] .ai-proposal-columns pre,
html[data-theme="dark"] .ai-message-content code:not(pre code) {
  background: #111713;
  color: #e7eee8;
}

html[data-theme="dark"] .ai-message-content a {
  color: #a9d2b2;
}

html[data-theme="dark"] .ai-chat-toolbar,
html[data-theme="dark"] .ai-side-section {
  border-color: #303a34;
}

html[data-theme="dark"] .ai-plan-card button {
  border-color: #3b4b40;
  background: #222d25;
  color: #d9e8dc;
}

html[data-theme="dark"] .ai-tab.is-active,
html[data-theme="dark"] .ai-workspace-status {
  background: #222b25;
  color: #e6eee8;
}

html[data-theme="dark"] .ai-status.is-error {
  color: #ffaaa0;
}

html[data-theme="dark"] .ai-workspace-status.is-error {
  border-color: #70413c;
  background: #32211e;
}

html[data-theme="dark"] .ai-account-card strong {
  color: #b6d7bd;
}

@media (max-width: 760px) {
  .ai-workspace {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100dvh - 116px);
  }

  .ai-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(300px, calc(100vw - 36px));
    overflow: auto;
    border: 1px solid #dfe4df;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
    transform: translateX(calc(-100% - 22px));
    transition: transform 180ms ease;
  }

  .ai-workspace.is-sidebar-open .ai-sidebar {
    transform: translateX(0);
  }

  .ai-workspace.is-sidebar-collapsed .ai-sidebar-brand > span:last-child,
  .ai-workspace.is-sidebar-collapsed .ai-nav-label,
  .ai-workspace.is-sidebar-collapsed .ai-account-details,
  .ai-workspace.is-sidebar-collapsed .ai-sidebar-top #toggleSidebar,
  .ai-workspace.is-sidebar-collapsed .ai-side-section {
    display: initial;
  }

  .ai-workspace.is-sidebar-collapsed .ai-sidebar {
    width: min(300px, calc(100vw - 36px));
  }

  .ai-mobile-menu {
    display: grid;
  }

  .ai-work-toolbar {
    justify-content: flex-start;
  }

}

@media (max-width: 600px) {
  .ai-main {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .ai-header .nav-shell {
    padding-inline: 12px;
  }

  .ai-work-area {
    min-height: calc(100dvh - 132px);
    padding: 14px 12px;
  }

  .ai-chat-toolbar,
  .ai-project-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-project-picker,
  .ai-project-picker select,
  .ai-currency-picker,
  .ai-currency-picker select {
    width: 100%;
    min-width: 0;
  }

  .ai-chat-messages {
    min-height: 240px;
    padding: 16px 0;
  }

  .ai-message {
    max-width: 96%;
    padding-inline: 12px;
  }

  .ai-proposal-columns {
    grid-template-columns: 1fr;
  }

  .ai-composer-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-composer-footer .button,
  .ai-inline-form,
  .ai-inline-form input,
  .ai-file-actions .button {
    width: 100%;
  }

  .ai-file-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-file-tools select,
  .ai-file-tools input,
  .ai-file-input {
    width: 100%;
  }

  .ai-file-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-file-actions .button:last-child {
    grid-column: 1 / -1;
  }

  .ai-project-actions {
    display: grid;
  }
}

.ai-body {
  --branded-bg: #f7f5f0;
  --branded-sidebar: #efede7;
  --branded-surface: #fffefa;
  --branded-surface-soft: #f2f0e9;
  --branded-line: #dedbd2;
  --branded-text: #282923;
  --branded-muted: #77786f;
  --branded-accent: #c66b45;
  --branded-green: #526e59;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--branded-bg);
  color: var(--branded-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.ai-main.branded-ai {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

.ai-coming-soon-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.ai-coming-soon {
  width: min(520px, 100%);
  padding: clamp(30px, 7vw, 58px);
  border: 1px solid var(--branded-line);
  border-radius: 24px;
  background: var(--branded-surface);
  box-shadow: 0 24px 80px rgba(40, 41, 35, .08);
  text-align: center;
}

.ai-coming-soon-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 42px;
  color: var(--branded-text);
  font-size: .92rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-decoration: none;
}

.ai-coming-soon-brand strong {
  color: var(--branded-accent);
}

.ai-coming-soon-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: var(--branded-green);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.ai-coming-soon-eyebrow {
  margin: 0 0 12px;
  color: var(--branded-green);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.ai-coming-soon h1 {
  margin: 0;
  color: var(--branded-text);
  font: 500 clamp(3.2rem, 12vw, 5rem)/1 Georgia, "Times New Roman", serif;
  letter-spacing: -.06em;
}

.ai-coming-soon-copy {
  margin: 20px 0 28px;
  color: var(--branded-muted);
  line-height: 1.65;
}

.ai-coming-soon-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--branded-line);
  border-radius: 12px;
  color: var(--branded-text);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.ai-coming-soon-link:hover {
  border-color: var(--branded-green);
  background: var(--branded-surface-soft);
}

html[data-theme="dark"] .ai-coming-soon {
  border-color: #303a34;
  background: #1a211d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] .ai-coming-soon-link {
  border-color: #3a473f;
}

.branded-ai .ai-auth-card {
  position: relative;
  margin: clamp(20px, 7vh, 68px) auto;
  background: var(--branded-surface);
}

.branded-ai .ai-auth-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
}

.branded-ai .ai-workspace {
  position: relative;
  grid-template-columns: 270px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--branded-bg);
  box-shadow: none;
}

.branded-ai .ai-workspace.is-sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.branded-ai .ai-sidebar {
  height: 100dvh;
  overflow-y: auto;
  padding: 17px 13px;
  border-right-color: var(--branded-line);
  background: var(--branded-sidebar);
}

.branded-ai .ai-sidebar-top {
  padding: 0 2px;
}

.branded-ai .ai-sidebar-brand {
  gap: 9px;
  color: var(--branded-text);
  font-size: .96rem;
  letter-spacing: -.03em;
}

.branded-ai .ai-sidebar-brand .ai-welcome-mark {
  width: 29px;
  height: 29px;
  flex-basis: 29px;
  margin: 0;
  background: #d6dfd1;
  color: #3f5c47;
  font-size: 1.15rem;
}

.branded-ai .ai-account-card {
  border-color: transparent;
  background: transparent;
  padding: 5px;
}

.branded-ai .ai-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  background: #d7d7ca;
  color: #39463a;
}

.branded-ai .ai-account-details strong {
  color: var(--branded-text);
  font-size: .75rem;
}

.branded-ai .ai-account-details .ai-muted,
.branded-ai .ai-account-status {
  color: var(--branded-muted);
  font-size: .68rem;
}

.branded-ai .ai-full-button {
  width: fit-content;
  min-height: 36px;
  margin: 2px 0 8px;
  padding: 7px 11px;
  border-color: #d8d4c9;
  border-radius: 9px;
  background: #faf9f5;
  color: var(--branded-text);
  font-size: .78rem;
}

.branded-ai .ai-workspace.is-sidebar-collapsed .ai-full-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.branded-ai .ai-full-button:hover {
  background: var(--branded-surface);
}

.branded-ai .ai-nav-list {
  gap: 3px;
}

.branded-ai .ai-nav-button {
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #5f625b;
  font-size: .86rem;
}

.branded-ai .ai-nav-button:hover,
.branded-ai .ai-nav-button.is-active {
  border-color: transparent;
  background: #e2e0d7;
  color: var(--branded-text);
}

.branded-ai .ai-nav-button.is-active > span:first-child {
  color: var(--branded-accent);
}

.branded-ai .ai-nav-settings {
  margin-top: 0;
}

.branded-ai .ai-side-section {
  margin-top: 0;
  padding-top: 12px;
  border-top: 0;
}

.branded-ai .ai-section-label {
  padding: 4px 10px 7px;
  color: var(--branded-muted);
  font-size: .69rem;
}

.branded-ai .ai-history-search {
  min-height: 36px;
  border-color: #d8d4c9;
  border-radius: 8px;
  background: #faf9f5;
  color: var(--branded-text);
  font-size: .78rem;
}

.branded-ai .ai-list {
  gap: 2px;
  margin-top: 6px;
}

.branded-ai .ai-list button {
  padding: 7px 9px;
  border-radius: 8px;
  color: #686a62;
  font-size: .75rem;
}

.branded-ai .ai-list button:hover,
.branded-ai .ai-list button.is-active {
  border-color: transparent;
  background: #e5e2d9;
  color: var(--branded-text);
}

.branded-ai .ai-list button time {
  color: var(--branded-muted);
}

.branded-ai .ai-sidebar-bottom {
  display: grid;
  gap: 11px;
  margin-top: auto;
  padding-top: 12px;
}

.branded-ai .ai-sidebar,
.ai-body,
.branded-ai .ai-auth-card,
.branded-ai .ai-account-card,
.branded-ai .ai-workspace,
.branded-ai .ai-work-area,
.branded-ai .ai-work-toolbar,
.branded-ai .ai-nav-button,
.branded-ai .ai-full-button,
.branded-ai .ai-upgrade-card,
.branded-ai .ai-settings-card,
.branded-ai .ai-composer,
.branded-ai .ai-icon-button,
.branded-ai .ai-chat-attachment,
.branded-ai .ai-quick-prompt,
.branded-ai .ai-message,
.branded-ai .ai-response-mode-trigger,
.branded-ai .ai-response-mode-option,
.branded-ai .ai-status {
  transition:
    grid-template-columns 280ms cubic-bezier(.22, 1, .36, 1),
    background-color 240ms ease,
    color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    opacity 240ms ease,
    transform 240ms cubic-bezier(.22, 1, .36, 1);
}

.branded-ai .ai-view-panel-enter {
  animation: ai-view-enter 280ms cubic-bezier(.22, 1, .36, 1) both;
}

.branded-ai .ai-message-enter {
  animation: ai-message-enter 320ms cubic-bezier(.22, 1, .36, 1) both;
}

.branded-ai .ai-message-enter:nth-child(2) {
  animation-delay: 35ms;
}

.branded-ai .ai-message-enter:nth-child(3) {
  animation-delay: 70ms;
}

.branded-ai .ai-upgrade-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #d9d4c9;
  border-radius: 11px;
  background: #f7f5ef;
  color: var(--branded-text);
  text-align: left;
  cursor: pointer;
}

.branded-ai .ai-upgrade-card strong {
  font-size: .75rem;
}

.branded-ai .ai-upgrade-card > span {
  color: var(--branded-muted);
  font-size: .67rem;
}

.branded-ai .ai-upgrade-card .ai-upgrade-link {
  color: var(--branded-green);
  font-weight: 650;
}

.branded-ai .ai-portfolio-link {
  padding: 2px 5px;
  color: var(--branded-muted);
  font-size: .72rem;
  text-decoration: none;
}

.branded-ai .ai-portfolio-link:hover {
  color: var(--branded-text);
}

.branded-ai .ai-work-area {
  min-height: 0;
  overflow-y: auto;
  padding: 0 clamp(16px, 3vw, 34px) 18px;
}

.branded-ai .ai-work-toolbar {
  min-height: 62px;
  flex: 0 0 auto;
  margin: 0;
  border-bottom: 1px solid #e8e5dd;
}

.branded-ai .ai-toolbar-title .eyebrow {
  margin: 0 0 1px;
  color: var(--branded-muted);
  font-size: .64rem;
}

.branded-ai .ai-work-toolbar h1 {
  color: var(--branded-text);
  font-family: inherit;
  font-size: .94rem;
  font-weight: 650;
  line-height: 1.3;
}

.branded-ai .ai-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.branded-ai .ai-online-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--branded-green);
  font-size: .72rem;
}

.branded-ai .ai-online-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #729675;
  content: "";
}

.branded-ai .ai-icon-button {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--branded-muted);
}

.branded-ai .ai-mobile-sidebar-close,
.branded-ai .ai-sidebar-backdrop {
  display: none;
}

.branded-ai .ai-icon-button:hover {
  background: #e5e2d9;
  color: var(--branded-text);
}

.branded-ai .ai-chat-view {
  flex: 1 1 auto;
  min-height: 0;
  min-height: 0;
}

.branded-ai .ai-chat-toolbar {
  flex: 0 0 auto;
  padding: 13px 0 10px;
  border-bottom-color: #e8e5dd;
}

.branded-ai .ai-chat-toolbar > p {
  color: var(--branded-muted);
  font-size: .78rem;
}

.branded-ai .ai-project-picker {
  gap: 4px;
  min-width: min(220px, 42%);
  color: var(--branded-muted);
  font-size: .69rem;
}

.branded-ai .ai-project-picker select {
  min-height: 34px;
  border-color: var(--branded-line);
  border-radius: 8px;
  background: var(--branded-surface);
  color: var(--branded-text);
  font-size: .77rem;
}

.branded-ai .ai-chat-messages {
  flex: 1 1 0;
  min-height: 0;
  gap: 18px;
  padding: 18px 4px;
}

.branded-ai .ai-welcome {
  width: min(100%, 620px);
  max-width: 620px;
  margin: auto;
  color: var(--branded-muted);
  text-align: left;
}

.branded-ai .ai-welcome h2 {
  margin: 0 0 7px;
  color: var(--branded-text);
  font: 400 clamp(1.9rem, 4vw, 2.7rem)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
}

.branded-ai .ai-welcome > p {
  margin: 0;
  font-size: .86rem;
}

.branded-ai .ai-quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.branded-ai .ai-quick-prompt {
  display: flex;
  min-height: 62px;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--branded-line);
  border-radius: 10px;
  background: #fbfaf6;
  color: var(--branded-text);
  text-align: left;
  cursor: pointer;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.branded-ai .ai-quick-prompt:hover {
  border-color: #c8c0b1;
  background: var(--branded-surface);
}

.branded-ai .ai-quick-prompt > span:first-child {
  width: 19px;
  flex: 0 0 19px;
  color: var(--branded-accent);
  font-size: .95rem;
  text-align: center;
}

.branded-ai .ai-quick-prompt strong,
.branded-ai .ai-quick-prompt small {
  display: block;
}

.branded-ai .ai-quick-prompt strong {
  margin-bottom: 2px;
  font-size: .73rem;
  font-weight: 650;
}

.branded-ai .ai-quick-prompt small {
  color: var(--branded-muted);
  font-size: .66rem;
}

.branded-ai .ai-message {
  max-width: min(88%, 820px);
  border-color: var(--branded-line);
  border-radius: 12px;
}

.branded-ai .ai-message-user {
  border-color: #dedbd2;
  background: #ebe8df;
  color: var(--branded-text);
}

.branded-ai .ai-message-assistant {
  border-color: transparent;
  background: transparent;
  color: var(--branded-text);
}

.branded-ai .ai-composer {
  flex: 0 0 auto;
  padding: 11px 13px 9px;
  border-color: #d7d3c8;
  border-radius: 15px;
  background: var(--branded-surface);
  box-shadow: 0 3px 12px rgba(43, 41, 29, .04);
}

.branded-ai .ai-composer:focus-within {
  border-color: #bcb5a5;
  box-shadow: 0 0 0 3px rgba(186, 157, 123, .08);
}

.branded-ai .ai-composer textarea {
  min-height: 68px;
  max-height: 280px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: var(--branded-text);
  font-size: .86rem;
  resize: none;
}

.branded-ai .ai-composer textarea::placeholder {
  color: #99988f;
}

.branded-ai .ai-hidden-file-input {
  display: none;
}

.branded-ai .ai-chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 3px 0 9px;
}

.branded-ai .ai-usage-summary {
  margin: 16px 0 10px;
  color: var(--branded-text);
  font-size: .82rem;
  font-weight: 600;
}

.branded-ai .ai-usage-history {
  display: grid;
  gap: 8px;
}

.branded-ai .ai-usage-entry {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--branded-line);
  border-radius: 10px;
  background: var(--branded-surface-soft);
  font-size: .76rem;
}

.branded-ai .ai-usage-entry strong {
  overflow: hidden;
  color: var(--branded-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branded-ai .ai-usage-entry span,
.branded-ai .ai-usage-entry time {
  color: var(--branded-muted);
}

.branded-ai .ai-chat-attachment {
  display: inline-flex;
  max-width: min(100%, 260px);
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border: 1px solid var(--branded-line);
  border-radius: 9px;
  background: var(--branded-surface-soft);
  color: var(--branded-text);
  font-size: .7rem;
}

.branded-ai .ai-chat-attachment > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.branded-ai .ai-chat-attachment-remove {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--branded-muted);
  font-size: 1rem;
  cursor: pointer;
}

.branded-ai .ai-chat-attachment-remove:hover {
  background: rgba(0, 0, 0, .08);
  color: var(--branded-text);
}

.branded-ai .ai-composer-footer {
  align-items: center;
  color: var(--branded-muted);
}

.branded-ai .ai-composer-tools,
.branded-ai .ai-composer-submit {
  display: flex;
  align-items: center;
  gap: 5px;
}

.branded-ai .ai-response-mode {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 4px;
  color: var(--branded-muted);
  font-size: .62rem;
  line-height: 1.2;
}

.branded-ai .ai-response-mode-caption {
  padding-left: 2px;
}

.branded-ai .ai-response-mode-trigger {
  display: inline-flex;
  min-width: 112px;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 9px 6px 11px;
  border: 1px solid var(--branded-line);
  border-radius: 9px;
  background: var(--branded-surface);
  color: var(--branded-text);
  font: inherit;
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.branded-ai .ai-response-mode-trigger:hover,
.branded-ai .ai-response-mode-trigger[aria-expanded="true"] {
  border-color: var(--branded-accent);
  background: var(--branded-surface-soft);
}

.branded-ai .ai-response-mode-trigger:focus-visible,
.branded-ai .ai-response-mode-option:focus-visible {
  outline: 2px solid var(--branded-accent);
  outline-offset: 2px;
}

.branded-ai .ai-response-mode-trigger svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.branded-ai .ai-response-mode-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.branded-ai .ai-response-mode-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 20;
  display: grid;
  width: min(250px, calc(100vw - 32px));
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--branded-line);
  border-radius: 12px;
  background: var(--branded-surface);
  box-shadow: 0 12px 32px rgba(32, 30, 23, .16);
  transform-origin: bottom right;
  animation: ai-menu-enter 220ms cubic-bezier(.22, 1, .36, 1) both;
}

.branded-ai .ai-response-mode-menu[hidden] {
  display: none;
}

.branded-ai .ai-response-mode-option {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--branded-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.branded-ai .ai-response-mode-option:hover,
.branded-ai .ai-response-mode-option.is-selected {
  background: var(--branded-surface-soft);
}

.branded-ai .ai-response-mode-option.is-selected {
  box-shadow: inset 2px 0 var(--branded-accent);
}

.branded-ai .ai-response-mode-option-title {
  font-size: .75rem;
  font-weight: 650;
}

.branded-ai .ai-response-mode-option-description {
  color: var(--branded-muted);
  font-size: .66rem;
  line-height: 1.35;
}

.branded-ai .ai-response-mode-native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  pointer-events: none;
}

.branded-ai .ai-stop-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--branded-line);
  border-radius: 8px;
  background: var(--branded-surface-soft);
  color: var(--branded-text);
  font: inherit;
  font-size: .7rem;
  cursor: pointer;
}

.branded-ai .ai-message-is-streaming .ai-message-content::after {
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--branded-accent);
  animation: ai-caret-blink 900ms steps(2, start) infinite;
  content: "";
}

.branded-ai .ai-generating-status {
  color: var(--branded-muted);
  font-size: .7rem;
}

@keyframes ai-caret-blink {
  to { visibility: hidden; }
}

@keyframes ai-menu-enter {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ai-message-enter {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.branded-ai .ai-composer-tool {
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--branded-muted);
  font: inherit;
  font-size: .68rem;
  cursor: pointer;
}

.branded-ai .ai-composer-tool:hover:not(:disabled) {
  background: var(--branded-surface-soft);
  color: var(--branded-text);
}

.branded-ai .ai-composer-tool:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.branded-ai .ai-model-note {
  padding: 0 4px;
  color: var(--branded-muted);
  font-size: .66rem;
}

.branded-ai .ai-send-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #333c33;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.branded-ai .ai-send-button:hover:not(:disabled) {
  background: #202a22;
}

.branded-ai .ai-send-button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.branded-ai .ai-disclaimer {
  flex: 0 0 auto;
  margin: 8px 0 0;
  color: #939188;
  font-size: .63rem;
  text-align: center;
}

.branded-ai .ai-sidebar.is-hidden,
.branded-ai .ai-side-section.is-hidden {
  display: none !important;
}

.branded-ai .ai-workspace-status:not(:empty) {
  border: 1px solid var(--branded-line);
  background: var(--branded-surface);
  color: var(--branded-text);
}

html[data-theme="dark"] .ai-body {
  --branded-bg: #242522;
  --branded-sidebar: #20211f;
  --branded-surface: #2b2c29;
  --branded-surface-soft: #343530;
  --branded-line: #44453f;
  --branded-text: #efeee8;
  --branded-muted: #aaa99f;
  --branded-green: #a7c5aa;
  background: var(--branded-bg);
}

html[data-theme="dark"] .branded-ai .ai-auth-card h1 {
  color: #e7eee8;
}

html[data-theme="dark"] .branded-ai .ai-intro,
html[data-theme="dark"] .branded-ai .ai-auth-form label,
html[data-theme="dark"] .branded-ai .ai-text-button,
html[data-theme="dark"] .branded-ai .ai-muted {
  color: #a7b3aa;
}

html[data-theme="dark"] .branded-ai .ai-workspace,
html[data-theme="dark"] .branded-ai .ai-sidebar {
  background: var(--branded-bg);
}

html[data-theme="dark"] .branded-ai .ai-sidebar {
  background: var(--branded-sidebar);
}

html[data-theme="dark"] .branded-ai .ai-work-toolbar,
html[data-theme="dark"] .branded-ai .ai-chat-toolbar {
  border-color: #3a3b35;
}

html[data-theme="dark"] .branded-ai .ai-sidebar-brand,
html[data-theme="dark"] .branded-ai .ai-account-details strong,
html[data-theme="dark"] .branded-ai .ai-work-toolbar h1,
html[data-theme="dark"] .branded-ai .ai-welcome h2 {
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-account-status,
html[data-theme="dark"] .branded-ai .ai-account-details .ai-muted {
  color: var(--branded-muted);
}

html[data-theme="dark"] .branded-ai .ai-icon-button:hover,
html[data-theme="dark"] .branded-ai .ai-nav-button:hover,
html[data-theme="dark"] .branded-ai .ai-nav-button.is-active,
html[data-theme="dark"] .branded-ai .ai-list button:hover,
html[data-theme="dark"] .branded-ai .ai-list button.is-active {
  background: #373832;
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-full-button,
html[data-theme="dark"] .branded-ai .ai-history-search,
html[data-theme="dark"] .branded-ai .ai-project-picker select,
html[data-theme="dark"] .branded-ai .ai-quick-prompt,
html[data-theme="dark"] .branded-ai .ai-composer,
html[data-theme="dark"] .branded-ai .ai-chat-attachment {
  border-color: var(--branded-line);
  background: var(--branded-surface);
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-full-button:hover,
html[data-theme="dark"] .branded-ai .ai-quick-prompt:hover,
html[data-theme="dark"] .branded-ai .ai-composer-tool:hover:not(:disabled) {
  background: #33342f;
}

html[data-theme="dark"] .branded-ai .ai-upgrade-card {
  border-color: var(--branded-line);
  background: #292a26;
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-settings-heading h2,
html[data-theme="dark"] .branded-ai .ai-settings-card-heading h3,
html[data-theme="dark"] .branded-ai .ai-account-summary dd {
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-settings-heading > p:last-child,
html[data-theme="dark"] .branded-ai .ai-settings-card-heading p,
html[data-theme="dark"] .branded-ai .ai-settings-help,
html[data-theme="dark"] .branded-ai .ai-account-summary dt,
html[data-theme="dark"] .branded-ai .ai-settings-select-label {
  color: var(--branded-muted);
}

html[data-theme="dark"] .branded-ai .ai-settings-card,
html[data-theme="dark"] .branded-ai .ai-password-settings,
html[data-theme="dark"] .branded-ai .ai-usage-entry {
  border-color: var(--branded-line);
  background: var(--branded-surface);
}

html[data-theme="dark"] .branded-ai .ai-usage-entry strong,
html[data-theme="dark"] .branded-ai .ai-usage-summary {
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-usage-entry span,
html[data-theme="dark"] .branded-ai .ai-usage-entry time {
  color: var(--branded-muted);
}

html[data-theme="dark"] .branded-ai .ai-account-summary div {
  background: var(--branded-surface-soft);
}

html[data-theme="dark"] .branded-ai .ai-settings-select,
html[data-theme="dark"] .branded-ai .ai-password-settings input {
  border-color: var(--branded-line);
  background: #252623;
  color: var(--branded-text);
}

html[data-theme="dark"] .branded-ai .ai-settings-avatar {
  background: #3b473b;
  color: var(--branded-green);
}

html[data-theme="dark"] .branded-ai .ai-settings-policy-link {
  color: var(--branded-green);
}

html[data-theme="dark"] .branded-ai .ai-message-user {
  border-color: var(--branded-line);
  background: #3b3c35;
}

html[data-theme="dark"] .branded-ai .ai-message-assistant {
  border-color: transparent;
  background: transparent;
}

html[data-theme="dark"] .branded-ai .ai-send-button {
  background: #4a4b43;
}

html[data-theme="dark"] .branded-ai .ai-send-button:hover:not(:disabled) {
  background: #5a5b51;
}

@media (max-width: 760px) {
  .branded-ai .ai-workspace,
  .branded-ai .ai-workspace.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: visible;
  }

  .branded-ai .ai-work-area {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px max(10px, env(safe-area-inset-bottom));
  }

  .branded-ai .ai-work-toolbar {
    min-height: 52px;
    gap: 8px;
    margin-bottom: 4px;
  }

  .branded-ai .ai-work-toolbar h1 {
    font: 500 1.2rem/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  }

  .branded-ai .ai-workspace.is-sidebar-open .ai-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(25, 26, 23, .42);
    animation: ai-backdrop-enter 220ms ease-out both;
  }

  .branded-ai .ai-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: min(320px, calc(100vw - 48px));
    height: 100dvh;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid var(--branded-line);
    border-radius: 0 16px 16px 0;
    background: var(--branded-sidebar);
    box-shadow: 12px 0 40px rgba(0, 0, 0, .14);
    transform: translateX(calc(-100% - 14px));
    transition: transform 280ms cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
  }

  .branded-ai .ai-workspace.is-sidebar-open .ai-sidebar {
    transform: translateX(0);
    pointer-events: auto;
  }

  .ai-body.ai-sidebar-lock {
    overflow: hidden;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-sidebar {
    width: min(320px, calc(100vw - 48px));
    align-items: stretch;
    padding-inline: 14px;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-sidebar-top {
    flex-direction: row;
    justify-content: space-between;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-sidebar-brand > span:last-child,
  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-nav-label,
  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-account-details,
  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-side-section {
    display: initial;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-account-card,
  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-full-button,
  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-nav-button {
    justify-content: flex-start;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-account-card {
    width: 100%;
    padding: 8px;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-full-button {
    width: 100%;
    min-height: 40px;
    padding: 7px 11px;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-nav-button {
    padding-inline: 10px;
  }

  .branded-ai .ai-workspace.is-sidebar-collapsed .ai-sidebar-bottom {
    display: grid;
  }

  .branded-ai .ai-workspace .ai-sidebar-top #toggleSidebar {
    display: none;
  }

  .branded-ai .ai-mobile-sidebar-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border: 1px solid var(--branded-line);
    border-radius: 10px;
    background: var(--branded-surface);
    color: var(--branded-text);
    font-size: 1.35rem;
  }

  .branded-ai .ai-view-panel-enter {
    animation-duration: 240ms;
  }

  .branded-ai .ai-online-status {
    display: none;
  }

  .branded-ai .ai-chat-view {
    min-height: 0;
  }

  .branded-ai .ai-chat-toolbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 7px 0;
  }

  .branded-ai .ai-chat-toolbar > p {
    max-width: 42%;
    font-size: .68rem;
    line-height: 1.35;
  }

  .branded-ai .ai-project-picker {
    grid-template-columns: 1fr;
    flex: 1 1 0;
    gap: 3px;
    min-width: 0;
    font-size: .61rem;
  }

  .branded-ai .ai-project-picker select {
    width: 100%;
    min-height: 36px;
    min-width: 0;
    font-size: .72rem;
  }

  .branded-ai .ai-chat-messages {
    min-height: 0;
    gap: 12px;
    padding: 12px 0;
    overscroll-behavior: contain;
  }

  .branded-ai .ai-welcome {
    width: 100%;
    padding: 8px 0;
  }

  .branded-ai .ai-welcome h2 {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .branded-ai .ai-welcome > p {
    font-size: .78rem;
    line-height: 1.5;
  }

  .branded-ai .ai-quick-prompts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 16px;
  }

  .branded-ai .ai-quick-prompt {
    min-height: 48px;
    align-items: center;
    gap: 6px;
    padding: 8px;
  }

  .branded-ai .ai-quick-prompt > span:first-child {
    width: 16px;
    flex-basis: 16px;
  }

  .branded-ai .ai-quick-prompt strong {
    font-size: .68rem;
  }

  .branded-ai .ai-quick-prompt small {
    display: none;
  }

  .branded-ai .ai-composer-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .branded-ai .ai-composer-tools {
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .branded-ai .ai-composer-tool {
    flex: 0 0 auto;
    padding: 8px 5px;
    font-size: .63rem;
    white-space: nowrap;
  }

  .branded-ai .ai-composer-tool-icon {
    display: none;
  }

  .branded-ai .ai-composer-tool:disabled {
    display: none;
  }

  .branded-ai .ai-composer-submit {
    gap: 5px;
  }

  .branded-ai .ai-response-mode {
    gap: 0;
  }

  .branded-ai .ai-response-mode-caption {
    display: none;
  }

  .branded-ai .ai-response-mode-trigger {
    min-width: 91px;
    min-height: 38px;
    gap: 7px;
    padding-inline: 9px;
  }

  .branded-ai .ai-send-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .branded-ai .ai-stop-button {
    min-height: 38px;
    padding-inline: 8px;
  }

  .branded-ai .ai-composer {
    padding: 10px 11px 8px;
    border-radius: 13px;
  }

  .branded-ai .ai-composer textarea {
    min-height: 56px;
    max-height: 160px;
    font-size: 16px;
    line-height: 1.45;
  }

  .branded-ai .ai-response-mode-menu {
    right: -12px;
    width: min(220px, calc(100vw - 32px));
  }

  .branded-ai .ai-model-note {
    display: none;
  }

  .branded-ai .ai-disclaimer {
    margin: 6px 0 0;
    font-size: .59rem;
  }

  .branded-ai .ai-message {
    max-width: 96%;
    padding: 11px 12px 8px;
  }

  .branded-ai .ai-settings-card {
    padding: 16px;
  }

  .branded-ai .ai-account-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .branded-ai .ai-work-area {
    padding-right: 11px;
    padding-left: 11px;
  }

  .branded-ai .ai-chat-toolbar > p {
    max-width: 36%;
    font-size: .63rem;
  }

  .branded-ai .ai-quick-prompt {
    gap: 4px;
    padding-inline: 6px;
  }

  .branded-ai .ai-composer-tools .ai-composer-tool {
    font-size: .59rem;
  }

  .branded-ai .ai-composer-tool-icon {
    display: inline;
  }

  .branded-ai .ai-composer-tool-label {
    font-size: .59rem;
  }

  .branded-ai .ai-response-mode-trigger {
    min-width: 84px;
  }
}

@keyframes ai-view-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ai-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .branded-ai *,
  .branded-ai *::before,
  .branded-ai *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
