/* accessme.ai brand alignment (loaded after landing.css) */
/* Tokens copied from https://accessme.ai/css/site.css :root */
:root {
  --am-bg: #F8F5EE;
  --am-bg-alt: #F0EBDF;
  --am-surface: #FFFFFF;
  --am-surface-alt: #F0EBDF;
  --am-border: #E3DED1;
  --am-text: #0F1830;
  --am-text-2: #3A4259;
  --am-text-muted: #5F6577;
  --am-accent: #0F1830;
  --am-accent-hover: #1B2747;
  --am-accent-soft: #F1EADB;
  --am-accent-2: #2B3A5C;
  --am-teal-soft: #E6EAF1;
  --am-gold: #B39B72;
  --am-gold-soft: #F1EADB;
  --am-midnight: #0F1830;
  --am-midnight-hover: #1B2747;
  --am-ivory: #F8F5EE;
  --am-ivory-deep: #F0EBDF;
  --am-champagne: #B39B72;
  --am-champagne-deep: #A88F64;
  --am-champagne-text: #6F5B38;
  --am-champagne-soft: #F1EADB;
  --am-slate: #2B3A5C;
  --am-slate-soft: #E6EAF1;
  --am-error: #8E2F2F;
  --am-accent-gradient: var(--am-accent);
  --am-radius: 18px;
  --am-radius-sm: 12px;
  --am-shadow: 0 10px 30px rgba(15, 24, 48, 0.08), 0 1px 2px rgba(15, 24, 48, 0.06);
  --am-shadow-lg: 0 30px 60px rgba(15, 24, 48, 0.14), 0 2px 6px rgba(15, 24, 48, 0.06);
  --am-font-display: "Plus Jakarta Sans", "Inter", "Noto Sans KR", system-ui, sans-serif;
  --am-font-body: "Inter", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light;
}

