/* Hux Studio theme system v117: persistent themes with complete dialog and detail coverage. */

.workspace-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.workspace-actions .upload-button {
  grid-column: auto;
}

.theme-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #3b3b3b;
  border-radius: 0;
  background: #101010;
  color: #b9b9bc;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: #66666b;
  background: #171717;
  color: #f2f2f2;
}

.theme-toggle .ui-icon {
  width: 17px;
  height: 17px;
}

.theme-toggle-global {
  width: 58px;
  min-width: 58px;
  height: var(--nav-height);
  padding: 0;
  border-width: 0 0 0 1px;
  border-color: var(--border);
  background: transparent;
}

.theme-toggle-global [data-theme-label] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle-mobile {
  display: none;
}

html[data-theme="light"] {
  color-scheme: light;
  --background: #f4f4f5;
  --foreground: #18181b;
  --card: #ffffff;
  --card-foreground: #18181b;
  --popover: #ffffff;
  --popover-foreground: #18181b;
  --primary: #18181b;
  --primary-foreground: #ffffff;
  --secondary: #f4f4f5;
  --secondary-foreground: #27272a;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #ff4d4d;
  --accent-foreground: #ffffff;
  --brand: #df3f43;
  --brand-strong: #c93035;
  --brand-muted: rgb(223 63 67 / 9%);
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --input: #d4d4d8;
  --ring: #df3f43;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 5%);
  --shadow-md: 0 14px 34px rgb(0 0 0 / 8%);
  --shadow-lg: 0 28px 80px rgb(0 0 0 / 14%);
  --hux-tab-line: #d4d4d8;
  --hux-tab-line-soft: #e4e4e7;
  --hux-tab-surface: #ffffff;
  --hux-tab-surface-active: #f4f4f5;
  --hux-tab-text: #71717a;
  --hux-tab-text-strong: #18181b;
  --hux-tab-text-disabled: #71717a;
  background: var(--background);
  scrollbar-color: #a1a1aa #e4e4e7;
}

html[data-theme="light"] body {
  background:
    linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), rgb(28 28 28 / 3.2%) 25%, transparent calc(25% + 1px)),
    linear-gradient(90deg, transparent 0, transparent calc(50% - 1px), rgb(28 28 28 / 3.2%) 50%, transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent 0, transparent calc(75% - 1px), rgb(28 28 28 / 3.2%) 75%, transparent calc(75% + 1px)),
    var(--background);
  color: var(--foreground);
}

