/* ---------- Overprint: the shared accent layer ----------
   Taken from the sign-in screen and used everywhere. The idea is a print with a second ink:
   black page, one orange for the main action and for focus, and a pink "misregistered" offset
   behind whatever is most important. Everything else stays neutral.

   Rules
   1. Orange (--op-base) is only for the main action, the current focus and the current tab.
   2. The pink offset (--op-shift) is a hard 2-4px shadow with no blur. On the main action, the
      focused field, dialogs, the wordmark, the Create button and cards under the pointer.
   3. Small labels are mono, uppercase and tracked, with a two-ink line in front.
   4. Selected state = orange outline on a faint orange tint. Never a white fill.
   5. Links in running text carry an orange underline.
   Load after theme-black.css. */

:root {
  --op-base: #ff4f10;
  --op-shift: #ff2e63;
  --op-halo: #0099ff;
  --op-on-base: #090605;
  --op-tint: rgba(255, 79, 16, .13);
  --op-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

::selection { background: var(--op-base); color: var(--op-on-base); }

/* Final chat and recent-history polish */
body.memora-ui :is(.character-story-avatar, .continue-item > img, .chat-item .avatar, .chat-row .avatar, .chat-item .chat-avatar, .chat-row .chat-avatar) {
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base) !important;
}
body.memora-ui :is(.character-story strong, .character-story p, .character-story time, .continue-item strong, .continue-item small, .chat-item strong, .chat-item small, .chat-row strong, .chat-row small) {
  color: #f4f4f6 !important;
}
body.memora-ui .character-story .character-story-avatar { border: 0 !important; }

