:root {
  --sx-pine: #102b2a;
  --sx-night: #0b2223;
  --sx-mint: #c9f485;
  --sx-mint-soft: #eef7e3;
  --sx-paper: #f3f6f0;
  --sx-surface: #fff;
  --sx-ink: #182f2b;
  --sx-muted: #506860;
  --sx-line: #d6e2d9;
  --sx-green: #1c654e;
  --sx-radius: 16px;
  --sx-font: "Aptos", "Segoe UI", system-ui, sans-serif;
}

body {
  font-family: var(--sx-font);
}

:where(.auth-gate, .app-shell, .public-document) :where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid #467c61;
  outline-offset: 3px;
}

.auth-gate {
  min-height: 100dvh;
  align-items: start;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: var(--sx-night);
  color: #f2f8f4;
}

.auth-shell {
  width: min(100%, 1220px);
  max-width: none;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  column-gap: clamp(30px, 7vw, 100px);
  row-gap: clamp(30px, 5vw, 60px);
}

.public-header,
.auth-features,
.public-footer {
  grid-column: 1 / -1;
}

.public-header,
.public-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.public-header {
  min-height: 60px;
  padding-bottom: 14px;
  border-bottom: 1px solid #34504b;
}

.public-header nav,
.public-document .plans-header nav {
  display: flex;
  gap: clamp(12px, 3vw, 28px);
  flex-wrap: wrap;
  align-items: center;
}

.public-header nav a,
.public-footer a {
  color: #e0ede6;
  text-decoration: none;
}

