/* claudetuner.com/multiai — web shell around the extension's compare.html (#1453).
   The shared marketing header (/shared/site-header.js) sits on top; everything under it is the
   framed extension page plus four overlays (loading / install / update / mobile). Theme follows
   /shared/theme.js (`data-theme` on <html>) so the frame and the page around it agree. */
:root {
  --purple: #7C3AED; --purple-dark: #5B21B6;
  --mai-bg: #F9FAFB; --mai-card: #ffffff; --mai-text: #111827; --mai-muted: #6B7280;
  --mai-border: #E5E7EB; --mai-spinner-track: #E5E7EB;
}
[data-theme="dark"] {
  --mai-bg: #0f1419; --mai-card: #1a2029; --mai-text: #e6e8eb; --mai-muted: #9aa3ad;
  --mai-border: #2a323d; --mai-spinner-track: #2a323d;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--mai-text); background: var(--mai-bg);
  line-height: 1.6; display: flex; flex-direction: column; overflow: hidden; visibility: hidden;
}
body.lang-ready { visibility: visible; }
/* /shared/site-header.js relies on the page providing .container for its width. */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; width: 100%; }

.mai-main { flex: 1 1 auto; min-height: 0; position: relative; }
/* The embedded extension page. Hidden until the __ctReady handshake confirms. */
#panel { width: 100%; height: 100%; border: 0; background: var(--mai-bg); opacity: 0; transition: opacity .25s ease; }
#panel.ready { opacity: 1; }

/* Overlays sit centred over the frame column. */
.mai-overlay {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px; gap: 14px; background: var(--mai-bg);
}
.mai-overlay.show { display: flex; }
.mai-spinner { width: 34px; height: 34px; border: 3px solid var(--mai-spinner-track); border-top-color: var(--purple); border-radius: 50%; animation: mai-spin .8s linear infinite; }
@keyframes mai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mai-spinner { animation: none; } #panel { transition: none; } }
.mai-overlay h1 { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.mai-overlay p { color: var(--mai-muted); max-width: 420px; }
.mai-overlay .mai-note { font-size: 12px; color: var(--mai-muted); }
.mai-logo { width: 56px; height: 56px; border-radius: 14px; }
.mai-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 12px 24px; border-radius: 10px;
  background: var(--purple); color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .2s;
}
.mai-cta:hover { background: var(--purple-dark); }
.mai-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; max-width: 320px; }
.mai-actions .mai-cta { justify-content: center; border: 0; cursor: pointer; font-family: inherit; }
.mai-actions .mai-cta[hidden] { display: none; }
.mai-cta.mai-cta-sub { background: transparent; color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--purple); }
.mai-cta.mai-cta-sub:hover { background: transparent; color: var(--purple-dark); box-shadow: inset 0 0 0 1.5px var(--purple-dark); }
.mai-link { width: 100%; max-width: 320px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--mai-border); background: transparent; color: var(--mai-text); font: 13px/1.4 ui-monospace, monospace; }
.mai-link[hidden] { display: none; }
.mai-versions { font-variant-numeric: tabular-nums; }
.mai-privacy { font-size: 12px; color: var(--mai-muted); max-width: 460px; }
.mai-privacy a { color: inherit; }

/* ── "What it does" (.mh): under the phone page's handoff buttons (#mobile) and under the desktop
   install wall's CTA (#install) — multiai.js setupIntro moves the one section into the overlay that
   is up. Both overlays scroll; the frame and the other overlays are untouched. */