body.am-body { background-color: var(--am-bg); color: var(--am-text); font-family: var(--am-font-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.am-navbar { background-color: rgba(248, 245, 238, .85) !important; backdrop-filter: saturate(160%) blur(12px); }
.am-hero, .am-final-cta { background: none; }
.am-chat-card { box-shadow: var(--am-shadow-lg); }
.am-chat-user { background: var(--am-accent); }
a.am-contribute-option:hover, .am-contribute-option.is-active { border-color: var(--am-accent); }
.am-contribute-status { border-left-color: var(--am-accent); }
.am-badge-soon { background: var(--am-accent-soft); }
.am-btn-retry { border-color: var(--am-accent); color: var(--am-accent); }
.am-btn-retry:hover { background: var(--am-accent); color: #fff; }
body.am-body h1, body.am-body h2, body.am-body h3,
.am-hero h1, .am-dashboard-header h1, .am-navbar .navbar-brand {
  font-family: var(--am-font-display);
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: var(--am-text);
}
body.am-body h4, body.am-body h5, body.am-body h6 { color: var(--am-text); font-weight: 600; }
body.am-body a { color: var(--am-accent); }
body.am-body a:hover { color: var(--am-accent-hover); }
body.am-body a.am-btn-primary, body.am-body a.btn-primary { color: #fff; }
body.am-body .text-muted, body.am-body .form-text { color: var(--am-text-muted) !important; }

.am-btn-primary { background: var(--am-accent); box-shadow: 0 6px 18px rgba(15,24,48,.22); }
.am-btn-primary:hover { background: var(--am-accent-hover); }
.am-btn-ghost { background: var(--am-surface); color: var(--am-text) !important; }
.am-btn-ghost:hover { border-color: var(--am-text); }

body.am-body .card,
body.am-body .modal-content,
body.am-body .dropdown-menu {
  background: var(--am-surface);
  color: var(--am-text);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  box-shadow: var(--am-shadow);
}

body.am-body .form-control,
body.am-body .form-select,
body.am-body textarea {
  background-color: var(--am-surface);
  color: var(--am-text);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius-sm);
}
body.am-body .form-control:focus,
body.am-body .form-select:focus,
body.am-body textarea:focus {
  background-color: var(--am-surface);
  color: var(--am-text);
  border-color: var(--am-accent);
  box-shadow: 0 0 0 .2rem var(--am-accent-soft);
}
body.am-body .form-control::placeholder, body.am-body textarea::placeholder { color: var(--am-text-muted); }
body.am-body .form-floating > label { color: var(--am-text-muted); }
body.am-body .form-check-input:checked { background-color: var(--am-accent); border-color: var(--am-accent); }

body.am-body .btn-primary { background: var(--am-accent); border-color: var(--am-accent); border-radius: 999px; font-weight: 600; }
body.am-body .btn-primary:hover { background: var(--am-accent-hover); border-color: var(--am-accent-hover); }
body.am-body .btn-outline-secondary, body.am-body .btn-secondary {
  color: var(--am-text); background: transparent; border-color: var(--am-border); border-radius: 999px;
}
body.am-body .btn-outline-secondary:hover, body.am-body .btn-secondary:hover {
  border-color: var(--am-text); background: var(--am-bg-alt); color: var(--am-text);
}

body.am-body .alert-success { background: var(--am-teal-soft); color: var(--am-accent-2); border-color: transparent; }
body.am-body .alert-danger { background: var(--am-accent-soft); color: #B4432A; border-color: transparent; }
body.am-body .text-danger { color: #B4432A !important; }
body.am-body .alert-warning, body.am-body .alert-info { background: var(--am-gold-soft); color: #7a5a1c; border-color: transparent; }

body.am-body .table { --bs-table-bg: transparent; --bs-table-color: var(--am-text); border-color: var(--am-border); }

.am-navbar { border-bottom: 1px solid var(--am-border); }
.am-navbar .nav-link { color: var(--am-text-2) !important; font-weight: 500; }
.am-navbar .nav-link:hover { color: var(--am-text) !important; }

.am-footer { border-top: 1px solid var(--am-border); color: var(--am-text-muted); background: var(--am-bg-alt); }

.am-twin-card, .am-price-card, .am-contribute-option { box-shadow: var(--am-shadow); }
.am-twin-card:hover, .am-price-card:hover { box-shadow: var(--am-shadow-lg); }
.am-chat-twin { background: var(--am-bg-alt); color: var(--am-text); }

/* Dashboard twin card: Contribute is the primary action. */
.am-twin-card-cta { display: flex; width: 100%; justify-content: center; margin-top: 1rem; }
.am-twin-card-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.am-twin-card-actions > a { flex: 1 1 0; text-align: center; }
.am-twin-card-public { margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--am-border); font-size: .9rem; text-align: center; }
.am-twin-card-public a { font-weight: 600; text-decoration: none; }
.am-twin-card-public a:hover { text-decoration: underline; }

/* Public twin page: mobile-first, chat-first. */
.am-public { padding: 0; color: var(--am-text); }
.am-public-shell {
  display: flex; flex-direction: column; max-width: 760px; margin: 0 auto;
  height: 100dvh; min-height: 420px; padding: .75rem .75rem calc(.75rem + env(safe-area-inset-bottom));
}
.am-public p, .am-public-intro-text, .am-chat-twin, .am-public-input { color: var(--am-text); }
.am-public-input::placeholder { color: var(--am-text-muted); }
.am-public-back { align-self: flex-start; margin-bottom: .5rem; font-size: .75rem; text-decoration: none; opacity: .6; color: var(--am-text) !important; }
.am-public-back:hover { opacity: 1; color: var(--am-accent) !important; }
.am-public-header { display: flex; align-items: center; gap: .75rem; padding: .25rem 0 .75rem; border-bottom: 1px solid var(--am-border); }
.am-public-avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; object-fit: cover; }
.am-public-avatar-initial { display: flex; align-items: center; justify-content: center; background: var(--am-accent); color: #fff; font-weight: 700; font-size: 1.25rem; }
.am-public-id h1 { font-size: 1.2rem; margin: 0; line-height: 1.2; }
.am-public-id p { margin: 0; font-size: .85rem; color: var(--am-text-muted); }
.am-public-log { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: .6rem; padding: 1rem 0; }
.am-public-log .am-chat-msg { max-width: 88%; white-space: pre-wrap; word-wrap: break-word; }
.am-public-intro { color: var(--am-text-2); font-size: .95rem; }
.am-public-intro.is-compact > p { display: none; }
.am-public-tagline { font-weight: 600; color: var(--am-text); }
.am-public-form { display: flex; align-items: flex-end; gap: .5rem; padding-top: .5rem; border-top: 1px solid var(--am-border); }
.am-public-input { flex: 1 1 auto; resize: none; min-height: 44px; max-height: 160px; font-size: 16px; /* prevents iOS zoom */ }
.am-public-send { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0 1rem; }
.am-public-meta { margin: .4rem 0 0; font-size: .8rem; text-align: center; color: var(--am-text-muted); }
.am-public-gate { border: 1px solid var(--am-border); border-radius: 16px; padding: 1rem; text-align: center; background: var(--am-bg-alt); }
.am-voice-call { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding-top: .5rem; }
.am-voice-start { flex: 0 0 auto; min-height: 44px; padding: 0 .9rem; white-space: nowrap; }
.am-voice-active { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem; font-size: .9rem; }
.am-voice-active button { min-height: 44px; }
.am-voice-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #d33; animation: am-voice-pulse 1.4s ease-in-out infinite; }
.am-voice-timer { font-variant-numeric: tabular-nums; color: var(--am-text-muted); }
.am-voice-timer.is-low { color: #d33; font-weight: 600; }
.am-voice-error { margin: 0; font-size: .85rem; color: #d33; text-align: center; }
.am-voice-options { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; margin: 0; padding: 0; border: 0; font-size: .85rem; color: var(--am-text-muted); }
.am-voice-options label { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; cursor: pointer; }
.am-voice-options label.is-implied { opacity: .7; cursor: default; }
.am-voice-options label.is-implied span::after { content: " (on via Tap to talk)"; }
.am-voice-ptt { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 64px; min-width: min(100%, 280px); padding: .75rem 1.5rem; border: 2px dashed var(--am-border); border-radius: 999px; background: var(--am-bg-alt); color: var(--am-text); font-size: 1.1rem; font-weight: 700; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.am-voice-ptt.is-open { border: 3px solid #d33; background: #fdecec; color: #8a1010; }
.am-voice-ptt:focus-visible { outline: 3px solid var(--am-text); outline-offset: 3px; }
.am-voice-ptt-icon { font-size: 1.4rem; }
.am-voice-interrupt { min-height: 44px; font-size: .85rem; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@keyframes am-voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce)
.am-public-gate h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.am-public-gate p { font-size: .9rem; margin-bottom: .75rem; }
.am-public-gate-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.am-public-gate-actions > a { flex: 1 1 140px; text-align: center; min-height: 44px; }
.am-chat-modes { display: flex; gap: .25rem; padding: .25rem; margin-bottom: .5rem; border: 1px solid var(--am-border); border-radius: 999px; background: var(--am-bg-alt); }
.am-chat-mode { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--am-text-muted); font-weight: 600; cursor: pointer; }
.am-chat-mode.is-active { background: var(--am-accent); color: #fff; }
.am-chat-mode[data-mode="private"].is-active { background: #2B3A5C; }
.am-chat-mode-banner { margin-bottom: .5rem; padding: .6rem .8rem; border-radius: 12px; font-size: .85rem; border: 1px solid var(--am-border); background: var(--am-bg-alt); }
.am-chat-mode-banner.is-private { border-color: #2B3A5C; background: #E6EAF1; color: #2B3A5C; }
.am-public-log.is-private { outline: 2px dashed #2B3A5C; outline-offset: 4px; border-radius: 12px; }
/* Live Join: the real Original's own messages must never look like the twin's. */
.am-live-join-disclosure { display: flex; gap: .5rem; align-items: center; }
.am-chat-original { align-self: flex-start; max-width: 85%; padding: .6rem .8rem; border-radius: 12px; border: 2px solid var(--am-accent, #0F1830); background: var(--am-surface, #fff); color: var(--am-text); white-space: pre-wrap; }
.am-chat-original-head { display: flex; gap: .4rem; align-items: center; margin-bottom: .25rem; font-size: .8rem; font-weight: 600; }
.am-chat-original-photo { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.am-chat-original-badge { margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--am-accent, #0F1830); color: #fff; }
.am-chat-event { align-self: center; margin: .25rem 0; font-size: .8rem; font-style: italic; color: var(--am-text-muted); text-align: center; }
.am-public-form.is-private .am-public-input { border-color: #2B3A5C; }
.am-memory-link { display: flex; justify-content: flex-end; margin-bottom: .5rem; }
.am-memory-open { font-size: .85rem; padding: .35rem .8rem; border: 1px solid var(--am-border); border-radius: 999px; cursor: pointer; }
.am-btn-ghost.am-memory-open { display: inline-flex; max-width: 100%; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; text-align: left; height: auto; line-height: 1.3; }
.am-memory-dialog { width: min(560px, calc(100vw - 2rem)); max-height: min(80vh, 720px); padding: 1rem 1.25rem; border: 1px solid var(--am-border); border-radius: 16px; background: var(--am-surface); color: var(--am-text); }
.am-memory-dialog::backdrop { background: rgba(15, 24, 48, .45); }
.am-memory-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.am-memory-head h2 { font-size: 1.1rem; margin: 0; }
.am-memory-close { border: 0; background: transparent; color: var(--am-text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; }
.am-memory-note { font-size: .85rem; color: var(--am-text-muted); margin: .5rem 0; }
.am-memory-note:empty { display: none; }
.am-memory-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.am-memory-item { border: 1px solid var(--am-border); border-radius: 12px; padding: .6rem .8rem; background: var(--am-bg-alt); }
.am-memory-type { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--am-text-muted); }
.am-memory-text { margin: .2rem 0 .4rem; }
.am-memory-item textarea { width: 100%; margin-bottom: .4rem; }
.am-memory-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.am-memory-actions button { font-size: .8rem; padding: .3rem .8rem; border: 1px solid var(--am-border); border-radius: 999px; cursor: pointer; }
.am-memory-delete { color: #8E2F2F !important; }
.am-memory-error { color: #8E2F2F; font-size: .8rem; margin: .3rem 0 0; }
@media (min-width: 768px) {
  .am-public-shell { padding-top: 1.5rem; }
  .am-public-avatar { width: 64px; height: 64px; flex-basis: 64px; }
  .am-public-id h1 { font-size: 1.5rem; }
  .am-public-log .am-chat-msg { max-width: 75%; }
}

/* Public chat log: soft card that matches the message input, with friendly scrollbars */
.am-public-log {
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  border-radius: var(--am-radius);
  box-shadow: 0 1px 2px rgba(15,24,48,.04), 0 4px 16px rgba(15,24,48,.04);
  padding: 1rem .9rem;
  margin: .75rem 0;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--am-text-muted) 45%, transparent) transparent;
  scroll-behavior: smooth;
}
.am-public-log::-webkit-scrollbar { width: 8px; }
.am-public-log::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.am-public-log::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--am-text-muted) 40%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.am-public-log::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--am-accent) 70%, transparent);
  background-clip: padding-box;
}
.am-public-form { border-top: none; padding-top: 0; }
.am-public-input {
  border-radius: var(--am-radius);
  box-shadow: 0 1px 2px rgba(15,24,48,.04);
  transition: border-color .15s ease, box-shadow .15s ease;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--am-text-muted) 45%, transparent) transparent;
}
.am-public-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--am-accent) 18%, transparent); }
.am-public-input::-webkit-scrollbar { width: 6px; }
.am-public-input::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--am-text-muted) 40%, transparent); border-radius: 999px; }
.am-public-send { border-radius: var(--am-radius); }
@media (prefers-reduced-motion: reduce) { .am-public-log { scroll-behavior: auto; } }
/* Hide chat scrollbars while keeping wheel/touch/keyboard scrolling */
.am-public-log, .am-chat-log { scrollbar-width: none; -ms-overflow-style: none; }
.am-public-log::-webkit-scrollbar, .am-chat-log::-webkit-scrollbar { width: 0; height: 0; display: none; }


.am-public-intro-text { white-space: pre-wrap; margin: .5rem 0 0; color: inherit; opacity: .85; font-size: .95rem; line-height: 1.45; }

/* Public page owner-selected styles */
.am-public-has-twin-bubble .am-chat-twin { background: var(--am-public-twin-bubble); color: var(--am-public-twin-bubble-text, var(--am-text)); }
.am-public-box-outlined .am-public-log { box-shadow: none; border-width: 2px; }
.am-public-box-floating .am-public-log { border-color: transparent; box-shadow: var(--am-shadow-lg); }
.am-public-box-minimal .am-public-log { background: transparent; border: none; box-shadow: none; padding-left: 0; padding-right: 0; }
.am-public-bubble-pill .am-chat-msg { border-radius: 22px; }
.am-public-bubble-square .am-chat-msg { border-radius: 6px; }
.am-chat-user { border-bottom-right-radius: 4px; }
.am-public-bubble-pill .am-chat-twin, .am-public-bubble-square .am-chat-twin { border-bottom-left-radius: 4px; }

/* ---------- Buttons: squarer, roomier, never underlined ---------- */
.am-btn-primary,
.am-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.25;
  letter-spacing: .01em;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

body.am-body .btn {
  padding: .6rem 1.3rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none !important;
}

body.am-body .btn-link,
body.am-body .navbar .btn-link {
  text-decoration: none !important;
}

.am-btn-primary {
  border: 1px solid var(--am-accent);
  box-shadow: 0 1px 2px rgba(15,24,48,.08);
}
.am-btn-primary:hover,
.am-btn-primary:focus-visible {
  transform: none;
  background: var(--am-accent-hover);
  border-color: var(--am-accent-hover);
  box-shadow: 0 2px 6px rgba(15,24,48,.12);
}

.am-btn-ghost {
  border: 1px solid var(--am-border);
}
.am-btn-ghost:hover,
.am-btn-ghost:focus-visible {
  border-color: var(--am-text);
  background: var(--am-surface);
}

.am-btn-primary:focus-visible,
.am-btn-ghost:focus-visible {
  outline: 2px solid var(--am-accent);
  outline-offset: 2px;
}

.am-btn-primary:disabled,
.am-btn-ghost:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Nav-bar buttons stay compact. */
.am-navbar .nav-link.am-btn-primary,
.am-navbar .nav-link.am-btn-ghost {
  padding: .5rem 1.1rem;
  font-size: .9rem;
}

.am-pricing-card .am-btn-primary,
.am-pricing-card .am-btn-ghost { display: flex; width: 100%; }

.am-twin-card-actions .am-btn-ghost,
.am-twin-card-actions .am-btn-primary { padding: .55rem .9rem; font-size: .875rem; }

.am-btn-retry { border-radius: 6px; padding: .25rem .65rem; text-decoration: none; }

/* Segmented button group (dashboard: New twin | Credits | Account). */
.am-btn-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15,24,48,.06);
}
.am-btn-group > .am-btn-primary,
.am-btn-group > .am-btn-ghost {
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.am-btn-group > :not(:first-child) { margin-left: -1px; }
.am-btn-group > :first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.am-btn-group > :last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.am-btn-group > .am-btn-ghost:hover { position: relative; z-index: 1; }

@media (max-width: 575.98px) {
  .am-btn-group { display: flex; width: 100%; }
  .am-btn-group > * { flex: 1; padding-left: .75rem; padding-right: .75rem; }
}

/* Discover (consumer twin library) */
.am-discover-hero { text-align: center; margin-bottom: 2rem; }
.am-discover-search { display: flex; gap: .5rem; max-width: 640px; margin: 1rem auto 0; }
.am-discover-featured { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; margin-bottom: 2rem; }
.am-discover-feature { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--am-radius); overflow: hidden; background: var(--am-accent-soft); color: #fff; text-decoration: none; scroll-snap-align: start; }
.am-discover-feature img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.am-discover-feature:hover img { transform: scale(1.04); }
.am-discover-feature-caption { position: absolute; inset: auto 0 0 0; padding: 1rem 1.25rem; display: flex; flex-direction: column; background: linear-gradient(transparent, rgba(15,24,48,.75)); }
.am-discover-feature-caption strong { font-size: 1.4rem; }
.am-discover-feature-kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.am-discover-row-header { display: flex; align-items: baseline; justify-content: space-between; margin: 1.5rem 0 .75rem; }
.am-discover-row-header h2 { font-size: 1.35rem; margin: 0; }
.am-discover-shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .5rem; }
.am-discover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.25rem; }
.am-discover-tile { display: block; color: var(--am-text); text-decoration: none; scroll-snap-align: start; }
.am-discover-tile-legend { position: relative; }
.am-legend-badge { position: absolute; top: .5rem; left: .5rem; z-index: 2; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; color: #0F1830; background: #B39B72; box-shadow: 0 1px 3px rgba(15,24,48,.25); }
.am-legends { margin: 1.5rem 0 2.5rem; padding: 1.5rem; border-radius: 1rem; border: 1px solid rgba(179,155,114,.45); background: linear-gradient(135deg, rgba(241,234,219,.6), rgba(179,155,114,.08)); }
.am-legends .am-legend-badge { display: none; }
.am-public-intro .am-public-intro-text { margin-bottom: 0; }
.am-intro-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
@media (max-width: 640px) { .am-intro-clamped { -webkit-line-clamp: 2; line-clamp: 2; } }
.am-intro-toggle { background: none; border: 0; padding: 0; margin: .15rem 0 .5rem; color: var(--am-accent); font-weight: 600; cursor: pointer; }
.am-legends-header { margin-bottom: 1rem; }
.am-legends-header h2 { margin: .25rem 0; font-family: var(--am-font-display); letter-spacing: -0.02em; }
.am-legends-header p { margin: 0; color: var(--am-text-muted); }
.am-legends-kicker { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #6F5B38; }
.am-community-header { margin: 1rem 0 1.5rem; }
.am-community-header h2 { margin-bottom: .25rem; }
.am-discover-art { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--am-accent-soft); display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 600; color: var(--am-accent); box-shadow: 0 4px 14px rgba(15,24,48,.08); transition: transform .2s, box-shadow .2s; }
.am-discover-art img { width: 100%; height: 100%; object-fit: cover; }
.am-discover-tile:hover .am-discover-art { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,24,48,.16); }
.am-discover-badge { position: absolute; top: .5rem; left: .5rem; font-size: .7rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--am-text); }
.am-discover-name { margin-top: .5rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-discover-sub { font-size: .85rem; color: var(--am-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Twin banners (3:1 cover with the avatar overlapping the lower-left, LinkedIn-style) */
.am-twin-banner { position: relative; margin-bottom: 2.75rem; }
.am-twin-banner-image { aspect-ratio: 3 / 1; border-radius: var(--am-radius); overflow: hidden; background: linear-gradient(135deg, var(--am-accent-soft), var(--am-bg-alt, var(--am-accent-soft))); }
.am-twin-banner-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.am-twin-banner-avatar { position: absolute; left: 1.25rem; bottom: -2.25rem; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 4px solid var(--am-surface, #fff); background: var(--am-surface, #fff); box-shadow: 0 4px 14px rgba(15,24,48,.18); }
.am-twin-banner-avatar.am-public-avatar-initial { font-size: 2rem; }
.am-twin-banner-preview { max-width: 600px; }
.am-public-header-with-banner { padding-top: 0; }
@media (min-width: 768px) {
  .am-twin-banner { margin-bottom: 3.5rem; }
  .am-twin-banner-avatar { width: 120px; height: 120px; bottom: -3rem; left: 1.75rem; }
}

/* Discover: featured banner card — banner is the hero, avatar overlaps its lower-left */
.am-discover-feature-banner { overflow: visible; aspect-ratio: auto; background: none; }
.am-discover-feature-banner > img:first-child { display: block; width: 100%; aspect-ratio: 3 / 1; height: auto; border-radius: var(--am-radius); }
.am-discover-feature-banner:hover > img:first-child { transform: none; filter: brightness(1.05); }
.am-discover-feature-banner .am-discover-feature-avatar { position: absolute; left: 1rem; bottom: 2.25rem; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(15,24,48,.25); transform: none; }
.am-discover-feature-banner .am-discover-feature-caption { position: static; background: none; color: var(--am-text); padding: .5rem 0 0 6rem; min-height: 3rem; }
.am-discover-feature-banner .am-discover-feature-kicker { color: var(--am-text-muted); }
.am-discover-feature-banner .am-discover-feature-caption strong { font-size: 1.15rem; }

/* Discover: shelf tile with banner */
.am-discover-art-banner { overflow: visible; aspect-ratio: auto; background: none; box-shadow: none; display: block; }
.am-discover-art-banner > img:first-child { display: block; width: 100%; aspect-ratio: 3 / 1; height: auto; object-fit: cover; border-radius: 14px; box-shadow: 0 4px 14px rgba(15,24,48,.08); }
.am-discover-art-banner .am-discover-art-avatar { position: absolute; left: .5rem; bottom: -1.25rem; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 3px solid var(--am-surface, #fff); box-shadow: 0 2px 8px rgba(15,24,48,.2); }
.am-discover-art-banner + .am-discover-name { margin-top: 1.6rem; }

@media (max-width: 767.98px) {
  .am-discover-featured { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; scroll-snap-type: none; }
  .am-discover-feature-caption strong, .am-discover-feature-caption span { overflow-wrap: anywhere; }
  .am-discover-shelf { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow-x: visible; scroll-snap-type: none; }
}


/* Top nav: credits chip + avatar */
.am-navbar .nav-link.am-credit-chip { display: inline-flex; align-items: center; padding: .2rem .7rem; border-radius: 999px; background: var(--am-gold-soft); border: 1px solid var(--am-border); font-size: .85rem; white-space: nowrap; }
.am-navbar .nav-link.am-credit-chip:hover { border-color: var(--am-text); }
.am-navbar .am-avatar-toggle { display: inline-flex; align-items: center; gap: .25rem; }
.am-nav-avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--am-accent-soft); color: var(--am-accent-hover); font-weight: 600; font-size: .85rem; letter-spacing: .02em; }
.am-navbar .nav-link.active { color: var(--am-text) !important; }
@media (max-width: 575.98px) { .am-navbar .navbar-nav { align-items: flex-start !important; } .am-navbar .dropdown-menu { position: static; box-shadow: none; } .am-navbar .nav-link.am-credit-chip { align-self: flex-start; } }

/* Twin card actions wrap so the Gatekeeper-only Scoring button fits */
.am-twin-card-actions { flex-wrap: wrap; }
.am-twin-card-actions > a { flex: 1 1 auto; white-space: nowrap; }
.am-twin-card-actions .am-btn-ghost,
.am-twin-card-actions .am-btn-primary { padding: .55rem .9rem; }

/* User Agreement: public page, interstitial and print */
.am-legal .container { max-width: 46rem; }
.am-legal-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--am-text-muted); font-size: .9rem; margin-bottom: 1rem; }
.am-legal-meta .am-btn-ghost { margin-left: auto; padding: .3rem .8rem; }
.am-legal-body { line-height: 1.65; color: var(--am-text); overflow-wrap: anywhere; }
.am-legal-body h1 { font-size: 1.9rem; margin-bottom: .5rem; }
.am-legal-body h2 { font-size: 1.3rem; margin-top: 2rem; }
.am-legal-body h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.am-legal-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1rem 0; font-size: .92rem; }
.am-legal-body th, .am-legal-body td { border: 1px solid var(--am-border); padding: .5rem .65rem; vertical-align: top; min-width: 8rem; }
.am-legal-body th { background: var(--am-surface-alt); }
.am-legal-scroll { max-height: 55vh; overflow-y: auto; background: var(--am-surface); border: 1px solid var(--am-border); border-radius: var(--am-radius); padding: 1.25rem 1.5rem; }
@media print {
  .am-navbar, .am-footer, header, footer { display: none !important; }
  .am-body { background: #fff; }
  .am-legal .container { max-width: none; }
  .am-legal-body { font-size: 11pt; line-height: 1.45; color: #0F1830; }
  .am-legal-body table { display: table; overflow: visible; }
  .am-legal-body h2, .am-legal-body h3 { break-after: avoid; }
  .am-legal-body tr, .am-legal-body p, .am-legal-body li { break-inside: avoid; }
  .am-legal-scroll { max-height: none; overflow: visible; border: 0; padding: 0; }
}

/* AccessMe brand v1.0: logo, links, focus, alerts */
.am-navbar .navbar-brand.am-logo { display: inline-flex; align-items: center; padding: 0; }
.am-navbar .navbar-brand.am-logo img { display: block; height: 28px; width: auto; }
body.am-body a:not(.am-btn-primary):not(.btn):hover { color: var(--am-champagne-text); }
body.am-body .am-highlight, body.am-body h1 em, body.am-body h2 em { color: var(--am-champagne-text); }
.am-btn-primary:focus-visible, .am-btn-ghost:focus-visible, body.am-body .btn:focus-visible,
body.am-body a:focus-visible, body.am-body .form-control:focus, body.am-body .form-select:focus,
body.am-body .form-check-input:focus { outline: 2px solid var(--am-slate); outline-offset: 2px; box-shadow: none; }
body.am-body .form-check-input:checked { background-color: var(--am-midnight); border-color: var(--am-midnight); }
body.am-body .form-control:focus, body.am-body .form-select:focus { border-color: var(--am-slate); }
body.am-body .progress-bar { background-color: var(--am-slate); }
body.am-body .btn-primary { background-color: var(--am-midnight); border-color: var(--am-midnight); color: var(--am-ivory); }
body.am-body .btn-primary:hover, body.am-body .btn-primary:active { background-color: var(--am-midnight-hover); border-color: var(--am-midnight-hover); }
body.am-body .btn-outline-primary { color: var(--am-midnight); border-color: var(--am-border); }
body.am-body .btn-outline-primary:hover { background: var(--am-surface); color: var(--am-midnight); border-color: var(--am-text-2); }
body.am-body .btn-danger { background-color: var(--am-error); border-color: var(--am-error); }
body.am-body .text-danger { color: var(--am-error) !important; }
body.am-body .text-success { color: var(--am-slate) !important; }
body.am-body .alert-info, body.am-body .alert-success { background: var(--am-slate-soft); color: var(--am-slate); border-color: #C9D1E0; }
body.am-body .alert-warning { background: var(--am-champagne-soft); color: var(--am-champagne-text); border-color: #DDD0B4; }
body.am-body .alert-danger { background: #F6E9E7; color: var(--am-error); border-color: #E7CFCB; }
body.am-body .badge.bg-success, body.am-body .badge.bg-info { background-color: var(--am-slate) !important; }
body.am-body .badge.bg-warning { background-color: var(--am-champagne-soft) !important; color: var(--am-champagne-text) !important; }
body.am-body .badge.bg-primary { background-color: var(--am-midnight) !important; }
.am-powered-by img { height: 18px; width: auto; vertical-align: middle; }
.am-btn-primary, .am-btn-primary:hover, .am-btn-primary:focus, .am-btn-primary:active, .am-btn-primary:visited,
body.am-body a.am-btn-primary, body.am-body a.am-btn-primary:hover, body.am-body .nav-link.am-btn-primary,
body.am-body .navbar .nav-link.am-btn-primary:hover, body.am-body .navbar .nav-link.am-btn-primary:focus { color: var(--am-ivory) !important; }

/* Orange action color for primary buttons and chat (kept from the original brand) */
:root { --am-orange: #D9683B; --am-orange-hover: #C55A2F; }
.am-btn-primary, body.am-body .nav-link.am-btn-primary { background: var(--am-orange) !important; border-color: var(--am-orange) !important; box-shadow: 0 6px 18px rgba(217,104,59,.28); }
.am-btn-primary:hover, .am-btn-primary:focus, .am-btn-primary:active, body.am-body .nav-link.am-btn-primary:hover { background: var(--am-orange-hover) !important; border-color: var(--am-orange-hover) !important; }
.am-chat-avatar, .am-msg.out, .am-chat-user { background: var(--am-orange) !important; color: #fff !important; }
.am-msg.out .time { color: rgba(255,255,255,.8) !important; }

/* Studio shell: left sidebar (desktop) / offcanvas drawer (below lg). */
.am-studio-shell { display: flex; align-items: flex-start; min-width: 0; }
.am-studio-main { flex: 1 1 auto; min-width: 0; }
.am-studio-sidebar { background: var(--bg, var(--am-bg)); color: var(--ink, var(--am-text)); }
.am-studio-nav { padding: 1rem .75rem 1.5rem; }
.am-studio-org-wrap { margin-bottom: .75rem; }
.am-studio-org { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 44px; padding: .5rem; margin-bottom: .75rem; border-radius: 10px; text-align: left; color: var(--ink, var(--am-text)); background: transparent; border: 1px solid transparent; font: inherit; }
.am-studio-org-wrap .am-studio-org { margin-bottom: 0; }
.am-studio-org-switch { cursor: pointer; }
.am-studio-org-switch:hover { background: var(--surface, var(--am-surface)); border-color: var(--line, var(--am-border)); }
.am-studio-org-switch:focus-visible, .am-studio-close:focus-visible, .am-studio-menu-btn:focus-visible { outline: 2px solid var(--teal, var(--am-slate)); outline-offset: 2px; }
.am-studio-org-tile { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); font-family: var(--am-font-display); font-weight: 700; }
.am-studio-org-name { flex: 1 1 auto; min-width: 0; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.am-studio-org-caret { flex: 0 0 auto; color: var(--muted, var(--am-text-muted)); }
.am-studio-org-menu { min-width: 100%; max-width: calc(100vw - 2rem); }
.am-studio-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
body.am-body a.am-studio-link { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .5rem .75rem; border-radius: 10px; color: var(--ink-2, var(--am-text-2)); text-decoration: none; font-weight: 500; font-size: .95rem; }
body.am-body a.am-studio-link:hover { background: var(--surface, var(--am-surface)); color: var(--ink, var(--am-text)); }
body.am-body a.am-studio-link.active, body.am-body a.am-studio-link.active:hover { background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
.am-studio-link svg { flex: 0 0 auto; }
.am-studio-label { margin: 1.25rem .75rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, var(--am-text-muted)); }
.am-studio-menu-btn, .am-studio-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; margin-right: .25rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink, var(--am-text)); }
.am-studio-menu-btn:hover, .am-studio-close:hover { background: var(--surface, var(--am-surface)); }
.am-studio-drawer-title { font-family: var(--am-font-display); font-weight: 700; }
.am-studio-subtabs .nav-link { min-height: 44px; display: flex; align-items: center; }

/* Studio detail pages: underline tab row (_StudioTabs). One line; scrolls sideways when narrow. */
.am-studio-tabs { margin: 0 0 1.5rem; border-bottom: 1px solid var(--line, var(--am-border)); overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.am-studio-tabs ul { display: flex; flex-wrap: nowrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0 2px; }
.am-studio-tabs li { flex: 0 0 auto; }
body.am-body .am-studio-tabs a { display: flex; align-items: center; min-height: 44px; padding: 0 .1rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted, var(--am-text-muted)); text-decoration: none; white-space: nowrap; font-size: .95rem; font-weight: 500; }
body.am-body .am-studio-tabs a:hover { color: var(--ink, var(--am-text)); }
body.am-body .am-studio-tabs a.active { color: var(--ink, var(--am-text)); border-bottom-color: var(--ink, var(--am-text)); font-weight: 700; }
body.am-body .am-studio-tabs a:focus-visible { outline-offset: -2px; }

/* Studio headings are smaller than audience/marketing pages. */
.am-studio-main .am-section { padding-top: 2rem; padding-bottom: 3rem; }
.am-studio-main .am-dashboard-header { margin-bottom: 1.25rem; }
.am-studio-main .am-dashboard-header h1 { font-size: 2rem; }
.am-studio-main .am-panel-title, .am-studio-main .am-panel h2 { font-size: 1.25rem; }

/* Studio item header: title + type on the left, status menu + Archive on the right; wraps when narrow. */
.am-studio-item-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
.am-studio-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.am-studio-item-title h1 { overflow-wrap: anywhere; }
.am-studio-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.am-studio-status { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .7rem; border-radius: 999px; background: var(--teal-soft, var(--am-slate-soft)); color: var(--teal, var(--am-slate)); font-size: .85rem; font-weight: 600; }
.am-studio-status-toggle { min-height: 44px; padding: 0 1rem; border: 1px solid transparent; font: inherit; font-size: .9rem; font-weight: 600; }
.am-studio-status-toggle:hover { border-color: var(--teal, var(--am-slate)); }
.am-studio-status-toggle:focus-visible, .am-studio-menu-item:focus-visible { outline: 2px solid var(--teal, var(--am-slate)); outline-offset: 2px; }
.am-studio-menu-item { min-height: 44px; }
body.am-body .dropdown-item.am-studio-menu-item.active { background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
.am-studio-archive { min-height: 44px; }
.am-studio-copy { min-height: 44px; }
@media (max-width: 991.98px) {
  .am-studio-sidebar.offcanvas-lg { --bs-offcanvas-width: min(300px, 86vw); background: var(--bg, var(--am-bg)); border-right: 1px solid var(--line, var(--am-border)); }
  .am-studio-sidebar .offcanvas-header { padding: .75rem .75rem 0 1.25rem; }
  .am-studio-sidebar .am-studio-nav { overflow-y: auto; }
}
@media (min-width: 992px) {
  .am-studio-sidebar { flex: 0 0 248px; width: 248px; position: sticky; top: var(--am-topbar-h, 4.25rem); max-height: calc(100vh - var(--am-topbar-h, 4.25rem)); overflow-y: auto; border-right: 1px solid var(--line, var(--am-border)); align-self: flex-start; }
}
@media print { .am-studio-sidebar, .am-studio-menu-btn { display: none !important; } }

/* Twin scoring tabs */
.am-scoring-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.am-scoring-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .1rem; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.am-scoring-tab:hover { color: var(--ink); }
.am-scoring-tab.active { color: var(--ink); border-bottom-color: var(--teal); }
.am-scoring-tab:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Program Insights */
.am-insights-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.am-insights-tile { display: flex; flex-direction: column; padding: .85rem 1rem; background: var(--am-surface); border: 1px solid var(--am-border); border-radius: 10px; }
.am-insights-tile-value { font-size: 1.5rem; font-weight: 600; color: var(--am-text); }
.am-insights-tile-label { font-size: .85rem; color: var(--am-text-muted); }
.am-insights-columns { display: flex; align-items: flex-end; gap: 3px; height: 160px; border-bottom: 1px solid var(--am-border); }
.am-insights-column { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.am-insights-column-bar { flex: 1; background: var(--am-accent); border-radius: 2px 2px 0 0; min-height: 0; }
.am-insights-column-bar-2, .am-insights-key-2 { background: var(--am-slate) !important; }
.am-insights-key { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; background: var(--am-accent); vertical-align: middle; }
.am-insights-bar-row { display: flex; align-items: center; gap: .75rem; padding: .3rem 0; }
.am-insights-bar-label { flex: 0 0 4rem; color: var(--am-text-2); }
.am-insights-bar-label-wide { flex-basis: 14rem; }
.am-insights-bar { flex: 1; height: .65rem; background: var(--am-bg); border: 1px solid var(--am-border); border-radius: 999px; overflow: hidden; }
.am-insights-bar > span { display: block; height: 100%; background: var(--am-accent); }
.am-insights-bar-value { flex: 0 0 auto; min-width: 3rem; text-align: right; color: var(--am-text); }

/* Public twin page, desktop: rail + full-height conversation (not used by the embed widget). */
.am-public-rail, .am-public-main, .am-public-composer { display: contents; }
.am-conv-header, .am-rail-label, .am-conv-foot { display: none; }
.am-session-card { display: contents; }
.am-session-card > .am-session-row, .am-session-card > .am-session-meter { display: none; }
@media (min-width: 992px) { .am-public-split .am-public-composer > .am-session-legacy { display: none; } }
.am-public-split .am-chat-mode[aria-pressed="true"] { background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
.am-public-split a:focus-visible, .am-public-split button:focus-visible, .am-public-split textarea:focus-visible { outline: 2px solid var(--ink, var(--am-text)); outline-offset: 2px; }
@media (min-width: 992px) {
  body.am-body:has(.am-public-split) { margin-bottom: 0; overflow: hidden; }
  .am-public-split .am-public-shell { flex-direction: row; max-width: none; height: 100vh; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .am-public-split .am-public-rail { display: flex; flex-direction: column; flex: 0 0 320px; max-width: 340px; padding: 20px; overflow-y: auto; background: var(--bg, var(--am-bg)); border-right: 1px solid var(--line, var(--am-border)); }
  .am-public-split .am-public-back { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; margin-bottom: .25rem; }
  .am-public-split .am-twin-banner { margin-bottom: 46px; }
  .am-public-split .am-twin-banner-image { aspect-ratio: auto; height: 110px; border-radius: var(--am-radius-sm); }
  .am-public-split .am-twin-banner-avatar { width: 76px; height: 76px; left: 12px; bottom: -38px; border: 4px solid var(--bg, var(--am-bg)); background: var(--bg, var(--am-bg)); }
  .am-public-split .am-twin-banner-avatar.am-public-avatar-initial { font-size: 1.75rem; }
  .am-public-split .am-public-header { border-bottom: 0; padding: .25rem 0 .5rem; }
  .am-public-split .am-public-id h1 { font-size: 28px; line-height: 1.2; }
  .am-public-split .am-public-intro { font-size: .9rem; margin-bottom: .75rem; }
  .am-public-split .am-intro-toggle { min-height: 44px; }
  .am-public-split .am-rail-label { display: block; margin: .5rem 0 .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, var(--am-text-muted)); }
  .am-public-split .am-chat-modes { width: 100%; }
  .am-public-split .am-chat-mode { min-height: 44px; }
  .am-public-split .am-chat-mode-banner { font-size: 13px; }
  .am-public-split .am-memory-link { display: block; }
  .am-public-split .am-memory-open { width: 100%; min-height: 44px; background: transparent; border: 1px solid var(--line, var(--am-border)); }
  .am-public-split .am-session-card { display: flex; flex-direction: column; gap: .35rem; margin-top: auto; padding: .85rem 1rem; font-size: .85rem; border: 1px solid var(--line, var(--am-border)); border-radius: var(--am-radius-sm); background: var(--surface, var(--am-surface)); }
  .am-public-split .am-session-row { display: flex; justify-content: space-between; gap: .5rem; color: var(--ink-2, var(--am-text-2)); }
  .am-public-split .am-session-meter { display: block; height: 4px; border-radius: 999px; background: var(--bg-2, var(--am-bg-alt)); overflow: hidden; }
  .am-public-split .am-session-meter > span { display: block; height: 100%; background: var(--ink, var(--am-text)); }
  .am-public-split .am-session-voice { margin: 0; text-align: left; }

  .am-public-split .am-public-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; background: var(--surface, var(--am-surface)); }
  .am-public-split .am-conv-header { display: flex; align-items: center; gap: .75rem; flex: 0 0 64px; padding: 0 1.25rem; border-bottom: 1px solid var(--line, var(--am-border)); }
  .am-public-split .am-conv-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; object-fit: cover; font-size: 1rem; }
  .am-public-split .am-conv-id { min-width: 0; flex: 1 1 auto; }
  .am-public-split .am-conv-id p { margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .am-public-split .am-conv-name { font-weight: 600; }
  .am-public-split .am-conv-mode { font-size: .8rem; color: var(--muted, var(--am-text-muted)) !important; }
  .am-public-split .am-conv-pill { flex: 0 0 auto; padding: .25rem .75rem; font-size: .8rem; border: 1px solid var(--line, var(--am-border)); border-radius: 999px; color: var(--ink-2, var(--am-text-2)); }

  .am-public-split .am-public-log { flex: 1 1 auto; min-height: 0; gap: 24px; padding: 1.5rem max(1.25rem, calc((100% - 760px) / 2)); }
  .am-public-split .am-public-log.is-private { outline-offset: -6px; border-radius: 0; }
  .am-public-split .am-public-log .am-chat-msg { font-size: 16px; line-height: 1.6; }
  .am-public-split .am-public-log .am-chat-user { max-width: 80%; background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
  .am-public-split .am-public-log .am-chat-twin { position: relative; max-width: 100%; padding: 0 0 0 44px; min-height: 32px; background: none; border-radius: 0; }
  .am-public-split .am-public-log .am-chat-twin::before {
    content: var(--am-twin-initial, ""); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
    background: var(--am-twin-avatar, none) center / cover no-repeat, var(--ink, var(--am-accent)); color: var(--bg, var(--am-bg));
  }
  .am-public-split .am-public-log .am-chat-twin.is-error { padding: .6rem .8rem .6rem 44px; }
  .am-public-split .am-public-intro .am-chat-twin { margin-top: .5rem; }

  .am-public-split .am-public-composer { display: block; flex: 0 0 auto; padding: .75rem max(1.25rem, calc((100% - 760px) / 2)) .5rem; border-top: 1px solid var(--line, var(--am-border)); }
  .am-public-split .am-public-form { align-items: flex-end; padding: .35rem; border: 1px solid var(--line, var(--am-border)); border-radius: var(--am-radius); background: var(--surface, var(--am-surface)); }
  .am-public-split .am-public-form .am-public-input { border: 0; box-shadow: none; max-height: calc(6 * 1.6em + 1rem); line-height: 1.6; overflow-y: auto; }
  .am-public-split .am-public-send { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: var(--am-radius-sm); }
  .am-public-split .am-conv-foot { display: flex; justify-content: center; gap: .35rem; margin-top: .4rem; }
  .am-public-split .am-conv-foot > span:not([hidden]) + span:not([hidden])::before { content: "\00B7"; margin-right: .35rem; }
}

/* Public twin page, narrow: full-screen conversation; rail opens as an offcanvas drawer. */
@media (max-width: 991.98px) {
  body.am-body:has(.am-public-split) { margin-bottom: 0; overflow: hidden; }
  .am-public-split .am-public-shell { max-width: none; height: 100vh; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
  .am-public-split .am-public-rail.offcanvas-lg { --bs-offcanvas-width: min(340px, 88vw); background: var(--bg, var(--am-bg)); color: var(--am-text); padding: 0 20px 20px; overflow-y: auto; display: flex; flex-direction: column; }
  .am-public-split .am-rail-close { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 2; padding-top: 8px; margin: 0 -8px 4px 0; background: var(--bg, var(--am-bg)); }
  .am-public-split .am-rail-close .btn-close { width: 44px; height: 44px; padding: 0; }
  .am-public-split .am-rail-label { display: block; margin: .5rem 0 .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, var(--am-text-muted)); }
  .am-public-split .am-chat-mode { min-height: 44px; }
  .am-public-split .am-memory-link { display: block; }
  .am-public-split .am-memory-open { width: 100%; min-height: 44px; }
  .am-public-split .am-twin-banner-image { aspect-ratio: auto; height: 110px; border-radius: var(--am-radius-sm); }
  .am-public-split .am-twin-banner { margin-bottom: 46px; }
  .am-public-split .am-twin-banner-avatar { width: 76px; height: 76px; left: 12px; bottom: -38px; border-color: var(--bg, var(--am-bg)); }
  .am-public-split .am-public-header { border-bottom: 0; }
  .am-public-split .am-session-card { display: flex; flex-direction: column; gap: .35rem; margin-top: auto; padding: .85rem 1rem; font-size: .85rem; border: 1px solid var(--line, var(--am-border)); border-radius: var(--am-radius-sm); }
  .am-public-split .am-session-row { display: flex; justify-content: space-between; gap: .5rem; }
  .am-public-split .am-session-meter { display: block; height: 4px; border-radius: 999px; background: var(--bg-2, var(--am-bg-alt)); overflow: hidden; }
  .am-public-split .am-session-meter > span { display: block; height: 100%; background: var(--ink, var(--am-text)); }
  .am-public-split .am-session-voice { margin: 0; text-align: left; }
  .am-public-split .am-public-composer > .am-session-legacy { display: none; }

  .am-public-split .am-public-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; min-height: 0; background: var(--surface, var(--am-surface)); }
  .am-public-split .am-conv-header { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; min-height: 56px; padding: 0 .5rem; border-bottom: 1px solid var(--line, var(--am-border)); min-width: 0; }
  .am-public-split .am-conv-back { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; text-decoration: none; font-size: 1.25rem; color: var(--am-text) !important; }
  .am-public-split .am-conv-about { display: inline-flex; align-items: center; gap: .5rem; flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 0 .4rem; border: 0; border-radius: var(--am-radius-sm); background: transparent; color: var(--am-text); font-weight: 600; }
  .am-public-split .am-conv-about .am-conv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .am-public-split .am-conv-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; object-fit: cover; font-size: 1rem; }
  .am-public-split .am-conv-id { flex: 1 1 auto; min-width: 0; }
  .am-public-split .am-conv-mode-btn { display: block; width: 100%; min-height: 44px; padding: 0 .4rem; border: 0; background: transparent; text-align: left; font-size: .78rem; color: var(--muted, var(--am-text-muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .am-public-split .am-conv-pill { flex: 0 0 auto; padding: .2rem .6rem; font-size: .75rem; border: 1px solid var(--line, var(--am-border)); border-radius: 999px; white-space: nowrap; }
  @media (max-width: 420px) { .am-public-split .am-conv-pill { display: none; } }

  .am-public-split .am-public-log { flex: 1 1 auto; min-height: 0; gap: 20px; padding: 1rem .9rem; overflow-x: hidden; }
  .am-public-split .am-public-log .am-chat-msg { font-size: 16px; line-height: 1.6; }
  .am-public-split .am-public-log .am-chat-user { max-width: 85%; background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
  .am-public-split .am-public-log .am-chat-twin { position: relative; max-width: 100%; padding: 0 0 0 40px; min-height: 32px; background: none; border-radius: 0; }
  .am-public-split .am-public-log .am-chat-twin::before {
    content: var(--am-twin-initial, ""); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
    background: var(--am-twin-avatar, none) center / cover no-repeat, var(--ink, var(--am-accent)); color: var(--bg, var(--am-bg));
  }
  .am-public-split .am-public-composer { display: block; flex: 0 0 auto; padding: .5rem .75rem calc(.5rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line, var(--am-border)); }
  .am-public-split .am-public-form { align-items: flex-end; padding: .3rem; border: 1px solid var(--line, var(--am-border)); border-radius: var(--am-radius); border-top: 1px solid var(--line, var(--am-border)); min-width: 0; }
  .am-public-split .am-public-form .am-public-input { min-width: 0; border: 0; box-shadow: none; max-height: calc(6 * 1.6em + 1rem); line-height: 1.6; overflow-y: auto; }
  .am-public-split .am-public-send { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: var(--am-radius-sm); }
  .am-public-split .am-voice-start { padding: 0 .6rem; }
  .am-public-split .am-conv-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-top: .3rem; }
  .am-public-split .am-conv-foot > span:not([hidden]) + span:not([hidden])::before { content: "\00B7"; margin-right: .35rem; }
}

/* Public twin page (non-embed), both widths: match the reference design. */
/* Messages must never shrink inside the fixed-height scrolling log, or their text overlaps. */
.am-public-split .am-public-log > * { flex-shrink: 0; }
.am-public-split .am-public-log,
.am-public-split.am-public-box-outlined .am-public-log,
.am-public-split.am-public-box-floating .am-public-log,
.am-public-split.am-public-box-minimal .am-public-log { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.am-public-split .am-public-log .am-chat-user { align-self: flex-end; padding: .6rem 1rem; border-radius: 14px; background: var(--ink, var(--am-text)) !important; color: var(--bg, var(--am-bg)) !important; }
.am-public-split .am-public-log .am-chat-twin,
.am-public-split.am-public-has-twin-bubble .am-public-log .am-chat-twin { background: none; color: var(--am-text); border-radius: 0; }
.am-public-split .am-public-log .am-chat-twin::before { background: var(--am-twin-avatar, none) center / cover no-repeat, var(--bg-2, var(--am-bg-alt)); color: var(--am-text); border: 1px solid var(--line, var(--am-border)); }
.am-public-split .am-conv-avatar.am-public-avatar-initial { background: var(--bg-2, var(--am-bg-alt)); color: var(--am-text); border: 1px solid var(--line, var(--am-border)); }

.am-public-split .am-chat-modes { padding: .25rem; gap: .25rem; border: 0; border-radius: var(--am-radius-sm); background: var(--bg-2, var(--am-bg-alt)); }
.am-public-split .am-chat-mode { border-radius: 10px; color: var(--ink-2, var(--am-text-2)); font-size: .9rem; }
.am-public-split .am-chat-mode[data-mode="private"].is-active { background: var(--ink, var(--am-text)); color: var(--bg, var(--am-bg)); }
.am-public-split .am-chat-mode-banner,
.am-public-split .am-chat-mode-banner.is-private { margin: .6rem 0 1rem; padding: 0; border: 0; background: none; color: var(--ink-2, var(--am-text-2)); font-size: 13px; line-height: 1.5; }
.am-public-split .am-chat-mode-banner strong { font-weight: 600; }
.am-public-split .am-memory-open { display: flex; align-items: center; justify-content: center; gap: .4rem; border-radius: var(--am-radius-sm); background: var(--surface, var(--am-surface)); font-weight: 600; font-size: .85rem; }
.am-public-split .am-public-intro-text { opacity: 1; color: var(--ink-2, var(--am-text-2)); }

.am-public-split .am-session-card { padding: .9rem 1rem; gap: .4rem; background: var(--surface, var(--am-surface)); }
.am-public-split .am-session-row strong { font-weight: 600; color: var(--am-text); }
.am-public-split .am-session-row:not(:first-child) { margin-top: .35rem; }
.am-public-split .am-session-card:has(#rail-voice-today:not([hidden])) .am-session-voice { display: none !important; }

.am-public-split .am-conv-pill { border: 0; background: var(--bg-2, var(--am-bg-alt)); }
.am-public-split .am-public-form { gap: .5rem; align-items: center; }
.am-public-split .am-public-form .am-public-input { background: transparent; min-height: 44px; padding: .55rem .5rem; }
.am-public-split .am-public-form .am-public-input:focus { box-shadow: none; }
.am-public-split .am-public-form:focus-within { border-color: var(--ink, var(--am-text)); }
.am-public-split .am-public-form .am-voice-start { min-height: 44px; border: 0; border-radius: 10px; background: var(--bg-2, var(--am-bg-alt)); font-weight: 600; font-size: .9rem; }
.am-public-split .am-public-send { box-shadow: none; }
.am-public-split .am-lang-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.am-public-split .am-lang-chips > li { padding: .15rem .6rem; font-size: .8rem; line-height: 1.5; border-radius: 999px; background: var(--bg-2, var(--am-bg-alt)); color: var(--ink-2, var(--am-text-2)); }