/* Model picker and reasoning controls */
body.memora-ui.workspace-chat .chat-model-menu {
  width: 292px !important;
  padding: 10px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 14px !important;
  background: #09090b !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.72), 3px 3px 0 rgba(255,46,99,.42) !important;
  color: #fff !important;
}
body.memora-ui.workspace-chat .chat-model-group > span,
body.memora-ui.workspace-chat .chat-speed-label,
body.memora-ui.workspace-chat .chat-menu-section-heading small {
  color: #bfc0c8 !important;
}
body.memora-ui.workspace-chat .chat-model-menu [data-model] {
  min-height: 42px !important;
  padding: 0 11px !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  color: #f5f5f7 !important;
  background: transparent !important;
  font-size: 12px !important;
}
body.memora-ui.workspace-chat .chat-model-menu [data-model]:hover,
body.memora-ui.workspace-chat .chat-model-menu [aria-selected="true"] {
  color: var(--op-on-base) !important;
  background: var(--op-base) !important;
  border-color: var(--op-base) !important;
  box-shadow: 2px 2px 0 var(--op-shift) !important;
}
body.memora-ui.workspace-chat .chat-model-group + .chat-model-group {
  border-top-color: rgba(255,255,255,.16) !important;
}
body.memora-ui.workspace-chat .chat-depth-menu {
  margin-top: 10px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255,255,255,.16) !important;
}
body.memora-ui.workspace-chat .chat-speed-switch {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  gap: 3px !important;
  padding: 3px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 999px !important;
  background: #151519 !important;
}
body.memora-ui.workspace-chat .chat-speed-switch button {
  min-height: 34px !important;
  padding: 0 6px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  color: #c7c7ce !important;
  background: transparent !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
body.memora-ui.workspace-chat .chat-speed-switch button:hover,
body.memora-ui.workspace-chat .chat-speed-switch button[aria-checked="true"] {
  color: var(--op-on-base) !important;
  background: var(--op-base) !important;
  border-color: var(--op-base) !important;
  box-shadow: 2px 2px 0 var(--op-shift) !important;
  text-shadow: none !important;
}

/* 1. Main action */
body.memora-ui :where(.primary-button, .primary-action, .button.primary, a.primary, button.primary, .auth-submit,
  #welcomeSubmit, .welcome-submit, .ui-primary, .admin-choice-primary, .memora-cookie-button.primary, .admin-button.primary):not(:disabled):not([aria-disabled="true"]) {
  background: var(--op-base) !important; color: var(--op-on-base) !important;
  border: 1px solid var(--op-base) !important; font-weight: 650;
  box-shadow: 3px 3px 0 var(--op-shift) !important;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
body.memora-ui :where(.primary-button, .primary-action, .button.primary, a.primary, button.primary, .auth-submit,
  #welcomeSubmit, .welcome-submit, .ui-primary, .admin-choice-primary, .memora-cookie-button.primary, .admin-button.primary):not(:disabled):not([aria-disabled="true"]):hover {
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--op-shift) !important; filter: brightness(1.06);
}
body.memora-ui :where(.primary-button, .primary-action, .button.primary, a.primary, button.primary, .auth-submit,
  #welcomeSubmit, .welcome-submit, .ui-primary, .admin-choice-primary, .memora-cookie-button.primary, .admin-button.primary):not(:disabled):not([aria-disabled="true"]):active {
  transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--op-shift) !important;
}
/* The chat send button is the main action of the chat, but small: a shorter offset. */
body.memora-ui .composer #sendButton:not(:disabled) {
  background: var(--op-base) !important; color: var(--op-on-base) !important; border-color: var(--op-base) !important;
  box-shadow: none !important;
}
body.memora-ui .composer button:not(#sendButton) { box-shadow: none !important; }
body.memora-ui .composer .chat-model-trigger { color: #d0d0d7 !important; }
body.memora-ui .composer .chat-model-trigger:hover { box-shadow: inset 0 0 0 1px var(--op-base) !important; }

/* 2. Focus: orange edge and the offset second ink */
body.memora-ui :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, .field-control):focus-visible,
body.memora-ui :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select, .field-control):focus {
  border-color: var(--op-base) !important; outline: none;
  box-shadow: 2px 2px 0 var(--op-halo), 4px 4px 0 rgba(255, 46, 99, .55) !important;
}
body.memora-ui .composer :where(textarea, input):focus,
body.memora-ui .composer :where(textarea, input):focus-visible { box-shadow: none !important; }
body.memora-ui :where(.search-field, .search-box, .workspace-history-search, .comment-input-row):focus-within {
  box-shadow: inset 0 0 0 1px var(--op-base), 2px 2px 0 var(--op-halo), 4px 4px 0 rgba(255, 46, 99, .55) !important;
}
body.memora-ui :is(button, a, summary, [tabindex], input, textarea, select):focus-visible,
body.memora-ui.home-page :is(.shelf-heading a, .shelf-controls button, .filter-row button, .save-story, #resetCatalog):focus-visible,
body.memora-ui .settings-main :is(button, a, select, input):focus-visible { outline: 2px solid var(--op-halo) !important; outline-offset: 3px; }
/* Selected cards already carry the orange edge: no second ring on top of it. */
body.memora-ui.page-group-builder .character-result.is-selected:focus-visible { outline-offset: 2px; }
body.memora-ui :where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--op-base); }

/* 3. Tabs and filters: the current one is outlined in orange */
body.memora-ui :where(.filter-row, .chat-tabs, .groups-tabs, .privacy-toggle, .auth-tabs, .welcome-tabs, .public-profile-tabs) :where(button, a):is(.active, .selected, [aria-selected="true"], [aria-pressed="true"], [aria-current]) {
  background: var(--op-tint) !important; color: #fff !important;
  box-shadow: inset 0 0 0 1px var(--op-base) !important;
}
body.memora-ui .workspace-nav :where(a, button):is(.active, [aria-current]) { box-shadow: inset 2px 0 0 var(--op-base); }

/* 4. Small labels */
body.memora-ui :where(.eyebrow, .chat-persona-eyebrow, .welcome-kicker) {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--op-mono) !important;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
}
body.memora-ui :where(.eyebrow, .chat-persona-eyebrow)::before {
  content: ""; width: 22px; height: 1px; background: var(--op-base); box-shadow: 3px 0 0 var(--op-shift); flex: 0 0 auto;
}

/* 5. Links in running text */
body.memora-ui :where(.terms-consent a, .legal-page a, .help-page a, .text-link, .text-button, .welcome-note a) {
  text-decoration: underline; text-decoration-color: var(--op-base); text-decoration-thickness: 1px; text-underline-offset: 4px;
}
body.memora-ui :where(.terms-consent a, .legal-page a, .help-page a, .text-link, .text-button, .welcome-note a):hover { text-decoration-thickness: 2px; }