html[data-theme="light"] ::selection {
  background: var(--brand);
  color: #ffffff;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .workspace-header {
  border-color: var(--border);
  background: rgb(255 255 255 / 96%);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .nav-link,
html[data-theme="light"] .user-menu,
html[data-theme="light"] .theme-toggle-global,
html[data-theme="light"] .view-switch > .view-tab + .view-tab {
  border-color: var(--border);
}

html[data-theme="light"] .brand-mark::before,
html[data-theme="light"] .footer-mark::before {
  background: #1a1a1a;
}

html[data-theme="light"] .brand-mark::after,
html[data-theme="light"] .footer-mark::after {
  background: linear-gradient(180deg, #d4d4d8, #71717a);
}

html[data-theme="light"] .brand-name,
html[data-theme="light"] .user-copy strong,
html[data-theme="light"] .workspace-title h1 {
  color: #202022;
}

html[data-theme="light"] .product-name,
html[data-theme="light"] .user-copy small {
  color: #737278;
}

html[data-theme="light"] .nav-link {
  color: #69696e;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .user-menu:hover,
html[data-theme="light"] .theme-toggle-global:hover {
  background: #f4f4f5;
  color: #1d1d1f;
}

html[data-theme="light"] .avatar {
  border-color: #d4d4d8;
  background: #f4f4f5;
}

html[data-theme="light"] .theme-toggle {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #55555a;
}

html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible {
  border-color: #a1a1aa;
  background: #f4f4f5;
  color: #1d1d1f;
}

html[data-theme="light"] .view-switch > .view-tab {
  color: #6b6b70;
}

html[data-theme="light"] .view-switch > .view-tab:hover,
html[data-theme="light"] .view-switch > .view-tab.active {
  background: rgb(0 0 0 / 2.5%);
  color: #202022;
}

html[data-theme="light"] .button {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #323236;
}

html[data-theme="light"] .button:hover,
html[data-theme="light"] .button:focus-visible {
  border-color: var(--brand);
  background: #f4f4f5;
  color: #171719;
}

html[data-theme="light"] .button.primary,
html[data-theme="light"] .upload-button {
  border-color: #222224;
  background: #222224;
  color: #ffffff;
}

html[data-theme="light"] .button.primary:hover,
html[data-theme="light"] .upload-button:hover,
html[data-theme="light"] .button.primary:focus-visible,
html[data-theme="light"] .upload-button:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

html[data-theme="light"] .dashboard-section {
  --v43-surface: #ffffff;
  --v43-surface-soft: #fafafa;
  --v43-surface-active: #f4f4f5;
  --v43-border: #e4e4e7;
  --v43-border-strong: #a1a1aa;
  --v43-text: #202023;
  --v43-secondary: #5f5f65;
  --v43-muted: #77777d;
  --v43-red: var(--brand);
  --home-command-border: #e4e4e7;
  --home-command-surface: #ffffff;
  --home-command-surface-strong: #fafafa;
  --home-command-surface-hover: #f4f4f5;
  --home-command-text: #202023;
  --home-command-secondary: #5f5f65;
  --home-command-muted: #77777d;
  --home-command-accent: var(--brand);
}

html[data-theme="light"] .agent-copy-launcher-home,
html[data-theme="light"] .dashboard-command-board,
html[data-theme="light"] .dashboard-metrics article.metric-card,
html[data-theme="light"] .activity-card,
html[data-theme="light"] .activity-trend-pane,
html[data-theme="light"] .activity-category-pane {
  border-color: var(--border);
  background-color: #ffffff;
  color: #202023;
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .agent-copy-launcher-home {
  background:
    linear-gradient(112deg, rgb(223 63 67 / 7%), transparent 30%),
    #ffffff;
}

html[data-theme="light"] .agent-connect-copy::after {
  background: linear-gradient(transparent, #d4d4d8 14% 86%, transparent);
}

html[data-theme="light"] .agent-signal-field {
  background:
    linear-gradient(rgb(31 31 31 / 4%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(31 31 31 / 4%) 1px, transparent 1px),
    radial-gradient(circle at 50% 48%, rgb(223 63 67 / 8%), transparent 38%);
  background-size: 32px 32px, 32px 32px, auto;
}

html[data-theme="light"] .agent-signal-grid,
html[data-theme="light"] .activity-grid-line {
  stroke: rgb(31 31 31 / 8%);
}

html[data-theme="light"] .agent-signal-track,
html[data-theme="light"] .activity-baseline {
  stroke: #d4d4d8;
}

html[data-theme="light"] .agent-signal-anchor,
html[data-theme="light"] .agent-signal-source .agent-client-strip,
html[data-theme="light"] .asset-layer {
  border-color: #d4d4d8;
  background: #fafafa;
}

html[data-theme="light"] .agent-copy-launcher-home .agent-copy-pill {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #202023;
}

html[data-theme="light"] .agent-copy-launcher-home .agent-copy-pill:hover,
html[data-theme="light"] .agent-copy-launcher-home .agent-copy-pill:focus-visible {
  border-color: #a1a1aa;
  background: #e4e4e7;
  box-shadow: 0 10px 26px rgb(0 0 0 / 9%);
}

html[data-theme="light"] .agent-client-mark[data-client="codex"] img,
html[data-theme="light"] .agent-client-mark[data-client="cursor"] img {
  filter: none;
}

html[data-theme="light"] .dashboard-heading h2,
html[data-theme="light"] .activity-card-header h3,
html[data-theme="light"] .category-pane-header h3,
html[data-theme="light"] .dashboard-metrics .metric-value strong,
html[data-theme="light"] .activity-category-pane .category-row-label strong {
  color: #202023;
}

html[data-theme="light"] .dashboard-heading p,
html[data-theme="light"] .metric-label,
html[data-theme="light"] .activity-legend,
html[data-theme="light"] .category-pane-header .panel-note,
html[data-theme="light"] .activity-category-pane .category-stat small {
  color: #68686d;
}

html[data-theme="light"] .dashboard-data-status,
html[data-theme="light"] .dashboard-asset-link {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #3e3e42;
}

html[data-theme="light"] .activity-category-pane .category-row:hover,
html[data-theme="light"] .activity-category-pane .category-row:focus-visible,
html[data-theme="light"] .dashboard-metrics article.metric-card:hover {
  background: #f4f4f5;
}

html[data-theme="light"] .asset-filter-rail {
  border-color: var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

html[data-theme="light"] .asset-filter-rail-head {
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgb(223 63 67 / 7%), transparent 52%),
    #ffffff;
}

html[data-theme="light"] .asset-filter-rail-head strong {
  color: #252527;
}

html[data-theme="light"] .asset-filter-rail-head small {
  color: #79787d;
}

html[data-theme="light"] #assets-view .asset-toolbar .search-wrap {
  border-color: var(--border);
  background: #ffffff;
}

html[data-theme="light"] #assets-view .asset-toolbar .search-wrap:hover,
html[data-theme="light"] #assets-view .asset-toolbar .search-wrap:focus-within {
  background: #f4f4f5;
}

html[data-theme="light"] #assets-view .asset-toolbar .search-wrap input {
  /* The row owns the surface in rest, hover and focus states. */
  background: transparent;
  color: #222224;
}

html[data-theme="light"] #assets-view .asset-toolbar .search-wrap input::placeholder {
  color: #77777c;
}

html[data-theme="light"] #category-pills > .pill {
  border-color: var(--hux-tab-line-soft);
  color: var(--hux-tab-text);
}

html[data-theme="light"] #category-pills > .pill:hover,
html[data-theme="light"] #category-pills > .pill:focus-visible,
html[data-theme="light"] #category-pills > .pill.active {
  background: #f4f4f5;
  color: var(--hux-tab-text-strong);
}