.public-header nav a:hover,
.public-footer a:hover {
  color: var(--sx-mint);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-wordmark img {
  width: 40px;
  height: 40px;
}

.auth-wordmark strong {
  font-size: 1rem;
  letter-spacing: .1em;
}

.auth-story .auth-kicker {
  margin: 0 0 15px;
  color: var(--sx-mint);
  font-size: .875rem;
}

.auth-story h1 {
  font-size: clamp(2.7rem, 5.45vw, 5.35rem);
  line-height: 1.03;
  letter-spacing: -.065em;
}

.auth-story h1 em {
  color: var(--sx-mint);
  font-style: normal;
}

.auth-lead {
  max-width: 34rem;
  color: #c5d7d0;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.auth-stage {
  margin-top: 14px;
  color: #abcbc0;
}

.auth-card {
  border: 1px solid var(--sx-line);
  border-radius: var(--sx-radius);
  padding: clamp(22px, 3vw, 36px);
  color: var(--sx-ink);
  background: var(--sx-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.auth-card h2 {
  font-size: clamp(1.65rem, 3.1vw, 2.05rem);
}

.auth-intro {
  margin: 10px 0 18px;
  color: var(--sx-muted);
}

.auth-form input {
  border-radius: 9px;
  border-color: #aabeb0;
  background: #f7faf7;
}

.auth-primary {
  border-radius: 9px;
  background: var(--sx-green);
}

.auth-primary:hover:enabled {
  background: #104f3c;
}

.auth-message:empty {
  display: none;
}

.auth-card .auth-privacy {
  margin-top: 10px;
  color: var(--sx-muted);
}

.auth-features {
  gap: 12px;
}

.auth-features article {
  padding: 18px;
  border: 1px solid #36524b;
  border-radius: 12px;
  color: #f2f8f4;
  background: #183632;
}

.auth-features article > i {
  color: var(--sx-mint);
  background: #294941;
}

.auth-features article p {
  color: #c5d7d0;
}

.public-footer {
  padding-top: 16px;
  border-top: 1px solid #34504b;
  color: #a9c2ba;
  font-size: .875rem;
}

.app-shell {
  --desk-line: var(--sx-line);
  --desk-ink: var(--sx-ink);
  --desk-muted: var(--sx-muted);
  --desk-accent: var(--sx-green);
}

.app-shell .sidebar {
  background: var(--sx-pine) !important;
  color: #f2f8f4;
  border-right-color: #1e3c36 !important;
}

.app-shell :is(.sidebar-brand strong, .sidebar .profile-button strong, .sidebar-nav button, .sidebar .product-nav, .sidebar .conversation) {
  color: #eaf6ef !important;
}

.app-shell :is(.sidebar-brand small, .sidebar .profile-button small, .sidebar-nav-label, .sidebar-section > span, .sidebar .conversation small) {
  color: #b8cec4 !important;
}

.app-shell .sidebar .brand-icon {
  background: #254740;
  border-color: #3a5b52;
}

.app-shell .sidebar .profile-button {
  color: #eaf6ef !important;
  background: #1b3934 !important;
  border: 1px solid #36554c !important;
}

.app-shell .sidebar :is(.sidebar-nav button, .product-nav, .conversation):is(:hover, :focus-visible, .active) {
  color: white !important;
  background: #284e42 !important;
}

.app-shell .sidebar .new-chat {
  min-height: 44px;
  background: var(--sx-mint) !important;
  color: var(--sx-night) !important;
  border: 1px solid var(--sx-mint) !important;
}

.app-shell .sidebar .new-chat:hover {
  background: #ddffac !important;
}

.app-shell .chatPanel {
  background: var(--sx-paper) !important;
}

.app-shell :is(.chat-toolbar, .interaction-mode-bar) {
  background: var(--sx-surface) !important;
}

.app-shell .chat-toolbar {
  min-height: 66px !important;
  padding-block: 10px !important;
}

.app-shell .interaction-mode-bar {
  padding-block: 8px !important;
}

.app-shell .quick-start button {
  border-color: var(--sx-line);
  background: var(--sx-surface);
}

.app-shell .quick-start button:hover {
  border-color: #82a58d;
  background: var(--sx-mint-soft);
}

.app-shell .chat-input-area {
  border-color: #adc3b4 !important;
  border-radius: 15px !important;
  background: var(--sx-surface) !important;
  box-shadow: 0 6px 22px #143b2520 !important;
}

.app-shell #sendBtn {
  background: var(--sx-green) !important;
  color: white !important;
}

.public-document {
  color: var(--sx-ink);
  background: var(--sx-paper);
}

.public-document a {
  color: var(--sx-green);
}

.public-document .plans-header {
  flex-wrap: wrap;
  border-color: var(--sx-line);
}

.public-document .plans-brand {
  color: var(--sx-pine);
  font-size: .95rem;
  letter-spacing: .095em;
}

.public-document .plans-intro {
  max-width: none;
  margin-block: 24px;
  padding: clamp(23px, 5vw, 52px);
  border-radius: var(--sx-radius);
  line-height: 1.6;
  color: #f2f8f4;
  background: var(--sx-pine);
}

.public-document .plans-intro h1 {
  font-size: clamp(2.15rem, 5.5vw, 4.1rem);
}

.public-document .plans-intro p {
  max-width: 40rem;
  color: #d6e8de;
}

.public-document .plans-intro p:first-child {
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .08em;
  color: var(--sx-mint);
}

.public-document :is(.plan, .usage-panel, .product-section, .request-panel) {
  border-color: var(--sx-line);
}

.public-document .plans-grid {
  margin-block: 22px;
}

.public-document .plan-featured {
  border-color: #86a878;
  background: var(--sx-mint-soft);
}

.public-document .plan-price {
  color: var(--sx-pine);
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 770;
  line-height: 1.22;
}

.public-document .plans-button {
  color: white;
  background: var(--sx-green);
}

.public-document .plans-button:hover {
  background: #104f3c;
}

.public-document :is(.product-section, .usage-panel) {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .auth-shell {
    max-width: 42rem;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .auth-story h1 {
    font-size: clamp(2.45rem, 7.9vw, 4rem);
  }

  .hero-break {
    display: none;
  }

  .auth-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .auth-gate {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }

  .public-header nav,
  .public-document .plans-header nav {
    gap: 8px 16px;
    font-size: .875rem;
  }

  .auth-lead {
    margin-block: 14px;
  }

  .auth-features article {
    padding: 14px;
  }
}

.app-shell .sidebar .product-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
}

.app-shell .sidebar .product-nav i {
  width: 1.1em;
  text-align: center;
}

.app-shell .data-drawer,
.app-shell .statusPanel,
.code-workspace {
  border-color: var(--sx-line) !important;
  border-radius: var(--sx-radius) !important;
  color: var(--sx-ink);
  background: var(--sx-paper) !important;
}

.app-shell :is(.data-drawer-header, .status-header),
.code-workspace-header {
  border-bottom: 1px solid var(--sx-line);
  background: var(--sx-surface);
}

.app-shell .data-drawer :is(.context-box, .tool-card, .work-center-card, .memory-item, .permission-row) {
  border-color: var(--sx-line);
  border-radius: 12px;
  background: var(--sx-surface);
}

.code-workspace {
  --code-accent: var(--sx-green);
  --code-ink: var(--sx-ink);
  --code-muted: var(--sx-muted);
  --code-border: var(--sx-line);
}

.public-document .plans-header [aria-current="page"] {
  color: var(--sx-ink);
  font-weight: 750;
  text-underline-offset: 5px;
}

.conversation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b8cec4;
  font-weight: 650;
}

.conversation-heading button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.conversation-heading button:hover {
  background: #284e42;
  color: white;
}

.app-shell > .sidebar .sidebar-section {
  min-height: 0;
}

.sidebar-group {
  border-top: 1px solid #36554c;
  margin-top: 10px;
}

.sidebar-group summary {
  padding: 12px 8px;
  color: #eaf6ef;
  cursor: pointer;
}

.sidebar-group summary i {
  margin-inline: 6px;
}

.sidebar-group > :is(button, a) {
  width: 100%;
}

.chat-options {
  position: relative;
  margin-inline-start: auto;
}

.chat-options > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--sx-line);
  border-radius: 9px;
  list-style: none;
  color: var(--sx-ink);
  cursor: pointer;
}