/* Dialogs and the wordmark carry the second ink too */
body.memora-ui :where(dialog, .modal, .dialog):not(.cookie-banner) { box-shadow: 4px 4px 0 var(--op-shift), 0 24px 80px rgba(0, 0, 0, .48); }
body :where(.brand-wordmark, .workspace-brand) { text-shadow: 2px 0 0 rgba(255, 46, 99, .48); }

@media (prefers-reduced-motion: reduce) {
  body.memora-ui :where(.primary-button, .primary-action, .welcome-submit, button.primary, .ui-primary) { transition: none; }
  body.memora-ui :where(.primary-button, .primary-action, .welcome-submit, button.primary, .ui-primary):hover { transform: none; }
}

/* Places that kept their own selected state */
body.memora-ui .settings-main .settings-nav button.active,
body.memora-ui .settings-main .settings-nav button[aria-selected="true"] {
  background: var(--op-tint) !important; color: #fff !important; box-shadow: inset 0 0 0 1px var(--op-base) !important;
}
body.memora-ui.page-group-builder .groups-tabs button[aria-selected="true"] {
  background: var(--op-tint) !important; color: #fff !important; box-shadow: inset 0 0 0 1px var(--op-base) !important;
}
body.memora-ui.page-group-builder .group-catalog .character-result.is-selected {
  background: var(--op-tint) !important; box-shadow: inset 0 0 0 1px var(--op-base) !important;
}
body.memora-ui.page-group-builder .group-catalog .character-result.is-selected .result-add {
  background: var(--op-base) !important; color: var(--op-on-base) !important;
}


/* ---------- Accent across the whole system ----------
   Every surface gets a small share of the two inks, so no screen is black with three orange buttons. */