html[data-theme="light"] #category-pills > .pill .ui-icon,
html[data-theme="light"] #category-pills > .pill .pill-count,
html[data-theme="light"] #category-pills > .pill .pill-branch-indicator {
  color: #74737a;
}

html[data-theme="light"] #subcategory-group.asset-subcategory-bar {
  border-color: var(--subcategory-line);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 4px 14px rgb(24 24 27 / 5%);
}

html[data-theme="light"] .asset-subcategory-heading {
  border-color: var(--subcategory-line);
  background: linear-gradient(120deg, rgb(223 63 67 / 7%), transparent 72%);
}

html[data-theme="light"] #subcategory-pills > .secondary-pill {
  border-color: var(--hux-tab-line-soft);
  color: #606066;
}

html[data-theme="light"] #subcategory-pills > .secondary-pill:hover,
html[data-theme="light"] #subcategory-pills > .secondary-pill:focus-visible,
html[data-theme="light"] #subcategory-pills > .secondary-pill.active {
  background: #f4f4f5;
  color: #1f1f21;
}

html[data-theme="light"] #subcategory-pills > .secondary-pill .ui-icon,
html[data-theme="light"] #subcategory-pills > .secondary-pill .pill-count {
  color: #606066;
}

html[data-theme="light"] #subcategory-pills > .secondary-pill.active .ui-icon,
html[data-theme="light"] #subcategory-pills > .secondary-pill.active .pill-count {
  color: var(--brand);
}

html[data-theme="light"] .asset-card {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #18181b;
  box-shadow: none;
}

html[data-theme="light"] .asset-card:hover,
html[data-theme="light"] .asset-card:focus-visible,
html[data-theme="light"] .asset-card:focus-within {
  border-color: #a1a1aa;
  background: #fafafa;
  box-shadow: none;
}

