:root {
  color-scheme: light;
  --ui-bg: #f8fafc;
  --ui-surface: #ffffff;
  --ui-surface-subtle: #f9fbfd;
  --ui-sidebar: #edf2fa;
  --ui-sidebar-hover: #dfeaf7;
  --ui-sidebar-active: #ffffff;
  --ui-text: #111827;
  --ui-text-soft: #374151;
  --ui-muted: #6f6f71;
  --ui-placeholder: #9ca3af;
  --ui-border: #d8dee8;
  --ui-border-strong: #c7ced9;
  --ui-primary: #1681ef;
  --ui-primary-dark: #1051a6;
  --ui-primary-soft: #e5f0ff;
  --ui-primary-hover: #0d6fd4;
  --ui-success: #138a5b;
  --ui-success-soft: #e7f7f0;
  --ui-warning: #9a6700;
  --ui-warning-soft: #fff6dd;
  --ui-danger: #b42318;
  --ui-danger-soft: #fff0ee;
  --ui-shadow-sm: 0 1px 2px rgb(15 23 42 / 5%);
  --ui-shadow-md: 0 10px 30px rgb(15 23 42 / 9%);
  --ui-radius-xs: 6px;
  --ui-radius-sm: 8px;
  --ui-radius-md: 12px;
  --ui-radius-lg: 16px;
  --ui-radius-xl: 22px;
  --ui-font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ui-bg);
  color: var(--ui-text);
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
input,
textarea,
button,
select {
  font-family: var(--ui-font);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--ui-bg);
  color: var(--ui-text-soft);
  font: 400 14px/1.55 var(--ui-font);
}

body.app-body {
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

body.navigation-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

img,
svg,
.ui-icon {
  display: block;
  max-width: 100%;
}

.ui-icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  font-size: 20px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ui-text);
  line-height: 1.25;
}

button,
[role="button"],
a,
input,
textarea,
select,
summary {
  outline: none;
}

button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid rgb(15 23 42 / 34%);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Controls */

.button,
button.button,
input[type="submit"] {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button:hover,
button.button:hover,
input[type="submit"]:hover {
  background: var(--ui-primary-hover);
  box-shadow: 0 4px 12px rgb(22 129 239 / 18%);
}

.button:active,
button.button:active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.button--primary,
button.button--primary {
  background: var(--ui-primary);
  color: #fff;
}

.button--secondary,
button.button--secondary {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface);
  color: var(--ui-text-soft);
  box-shadow: var(--ui-shadow-sm);
}

.button--secondary:hover,
button.button--secondary:hover {
  border-color: #aab4c2;
  background: #f5f7fa;
  box-shadow: var(--ui-shadow-sm);
}

.button--ghost,
button.button--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ui-muted);
}

.button--ghost:hover,
button.button--ghost:hover {
  background: #eef2f7;
  color: var(--ui-text);
  box-shadow: none;
}

.button--danger,
button.button--danger {
  border-color: #f2c6c1;
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.button--danger:hover,
button.button--danger:hover {
  background: #fee4e2;
  box-shadow: none;
}

.button--compact,
button.button--compact {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12px;
}

.button--xs,
button.button--xs {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 6px;
  gap: 4px;
}

.figma-icon-button,
.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 8px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.figma-icon-button:hover,
.icon-button:hover {
  background: rgb(22 129 239 / 9%);
}

.figma-icon-button img,
.icon-button img,
.figma-icon-button .ui-icon,
.icon-button .ui-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.text-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.text-button--danger {
  color: var(--ui-danger);
}

/* Application shell */

.app-shell {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: var(--ui-bg);
}

.app-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  flex: 1;
  margin: 16px 16px 16px 2px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.app-main {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.mobile-header {
  display: none;
}

.sidebar {
  position: relative;
  z-index: 40;
  display: flex;
  width: 292px;
  min-width: 292px;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  transition: width 220ms ease, min-width 220ms ease, transform 220ms ease;
}

.sidebar-brand-row {
  display: flex;
  height: 58px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 20px;
}

.brand,
.mobile-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--ui-text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
}

.brand-logo {
  width: 32px;
  height: 25px;
  flex: 0 0 auto;
  object-fit: contain;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.sidebar-mobile-close {
  display: none;
}

.sidebar-panel {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  margin: 0 16px 16px;
  padding: 12px 10px 10px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-sidebar);
}

.new-workspace-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgb(17 24 39 / 8%);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--ui-shadow-sm);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.new-workspace-button:hover {
  border-color: #a8c8ed;
  background: #f8fbff;
}

.new-workspace-button__icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.new-workspace-button__icon .ui-icon {
  font-size: 16px;
}

.sidebar-search__field {
  display: flex;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  background: rgb(255 255 255 / 72%);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.sidebar-search__field:focus-within {
  border-color: #aeb7c4;
  background: var(--ui-surface);
  box-shadow: 0 0 0 3px rgb(15 23 42 / 5%);
}

.sidebar-search__field img,
.sidebar-search__field .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.65;
}

.sidebar-search__field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text);
  font-size: 13px;
}

.sidebar-search__field input::placeholder {
  color: var(--ui-muted);
}

.workspace-navigation {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 2px 1px 68px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.workspace-navigation::-webkit-scrollbar {
  display: none;
}

.workspace-nav-item {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-md);
  background: rgb(255 255 255 / 45%);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.workspace-nav-item:hover {
  background: var(--ui-sidebar-hover);
}

.workspace-nav-item--active {
  border-color: rgb(17 24 39 / 6%);
  background: var(--ui-sidebar-active);
  box-shadow: var(--ui-shadow-sm);
}

.workspace-nav-item--active:hover {
  background: var(--ui-sidebar-active);
}

.workspace-nav-item--active .workspace-nav-item__row {
  background: #cfe2ff;
}

.workspace-nav-item--dragging {
  opacity: 0.58;
  box-shadow: 0 10px 24px rgb(15 23 42 / 18%);
}

.workspace-nav-item__row {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  border-radius: 10px;
}

.workspace-nav-item__link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 600;
}

.workspace-nav-item--active .workspace-nav-item__link {
  color: var(--ui-text);
}