/* Sidebar */
body.memora-ui .workspace-links :where(a, button) .workspace-icon, body.memora-ui .workspace-links :where(a, button) svg { color: #c9c9d1; transition: color .15s ease; }
body.memora-ui .workspace-links :where(a, button):hover .workspace-icon, body.memora-ui .workspace-links :where(a, button):hover svg { color: var(--op-base); }
body.memora-ui .workspace-links :where(a, button):is(.active, [aria-current]) { background: var(--op-tint) !important; color: #fff !important; box-shadow: none !important; }
body.memora-ui .workspace-links :where(a, button):is(.active, [aria-current]) :is(.workspace-icon, svg) { color: var(--op-base) !important; }
body.memora-ui .workspace-create {
  background: transparent !important; color: #fff !important;
  box-shadow: inset 0 0 0 1px var(--op-base) !important; transition: background-color .16s ease;
}
body.memora-ui .workspace-create:hover { background: var(--op-tint) !important; }
body.memora-ui .workspace-create svg { color: var(--op-base); }
body.memora-ui :where(.workspace-brand, .workspace-mobile-brand, .brand-wordmark)::after { box-shadow: inset 0 0 0 1px var(--op-base) !important; color: var(--op-base) !important; }
body.memora-ui .workspace-account-avatar { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base); }
body.memora-ui :where(.workspace-history-heading, .workspace-page-name) { font-family: var(--op-mono) !important; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
body.memora-ui .workspace-history-heading svg { color: var(--op-base); }
body.memora-ui .workspace-mobile-nav-item:is(.active, [aria-current]) { color: var(--op-base) !important; }

/* Section titles: a two-ink tick before the title, orange chevron after */
body.memora-ui :where(.shelf-heading h2 a, .catalog-heading-copy h2, .continue-heading h2, .discover-heading h2)::before {
  content: ""; display: inline-block; width: 24px; height: 3px; margin: 0 14px 0.3em 0; vertical-align: middle;
  background: linear-gradient(90deg, var(--op-base) 0 62%, var(--op-shift) 62% 100%);
}
body.memora-ui .shelf-heading h2 a svg { color: var(--op-base); transition: transform .18s ease; }
body.memora-ui .shelf-heading h2 a:hover svg { transform: translateX(3px); }
body.memora-ui .shelf-controls button:not(:disabled) { color: var(--op-base) !important; box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .45) !important; }
body.memora-ui .shelf-controls button:not(:disabled):hover { background: var(--op-tint) !important; box-shadow: inset 0 0 0 1px var(--op-base), 2px 2px 0 var(--op-shift) !important; }
body.memora-ui .feed-summary { font-family: var(--op-mono) !important; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #b2b2bc; }

/* Cards: tags carry the accent, the card shifts and shows the second ink under the pointer */
body.memora-ui .card-tags { gap: 6px; }
body.memora-ui .card-tag { font-family: var(--op-mono) !important; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #c9c9d1 !important; }
body.memora-ui .card-tag:first-child { color: #ff6a36 !important; }
body.memora-ui .story-card h3 { transition: color .15s ease; }
body.memora-ui .story-card:is(:hover, :focus-within) h3 { color: #fff; text-decoration: underline; text-decoration-color: var(--op-base); text-decoration-thickness: 2px; text-underline-offset: 4px; }
body.memora-ui.workspace-catalog .story-card:is(:hover, :focus-within) {
  transform: translate(-1px, -1px); box-shadow: inset 0 0 0 1px var(--op-base), 4px 4px 0 var(--op-shift) !important;
}
body.memora-ui .story-card { transition: transform .16s ease, box-shadow .16s ease; }
body.memora-ui .story-badge { color: var(--op-base) !important; box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .5); font-family: var(--op-mono); letter-spacing: .08em; text-transform: uppercase; }
body.memora-ui .save-story:hover { color: var(--op-base) !important; }
body.memora-ui .save-story:is(.saved, [aria-pressed="true"]) { color: var(--op-on-base) !important; background: var(--op-base) !important; box-shadow: 2px 2px 0 var(--op-shift) !important; }
body.memora-ui .story-poster::after, body.memora-ui .result-avatar::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .17); }
body.memora-ui .story-card:is(:hover, :focus-within) .story-poster::after { box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .75); }
body.memora-ui .continue-item:hover > img { box-shadow: 0 0 0 2px var(--op-base); }

/* Banner */
body.memora-ui .promo-carousel .promo-pagination button[aria-current] span { background: var(--op-base) !important; box-shadow: 0 0 0 1px #000, 2px 2px 0 var(--op-shift); }
body.memora-ui .promo-carousel .promo-cta {
  background: var(--op-base) !important; color: var(--op-on-base) !important; border: 1px solid var(--op-base) !important;
  box-shadow: 3px 3px 0 var(--op-shift) !important; font-weight: 650; backdrop-filter: none;
}
body.memora-ui .promo-carousel .promo-cta:hover { background: var(--op-base) !important; transform: translate(-1px, -1px); filter: brightness(1.06); box-shadow: 4px 4px 0 var(--op-shift) !important; }
body.memora-ui .promo-carousel .promo-eyebrow { font-family: var(--op-mono) !important; }
body.memora-ui .promo-carousel .promo-eyebrow::before { content: ""; display: inline-block; width: 20px; height: 2px; margin-right: 10px; vertical-align: middle; background: #fff; box-shadow: 0 3px 0 var(--op-shift); }

/* Search */
body.memora-ui :where(.search-field, .search-box, .workspace-history-search) svg { color: var(--op-base); }
body.memora-ui :where(.search-field, .search-box, .workspace-history-search) input::placeholder { color: #9a9aa6; }

/* Filters: idle chips get an orange edge on hover */
body.memora-ui :where(.filter-row, .chat-tabs, .groups-tabs) button:not(.active):not([aria-selected="true"]):hover { box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .6) !important; color: #fff; }
body.memora-ui .groups-tabs #groupSavedCount { background: var(--op-base) !important; color: var(--op-on-base) !important; font-family: var(--op-mono); }

/* Chat */
body.memora-ui.workspace-chat .message.user .message-text {
  background: var(--op-tint) !important; color: #fff !important; box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .55), 3px 3px 0 rgba(255, 46, 99, .55);
}
body.memora-ui.workspace-chat .message.assistant .message-text { box-shadow: inset 2px 0 0 var(--op-base), inset 0 0 0 1px var(--ds-hairline); }
body.memora-ui.workspace-chat .message-meta { font-family: var(--op-mono) !important; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
body.memora-ui.workspace-chat .typing span, body.memora-ui .typing i { background: var(--op-base) !important; }
body.memora-ui.workspace-chat .message-action:hover { color: var(--op-base) !important; }
body.memora-ui.workspace-chat .composer { box-shadow: inset 0 1px 0 var(--ds-hairline), inset 0 2px 0 rgba(255, 79, 16, .35); }

/* Controls and small parts everywhere */
body.memora-ui :where(.text-button, .text-link, .intro-link, .wizard-exit) { color: var(--op-base) !important; }
body.memora-ui :where(.text-button, .text-link, .intro-link, .wizard-exit):hover { color: #ff7a47 !important; }
body.memora-ui :where(.secondary-button, .icon-button):hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--op-base) !important; }
body.memora-ui :where(.secondary-button, .icon-button) svg { color: #c9c9d1; }
body.memora-ui :where(.secondary-button, .icon-button):hover svg { color: var(--op-base); }
body.memora-ui :where(progress, meter) { accent-color: var(--op-base); }
body.memora-ui :where(hr, .divider) { border: 0; height: 2px; background: linear-gradient(90deg, var(--op-base) 0 28px, transparent 28px), linear-gradient(90deg, var(--op-shift) 0 28px, transparent 28px) 0 3px / 100% 1px no-repeat; opacity: .8; }
body.memora-ui .settings-main .settings-nav button svg { color: #a4a4ae; }
body.memora-ui .settings-main .settings-nav button:is(.active, [aria-selected="true"], :hover) svg { color: var(--op-base); }
body.memora-ui :where(.settings-card, .profile-card, .help-card, .creation-card) { box-shadow: inset 0 0 0 1px var(--ds-hairline), inset 0 2px 0 rgba(255, 79, 16, .55) !important; }
body.memora-ui :where(.visibility-badge.public) { color: var(--op-base); }
body.memora-ui * { scrollbar-color: rgba(255, 79, 16, .55) transparent; }
body.memora-ui ::-webkit-scrollbar-thumb { background: rgba(255, 79, 16, .55); border-radius: 999px; }
body.memora-ui ::-webkit-scrollbar-thumb:hover { background: var(--op-base); }
body.memora-ui .welcome-art-copy .welcome-kicker { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  body.memora-ui .story-card, body.memora-ui .workspace-create, body.memora-ui .shelf-heading h2 a svg { transition: none; }
  body.memora-ui.workspace-catalog .story-card:is(:hover, :focus-within), body.memora-ui .workspace-create:hover { transform: none; }
}

/* Top bar plus, and the muted lines under cards */
body.memora-ui .workspace-topbar :where(a, button) svg { color: var(--op-base); }
body.memora-ui :where(.profile-card, .settings-card) :where(small, .meta, .profile-meta, .profile-stats) { color: #b2b2bc !important; font-size: 12px; }

/* Same search icon colour in every field, and the group counter carries the accent */
body.memora-ui :where(.search-field, .search-box, .workspace-history-search, .group-search, .character-search) svg,
body.memora-ui.page-group-builder :where(label, .search) svg { color: var(--op-base); }
body.memora-ui.page-group-builder :where(.selection-count) { color: var(--op-base) !important; font-family: var(--op-mono) !important; }

/* Character page */
body.memora-ui :where(.author-link) { color: var(--op-base) !important; text-decoration: underline; text-decoration-color: var(--op-shift); text-decoration-thickness: 1px; text-underline-offset: 4px; }
body.memora-ui :where(.author-link):hover { text-decoration-thickness: 2px; }
body.memora-ui :where(.character-tags, .tag-list, [class*="character-tag"]) :where(span, a, button) {
  font-family: var(--op-mono) !important; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #ff6a36 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 79, 16, .5) !important; background: transparent !important;
}

/* Persona picker dialog */
body.memora-ui .chat-persona-primary {
  background: var(--op-base) !important; color: var(--op-on-base) !important; border: 1px solid var(--op-base) !important;
  box-shadow: 3px 3px 0 var(--op-shift) !important; font-weight: 650;
}
body.memora-ui .chat-persona-primary:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--op-shift) !important; }
body.memora-ui .chat-persona-secondary:hover { box-shadow: inset 0 0 0 1px var(--op-base) !important; }
body.memora-ui .chat-persona-choice:has(input:checked) { background: var(--op-tint) !important; box-shadow: inset 0 0 0 1px var(--op-base) !important; }
body.memora-ui input[type="radio"], body.memora-ui input[type="checkbox"] { accent-color: var(--op-base); }

/* Chat send button */
body.memora-ui.workspace-chat .composer :where(button[type="submit"], .send-button, #sendButton):not(:disabled) {
  background: var(--op-base) !important; color: var(--op-on-base) !important; box-shadow: 2px 2px 0 var(--op-shift) !important;
}

/* Radio inside a choice card: the card carries the focus, not a blue ring on the dot */
body.memora-ui .chat-persona-choice input[type="radio"]:focus-visible { outline: none !important; }
body.memora-ui .chat-persona-choice:has(input:focus-visible) { box-shadow: inset 0 0 0 1px var(--op-base), 2px 2px 0 var(--op-halo) !important; }

/* Model picker in the composer: the label was dark on dark. */
body.memora-ui .composer .chat-model-trigger strong { color: #f1f1f3 !important; }
body.memora-ui .composer .chat-model-trigger span { color: #a4a4ae !important; }

/* ---------- BETA mark ----------
   Orange outline and orange letters, with the pink offset as the second ink. */
body.memora-ui.memora-ui .workspace-brand::after, body.memora-ui.memora-ui .workspace-mobile-brand::after,
body.memora-ui.memora-ui .brand-wordmark::after, body.memora-ui.memora-ui .brand-beta-label::after,
body.memora-ui.memora-ui .welcome-brand .welcome-beta {
  color: var(--op-base) !important; background: transparent !important;
  box-shadow: inset 0 0 0 1px var(--op-base), 2px 2px 0 var(--op-shift) !important;
  font-family: "Syne", sans-serif !important; font-weight: 800; letter-spacing: 0;
}
body.memora-ui .welcome-brand .welcome-beta { border-color: var(--op-base) !important; }

/* ---------- Avatar ring ----------
   Every avatar gets a thin orange ring, separated from the picture by a black gap. */
body.memora-ui :where(
  .workspace-account-avatar, .workspace-recent-avatar, .chat-avatar, .message-avatar, .rail-avatar, .mobile-avatar,
  .comment-avatar, .author-avatar, .chat-persona-avatar, .participant-avatar, .result-avatar, .selected-avatar,
  .summary-avatar, .persona-avatar-preview, .public-profile-avatar, .character-visual
) {
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base) !important;
}
/* Overlapping stacks need the gap on the dark side only, or the rings cut into each other. */
body.memora-ui .participant-avatar { border-color: #000 !important; box-shadow: 0 0 0 1px var(--op-base) !important; }
/* Small avatars: thinner gap so the ring does not crowd the picture. */
body.memora-ui :where(.workspace-recent-avatar, .comment-avatar, .message-avatar, .mobile-avatar, .selected-avatar) {
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--op-base) !important;
}

/* ---------- Avatar rings, final pass ----------
   Plain avatars get a quiet neutral ring. Orange is reserved for the current chat,
   a selected participant and the hero portrait. */
body.memora-ui :where(
  .workspace-account-avatar, .workspace-recent-avatar, .chat-avatar, .message-avatar, .rail-avatar, .mobile-avatar,
  .comment-avatar, .author-avatar, .chat-persona-avatar, .participant-avatar, .result-avatar, .selected-avatar,
  .summary-avatar, .persona-avatar-preview, .public-profile-avatar
) {
  box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(255, 255, 255, .24) !important;
}
body.memora-ui :where(.workspace-recent-avatar, .comment-avatar, .message-avatar, .mobile-avatar, .selected-avatar) {
  box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(255, 255, 255, .24) !important;
}
body.memora-ui .participant-avatar { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) !important; border-color: #000 !important; }
body.memora-ui .character-visual { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base) !important; }
body.memora-ui :where(.workspace-recent-item, .chat-item, .chat-row):is(.active, .is-active, [aria-current]) :where(.workspace-recent-avatar, .chat-avatar) {
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--op-base) !important;
}
body.memora-ui.page-group-builder :where(.character-result.is-selected) .result-avatar,
body.memora-ui :where(.chat-persona-choice:has(input:checked)) .chat-persona-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base) !important;
}

/* Recent items are plain rows, not underlined links. */
body.memora-ui .workspace-recent-item { text-decoration: none !important; }

/* Icons inside orange primary buttons stay dark, or they vanish into the fill. */
body.memora-ui :where(.primary-button, .primary-action, .button.primary, .welcome-submit, .comment-submit, .ui-primary, .chat-persona-primary, .promo-cta) svg { color: var(--op-on-base) !important; }

/* The user's own account avatar keeps the orange accent. */
body.memora-ui .workspace-account-avatar { box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--op-base) !important; }

/* ---------- Banner: overprint style ----------
   Black surface and hairline, like every other card. The orange/pink second ink shows in
   the eyebrow tick, the accent word, the CTA and a faint glow behind the art. No per-slide
   colour gradients, no photo backgrounds. */
body.memora-ui .promo-carousel .promo-stage .promo-slide,
body.memora-ui .promo-carousel .promo-slide.promo-stories,
body.memora-ui .promo-carousel .promo-slide.promo-worlds,
body.memora-ui .promo-carousel .promo-slide.promo-personas {
  background:
    radial-gradient(110% 130% at 85% 22%, rgba(255, 79, 16, .16), transparent 52%),
    radial-gradient(90% 90% at 6% 104%, rgba(255, 46, 99, .10), transparent 56%),
    linear-gradient(180deg, #0b0b0d 0%, #000 100%) !important;
}
/* no gradient or photo overlays on top of the slide */
body.memora-ui .promo-carousel .promo-stage .promo-slide::before,
body.memora-ui .promo-carousel .promo-stage .promo-slide::after { display: none !important; }
/* photo slides show the same art as everyone else */
body.memora-ui .promo-carousel .promo-stories .promo-art,
body.memora-ui .promo-carousel .promo-worlds .promo-art { display: flex !important; }
body.memora-ui .promo-carousel .promo-stories .promo-copy,
body.memora-ui .promo-carousel .promo-worlds .promo-copy { width: 34%; }
/* title in the display serif; the accent word in the pink second ink */
body.memora-ui #promoCarousel .promo-copy h2 {
  font-family: var(--ds-font-display) !important; font-weight: 500 !important; letter-spacing: -.02em !important;
}
body.memora-ui #promoCarousel .promo-copy h2 em { font-style: italic !important; color: var(--op-shift) !important; }
/* subtitle muted */
body.memora-ui .promo-carousel .promo-copy p { color: #b2b2bc; }
/* eyebrow tick in the two inks */
body.memora-ui .promo-carousel .promo-eyebrow::before {
  width: 22px; height: 2px; box-shadow: none;
  background: linear-gradient(90deg, var(--op-base) 0 60%, var(--op-shift) 60% 100%);
}

/* ---------- Profile tabs: orange edge only, no white stripe/underline ---------- */
body.memora-ui .public-profile-tab { outline: none !important; border: 0 !important; box-shadow: none !important; }
body.memora-ui .public-profile-tab:focus,
body.memora-ui .public-profile-tab:focus-visible { outline: none !important; box-shadow: none !important; }
body.memora-ui .public-profile-tab::before,
body.memora-ui .public-profile-tab::after { display: none !important; }
body.memora-ui .public-profile-tab.active,
body.memora-ui .public-profile-tab[aria-selected="true"] {
  background: var(--op-tint) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px var(--op-base) !important;
}

/* ---------- App brand mark: 3D accent on the "M" letter ---------- */
body.memora-ui .workspace-brand > b {
  text-shadow: 2px 2px 0 var(--op-shift), 4px 4px 0 rgba(0, 0, 0, .45);
}

body.memora-ui .auth-dialog .auth-code-hint {
  margin: 0 0 0.9rem; color: var(--op-muted, #9c9ca8); font-size: 0.92rem; line-height: 1.55;
}
body.memora-ui .auth-dialog .auth-code-hint b { color: var(--op-on-surface, #f2f2f5); font-weight: 650; }
body.memora-ui .auth-dialog .auth-code-resend {
  display: block; width: 100%; margin: 0.7rem auto 0; padding: 0.55rem 0.2rem;
  border: 0; background: transparent; color: var(--op-base); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
body.memora-ui .auth-dialog .auth-code-resend:hover { text-decoration: underline; }
body.memora-ui .auth-dialog .auth-code-resend:disabled { color: var(--op-muted, #9c9ca8); cursor: default; text-decoration: none; opacity: 0.8; }