html[data-theme="light"] .skill-card-body {
  border-color: #e4e4e7;
  background: #ffffff;
}

html[data-theme="light"] .skill-card .badge {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #52525b;
}

html[data-theme="light"] .skill-card .badge.level,
html[data-theme="light"] .skill-owner-copy strong {
  color: #18181b !important;
}

html[data-theme="light"] .skill-owner-copy .skill-card-summary {
  color: #71717a;
}

html[data-theme="light"] .skill-footer {
  border-color: #e4e4e7;
}

html[data-theme="light"] .skeleton-grid span {
  border-color: var(--border);
  background: linear-gradient(90deg, #e4e4e7 20%, #fafafa 48%, #e4e4e7 76%);
  background-size: 240% 100%;
}

html[data-theme="light"] .empty-state {
  border-color: var(--border);
  background: #ffffff;
  color: #252527;
}

html[data-theme="light"] .empty-state p {
  color: #68686d;
}

html[data-theme="light"] .sheet-backdrop,
html[data-theme="light"] .portal-dialog::backdrop,
html[data-theme="light"] .profile-settings-dialog::backdrop,
html[data-theme="light"] .identity-dialog::backdrop {
  background: rgb(0 0 0 / 32%);
}

html[data-theme="light"] .asset-sheet,
html[data-theme="light"] .portal-dialog,
html[data-theme="light"] .portal-dialog-shell,
html[data-theme="light"] .identity-dialog,
html[data-theme="light"] .profile-settings-dialog,
html[data-theme="light"] .workflow-reader {
  border-color: var(--border-strong);
  background: #fafafa;
  color: #222224;
  box-shadow: var(--shadow-lg);
  color-scheme: light;
}

html[data-theme="light"] .sheet-hero,
html[data-theme="light"] .sheet-block,
html[data-theme="light"] .sheet-grid .sheet-block,
html[data-theme="light"] .sheet-actions,
html[data-theme="light"] .portal-dialog-header,
html[data-theme="light"] .portal-steps li,
html[data-theme="light"] .portal-guide-grid section,
html[data-theme="light"] .portal-guide-overview,
html[data-theme="light"] .workflow-reader-bar,
html[data-theme="light"] .workflow-article-hero,
html[data-theme="light"] .workflow-step-flow,
html[data-theme="light"] .workflow-platform-grid article,
html[data-theme="light"] .workflow-toc,
html[data-theme="light"] .workflow-source-note,
html[data-theme="light"] .workflow-callout,
html[data-theme="light"] .workflow-resource,
html[data-theme="light"] .identity-dialog-header,
html[data-theme="light"] .profile-settings-header,
html[data-theme="light"] .profile-settings-card.identity-profile-card {
  border-color: var(--border);
  background-color: #ffffff;
  color: #222224;
}

html[data-theme="light"] .identity-dialog-header,
html[data-theme="light"] .profile-settings-header {
  background:
    linear-gradient(112deg, rgb(223 63 67 / 7%), transparent 52%),
    #ffffff;
}

html[data-theme="light"] :is(
  .identity-dialog-heading h2,
  .identity-option-topline strong,
  .profile-settings-heading h2,
  .profile-settings-primary h3,
  .portal-dialog-header h2,
  .portal-guide-overview h3,
  .portal-platform-map strong,
  .sheet-content h2,
  .sheet-content h3,
  .workflow-article h1,
  .workflow-article h2,
  .workflow-article h3
) {
  color: #222224;
}

html[data-theme="light"] :is(
  .identity-dialog-heading p,
  .identity-option-copy p,
  .identity-option-topline small,
  .identity-dialog-note p,
  .profile-settings-heading p,
  .portal-guide-overview p,
  .portal-guide-heading p,
  .workflow-article p,
  .sheet-content p
) {
  color: #66666b;
}

html[data-theme="light"] .identity-option,
html[data-theme="light"] .identity-dialog-note,
html[data-theme="light"] .profile-settings-primary,
html[data-theme="light"] .profile-settings-meta,
html[data-theme="light"] .profile-settings-history {
  border-color: var(--border);
  background-color: #ffffff;
}

html[data-theme="light"] .identity-option:hover,
html[data-theme="light"] .identity-option:focus-visible,
html[data-theme="light"] .identity-option.active {
  background: #f4f4f5;
}

html[data-theme="light"] .identity-option-avatar,
html[data-theme="light"] .profile-settings-avatar,
html[data-theme="light"] .identity-account-settings,
html[data-theme="light"] .profile-settings-close,
html[data-theme="light"] .profile-settings-icon-action,
html[data-theme="light"] .identity-dialog-close {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #5f5f64;
}

html[data-theme="light"] :is(input, textarea, select) {
  border-color: #d4d4d8;
  background-color: #ffffff;
  color: #222224;
}

html[data-theme="light"] :is(input, textarea)::placeholder {
  color: #85848a;
}

html[data-theme="light"] .toast {
  border-color: var(--brand);
  background: #ffffff;
  color: #252527;
  box-shadow: var(--shadow-md);
}

html[data-theme="light"] .auth-gate {
  background: #f4f4f5;
  color: #202023;
}

html[data-theme="light"] .auth-gate-grid {
  background-image:
    linear-gradient(rgb(30 30 30 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(30 30 30 / 5%) 1px, transparent 1px);
}

html[data-theme="light"] .auth-gate-content,
html[data-theme="light"] .auth-gate-card,
html[data-theme="light"] .auth-gate-footer {
  border-color: var(--border-strong);
  background-color: #ffffff;
  color: #202023;
}

html[data-theme="light"] .auth-gate-intro {
  border-color: var(--border-strong);
  background: #171719;
  color: #f3f3f4;
}

html[data-theme="light"] .auth-gate-card-copy h2 {
  color: #222224;
}

html[data-theme="light"] .auth-gate-card-copy p,
html[data-theme="light"] .auth-gate-card-note,
html[data-theme="light"] .auth-gate-footer,
html[data-theme="light"] .auth-gate-brand small {
  color: #6d6d72;
}

html[data-theme="light"] .auth-gate-status:not(:empty) {
  border-left-color: var(--brand);
  background: rgb(223 63 67 / 7%);
  color: #52525b;
}

html[data-theme="light"] .auth-gate-divider {
  color: #71717a;
}

html[data-theme="light"] .auth-gate-divider::before,
html[data-theme="light"] .auth-gate-divider::after {
  background: #d4d4d8;
}

html[data-theme="light"] .auth-gate-secondary {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #2b2b2e;
}

html[data-theme="light"] .auth-gate-secondary:hover,
html[data-theme="light"] .auth-gate-secondary:focus-visible {
  border-color: #a1a1aa;
  background: #f4f4f5;
}

/* v117 visual audit: complete light surfaces across detail, identity and creation flows. */

.auth-gate-theme-toggle {
  min-width: 112px;
  margin-left: auto;
}

html[data-theme="light"] .auth-gate-layout {
  border-color: var(--border-strong);
  background: #ffffff;
  box-shadow: 0 28px 72px rgb(24 24 27 / 12%);
}

html[data-theme="light"] .auth-gate-monogram {
  border-color: var(--border-strong);
  background: #ffffff;
}

html[data-theme="light"] .auth-gate-card {
  background: #ffffff;
}

html[data-theme="light"] .auth-gate-primary:disabled {
  border-color: #d4d4d8;
  background: #e4e4e7;
  color: #71717a;
}

html[data-theme="light"] .asset-sheet,
html[data-theme="light"] .skill-detail-sheet,
html[data-theme="light"] .skill-detail-record,
html[data-theme="light"] .skill-detail-sheet .sheet-actions {
  border-color: var(--border-strong);
  background: #ffffff;
  color: #27272a;
}

html[data-theme="light"] .asset-sheet {
  box-shadow: -28px 0 68px rgb(24 24 27 / 18%);
}

html[data-theme="light"] .skill-detail-record {
  border-top-color: var(--border);
}

html[data-theme="light"] .skill-detail-row {
  border-bottom-color: var(--border);
}

html[data-theme="light"] .skill-detail-label {
  border-right-color: var(--border);
  background: #fafafa;
  color: #52525b;
}

html[data-theme="light"] .skill-detail-value {
  background: #ffffff;
  color: #3f3f46;
}

html[data-theme="light"] .skill-detail-command,
html[data-theme="light"] .skill-detail-person {
  border-color: #d4d4d8;
  background: #fafafa;
  color: #18181b;
}

html[data-theme="light"] .skill-detail-pills span {
  border-color: rgb(201 48 53 / 28%);
  background: rgb(223 63 67 / 6%);
  color: #8f2f33;
}

html[data-theme="light"] .skill-detail-link {
  border-color: rgb(201 48 53 / 30%);
  background: rgb(223 63 67 / 5%);
  color: #b33439;
}

html[data-theme="light"] .skill-detail-link:hover,
html[data-theme="light"] .skill-detail-link:focus-visible {
  border-color: rgb(201 48 53 / 58%);
  background: rgb(223 63 67 / 10%);
  color: #8f2429;
}

html[data-theme="light"] .skill-detail-empty {
  color: #71717a;
}

html[data-theme="light"] .skill-detail-avatar {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: var(--brand);
}

html[data-theme="light"] .sheet-close-button {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #52525b;
}

html[data-theme="light"] .sheet-close-button:hover,
html[data-theme="light"] .sheet-close-button:focus-visible {
  border-color: #a1a1aa;
  background: #e4e4e7;
  color: #18181b;
}

html[data-theme="light"] .favorite-btn,
html[data-theme="light"] #asset-grid .skill-card > .favorite-btn {
  border: 1px solid #d4d4d8;
  background: #ffffff;
  color: #52525b;
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .favorite-btn:hover,
html[data-theme="light"] .favorite-btn:focus-visible,
html[data-theme="light"] .asset-card:focus-within .favorite-btn {
  border-color: #a1a1aa;
  background: #f4f4f5;
  color: #18181b;
}

html[data-theme="light"] #asset-grid .skill-card > .favorite-btn.active,
html[data-theme="light"] #asset-grid .skill-card > .favorite-btn[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

html[data-theme="light"] .identity-dialog-shell,
html[data-theme="light"] .identity-options,
html[data-theme="light"] .identity-login-panel,
html[data-theme="light"] .identity-session-actions {
  border-color: var(--border);
  background: #ffffff;
  color: #27272a;
}

html[data-theme="light"] .identity-option {
  border-bottom-color: var(--border);
  background: #ffffff;
  color: #27272a;
}

html[data-theme="light"] .identity-option:hover,
html[data-theme="light"] .identity-option:focus-visible {
  border-bottom-color: var(--border);
  background: #f4f4f5;
}

html[data-theme="light"] .identity-option.active,
html[data-theme="light"] .identity-option-session:hover {
  border-bottom-color: var(--border);
  background: linear-gradient(90deg, rgb(223 63 67 / 8%), transparent 78%), #ffffff;
}

html[data-theme="light"] .identity-login-panel {
  border-top-color: var(--border);
  background: linear-gradient(135deg, rgb(223 63 67 / 6%), transparent 54%), #fafafa;
}

html[data-theme="light"] .identity-login-copy strong {
  color: #18181b;
}

html[data-theme="light"] .identity-login-copy p {
  color: #71717a;
}

html[data-theme="light"] .identity-github-login {
  border-color: #27272a;
  background: #27272a;
  color: #ffffff;
}

html[data-theme="light"] .identity-github-login:hover,
html[data-theme="light"] .identity-github-login:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

html[data-theme="light"] .identity-session-actions {
  border-top-color: var(--border);
  background: #fafafa;
}

html[data-theme="light"] .identity-session-logout {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #3f3f46;
}

html[data-theme="light"] .identity-session-logout:hover,
html[data-theme="light"] .identity-session-logout:focus-visible {
  border-color: rgb(201 48 53 / 46%);
  background: rgb(223 63 67 / 7%);
  color: #a62d32;
}

html[data-theme="light"] .profile-settings-shell,
html[data-theme="light"] .profile-settings-content,
html[data-theme="light"] .profile-settings-card.identity-profile-card {
  background: #ffffff;
  color: #27272a;
}

html[data-theme="light"] .profile-settings-primary,
html[data-theme="light"] .profile-settings-meta,
html[data-theme="light"] .profile-settings-owner-linker {
  border-color: var(--border);
  background: #ffffff;
}

html[data-theme="light"] .profile-settings-primary-copy strong,
html[data-theme="light"] .profile-settings-owner-title strong {
  color: #18181b;
}

html[data-theme="light"] .profile-settings-field-label,
html[data-theme="light"] .profile-settings-github,
html[data-theme="light"] .profile-settings-description,
html[data-theme="light"] .profile-settings-owner-title small,
html[data-theme="light"] .profile-settings-meta dt,
html[data-theme="light"] .profile-settings-meta dd small {
  color: #71717a;
}

html[data-theme="light"] .profile-settings-meta dd,
html[data-theme="light"] .profile-settings-meta code {
  color: #3f3f46;
}

html[data-theme="light"] .profile-settings-meta-icon,
html[data-theme="light"] .profile-settings-owner-icon {
  border-color: #d4d4d8;
  background: #f4f4f5;
  color: #52525b;
}

html[data-theme="light"] .identity-profile-input {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #18181b;
}

html[data-theme="light"] .identity-profile-cancel {
  border-color: #d4d4d8;
  background: #ffffff;
  color: #52525b;
}

html[data-theme="light"] .identity-profile-save {
  border-color: #27272a;
  background: #27272a;
  color: #ffffff;
}

html[data-theme="light"] .portal-dialog[data-mode="intake"],
html[data-theme="light"] .portal-dialog[data-mode="intake"] .portal-dialog-shell,
html[data-theme="light"] .portal-dialog[data-mode="intake"] .portal-dialog-body,
html[data-theme="light"] .asset-intake-simple,
html[data-theme="light"] .intake-workspace,
html[data-theme="light"] .intake-workspace-simple,
html[data-theme="light"] .intake-main,
html[data-theme="light"] .intake-mcp-panel-simple,
html[data-theme="light"] .mcp-setup-wizard {
  border-color: var(--border);
  background: #ffffff;
  color: #27272a;
  color-scheme: light;
}

html[data-theme="light"] .portal-dialog[data-mode="intake"] .portal-dialog-header,
html[data-theme="light"] .intake-create-heading,
html[data-theme="light"] .intake-requirement-rail {
  border-color: var(--border);
  background: #fafafa;
}

html[data-theme="light"] :is(
  .intake-type-grid,
  .intake-mcp-source-grid,
  .intake-mcp-command,
  .intake-create-result,
  .mcp-entry-status,
  .mcp-journey-grid,
  .mcp-boundary-note,
  .mcp-progress,
  .mcp-managed-card,
  .mcp-auth-section,
  .mcp-tools-section,
  .mcp-review-summary,
  .mcp-verification-list,
  .mcp-compatibility-tools,
  .mcp-save-notice
) {
  border-color: var(--border);
  background: #fafafa;
  color: #27272a;
}

html[data-theme="light"] :is(
  .intake-type-option,
  .intake-mcp-source-grid > div,
  .mcp-journey-grid li,
  .mcp-progress li,
  .mcp-option,
  .mcp-auth-option,
  .mcp-approval-option,
  .mcp-tool-list label,
  .mcp-compatibility-tool
) {
  border-color: var(--border);
  background: #ffffff;
  color: #3f3f46;
}

html[data-theme="light"] :is(
  .intake-type-option:hover,
  .intake-type-option:focus-visible,
  .mcp-option:hover,
  .mcp-option:focus-visible,
  .mcp-auth-option:hover,
  .mcp-approval-option:hover
) {
  background: #f4f4f5;
}

html[data-theme="light"] :is(
  .intake-type-option.active,
  .mcp-progress li.current,
  .mcp-option.active,
  .mcp-auth-option.active,
  .mcp-approval-option.active,
  .mcp-entry-status.has-plan
) {
  border-color: rgb(201 48 53 / 32%);
  background: linear-gradient(120deg, rgb(223 63 67 / 8%), transparent 70%), #ffffff;
}

html[data-theme="light"] :is(
  .intake-section-heading h3,
  .intake-main-heading h3,
  .intake-mcp-lead h4,
  .intake-manual-intro h4,
  .intake-type-copy strong,
  .intake-mcp-source-grid strong,
  .intake-mcp-command > div strong,
  .mcp-entry-status strong,
  .mcp-journey-grid strong,
  .mcp-wizard-header h4,
  .mcp-step-heading h5,
  .mcp-auth-section h6,
  .mcp-tools-section h6,
  .mcp-review-summary h6,
  .mcp-verification-list h6
) {
  color: #27272a;
}

html[data-theme="light"] :is(
  .intake-section-heading p,
  .intake-main-heading p,
  .intake-mcp-lead p,
  .intake-manual-intro p,
  .intake-type-copy small,
  .intake-mcp-source-grid small,
  .intake-mcp-command p,
  .mcp-entry-status small,
  .mcp-journey-grid small,
  .mcp-boundary-note p,
  .mcp-wizard-header p,
  .mcp-option small,
  .mcp-auth-option small,
  .mcp-approval-option small,
  .mcp-compatibility-tool small
) {
  color: #71717a;
}

html[data-theme="light"] .intake-method-switch {
  border-color: #d4d4d8;
}

html[data-theme="light"] .intake-method-switch button {
  border-color: var(--border);
  background: #ffffff;
  color: #71717a;
}

html[data-theme="light"] .intake-method-switch button:hover,
html[data-theme="light"] .intake-method-switch button:focus-visible {
  background: #f4f4f5;
  color: #18181b;
}

html[data-theme="light"] .intake-method-switch button.active {
  background: #27272a;
  color: #ffffff;
}

html[data-theme="light"] .draft-editor-frame,
html[data-theme="light"] .draft-editor-scroll {
  background: #f4f4f5;
  color: #27272a;
}

html[data-theme="light"] .draft-editor-document {
  border-color: #d4d4d8;
  background: #ffffff;
  box-shadow: 0 22px 60px rgb(24 24 27 / 10%);
}

html[data-theme="light"] .draft-document-title,
html[data-theme="light"] .draft-document-section h2,
html[data-theme="light"] .draft-editor-outline > strong {
  color: #18181b;
}

html[data-theme="light"] .draft-document-summary,
html[data-theme="light"] .draft-document-field,
html[data-theme="light"] .draft-document-facts dd,
html[data-theme="light"] .draft-editor-owner strong {
  color: #52525b;
}

html[data-theme="light"] .draft-document-section,
html[data-theme="light"] .draft-document-facts,
html[data-theme="light"] .draft-editor-outline,
html[data-theme="light"] .draft-editor-outline nav button,
html[data-theme="light"] .draft-editor-owner {
  border-color: var(--border);
}

html[data-theme="light"] .draft-document-field:hover,
html[data-theme="light"] .draft-document-field:focus {
  border-color: #d4d4d8;
  background: #fafafa;
}

@media (max-width: 620px) {
  .auth-gate-theme-toggle {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  .auth-gate-theme-toggle [data-theme-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 1020px) and (min-width: 721px) {
  .topbar .sidebar-footer {
    display: flex;
    width: 58px;
  }

  .topbar .theme-toggle-global {
    display: inline-flex;
    width: 58px;
    min-width: 58px;
  }

  .topbar .user-menu,
  .topbar .source-status {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar .theme-toggle-global {
    display: none;
  }

  .workspace-actions {
    grid-column: 2;
    gap: 7px;
  }

  .theme-toggle-mobile {
    display: inline-flex;
    width: 34px;
    min-width: 34px;
    min-height: 32px;
    padding: 0;
  }

  .theme-toggle-mobile [data-theme-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .theme-toggle-mobile .ui-icon {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none;
  }
}