.workspace-nav-item__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-drag-handle,
.workspace-nav-action {
  display: grid;
  width: 27px;
  height: 30px;
  flex: 0 0 27px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius-xs);
  background: transparent;
  color: var(--ui-muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.workspace-drag-handle {
  cursor: grab;
  touch-action: none;
}

.workspace-drag-handle:active {
  cursor: grabbing;
}

.workspace-drag-handle:hover,
.workspace-nav-action:hover {
  background: rgb(255 255 255 / 58%);
  color: var(--ui-primary-dark);
}

.workspace-drag-handle .ui-icon,
.workspace-nav-action .ui-icon {
  font-size: 18px;
}

.workspace-subnav {
  display: grid;
  gap: 3px;
  padding: 4px 8px 10px;
  border-top: 1px solid #e7ebf0;
}

.workspace-subnav__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px 3px;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-subnav__heading a {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 5px;
  color: var(--ui-muted);
}

.workspace-subnav__heading a .ui-icon {
  font-size: 17px;
}

.workspace-subnav__heading a:hover {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.workspace-chat-link,
.workspace-chat-empty {
  display: flex;
  min-width: 0;
  min-height: 31px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--ui-radius-xs);
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 500;
}

.workspace-chat-link:hover,
.workspace-chat-link--active {
  background: #eef4fb;
  color: var(--ui-primary-dark);
}

.workspace-chat-link__icon {
  color: #8491a2;
  font-size: 14px;
}

.workspace-chat-link--active .workspace-chat-link__icon {
  color: var(--ui-primary);
}

.workspace-chat-link > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chat-empty {
  color: var(--ui-placeholder);
}

.sidebar-empty {
  padding: 28px 16px;
  color: var(--ui-muted);
  text-align: center;
}

.sidebar-empty p {
  margin-bottom: 8px;
}

.sidebar-empty a {
  color: var(--ui-primary-dark);
  font-weight: 600;
}

.sidebar-profile {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 10px;
  left: 10px;
}

.sidebar-profile > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 1px solid rgb(17 24 39 / 6%);
  border-radius: var(--ui-radius-sm);
  background: rgb(255 255 255 / 86%);
  box-shadow: var(--ui-shadow-sm);
  cursor: pointer;
  list-style: none;
  backdrop-filter: blur(12px);
}

.sidebar-profile > summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ui-text);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.user-avatar img,
.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sidebar-profile__identity {
  min-width: 0;
  flex: 1;
}

.sidebar-profile__identity strong {
  display: block;
  overflow: hidden;
  color: var(--ui-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  color: var(--ui-muted);
  font-size: 14px;
}

.profile-menu__panel {
  position: absolute;
  z-index: 80;
  bottom: calc(100% + 8px);
  left: 0;
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-text-soft);
  font-size: 12px;
}

.profile-menu__panel strong {
  overflow: hidden;
  padding: 4px 6px;
  font-size: 11px;
  text-overflow: ellipsis;
}

.profile-menu__panel hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--ui-border);
}

.profile-menu__panel a,
.profile-menu__disabled,
.profile-logout {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--ui-radius-xs);
  background: transparent;
  color: var(--ui-text-soft);
  text-align: left;
}

.profile-menu__panel form {
  margin: 0;
}

.profile-menu__panel .ui-icon {
  font-size: 16px;
}

.profile-menu__panel a:hover,
.profile-logout:hover {
  background: #eef2f7;
}

.profile-menu__disabled {
  color: var(--ui-placeholder);
}

.profile-logout {
  color: var(--ui-danger);
  cursor: pointer;
}

.app-shell--collapsed .sidebar {
  width: 0;
  min-width: 0;
  overflow: visible;
}

.app-shell--collapsed .sidebar-brand-row,
.app-shell--collapsed .sidebar-panel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.stage-sidebar-toggle {
  display: none;
  position: absolute;
  top: 11px;
  left: 12px;
  z-index: 60;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  cursor: pointer;
}

.stage-sidebar-toggle:hover {
  background: #eef2f7;
}

.app-shell--collapsed .stage-sidebar-toggle {
  display: grid;
  place-items: center;
}

.app-shell--collapsed .chat-topbar,
.app-shell--collapsed .settings-tabs {
  padding-left: 54px;
}

.app-shell--collapsed .app-stage {
  margin-left: 16px;
}

/* Disable Turbo Drive top progress bar */
.turbo-progress-bar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Circular Loading Spinner */
.spinner-ring {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
  vertical-align: middle;
  box-sizing: border-box;
}

.spinner-ring--dark {
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--ui-primary);
}

.spinner-ring--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-ring--lg {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Notices */

.flash {
  position: fixed;
  z-index: 120;
  bottom: 24px;
  right: 28px;
  max-width: min(440px, calc(100% - 36px));
  padding: 12px 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-text-soft);
  font-size: 13px;
}