.chat-options > summary::-webkit-details-marker {
  display: none;
}

.chat-options-menu {
  position: absolute;
  z-index: 20;
  inset: calc(100% + 6px) 0 auto auto;
  width: max-content;
  max-width: 85vw;
  padding: 4px;
  border: 1px solid var(--sx-line);
  border-radius: 10px;
  background: var(--sx-surface);
  box-shadow: 0 6px 24px #102b2a26;
}

.chat-options-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  text-align: start;
  color: var(--sx-ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.chat-options-menu button:hover {
  background: var(--sx-mint-soft);
}

@media (max-width: 900px) {
  .app-shell .composer-wrap {
    bottom: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }
}


body[data-user-role="owner"] .composer-note {
  display: none;
}

@media (max-width: 520px) {
  .app-shell .chat-toolbar {
    gap: 8px;
  }

  .chat-options > summary {
    width: 40px;
  }
}

/* Connections: link Claude, ChatGPT and other assistants to AI CORE. */
.sidebar-nav .sidebar-primary {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(214, 245, 140, 0.45);
  border-radius: 12px;
  background: rgba(214, 245, 140, 0.1);
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}
.sidebar-nav .sidebar-primary:hover,
.sidebar-nav .sidebar-primary:focus-visible {
  background: rgba(214, 245, 140, 0.2);
}
.connections-intro p {
  margin: 0 0 12px;
  line-height: 1.5;
}
.connection-url {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.connection-url code {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef3f1;
  color: #10332b;
  overflow-wrap: anywhere;
}
.connection-copy,
.connection-revoke {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: #1d6b55;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.connection-revoke {
  background: transparent;
  color: #9b1c1c;
  border: 1px solid #f0c2c2;
}
.connection-guide {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid #dfe7e4;
  border-radius: 12px;
}
.connection-guide summary {
  font-weight: 700;
  cursor: pointer;
}
.connection-guide ol {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.6;
}
.connection-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.connection-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1ef;
}
.connection-text {
  flex: 1;
  display: grid;
}
.connection-text small {
  color: #5b6b66;
}
.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22a06b;
}
.connection-empty {
  color: #5b6b66;
}

/* Memory inbox: approve what AI assistants suggest remembering. */
.inbox-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #d6f58c;
  color: #10332b;
  font-size: 12px;
  text-align: center;
}
.inbox-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.inbox-item {
  padding: 12px;
  border: 1px solid #dfe7e4;
  border-radius: 12px;
  background: #fff;
}
.inbox-fact {
  margin: 0 0 6px;
  line-height: 1.5;
}
.inbox-edit {
  width: 100%;
  min-height: 72px;
  margin-bottom: 6px;
  padding: 8px;
  border: 1px solid #b9cbc4;
  border-radius: 8px;
  font: inherit;
}
.inbox-item small {
  color: #5b6b66;
}
.inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.inbox-approve,
.inbox-secondary {
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.inbox-approve {
  border: 0;
  background: #1d6b55;
  color: #fff;
}
.inbox-secondary {
  border: 1px solid #c9d6d1;
  background: transparent;
  color: #10332b;
}
.inbox-empty {
  padding: 16px;
  border: 1px dashed #c9d6d1;
  border-radius: 12px;
}
.inbox-empty p {
  margin: 6px 0 12px;
  color: #5b6b66;
}

/* My data: export and account deletion. */
.my-data-download {
  display: inline-block;
  text-decoration: none;
}
.my-data-danger {
  border-top: 1px solid #f0c2c2;
}
.my-data-delete {
  display: grid;
  gap: 6px;
  max-width: 360px;
}
.my-data-delete input {
  padding: 9px 10px;
  border: 1px solid #b9cbc4;
  border-radius: 8px;
  font: inherit;
}
.my-data-delete button {
  margin-top: 6px;
  justify-self: start;
}