:root { --mai-tap: 44px; --mh-feed: #F5F3FF; --mh-skel: #E5E7EB; --mh-mod-bg: #FFFBEB; --mh-mod-border: #FDE68A; --mh-at: #7C3AED; }
[data-theme="dark"] { --mh-feed: #1f1b2e; --mh-skel: #2a323d; --mh-mod-bg: #2d2412; --mh-mod-border: #5c4813; --mh-at: #a78bfa; }
#mobile { word-break: keep-all; justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: 40px; padding-bottom: 40px; }
#mobile > *, #install > * { flex-shrink: 0; }
/* Desktop: stays centred while it fits, scrolls from the top (never clipped above) once it does not. */
#install { word-break: keep-all; justify-content: safe center; overflow-y: auto; }
#mobile .mai-actions .mai-cta { min-height: var(--mai-tap); }
.mh { width: 100%; max-width: 440px; margin-top: 22px; padding-top: 26px; border-top: 1px solid var(--mai-border); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: left; }
.mh h2 { font-size: 17px; font-weight: 700; text-align: center; }
.mh-cards { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.mai-debate-first .mh-dbt { order: -1; }
.mh-card { background: var(--mai-card); border: 1px solid var(--mai-border); border-radius: 14px; padding: 14px; min-width: 0; }
.mh-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.mh .mh-card p { font-size: 13px; line-height: 1.5; color: var(--mai-muted); max-width: none; margin-bottom: 10px; }
.mh-mock { border: 1px solid var(--mai-border); border-radius: 10px; overflow: hidden; font-size: 11px; }
.mh-q { padding: 6px 10px; border-bottom: 1px solid var(--mai-border); color: var(--mai-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mh-col { padding: 7px 8px 9px; border-right: 1px solid var(--mai-border); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mh-col:last-child { border-right: 0; }
.mh-col-head { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 10.5px; color: var(--mai-text); white-space: nowrap; overflow: hidden; }
.mh-col-head svg { width: 11px; height: 11px; flex-shrink: 0; }
.mh-col i { display: block; height: 6px; border-radius: 3px; background: var(--mh-skel); }
.mh-col i.mh-tbl { height: 22px; border-radius: 4px; background: repeating-linear-gradient(180deg, var(--mh-skel) 0 5px, transparent 5px 7px); }
.mh-col i.mh-cursor { width: 40%; background: linear-gradient(90deg, var(--mh-skel) 0 75%, var(--purple) 75% 100%); }
.mh-chat { background: var(--mh-feed); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mh-msg { display: flex; gap: 7px; align-items: flex-start; min-width: 0; }
.mh-msg > div { min-width: 0; }
.mh-msg b { display: block; font-size: 10px; color: var(--mai-muted); margin-bottom: 2px; }
.mh-bubble { display: block; background: var(--mai-card); border: 1px solid var(--mai-border); border-radius: 3px 10px 10px 10px; padding: 5px 8px; color: var(--mai-text); line-height: 1.45; }
.mh-mod .mh-bubble { background: var(--mh-mod-bg); border-color: var(--mh-mod-border); }
.mh-av { position: relative; width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; background: var(--c); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.mh-badge { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--mh-feed); display: flex; align-items: center; justify-content: center; }
.mh-badge svg { width: 70%; height: 70%; }
.mh-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mh-chips li { font-size: 12px; color: var(--mai-text); background: var(--mai-card); border: 1px solid var(--mai-border); border-radius: 999px; padding: 4px 10px; }
.mh-chips li::before { content: '\2713'; color: var(--purple); font-weight: 700; margin-right: 5px; }
.mh-more { display: inline-flex; align-items: center; justify-content: center; min-height: var(--mai-tap); padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--mh-at); text-decoration: none; }
.mh-more:hover { text-decoration: underline; }
/* Desktop install wall: the two cards side by side (stacked again in a narrow window). */
#install .mh { max-width: 760px; }
@media (min-width: 640px) {
  #install .mh-cards { flex-direction: row; align-items: flex-start; }
  #install .mh-card { flex: 1 1 0; }
}

/* The shared header (/shared/site-header.js) is light-only across the marketing site. This page
   follows the dashboard theme, so under dark it would sit white over a dark shell — restyle it
   here, page-locally, rather than touching the shared file (cache-bust + every page). Selectors
   carry [data-theme] so they beat the header's own injected rules whatever the order. */
[data-theme="dark"] .site-header { background: rgba(15, 20, 25, .9); border-bottom-color: var(--mai-border); }
[data-theme="dark"] .site-header .nav-logo { color: var(--mai-text); }
[data-theme="dark"] .site-header .nav-links a { color: var(--mai-muted); }
[data-theme="dark"] .site-header .nav-links a:hover { color: var(--mai-text); }
[data-theme="dark"] .site-header .nav-links a.sh-dash { color: #a78bfa; }
[data-theme="dark"] .site-header .sh-lang { border-color: var(--mai-border); color: var(--mai-muted); }
[data-theme="dark"] .site-header .sh-toggle { color: var(--mai-text); }
@media (max-width: 768px) { [data-theme="dark"] .site-header .nav-links { background: var(--mai-card); border-bottom-color: var(--mai-border); } }

/* ── One-line notice (notices.json): a flex row between the header and the frame, so the frame gets
   the remaining height and nothing is overlapped. Theme tokens only. */
.mai-notice { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px; background: var(--mh-feed, var(--mai-card)); border-bottom: 1px solid var(--mai-border); font-size: 13px; line-height: 1.4; color: var(--mai-text); }
.mai-notice[hidden] { display: none; }
.mai-notice-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mai-notice-close { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--mai-muted); font: 20px/1 inherit; cursor: pointer; }
.mai-notice-close:hover { color: var(--mai-text); }
.mai-notice-close:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.mai-notice-link { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--mh-at, var(--purple)); font-weight: 600; text-decoration: underline; white-space: nowrap; }
/* Narrow screens: text and link wrap (a 40-char label must not push the × off screen); only the × never shrinks. */
@media (max-width: 640px) { .mai-notice { padding: 6px 10px; } .mai-notice-text, .mai-notice-link { white-space: normal; overflow-wrap: anywhere; } }
.mai-notice-link[hidden] { display: none; }
.mai-notice-date { flex: 0 0 auto; color: var(--mai-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mai-notice-date[hidden] { display: none; }