.flash--alert {
  border-color: #f0b9b2;
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.flash--public {
  position: fixed;
}

.inline-alert,
.alert-panel {
  padding: 12px 14px;
  border: 1px solid #f0b9b2;
  border-radius: var(--ui-radius-sm);
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.alert-panel {
  display: flex;
  gap: 10px;
}

.alert-panel--spaced {
  margin: 18px 0;
}

.alert-panel__icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--ui-danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.alert-panel h2,
.alert-panel h3 {
  margin-bottom: 4px;
  color: var(--ui-danger);
  font-size: 14px;
}

.alert-panel p {
  margin-bottom: 0;
}

.alert-panel ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

/* Chat */

.chat-page {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-topbar {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px 10px 22px;
  border-bottom: 1px solid #e8ebef;
  background: rgb(255 255 255 / 92%);
}

.chat-topbar__identity {
  min-width: 0;
}

.chat-topbar__identity h1 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-topbar__identity p {
  margin: 2px 0 0;
  color: var(--ui-muted);
  font-size: 11px;
}

.chat-topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-topbar__actions form {
  margin: 0;
}

.chat-page--empty {
  display: block;
  position: relative;
}

.chat-page--empty .chat-topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}

.chat-empty-layout {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 96px clamp(24px, 6vw, 80px) 54px;
  overflow-y: auto;
}

.chat-empty-state {
  max-width: 690px;
  margin-bottom: 16px;
  text-align: center;
}

.chat-empty-state::before {
  display: none;
}

.chat-empty-logo {
  display: block;
  height: 192px;
  width: auto;
  max-width: 600px;
  margin: 0 auto -24px;
  object-fit: contain;
}

.chat-empty-state h2,
.chat-hero-title {
  margin-bottom: 10px;
  color: var(--ui-text);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.chat-empty-state p {
  margin: 0 auto;
  color: var(--ui-muted);
  font-size: 14px;
}

.chat-empty-composer {
  width: min(100%, 750px);
}

.composer {
  display: flex;
  min-height: 122px;
  flex-direction: column;
  padding: 15px 16px 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: 0 8px 28px rgb(15 23 42 / 7%);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within {
  border-color: #aeb7c4;
  box-shadow: 0 0 0 3px rgb(15 23 42 / 5%), 0 10px 30px rgb(15 23 42 / 8%);
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  flex: 1;
  padding: 2px 4px;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ui-text);
  font-size: 15px;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: var(--ui-placeholder);
}

.composer__footer {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
}

.composer__model-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.composer__model-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--ui-text-soft);
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 22px 4px 6px;
  border-radius: var(--ui-radius-xs);
  cursor: pointer;
  outline: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.composer__model-select:hover {
  background: #f1f5f9;
  color: var(--ui-text);
}

.composer__model-icon {
  position: absolute;
  right: 5px;
  pointer-events: none;
  font-size: 11px;
  color: var(--ui-muted);
}

.composer__hint {
  color: var(--ui-muted);
  font-size: 11px;
}

.composer__submit {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ui-text);
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.composer__submit:hover {
  background: var(--ui-primary-dark);
}

.composer__submit:active {
  transform: scale(0.96);
}

.composer__submit img,
.composer__submit .ui-icon {
  width: 18px;
  height: 18px;
  color: #fff;
  font-size: 18px;
}

.ai-disclaimer {
  margin: 9px 0 0;
  color: var(--ui-placeholder);
  font-size: 10px;
  text-align: center;
}

.chat-empty-layout .inline-alert {
  width: min(100%, 750px);
  margin-bottom: 12px;
}

.chat-layout {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  transition: grid-template-columns 180ms ease;
}

.chat-layout--sources-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
}

.chat-conversation {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-scroll {
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-thread {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 34px 32px 18px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  margin-bottom: 6px;
}

.chat-message--assistant {
  align-self: flex-start;
  margin-right: auto;
}

.chat-message--user {
  align-self: flex-end;
  margin-left: auto;
}

.chat-message__header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.chat-message--user .chat-message__header {
  flex-direction: row-reverse;
  text-align: right;
}

.chat-message--assistant .chat-message__header {
  flex-direction: row;
  text-align: left;
}

.chat-message__avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #eef1f5;
  color: var(--ui-text);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
}

.chat-message__avatar--assistant {
  border: 1px solid var(--ui-border);
  background: #ffffff;
  padding: 2px;
}

.chat-avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.user-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-message__header h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 700;
}

.chat-message__header time {
  color: var(--ui-placeholder);
  font-size: 9px;
}

.chat-message__content {
  color: var(--ui-text-soft);
  font-size: 14px;
  line-height: 1.75;
}

.chat-message--assistant .chat-message__content {
  padding-left: 41px;
  padding-right: 0;
  text-align: left;
}

.chat-message--user .chat-message__content {
  padding-left: 0;
  padding-right: 41px;
  color: var(--ui-text);
  font-weight: 400;
  text-align: left;
}

.chat-bullet-list {
  margin: 10px 0;
  padding-left: 20px;
  list-style-type: disc;
}

.chat-bullet-item {
  margin-bottom: 6px;
  line-height: 1.6;
}

.answer-copy strong {
  font-weight: 700;
  color: var(--ui-text);
}

.answer-copy p {
  margin-bottom: 0.85em;
}

.answer-copy p:last-child,
.message-error p:last-child {
  margin-bottom: 0;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.sources-trigger {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xs);
  background: var(--ui-surface);
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.sources-trigger:hover,
.sources-trigger[aria-expanded="true"] {
  border-color: #b8d0e9;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.sources-trigger__count {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: #d9e8f9;
  color: var(--ui-primary-dark);
  font-size: 9px;
}

.generation-details {
  color: var(--ui-muted);
  font-size: 10px;
}

.generation-details summary {
  padding: 5px 7px;
  cursor: pointer;
}

.generation-details p {
  margin: 4px 0 0;
}

.answer-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ui-muted);
  font-size: 13px;
}

.message-error {
  color: var(--ui-danger);
}

.chat-composer-wrap {
  width: 100%;
  padding: 10px 20px 16px;
  background: linear-gradient(to top, #fff 82%, rgb(255 255 255 / 0%));
}

.chat-composer-wrap .composer,
.chat-composer-wrap .ai-disclaimer {
  width: min(100%, 900px);
  margin-right: auto;
  margin-left: auto;
}

.chat-composer-wrap .composer {
  min-height: 102px;
  padding: 13px 14px 10px;
}

.chat-composer-wrap .composer textarea {
  min-height: 46px;
  font-size: 14px;
}

.conversation-menu {
  position: relative;
}

.conversation-menu summary {
  cursor: pointer;
  list-style: none;
}

.conversation-menu summary::-webkit-details-marker {
  display: none;
}

.conversation-menu__panel {
  position: absolute;
  z-index: 25;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 210px;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
  font-size: 12px;
}

.conversation-menu__panel a,
.conversation-menu__panel .text-button {
  padding: 7px 8px;
  border-radius: var(--ui-radius-xs);
}

.conversation-menu__panel a:hover,
.conversation-menu__panel .text-button:hover {
  background: #eef2f7;
}

.sources-drawer {
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--ui-border);
  background: var(--ui-surface-subtle);
}

.sources-drawer__header {
  display: flex;
  min-height: 70px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface);
}

.sources-drawer__header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sources-drawer__header p {
  margin: 3px 0 0;
  color: var(--ui-muted);
  font-size: 10px;
}

.sources-drawer__content {
  height: calc(100% - 70px);
  padding: 12px;
  overflow-y: auto;
}

.sources-list {
  display: grid;
  gap: 10px;
}

.source-card {
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.source-card__header {
  padding: 12px 13px 9px;
  border-bottom: 1px solid #eef0f3;
}

.source-card__header h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.source-card__header a:hover {
  color: var(--ui-primary-dark);
  text-decoration: underline;
}

.source-card__header p {
  margin: 4px 0 0;
  color: var(--ui-muted);
  font-size: 9px;
}

.source-card__excerpt {
  padding: 10px 13px 12px;
  color: var(--ui-text-soft);
  font-size: 11px;
  line-height: 1.65;
}

.source-card__excerpt p:last-child {
  margin-bottom: 0;
}

/* Pages and cards */

.page-shell {
  width: min(100%, 1180px);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) clamp(22px, 5vw, 58px) 64px;
}

