/* Mobile Fix Strip demo. The phone is a neutral, generic messaging UI: no Wispr or Apple branding. */
.demo { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 32px; align-items: start; }
.demo-side { display: grid; gap: 16px; position: sticky; top: 16px; }
@media (max-width: 900px) { .demo { grid-template-columns: 1fr; justify-items: center; } .demo-side { position: static; width: 100%; } }

.phone { --pe-ink: var(--ph-ink); --pe-sub: var(--ph-sub); --pe-line: var(--ph-line); --pe-key: var(--ph-key); --pe-accent: var(--ph-blue); --pe-on-accent: #fff; --pe-fix: #6d45a3;
  --ph-bg: #f7f7f2; --ph-ink: #1a1a1a; --ph-sub: #6b6b63; --ph-line: #e2e2d8; --ph-key: #ffffff; --ph-kb: #d9d9d0; --ph-blue: #1d5fd1;
  width: 390px; max-width: 100%; border-radius: 48px; padding: 12px; background: #1a1a1a; box-shadow: var(--shadow); }
:root[data-theme="dark"] .phone { --pe-ink: var(--ph-ink); --pe-sub: var(--ph-sub); --pe-line: var(--ph-line); --pe-key: var(--ph-key); --pe-accent: var(--ph-blue); --pe-on-accent: #fff; --pe-fix: #6d45a3;
  --ph-bg: #121212; --ph-ink: #f2f2ea; --ph-sub: #9a9a90; --ph-line: #2c2c28; --ph-key: #3a3a36; --ph-kb: #232320; --ph-blue: #6ea0ff; background: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone { --pe-ink: var(--ph-ink); --pe-sub: var(--ph-sub); --pe-line: var(--ph-line); --pe-key: var(--ph-key); --pe-accent: var(--ph-blue); --pe-on-accent: #fff; --pe-fix: #6d45a3;
  --ph-bg: #121212; --ph-ink: #f2f2ea; --ph-sub: #9a9a90; --ph-line: #2c2c28; --ph-key: #3a3a36; --ph-kb: #232320; --ph-blue: #6ea0ff; background: #000; } }
.phone-screen { position: relative; height: 760px; border-radius: 38px; overflow: hidden; background: var(--ph-bg); color: var(--ph-ink); display: flex; flex-direction: column; font: 400 16px/22px -apple-system, system-ui, var(--font-sans); }
@media (max-width: 480px) {
  .phone { width: 100%; border-radius: 28px; padding: 6px; }
  .phone-screen { height: min(760px, calc(100svh - 24px)); min-height: 600px; border-radius: 24px; }
}

.statusbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 6px; font-weight: 600; font-size: 15px; }
.sim-chip { font: 600 10px/14px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; border: 1.5px dashed currentColor; border-radius: 4px; padding: 1px 6px; color: var(--ph-sub); }
.thread-head { display: flex; gap: 10px; align-items: center; padding: 8px 16px 10px; border-bottom: 1px solid var(--ph-line); }
.thread-head strong { display: block; font-size: 15px; line-height: 20px; }
.thread-head span:not(.avatar) { font-size: 12px; color: var(--ph-sub); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #034f46; color: #ffffeb; font-weight: 700; font-size: 14px; }
.thread { flex: 1; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 18px; font-size: 15px; line-height: 20px; }
.bubble.in { background: var(--ph-line); align-self: flex-start; border-bottom-left-radius: 6px; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px; border-top: 1px solid var(--ph-line); }
.field { flex: 1; min-height: 38px; max-height: 150px; overflow-y: auto; border: 1px solid var(--ph-line); border-radius: 19px; padding: 8px 14px; font-size: 16px; line-height: 22px; background: var(--ph-bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.field .placeholder { color: var(--ph-sub); }
.field .caret { display: inline-block; width: 2px; height: 1.1em; vertical-align: -0.15em; background: var(--ph-blue); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.field del, .field ins { color: var(--ph-ink); }
.send { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ph-blue); color: #fff; font-size: 18px; cursor: pointer; }
.send[disabled] { opacity: 0.35; cursor: default; }

.strip { border-top: 1px solid var(--ph-line); background: color-mix(in srgb, var(--ph-bg) 70%, var(--hl)); padding: 8px 10px 10px; animation: rise 220ms var(--ease-out); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.strip-head { display: flex; justify-content: space-between; align-items: center; font: 600 11px/16px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ph-sub); margin-bottom: 6px; }
.strip-close { border: 0; background: none; color: var(--ph-sub); font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.kb { background: var(--ph-kb); padding: 10px 10px 26px; min-height: 236px; display: flex; flex-direction: column; gap: 10px; }
.kb-label { display: flex; justify-content: space-between; align-items: center; font: 600 11px/16px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ph-sub); }
.kb-main { flex: 1; display: grid; place-items: center; gap: 10px; text-align: center; }
.kb-editor { flex: 1; display: grid; }
.toast { margin: 0 10px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #1a1a1a; color: #ffffeb; border-radius: 14px; padding: 10px 10px 10px 14px; font-size: 14px; line-height: 20px; box-shadow: var(--shadow); animation: rise 220ms var(--ease-out); }
.toast button { border: 0; background: #ffffeb; color: #1a1a1a; border-radius: 999px; padding: 6px 14px; font: 700 14px/18px var(--font-sans); cursor: pointer; min-height: 36px; }

/* Recording mode (?record): only the phone and the step panel, for a clean screen capture. */
body.record .masthead, body.record footer, body.record .legend, body.record main > section:not(#demo), body.record #demo .section-head { display: none; }
body.record main { padding-block: 24px; }
.phone :where(.pe-controls, .kb) button.key, .phone .pe-input { font-family: -apple-system, system-ui, var(--font-sans); }
.phone .pe-words { max-height: 96px; }
.scenario-pick { display: flex; gap: 6px; flex-wrap: wrap; }

.bubble.out { background: var(--ph-blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; border-bottom-left-radius: 18px; }
.sb-icons, .navbar { display: none; }
.phone .kb { min-height: 236px; }

/* Android preview: same repair interaction, platform chrome only. No Google or Apple branding. */
.phone.android { --ph-blue: #0b57d0; --ph-kb: #e9eef6; --ph-key: #ffffff; --ph-bg: #fbfbfe; --ph-line: #dde3ea; border-radius: 30px; padding: 8px; }
:root[data-theme="dark"] .phone.android { --ph-blue: #a8c7fa; --ph-kb: #1f2329; --ph-key: #2d3138; --ph-bg: #111317; --ph-line: #2b2f36; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone.android { --ph-blue: #a8c7fa; --ph-kb: #1f2329; --ph-key: #2d3138; --ph-bg: #111317; --ph-line: #2b2f36; } }
.phone.android .phone-screen { border-radius: 24px; font-family: "Roboto", system-ui, var(--font-sans); }
.phone.android .statusbar { padding: 10px 18px 4px; font-size: 13px; }
.phone.android .sb-icons { display: inline; letter-spacing: 2px; color: var(--ph-sub); }
.phone.android .field { border-radius: 24px; background: color-mix(in srgb, var(--ph-line) 55%, var(--ph-bg)); border-color: transparent; }
.phone.android .send { border-radius: 14px; width: 40px; }
.phone.android :where(.pe-controls, .kb) button.key { border-radius: 999px; box-shadow: none; border: 1px solid var(--ph-line); }
.phone.android :where(.pe-controls, .kb) button.key.primary { border-color: transparent; }
.phone.android .bubble.in { border-radius: 20px 20px 20px 6px; }
.phone.android .navbar { display: flex; justify-content: center; padding: 6px 0 8px; background: var(--ph-kb); }
.phone.android .navbar span { width: 108px; height: 4px; border-radius: 4px; background: var(--ph-sub); opacity: 0.6; }
.phone.android .kb { padding-bottom: 10px; }

/* Keep the whole repair interaction in one desktop viewport */
@media (min-width: 901px) { .phone-screen { height: 700px; } .phone .thread { padding-block: 8px; } }
/* Dark phone: dark text on the light blue accent so labels stay readable */
:root[data-theme="dark"] .phone { --pe-on-accent: #0b1730; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone { --pe-on-accent: #0b1730; } }
:root[data-theme="dark"] .phone .send { color: #0b1730; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .phone .send { color: #0b1730; } }

/* Desktop preview: the same composer in a window, no phone chrome */
.desk-bar { display: none; }
body[data-device="desktop"] .demo { grid-template-columns: minmax(0, 1fr) 300px; justify-items: stretch; }
@media (max-width: 900px) { body[data-device="desktop"] .demo { grid-template-columns: 1fr; } }
body[data-device="desktop"] .phone { width: 100%; padding: 0; border-radius: 14px; background: none; border: 1px solid var(--border-strong); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55); overflow: hidden; }
body[data-device="desktop"] .phone-screen { height: 620px; min-height: 0; border-radius: 0; }
body[data-device="desktop"] .statusbar, body[data-device="desktop"] .navbar { display: none; }
body[data-device="desktop"] .desk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ph-line); font-size: 13px; color: var(--ph-sub); background: color-mix(in srgb, var(--ph-line) 35%, var(--ph-bg)); }
.desk-bar .lights { display: flex; gap: 6px; }
.desk-bar .lights span { width: 11px; height: 11px; border-radius: 50%; background: var(--ph-line); }
.desk-bar .title { flex: 1; text-align: center; font-weight: 600; color: var(--ph-ink); }
body[data-device="desktop"] .bubble { max-width: 60%; }
body[data-device="desktop"] .phone .kb { min-height: 190px; padding-bottom: 12px; }
body[data-device="desktop"] .phone .pe-words { max-height: 120px; }