.page-shell--narrow {
  display: grid;
  width: min(100%, 720px);
  place-items: center;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-heading__eyebrow {
  margin-bottom: 7px;
  color: var(--ui-primary-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.page-heading p:not(.page-heading__eyebrow) {
  max-width: 670px;
  margin-bottom: 0;
  color: var(--ui-muted);
}

.page-heading__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--ui-muted);
  font-size: 11px;
}

.breadcrumbs a:hover {
  color: var(--ui-primary-dark);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.workspace-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.workspace-card:hover {
  border-color: #b8cee6;
  box-shadow: 0 10px 24px rgb(15 23 42 / 7%);
  transform: translateY(-2px);
}

.workspace-card__header h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.workspace-card__header a:hover {
  color: var(--ui-primary-dark);
}

.workspace-card > p {
  color: var(--ui-muted);
  font-size: 12px;
}

.workspace-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #eef0f3;
  color: var(--ui-muted);
  font-size: 10px;
}

.workspace-card__footer a {
  color: var(--ui-primary-dark);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
}

.stat-card span {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 600;
}

.stat-card strong {
  color: var(--ui-text);
  font-size: 29px;
  line-height: 1;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.quick-action {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--ui-radius-md);
  background: var(--ui-sidebar);
  color: var(--ui-text-soft);
  font-size: 12px;
  transition: background-color 150ms ease, color 150ms ease;
}

a.quick-action:hover {
  background: var(--ui-sidebar-hover);
  color: var(--ui-primary-dark);
}

.surface-card {
  padding: 18px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.surface-card--spaced {
  margin-top: 18px;
}

.surface-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.surface-card__header h2 {
  margin-bottom: 4px;
  font-size: 15px;
}

.surface-card__header p {
  margin-bottom: 0;
  color: var(--ui-muted);
  font-size: 11px;
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table tr + tr {
  border-top: 1px solid var(--ui-border);
}

.data-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.data-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.table-primary a {
  display: block;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 600;
}

.table-primary small {
  display: block;
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: 9px;
}

.empty-state {
  display: grid;
  justify-items: center;
  max-width: 620px;
  margin: 42px auto;
  padding: 36px 24px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 15px;
  background: var(--ui-sidebar);
  color: var(--ui-primary-dark);
  font-size: 21px;
  font-weight: 600;
}

.empty-state h1,
.empty-state h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.empty-state p {
  margin-bottom: 18px;
  color: var(--ui-muted);
}

/* Settings and forms */

.settings-page {
  min-height: 100%;
  padding: 0 0 54px;
}

.settings-tabs {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 4px;
  padding: 8px 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ui-border);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tabs__back,
.modal-back {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: var(--ui-radius-sm);
}

.settings-tabs__back:hover,
.modal-back:hover {
  background: #eef2f7;
}

.settings-tabs__back img,
.modal-back img,
.settings-tabs__back .ui-icon,
.modal-back .ui-icon {
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.settings-tab {
  min-width: max-content;
  padding: 8px 14px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

a.settings-tab:hover {
  background: #eef2f7;
  color: var(--ui-text);
}

.settings-tab--active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.settings-section__header {
  margin-bottom: 24px;
}

.settings-section__header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ui-text);
  margin-bottom: 6px;
}

.settings-section__header p {
  color: var(--ui-muted);
  font-size: 14px;
  margin: 0;
}

.settings-content {
  display: grid;
  width: 100%;
  max-width: 1160px;
  gap: 20px;
  margin: 0 auto;
  padding: 24px clamp(20px, 3vw, 40px);
}

.settings-content--wide {
  max-width: 100%;
}

.settings-section {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-section h1,
.settings-section h2 {
  margin-bottom: 7px;
  font-size: 19px;
}

.settings-section > p {
  margin-bottom: 22px;
  color: var(--ui-muted);
  font-size: 12px;
}

.account-settings-page {
  min-height: 100%;
  padding: 42px clamp(24px, 5vw, 72px) 60px;
  background: var(--ui-surface-subtle);
}

.account-settings-header {
  width: min(100%, 1060px);
  margin: 0 auto 28px;
}

.account-settings-header h1 {
  margin-bottom: 7px;
  font-size: clamp(25px, 2.6vw, 34px);
  letter-spacing: -0.035em;
}

.account-settings-header > div > p:last-child {
  margin: 0;
  color: var(--ui-muted);
}

.account-settings-layout {
  display: grid;
  width: min(100%, 1060px);
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin: 0 auto;
}

.account-settings-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.account-settings-nav > p {
  margin: 12px 9px 4px;
  color: var(--ui-placeholder);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-settings-nav > p:first-child {
  margin-top: 2px;
}

.account-settings-nav__item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--ui-radius-sm);
  color: var(--ui-muted);
}

a.account-settings-nav__item:hover {
  background: #eef3f8;
  color: var(--ui-text);
}

.account-settings-nav__item--active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.account-settings-nav__item--disabled {
  opacity: 0.52;
}

.account-settings-nav__item > .ui-icon {
  font-size: 18px;
}

.account-settings-nav__item > span {
  display: grid;
  min-width: 0;
}

.account-settings-nav__item strong {
  color: inherit;
  font-size: 11px;
}

.account-settings-nav__item small {
  font-size: 9px;
}

.account-settings-content {
  min-width: 0;
}

.settings-section--account {
  width: 100%;
  padding: clamp(22px, 4vw, 34px);
}

.settings-section__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ui-border);
}

.settings-section__header h1,
.settings-section__header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ui-text);
  margin-bottom: 6px;
}

.settings-section__header p {
  color: var(--ui-muted);
  font-size: 14px;
  margin: 0;
}

.settings-section__icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.settings-section__icon .ui-icon {
  font-size: 21px;
}

.account-settings-divider {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 5px;
  padding-top: 20px;
  border-top: 1px solid var(--ui-border);
}

.account-settings-divider strong {
  color: var(--ui-text);
  font-size: 12px;
}

.account-settings-divider span {
  color: var(--ui-muted);
  font-size: 10px;
}

.form-stack {
  display: grid;
  gap: 17px;
}

.form-field,
.field {
  display: grid;
  gap: 7px;
}

.form-field label,
.field label {
  color: var(--ui-text);
  font-size: 11px;
  font-weight: 700;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field textarea,
.form-field select,
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select,
.upload-title-field,
.inline-role-form select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field textarea,
.field textarea {
  min-height: 110px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.upload-title-field:focus,
.inline-role-form select:focus {
  border-color: #aeb7c4;
  box-shadow: 0 0 0 3px rgb(15 23 42 / 5%);
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.upload-title-field::placeholder {
  color: var(--ui-placeholder);
}

.form-field__hint {
  margin: -1px 0 0;
  color: var(--ui-muted);
  font-size: 10px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.field--inline {
  display: flex;
  align-items: center;
}

.field--inline label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ui-muted);
  font-weight: 500;
}

/* Documents and members */

.codex-modal-layer {
  width: 100%;
  min-height: 100%;
  padding: clamp(20px, 4vw, 42px);
  overflow-y: auto;
  background: var(--ui-surface-subtle);
}

.codex-modal-card {
  width: min(100%, 1050px);
  min-height: min(760px, calc(100dvh - 116px));
  margin: 0 auto;
  padding: 0 24px 28px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-shadow: 0 14px 36px rgb(15 23 42 / 8%);
}

.modal-heading {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -24px 22px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--ui-border);
}

.modal-heading__title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.modal-heading__title > div {
  min-width: 0;
}

.modal-heading h1 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-heading small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-list {
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
}

.resource-row {
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ui-border);
}

.resource-primary {
  flex: 1;
  min-width: 0;
}

.resource-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.status-badge-slot {
  width: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.doc-preview-btn {
  height: 28px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.doc-preview-btn ion-icon,
.doc-preview-btn svg {
  width: 14px;
  height: 14px;
}

.resource-row:last-child {
  border-bottom: 0;
}

.resource-row:hover {
  background: #fafbfd;
}

.resource-checkbox {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 4px;
  background: var(--ui-surface);
}

.resource-icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 6px;
  background: var(--ui-sidebar);
  color: var(--ui-primary-dark);
  font-size: 16px;
}

.resource-primary {
  min-width: 0;
}

.resource-primary > a,
.resource-primary > strong {
  display: block;
  overflow: hidden;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-primary > a:hover {
  color: var(--ui-primary-dark);
}

.resource-primary small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge,
.role-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 12px;
  background: #eef1f5;
  color: var(--ui-muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge--completed,
.role-badge--owner {
  background: var(--ui-success-soft);
  color: var(--ui-success);
}

.status-badge--pending,
.status-badge--processing,
.role-badge--admin {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
}

.status-badge--failed {
  background: var(--ui-danger-soft);
  color: var(--ui-danger);
}

.upload-zone {
  display: grid;
  min-height: 270px;
  margin-top: 18px;
  place-items: center;
  padding: 28px;
  border: 1px dashed #9bb6d1;
  border-radius: var(--ui-radius-md);
  background: #f8fbff;
}

.upload-zone--standalone {
  min-height: 430px;
  margin-top: 0;
}

.upload-zone__inner {
  display: grid;
  width: min(100%, 560px);
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.upload-zone__icon {
  width: 44px;
  height: 44px;
  margin-bottom: 4px;
  padding: 10px;
  border-radius: 14px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
  font-size: 24px;
}

.upload-zone strong {
  color: var(--ui-text);
  font-size: 14px;
}

.upload-zone p {
  margin-bottom: 5px;
  color: var(--ui-muted);
  font-size: 10px;
}

.upload-title-field {
  max-width: 460px;
  text-align: left;
}

.upload-zone input[type="file"] {
  width: min(100%, 460px);
  padding: 7px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-surface);
  color: var(--ui-muted);
  font-size: 10px;
}

.upload-zone input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--ui-sidebar);
  color: var(--ui-primary-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.upload-title-container {
  width: min(100%, 460px);
}

.upload-title-container .upload-title-field {
  width: 100%;
}

.selected-files-preview {
  width: min(100%, 460px);
  margin: 6px 0;
}

.selected-files-box {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.selected-files-summary {
  font-size: 11px;
  color: var(--ui-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.selected-files-scroll {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ui-text);
  gap: 8px;
}

.selected-file-row .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.selected-file-row .file-size {
  color: var(--ui-muted);
  font-size: 11px;
  flex-shrink: 0;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
}

.detail-list dt,
.detail-list dd {
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-border);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.detail-list dt:nth-last-of-type(1),
.detail-list dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.detail-list dt {
  background: var(--ui-surface-subtle);
  color: var(--ui-muted);
  font-weight: 600;
}

.detail-list dd {
  color: var(--ui-text-soft);
}

.danger-zone {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #f0b9b2;
  border-radius: var(--ui-radius-md);
  background: var(--ui-danger-soft);
}

.danger-zone h2 {
  margin-bottom: 4px;
  color: var(--ui-danger);
  font-size: 14px;
}

.danger-zone p {
  margin-bottom: 12px;
  color: #8d332c;
  font-size: 11px;
}

.member-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: end;
  gap: 12px;
}

.member-add-form .form-field input,
.member-add-form .form-field select {
  min-height: 42px;
  height: 42px;
  box-sizing: border-box;
  font-size: 13px;
}

.member-add-form .button,
.member-add-form input[type="submit"] {
  min-height: 42px;
  height: 42px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.member-resource-table {
  width: 100%;
  border-collapse: collapse;
}

.member-resource-table .resource-row {
  display: table-row;
}

.member-resource-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--ui-border);
  vertical-align: middle;
}

.member-resource-table tr:last-child td {
  border-bottom: 0;
}


.inline-role-form {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  vertical-align: middle;
}

.member-resource-table .resource-actions {
  display: table-cell;
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.member-resource-table .resource-actions > form {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
}

.member-resource-table .resource-actions .inline-role-form {
  display: inline-flex;
}

.inline-role-form select {
  width: auto;
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  box-sizing: border-box;
  vertical-align: middle;
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-surface);
}

.inline-role-form .button,
.inline-role-form input[type="submit"],
.resource-actions .button,
.resource-actions button {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.owner-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  box-sizing: border-box;
  border-radius: var(--ui-radius-sm);
  background: #f4f6f8;
  color: var(--ui-muted);
  vertical-align: middle;
}

/* Public and authentication */

.public-main {
  min-height: 100dvh;
  background: var(--ui-bg);
}

.landing-shell {
  position: relative;
  min-height: 100vh;
  background-color: #f8fafc;
  color: #0f172a;
  overflow-x: hidden;
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. Minimalist Editorial Header
   ========================================================================== */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(248 250 252 / 85%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #e2e8f0;
}

.landing-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
}

.landing-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.landing-nav__logo {
  height: 32px;
  width: auto;
  max-width: 36px;
  display: block;
  object-fit: contain;
}

.landing-nav__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #0f172a;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.landing-nav__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.landing-nav__link {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.landing-nav__link:hover {
  color: #0f172a;
}

.landing-nav__cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-editorial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-editorial--plain {
  color: #0f172a;
}

.btn-editorial--plain:hover {
  background-color: #f1f5f9;
}

.btn-editorial--dark {
  background: #0f172a;
  color: #ffffff;
}

.btn-editorial--dark:hover {
  background: #000000;
}

.btn-editorial--github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.btn-editorial--github:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #000000;
}

.btn-editorial--github .ui-icon {
  font-size: 17px;
}

/* ==========================================================================
   2. Hero Section (Editorial Asymmetric Layout)
   ========================================================================== */
.hero-editorial {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px 88px;
}

.hero-editorial__lead {
  max-width: 860px;
  margin-bottom: 56px;
}

.hero-editorial__pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 16px;
}

.hero-editorial__title {
  font-size: clamp(38px, 5.2vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #0f172a;
  margin: 0 0 20px;
}

.hero-editorial__desc {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  color: #64748b;
  max-width: 720px;
  margin: 0 0 32px;
}

.hero-editorial__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Neo-Geometric Action Buttons (inspired by user's reference) */
.btn-hero-neo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

/* Primary Button: Cut-corner Accent (like 'Book a Demo') */
.btn-hero-neo--primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  box-shadow:
    -5px -5px 0 0 #2563eb,
    5px 5px 0 0 #0284c7;
  clip-path: polygon(
    8px 0%, 100% 0%,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    0% 100%, 0% 8px
  );
}

.btn-hero-neo--primary:hover {
  background: #000000;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow:
    -6px -6px 0 0 #3b82f6,
    6px 6px 0 0 #0ea5e9;
}

/* Secondary Button: Sharp Outline Box (like 'Try for Free') */
.btn-hero-neo--secondary {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #0f172a;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-hero-neo--secondary:hover {
  background: #0f172a;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* GitHub Button: Sharp Box with Icon */
.btn-hero-neo--github {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #0f172a;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-hero-neo--github:hover {
  background: #0f172a;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-hero-neo--github .ui-icon {
  font-size: 18px;
}

/* ==========================================================================
   3. Real Showcase Frame (Atmospheric Blue Glow Halo)
   ========================================================================== */
.hero-showcase {
  position: relative;
  max-width: 1180px;
  margin: 36px auto 0;
}

/* Atmospheric vibrant blue/cyan blur aura */
.hero-showcase::before {
  content: "";
  position: absolute;
  top: -30px;
  left: -20px;
  right: -20px;
  bottom: -30px;
  background: radial-gradient(
    ellipse at center,
    rgba(56, 189, 248, 0.65) 0%,
    rgba(37, 99, 235, 0.5) 40%,
    rgba(37, 99, 235, 0.2) 65%,
    transparent 80%
  );
  filter: blur(55px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.88;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.hero-showcase:hover::before {
  opacity: 1;
  filter: blur(65px);
}

.hero-showcase__frame {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid rgba(147, 197, 253, 0.7);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.3),
    0 20px 60px -10px rgba(37, 99, 235, 0.35),
    0 40px 90px -20px rgba(56, 189, 248, 0.3);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.hero-showcase__frame:hover {
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.45),
    0 28px 80px -10px rgba(37, 99, 235, 0.45),
    0 50px 110px -20px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.hero-showcase__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ==========================================================================
   4. Metrics Strip (Clean Hairline Borders, No Cards)
   ========================================================================== */
.metrics-strip {
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.metrics-strip__container {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.metric-item {
  padding: 32px 24px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-item:last-child {
  border-right: none;
}

.metric-item__num {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.metric-item__label {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}

/* ==========================================================================
   5. Pipeline Section (Dynamic Hover with Large Icons)
   ========================================================================== */
.pipeline-section {
  padding: 96px 24px;
  background: #f8fafc;
}

.pipeline-section__container {
  max-width: 1240px;
  margin: 0 auto;
}

.section-lead {
  max-width: 760px;
  margin-bottom: 56px;
}

.section-lead__pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 12px;
}

.section-lead__title {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 16px;
}

.section-lead__desc {
  font-size: 16px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #e2e8f0;
}

.pipeline-col {
  position: relative;
  padding: 36px 24px 28px;
  border-right: 1px solid #e2e8f0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent;
}

.pipeline-col:first-child {
  padding-left: 0;
}

.pipeline-col:last-child {
  border-right: none;
}

.pipeline-col:hover {
  background: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -8px rgb(15 23 42 / 6%);
  z-index: 2;
}

.pipeline-col__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pipeline-col__step {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: -0.03em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.pipeline-col:hover .pipeline-col__step {
  color: #0f172a;
  transform: scale(1.05);
}

.pipeline-col__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 22px;
  transition: all 0.25s ease;
}

.pipeline-col:hover .pipeline-col__icon-wrap {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  transform: scale(1.1) rotate(-3deg);
}

.pipeline-col__heading {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  transition: color 0.2s ease;
}

.pipeline-col:hover .pipeline-col__heading {
  color: #2563eb;
}

.pipeline-col__text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   6. Engine Section (Interactive Hover Rows with Large Icons)
   ========================================================================== */
.engine-section {
  padding: 96px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.engine-section__container {
  max-width: 1240px;
  margin: 0 auto;
}

.engine-section__header {
  max-width: 820px;
  margin-bottom: 64px;
}

.engine-table {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #0f172a;
}

.engine-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
  padding: 36px 20px;
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.engine-row:hover {
  background: #f8fafc;
  padding-left: 28px;
}

.engine-row__meta {
  display: flex;
  flex-direction: column;
}

.engine-row__indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.engine-row__num {
  font-size: 13px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.engine-row__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  transition: all 0.2s ease;
}

.engine-row:hover .engine-row__icon-wrap {
  background: #0f172a;
  color: #ffffff;
  transform: scale(1.15);
}

.engine-row__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 6px;
  transition: color 0.2s ease;
}

.engine-row:hover .engine-row__title {
  color: #2563eb;
}

.engine-row__sub {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
}

.engine-row__body p {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  margin: 0;
}

/* ==========================================================================
   7. Specifications Section
   ========================================================================== */
.specs-section {
  padding: 96px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.specs-section__container {
  max-width: 1240px;
  margin: 0 auto;
}

.specs-section__lead {
  max-width: 760px;
  margin-bottom: 56px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  border-top: 1px solid #cbd5e1;
  padding-top: 32px;
}

.specs-cell {
  display: flex;
  flex-direction: column;
}

.specs-cell__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.specs-cell__title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.specs-cell__tag {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.specs-cell__desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   8. Security Section
   ========================================================================== */
.security-editorial {
  padding: 96px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.security-editorial__container {
  max-width: 1240px;
  margin: 0 auto;
}

.security-editorial__intro {
  max-width: 760px;
  margin-bottom: 56px;
}

.security-editorial__columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  border-top: 2px solid #0f172a;
  padding-top: 32px;
}

.sec-col__title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
}

.sec-col__text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   10. Footer Editorial (Multi-Column with Big White Logo)
   ========================================================================== */
.footer-editorial {
  background: #000000;
  color: #ffffff;
  padding: 72px 24px 44px;
  border-top: 1px solid #18181b;
}

.footer-editorial__container {
  max-width: 1240px;
  margin: 0 auto;
}

.footer-editorial__grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid #1e293b;
}

.footer-editorial__columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 48px;
  flex: 1;
  max-width: 820px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-col__title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  text-transform: uppercase;
}

.footer-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col__link {
  font-size: 13.5px;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col__link:hover {
  color: #ffffff;
}

.footer-editorial__brand-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
}

.footer-editorial__big-logo {
  width: 220px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.95;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.footer-editorial__big-logo:hover {
  opacity: 1;
  transform: scale(1.03);
}

.footer-editorial__bottom {
  padding-top: 32px;
}

.footer-editorial__copy {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-showcase {
    max-width: 100%;
  }

  .metrics-strip__container {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-item:nth-child(2) {
    border-right: none;
  }

  .metric-item:nth-child(3),
  .metric-item:nth-child(4) {
    border-top: 1px solid #e2e8f0;
  }

  .pipeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline-col:nth-child(2) {
    border-right: none;
  }

  .pipeline-col:nth-child(3),
  .pipeline-col:nth-child(4) {
    border-top: 1px solid #e2e8f0;
  }

  .pipeline-col:nth-child(3) {
    padding-left: 0;
  }

  .engine-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .specs-grid {
    grid-template-columns: 1fr;
  }

  .security-editorial__columns {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .landing-nav__menu {
    display: none;
  }

  .metrics-strip__container {
    grid-template-columns: 1fr;
  }

  .metric-item {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .metric-item:last-child {
    border-bottom: none;
  }

  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-col {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding-left: 0;
  }

  .pipeline-col:last-child {
    border-bottom: none;
  }

  .footer-editorial__grid {
    flex-direction: column-reverse;
    gap: 36px;
  }

  .footer-editorial__brand-side {
    justify-content: flex-start;
  }

  .footer-editorial__big-logo {
    width: 140px;
  }

  .footer-editorial__columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ==========================================================================
   11. Unified White/Dark Auth Experience (Matches Landing Design System)
   ========================================================================== */
.auth-shell {
  min-height: 100dvh;
  width: 100%;
  background: #ffffff;
  padding: 0;
  display: block;
}

.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* Top Navigation */
.auth-top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 85%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
}

.auth-top-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
}

.auth-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.auth-nav-logo {
  height: 32px;
  width: auto;
  max-width: 36px;
  display: block;
  object-fit: contain;
}

.auth-nav-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #0f172a;
  line-height: 1;
}

.auth-top-nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Main Body & Container */
.auth-page__body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 72px;
}

.auth-page__container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  gap: 48px;
  align-items: center;
}

/* Left Form Box */
.auth-box {
  display: flex;
  flex-direction: column;
}

.auth-box__header {
  margin-bottom: 28px;
}

.auth-box__pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 12px;
}

.auth-box__title {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #0f172a;
  margin: 0 0 10px;
}

.auth-box__subtitle {
  font-size: 14.5px;
  line-height: 1.55;
  color: #64748b;
  margin: 0;
}

.auth-form-neo {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-input-label {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.auth-link-subtle {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link-subtle:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.auth-input-field {
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.auth-input-field:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-input-field::placeholder {
  color: #94a3b8;
}

.auth-checkbox-group {
  display: flex;
  align-items: center;
}

.auth-checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.auth-checkbox-input {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  accent-color: #0f172a;
}

.auth-btn-row {
  margin-top: 6px;
}

.btn-hero-neo--full {
  width: 100%;
  padding: 13px 24px;
  font-size: 15px;
}

.auth-box__footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  font-size: 13.5px;
  color: #64748b;
}

.auth-link-bold {
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link-bold:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ==========================================================================
   Super-Large Frameless 3D Mascot Artwork (Cline Interactive 3D Experience)
   ========================================================================== */
.auth-ambient-orbit {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
}

.ambient-orbit-stage {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  user-select: none;
}

.ambient-orbit-stage pre {
  margin: 0;
  padding: 0;
  font-family: "Courier New", Courier, monospace !important;
  font-weight: 700;
  line-height: 1 !important;
  letter-spacing: -0.02em;
  user-select: none;
  cursor: grab;
}

.ambient-orbit-stage pre:active {
  cursor: grabbing;
}

/* Responsive */
@media (max-width: 960px) {
  .auth-page__container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .auth-ambient-orbit {
    display: none;
  }
}

/* Responsive */

@media (max-width: 1100px) {
  .chat-layout--sources-open {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .member-add-form {
    grid-template-columns: minmax(0, 1fr) 160px;
  }

  .member-add-form > .button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 900px) {
  body.app-body {
    min-height: 0;
  }

  .app-stage {
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .mobile-header {
    position: absolute;
    z-index: 30;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--ui-border);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(12px);
  }

  .mobile-brand {
    margin-right: auto;
    margin-left: 6px;
    font-size: 16px;
  }

  .mobile-brand .brand-logo {
    width: 28px;
  }

  .app-main {
    padding-top: 56px;
  }

  .sidebar {
    position: fixed;
    z-index: 100;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 292px);
    min-width: min(86vw, 292px);
    background: var(--ui-bg);
    box-shadow: 18px 0 50px rgb(15 23 42 / 18%);
    transform: translateX(-105%);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar-mobile-close {
    display: grid;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgb(15 23 42 / 42%);
    backdrop-filter: blur(2px);
  }

  .app-shell--collapsed .sidebar {
    width: min(86vw, 292px);
    min-width: min(86vw, 292px);
  }

  .app-shell--collapsed .sidebar-brand-row,
  .app-shell--collapsed .sidebar-panel {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell--collapsed .app-stage {
    margin: 0;
  }

  .app-shell--collapsed .sidebar-toggle {
    display: none;
  }

  .chat-page {
    height: calc(100dvh - 56px);
  }

  .chat-page--empty {
    height: calc(100dvh - 56px);
  }

  .chat-topbar {
    min-height: 54px;
    padding: 8px 13px;
  }

  .chat-topbar__actions .button span {
    display: none;
  }

  .chat-layout--sources-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .sources-drawer {
    position: absolute;
    z-index: 50;
    inset: 0 0 0 auto;
    width: 100%;
    border-left: 1px solid var(--ui-border);
    box-shadow: -18px 0 48px rgb(15 23 42 / 18%);
  }

  .codex-modal-layer {
    min-height: calc(100dvh - 56px);
  }

  .settings-tabs {
    top: 0;
  }

  .account-settings-page {
    padding: 28px 18px 44px;
  }

  .account-settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-settings-nav {
    position: static;
    display: flex;
    padding: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .account-settings-nav::-webkit-scrollbar,
  .account-settings-nav > p {
    display: none;
  }

  .account-settings-nav__item {
    min-width: max-content;
  }

  .account-settings-nav__item small {
    display: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 26px 16px 44px;
  }

  .page-heading {
    display: grid;
  }

  .page-heading__actions {
    justify-content: stretch;
  }

  .page-heading__actions .button {
    flex: 1;
  }

  .workspace-grid,
  .dashboard-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .chat-empty-layout {
    justify-content: flex-start;
    padding: 100px 16px 30px;
  }

  .chat-empty-state {
    margin-bottom: 24px;
  }

  .chat-empty-state h2 {
    font-size: 22px;
  }

  .composer {
    min-height: 112px;
    border-radius: var(--ui-radius-md);
  }

  .composer__model {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-thread {
    padding: 26px 16px 12px;
  }

  .chat-message__content {
    padding-left: 0;
  }

  .chat-composer-wrap {
    padding: 8px 10px 10px;
  }

  .ai-disclaimer {
    display: none;
  }

  .settings-tabs {
    padding-inline: 12px;
  }

  .settings-content {
    padding: 24px 14px;
  }

  .settings-section {
    padding: 18px;
  }

  .codex-modal-layer {
    padding: 0;
    background: var(--ui-surface);
  }

  .codex-modal-card {
    min-height: calc(100dvh - 56px);
    padding: 0 14px 24px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .modal-heading {
    margin: 0 -14px 18px;
    padding: 10px 12px;
  }

  .modal-heading h1 {
    font-size: 16px;
  }

  .resource-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .resource-row .resource-checkbox {
    display: none;
  }

  .upload-zone {
    padding: 22px 14px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list dt,
  .detail-list dd {
    border-bottom: 0;
  }

  .detail-list dd {
    padding-top: 0;
    border-bottom: 1px solid var(--ui-border);
  }

  .detail-list dd:last-child {
    border-bottom: 0;
  }

  .member-add-form {
    grid-template-columns: 1fr;
  }

  .member-add-form > .button {
    grid-column: auto;
    width: 100%;
  }

  .member-resource-table {
    min-width: 700px;
  }

  .resource-list:has(.member-resource-table) {
    overflow-x: auto;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

  .auth-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Inline Title Edit Styles */
.chat-topbar__identity--session {
  flex: 1;
  min-width: 0;
}

.title-display {
  display: block;
  cursor: text;
  padding: 2px 0;
  width: 100%;
}

.title-display:hover {
  background-color: transparent;
}

.title-form {
  width: 100%;
  margin-left: -6px;
}

.title-input {
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-primary);
  border-radius: 6px;
  padding: 2px 6px;
  outline: none;
  box-shadow: 0 0 0 3px var(--ui-primary-soft);
  box-sizing: border-box;
}

/* Avatar Upload Settings Styles */
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.user-avatar--large {
  width: 56px;
  height: 56px;
  font-size: 20px;
  flex: 0 0 56px;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-upload-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avatar-upload-button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.user-avatar--large {
  width: 56px;
  height: 56px;
  font-size: 20px;
  flex: 0 0 56px;
  border-radius: 50%;
  overflow: hidden;
}

.avatar-upload-inputs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-file-input {
  font-size: 13px;
  color: var(--ui-text);
}

/* PDF Viewer Styles */
.pdf-viewer-container {
  width: 100%;
  height: 680px;
  border-radius: var(--ui-radius-sm);
  overflow: hidden;
  border: 1px solid var(--ui-border);
  background: #f8fafc;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.pdf-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Admin Portal Styles */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-xs);
}

.admin-stat-card__icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary-dark);
  font-size: 22px;
  flex-shrink: 0;
}

.admin-stat-card__info {
  display: flex;
  flex-direction: column;
}

.admin-stat-card__value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ui-text);
  line-height: 1.2;
}

.admin-stat-card__label {
  font-size: 0.8rem;
  color: var(--ui-muted);
  margin-top: 2px;
}

/* Onboarding Tutorial Wizard Styles */
.onboarding-body {
  background: linear-gradient(135deg, #f0f4f9 0%, #e2eaf4 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.onboarding-wrapper {
  width: 100%;
  max-width: 580px;
}

.onboarding-card {
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 28px;
}

.onboarding-logo {
  height: 64px;
  width: auto;
  margin: 0 auto 16px;
  display: block;
}

.onboarding-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ui-text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.onboarding-header p {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.5;
}

.onboarding-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.onboarding-step-indicator.is-active,
.onboarding-step-indicator.is-completed {
  opacity: 1;
}

.onboarding-step-indicator .step-num {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 700;
}

.onboarding-step-indicator.is-active .step-num {
  background: var(--ui-primary-dark);
  color: #ffffff;
}

.onboarding-step-indicator.is-completed .step-num {
  background: #10b981;
  color: #ffffff;
}

.onboarding-step-indicator .step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-text);
}

.onboarding-step-divider {
  width: 32px;
  height: 2px;
  background: #cbd5e1;
}

.onboarding-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ui-text);
  margin-bottom: 8px;
}

.onboarding-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--ui-radius-sm);
  border: 1px solid var(--ui-border);
  font-size: 14px;
  background: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s;
}

.onboarding-input:focus {
  outline: none;
  border-color: var(--ui-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.onboarding-step-content.is-hidden {
  display: none !important;
}

