/* Shared design tokens: keep both preparation screens aligned. */
/* Colors follow the homepage (site/styles.css): light by default, its dark theme on dark devices.
   static/theme.js sets html[data-theme=light|dark] before the first paint (the Light/Dark switch, remembered in
   localStorage; the OS setting until chosen); pages without the script keep following the OS. */
:root {
  color-scheme: light;
  --background: #fcfaff;
  --surface: #fff;
  --surface-raised: #f4eafa;
  --soft: #f4eafa;
  --text: #211c34;
  --text-muted: #665c74;
  --accent: #7940cc;
  --accent-text: #fff;
  --pink: #c9328e;
  --border: #e5dced;
  --focus: #7940cc;
  --primary-background: linear-gradient(105deg, #bd237d, #7040d7);
  --primary-text: #fff;
  --success-surface: #e6f6ee;
  --success-text: #1d5e3f;
  --error-surface: #fdebf0;
  --error-text: #9b1c3a;
  --warning-surface: #fdf1e2;
  --warning-text: #7a4210;
  --info-surface: #e7edfc;
  --info-text: #2c3e7a;
  --space-small: 12px;
  --space-medium: 16px;
  --space-large: 24px;
  --radius-control: 12px;
  --radius-button: 40px;
  --radius-card: 20px;
  --font-body: 16px;
  --font-small: .85rem;
  --font-heading: 1.15rem;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text); background: var(--background); line-height: 1.7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #100c21;
    --surface: #1d1733;
    --surface-raised: #30203f;
    --soft: #30203f;
    --text: #faf4ff;
    --text-muted: #c8bdd9;
    --accent: #cfadff;
    --accent-text: #100c21;
    --pink: #ff94d1;
    --border: #4b355e;
    --focus: #cfadff;
    --success-surface: #203c33;
    --success-text: #b9f3dc;
    --error-surface: #422530;
    --error-text: #ffc4d0;
    --warning-surface: #3d2a1f;
    --warning-text: #ffd9b8;
    --info-surface: #2c3754;
    --info-text: #c9d8ff;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #100c21;
  --surface: #1d1733;
  --surface-raised: #30203f;
  --soft: #30203f;
  --text: #faf4ff;
  --text-muted: #c8bdd9;
  --accent: #cfadff;
  --accent-text: #100c21;
  --pink: #ff94d1;
  --border: #4b355e;
  --focus: #cfadff;
  --success-surface: #203c33;
  --success-text: #b9f3dc;
  --error-surface: #422530;
  --error-text: #ffc4d0;
  --warning-surface: #3d2a1f;
  --warning-text: #ffd9b8;
  --info-surface: #2c3754;
  --info-text: #c9d8ff;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(100%, 600px); margin: auto; padding: 24px 20px max(30px, env(safe-area-inset-bottom)); }
.brand { font-size: 1.2rem; font-weight: 750; letter-spacing: -.04em; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.brand span { display: block; font-size: .72rem; font-weight: 400; color: var(--text-muted); letter-spacing: .04em; }
.screen { padding-top: 30px; }
.hero { padding-top: 36px; }
.symbol { font-size: 2.8rem; color: var(--accent); }
h1 { font-size: clamp(1.65rem, 5vw, 2rem); line-height: 1.5; letter-spacing: -.025em; margin: 12px 0 16px; }
.hero h1 { font-size: clamp(2rem, 7vw, 2.7rem); }
h2 { font-size: 1.1rem; margin: 0 0 14px; }
p { margin: 12px 0; }
.eyebrow { font-size: .78rem; color: var(--accent); font-weight: 600; }
.muted, .hint { color: var(--text-muted); }
.hint { font-size: .8rem; }
button { font: inherit; font-weight: 600; border-radius: var(--radius-control); border: 1px solid transparent; padding: 12px 18px; min-height: 48px; cursor: pointer; touch-action: manipulation; }
button.primary { background: var(--accent); color: var(--surface); }
button.secondary { background: var(--surface); color: var(--accent); border-color: var(--border); }
button.link { color: var(--accent); text-decoration: underline; background: transparent; font-size: .87rem; }
button:disabled { cursor: default; opacity: .45; }
.hero .primary, #finish-actions > button { width: 100%; margin: 22px 0 6px; }
label { display: block; font-size: .92rem; margin: 16px 0; }
input:not([type=radio]), textarea { display: block; width: 100%; min-width: 0; margin-top: 8px; font: inherit; font-size: 16px; line-height: 1.6; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: inherit; }
textarea { resize: vertical; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1:focus { outline: none; }
.choices { display: grid; gap: 10px; margin: 24px 0; }
.choice { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); min-height: 58px; cursor: pointer; }
.choice:has(input:checked) { background: var(--surface-raised); border-color: var(--accent); }
input[type=radio] { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
progress { width: 100%; height: 6px; accent-color: var(--accent); display: block; margin-bottom: 28px; }
.navigation { display: flex; gap: 12px; margin-top: 30px; }
.navigation .primary { flex: 1; }
.loading { text-align: center; padding: 90px 0; }
.spinner { width: 42px; height: 42px; margin: 0 auto 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.completion { border-radius: var(--radius-card); padding: 22px; background: var(--surface-raised); }
.completion.done { background: var(--success-surface); }
.completion h1 { font-size: 1.6rem; }
.remaining { font-weight: 700; }
/* A small in-flow guide, bounded by results rather than the viewport. */
#results .next-confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block: 1rem; padding: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); min-width: 0; }
#results .next-confirmation > span { flex: 1 1 5rem; overflow-wrap: anywhere; }
#results .next-confirmation > button { flex: 1 1 9rem; min-width: 0; }
@media (max-width: 699px) and (min-height: 600px) {
  #results .next-confirmation { position: sticky; bottom: 0; width: fit-content; max-width: 100%; margin-inline: auto; }
  /* Leave room below controls when they are scrolled into view. */
  #results :is(button, input, textarea, h2, summary) { scroll-margin-block: 8rem; }
  #results { padding-bottom: 8rem; }
}
.confirm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; margin-top: 16px; }
.confirm-card > button { margin-top: 12px; width: 100%; }
.prepared { margin-top: 40px; }
.post-export { margin-top: var(--space-large); padding: var(--space-medium); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.post-export-row { min-width: 0; padding: var(--space-small) 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.post-export-row h3 { margin: 0; }
.post-export-controls { display: flex; flex-wrap: wrap; gap: var(--space-small); }
.post-export-controls > button { flex: 1 1 140px; min-width: 0; }
/* Public results: one panel per text, matching .panel / .out / .copy / .label in docs/design/app-redesign-mock.html. */
#artifacts.panels { display: flex; flex-direction: column; gap: 14px; }
#artifacts.panels > details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px; min-width: 0; }
#artifacts.panels > details > summary { padding: 0; font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--accent); }
#artifacts.panels > details > * + * { margin-top: 12px; }
#artifacts.panels .out { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--background); border: 1px solid var(--border); }
#artifacts.panels .out > .body { flex: 1; min-width: 0; margin: 0; padding: 0; background: none; border-radius: 0; color: var(--text); }
#artifacts.panels .out > .copy { flex: none; margin: 0; min-height: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; font-size: 11.5px; font-weight: 400; padding: 3px 8px; color: var(--text-muted); box-shadow: none; }
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; padding: 10px 2px; font-weight: 600; overflow-wrap: anywhere; }
details button { margin: 10px 8px 10px 0; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border-radius: var(--radius-control); padding: 16px; }
ol { padding-left: 24px; }
li { margin-bottom: 16px; }
#status { white-space: pre-wrap; font-size: .9rem; }
#status.error { color: var(--error-text); padding: 12px; background: var(--error-surface); border-radius: var(--radius-control); }
footer { color: var(--text-muted); font-size: .75rem; margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border); }
[hidden] { display: none !important; }
@media (min-width: 700px) { main { padding-top: 40px; } .screen { padding-top: 40px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Shared controls and states, including dynamically created controls. */
body { background: var(--background); font-size: var(--font-body); }
main { padding: var(--space-large) 20px max(40px, env(safe-area-inset-bottom)); }
h1 { font-size: clamp(1.65rem, 5vw, 2rem); line-height: 1.5; letter-spacing: -.025em; margin: 12px 0 16px; }
.hero h1, .intro h1 { font-size: clamp(2rem, 7vw, 2.7rem); }
h2, h3 { font-size: var(--font-heading); line-height: 1.5; }
p, .muted, .hint { color: var(--text-muted); }
.eyebrow { color: var(--accent); font-size: var(--font-small); letter-spacing: .04em; }
a { color: var(--accent); text-underline-offset: 4px; }
.brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-medium); padding-bottom: var(--space-large); border-bottom: 1px solid var(--border); }
.brand .brand-name { font-size: 1.2rem; font-weight: 750; letter-spacing: -.04em; color: var(--text); text-decoration: none; }
.brand .brand-subtitle { display: block; font-size: .75rem; font-weight: 400; letter-spacing: .04em; color: var(--text-muted); }
.brand nav { display: flex; flex-wrap: wrap; gap: var(--space-small); }
.brand nav a { padding: 10px 4px; font-size: var(--font-small); font-weight: 600; color: var(--text-muted); }
.brand nav a[aria-current="page"] { color: var(--text); text-decoration-thickness: 2px; }
button, input::file-selector-button { border: 1px solid var(--border); border-radius: var(--radius-button); background: var(--surface); color: var(--text); padding: 12px 20px; min-height: 48px; font: inherit; font-weight: 700; max-width: 100%; white-space: normal; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation; }
button.primary, input::file-selector-button { background: var(--primary-background); color: var(--primary-text); border-color: transparent; box-shadow: 0 8px 28px #bd3aab30; }
button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
button.link { background: transparent; border-color: transparent; color: var(--accent); }
button:not(:disabled):hover, input:not(:disabled)::file-selector-button:hover { filter: brightness(1.12); }
button:disabled, input:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input, textarea { accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
.confirm-card, .card, .confirm, .completion, #manual-copy, #generation-failure, #recovery { border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--space-large); background: var(--surface); }
.completion.done { background: var(--success-surface); border-color: var(--success-text); }
.completion.done h1, #stages li.done { color: var(--success-text); }
#manual-copy, #generation-failure { margin-top: var(--space-medium); }
#manual-copy button, #generation-failure button { margin: 12px 8px 0 0; }
#demo-notice, .note { background: var(--surface-raised); border-radius: var(--radius-control); padding: 12px 16px; color: var(--text-muted); }
#status.error, #video-status.error, #understand-status.error { color: var(--error-text); background: var(--error-surface); border: 1px solid var(--error-text); padding: 12px 16px; border-radius: var(--radius-control); }
.note.warn { color: var(--warning-text); background: var(--warning-surface); }
.spinner { border-color: var(--border); border-top-color: var(--accent); animation-duration: 1.2s; }
footer { border-color: var(--border); color: var(--text-muted); font-size: .8rem; margin-top: 48px; padding-top: 20px; }
p, label, summary, figcaption, .brand, button { overflow-wrap: anywhere; }
.navigation { flex-wrap: wrap; }
.navigation > button { min-width: 0; }
[hidden] { display: none !important; }
@media (min-width: 700px) { main { padding-top: 40px; } }
@media (max-width: 480px) { main { padding-inline: 16px; } .confirm-card, .card, .confirm, .completion, #manual-copy, #generation-failure, #recovery { padding: var(--space-medium); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Conversation uses shared tokens and explicit speaker text from app.js. */
#conversation-history { list-style: none; padding: 0; }
#conversation-history li { white-space: pre-wrap; overflow-wrap: anywhere; padding: var(--space-medium); margin-bottom: var(--space-medium); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); color: var(--text); }
#conversation-form > button { margin-top: var(--space-small); }
.chat-head { display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; align-items: center; margin-bottom: var(--space-small); }
.chat-head img { grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: var(--surface); }
.chat-head span { font-size: var(--font-small); opacity: .8; }
.intake-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; object-position: 50% 22%; border-radius: var(--radius-card); margin-bottom: var(--space-medium); }
#intake-chat-history { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#intake-chat-history li { white-space: pre-wrap; overflow-wrap: anywhere; padding: 9px 12px; max-width: 92%; align-self: flex-start; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
#intake-chat-history li.me { align-self: flex-end; background: var(--surface-raised); }
#intake-chat-quick button[aria-pressed="true"] { border-color: var(--accent, currentColor); background: var(--accent, currentColor); color: #fff; }
#intake-chat-form > button { margin-top: var(--space-small); }
.intake-decided { margin: 0 0 var(--space-medium); }
.intake-decided dt { font-size: var(--font-small); color: var(--muted, inherit); }
.intake-decided dd { margin: 0 0 var(--space-small); white-space: pre-wrap; overflow-wrap: anywhere; }

/* R2 side chat (Owner 2026-11-03): work on the left and the AI chat on the right; a bottom sheet on narrow screens. */
.chat { min-width: 0; padding: var(--space-medium); background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-card); overflow-y: auto; overscroll-behavior: contain; }
.chat h2 { margin: 0 0 var(--space-small); }
.chat > section + section { margin-top: var(--space-large); padding-top: var(--space-medium); border-top: 1px solid var(--border); }
.chat label { margin: var(--space-small) 0; }
.chat > section > button, #sales-consult-choice button { margin: var(--space-small) 8px 0 0; }
#sales-consult-history { list-style: none; padding: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-small) 0; }
.quick > button { min-height: 40px; padding: 6px 12px; font-size: var(--font-small); }
.chat-toggle { display: none; }
@media (min-width: 861px) {
  .app-shell { display: grid; grid-template-columns: minmax(0, 600px) 380px; justify-content: center; align-items: start; gap: var(--space-large); padding-inline: 20px; }
  .app-shell > main { width: auto; margin: 0; padding-inline: 0; }
  .chat { position: sticky; top: 12px; margin-top: 40px; max-height: calc(100vh - 24px); }
}
@media (max-width: 860px) {
  .app-shell > main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  /* Closed sheets stay focusable (no visibility change) so focusing a chat field can open them. */
  .chat { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 72vh; border-bottom: 0; border-radius: var(--radius-card) var(--radius-card) 0 0;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .25s ease-out; }
  .chat.open { transform: none; box-shadow: 0 -10px 40px #0004; }
  .chat-toggle { display: inline-flex; align-items: center; position: fixed; z-index: 21; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .chat-toggle[aria-expanded="true"] { bottom: calc(72vh + 12px); }
  /* Keep the sticky confirmation guide above the toggle. */
  #results .next-confirmation { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .chat { transition: none; } }

/* Public account panel (#516): shown above the preparation screens; wraps on narrow screens. */
.account { margin-top: var(--space-large); padding: var(--space-medium); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); min-width: 0; }
.account h2 { margin: 0; }
.account label { margin: var(--space-small) 0; }
.account .choice { margin: var(--space-medium) 0; }
.account input[type=checkbox] { display: inline-block; width: 20px; height: 20px; margin: 0; padding: 0; flex-shrink: 0; }
.account-actions, .account-member { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-small); }
.account-kind { display: flex; flex-wrap: wrap; gap: var(--space-small); margin-top: var(--space-medium); }
.account-kind > button { flex: 1 1 140px; min-width: 0; }
.account-kind > button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.account-actions > button { flex: 1 1 140px; min-width: 0; }
.account-member .remaining { flex: 1 1 200px; margin: 0; color: var(--text); }
#account-status:empty { display: none; }
#account-status.error, .quota-notice { color: var(--error-text); background: var(--error-surface); border: 1px solid var(--error-text); padding: 12px 16px; border-radius: var(--radius-control); overflow-wrap: anywhere; }

/* Candidate comparison stays vertically stacked on narrow screens. */
.candidate-comparison, .comparison-side { min-width: 0; max-width: 100%; }
.candidate-comparison { margin-block: 1rem; border: 2px solid currentColor; padding: .75rem; }
.comparison-side + .comparison-side { border-top: 2px dashed currentColor; margin-top: 1rem; }
.comparison-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.change-label { display: inline-block; margin-inline: .25rem; }
.comparison-text .removed { text-decoration: line-through; background: #ffe4e4; color: #651919; }
.comparison-text .added { text-decoration: underline; text-decoration-style: double; background: #dcf4e4; color: #174c2e; }
.comparison-warning { font-weight: bold; overflow-wrap: anywhere; }
.candidate-comparison summary { overflow-wrap: anywhere; cursor: pointer; }
.candidate-comparison summary:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

/* Entry and authentication follow the agreed mock, scoped away from local work. */
:root { --shadow:0 18px 55px #58357318; }
.public-entry .app-shell { display:block; max-width:1240px; margin:auto; padding:14px 20px 0; }
.public-entry .app-shell > main { width:100%; padding:0; margin:0; }
.public-entry #welcome { padding:0; }
.public-entry #account { width:100%; margin:0; padding:0; border:0; background:transparent; }
:is(#entry-guest, #account-guest) :is(h1,h2,h3,p) { margin:0; }
:is(#entry-guest, #account-guest) { font-size:15px; line-height:1.75; }
:is(#entry-guest, #account-guest) .brand { padding:0; border:0; }
:is(#entry-guest, #account-guest) .brand span { display:inline; font:inherit; letter-spacing:inherit; }
:is(#entry-guest, #account-guest) .top { display:flex; align-items:center; gap:14px; padding-block:6px }
:is(#entry-guest, #account-guest) .brand { display:flex; align-items:center; gap:8px; font-size:24px; font-weight:800; letter-spacing:-1px; text-decoration:none; color:var(--text) }
:is(#entry-guest, #account-guest) .brand span { color:var(--pink) }
:is(#entry-guest, #account-guest) .top .right { margin-left:auto; display:flex; gap:10px; align-items:center; font-size:13px; color:var(--text-muted) }
:is(#entry-guest, #account-guest) .btn { display:inline-flex; align-items:center; justify-content:center; gap:10px; border-radius:40px; min-height:48px; padding:12px 24px; font-weight:700; font-size:15px; border:0; cursor:pointer; text-decoration:none }
:is(#entry-guest, #account-guest) .btn.primary { color:#fff; background:linear-gradient(105deg,#bd237d,#7040d7); box-shadow:0 8px 28px #bd3aab30 }
:is(#entry-guest, #account-guest) .btn.ghost { background:var(--surface); border:1px solid var(--border); color:var(--text) }
:is(#entry-guest, #account-guest) .btn.small { min-height:36px; padding:6px 14px; font-size:13px }
:is(#entry-guest, #account-guest) .gradient { background:linear-gradient(100deg,#8254db,#c9328e); -webkit-background-clip:text; background-clip:text; color:transparent }
:is(#entry-guest, #account-guest) .entry { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:28px; align-items:center; padding-block:20px }
:is(#entry-guest, #account-guest) .entry h1 { font-size:clamp(30px,4vw,46px); line-height:1.35 }
:is(#entry-guest, #account-guest) .entry .lead { color:var(--text-muted); margin-top:14px }
:is(#entry-guest, #account-guest) .entry .cta { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; align-items:center }
:is(#entry-guest, #account-guest) .entry .cta small { color:var(--text-muted); font-size:12px; width:100% }
:is(#entry-guest, #account-guest) .photo { border-radius:80px 24px 24px 24px; overflow:hidden; box-shadow:var(--shadow); aspect-ratio:4/5; max-width:100% }
:is(#entry-guest, #account-guest) .photo img { width:100%; height:100%; object-fit:cover; object-position:52% 35% }
:is(#entry-guest, #account-guest) .three { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:8px }
:is(#entry-guest, #account-guest) .three div { background:var(--surface); border:1px solid var(--border); border-radius:18px; padding:14px 16px }
:is(#entry-guest, #account-guest) .three b { display:block; font-size:14px }
:is(#entry-guest, #account-guest) .three span { font-size:13px; color:var(--text-muted) }
:is(#entry-guest, #account-guest) .vision { display:flex; flex-direction:column; gap:10px; padding-block:34px 10px }
:is(#entry-guest, #account-guest) .vision h2 { font-size:clamp(24px,3vw,34px) }
:is(#entry-guest, #account-guest) .eyebrow { font-size:11px; letter-spacing:.15em; color:var(--accent); font-weight:700 }
:is(#entry-guest, #account-guest) .four { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-top:12px }
:is(#entry-guest, #account-guest) .u { background:var(--surface); border:1px solid var(--border); border-radius:22px; padding:20px; display:flex; flex-direction:column; gap:8px; min-width:0 }
:is(#entry-guest, #account-guest) .u .num { font-size:11px; letter-spacing:.12em; font-weight:700; color:var(--text-muted) }
:is(#entry-guest, #account-guest) .u h3 { font-size:18px }
:is(#entry-guest, #account-guest) .u p { font-size:14px; color:var(--text-muted) }
:is(#entry-guest, #account-guest) .u.pink h3 { color:var(--pink) }
:is(#entry-guest, #account-guest) .u.purple h3 { color:var(--accent) }
:is(#entry-guest, #account-guest) .u.next { background:linear-gradient(145deg,#302441,#1c1a33); color:#faf4ff; border-color:transparent }
:is(#entry-guest, #account-guest) .u.next p, :is(#entry-guest, #account-guest) .u.next .num { color:#d9cbe9 }
:is(#entry-guest, #account-guest) .foot { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11.5px; color:var(--text-muted); padding-block:24px 8px; border-top:1px solid var(--border); margin-top:24px }
:is(#entry-guest, #account-guest) .foot a { color:var(--text-muted) }
:is(#entry-guest, #account-guest) .login { display:grid; grid-template-columns:minmax(0,420px) minmax(0,1fr); gap:28px; align-items:stretch; padding-block:16px }
:is(#entry-guest, #account-guest) .card { background:var(--surface); border:1px solid var(--border); border-radius:24px; padding:26px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:14px; min-width:0 }
:is(#entry-guest, #account-guest) .card h1 { font-size:24px }
:is(#entry-guest, #account-guest) .field { display:flex; flex-direction:column; gap:4px; font-size:13px; font-weight:600 }
:is(#entry-guest, #account-guest) .field input { border:1px solid var(--border); background:var(--background); border-radius:12px; padding:11px 12px; font-size:16px; font-weight:400 }
:is(#entry-guest, #account-guest) .check { display:flex; gap:8px; align-items:flex-start; font-size:13px }
:is(#entry-guest, #account-guest) .note { font-size:12px; color:var(--text-muted) }
:is(#entry-guest, #account-guest) .login .photo { aspect-ratio:auto; min-height:420px; border-radius:24px 80px 24px 24px }
:is(#entry-guest, #account-guest) .linkish { background:none; border:0; padding:0; color:var(--accent); text-decoration:underline; cursor:pointer; font-size:13px }


#entry-guest .primary { width:auto; margin:0; }
#account-form { margin:0; }
#account-form .field { margin:0; }
#account-form .field input { margin:0; line-height:inherit; }
#account-form .choice { margin:0; font-size:13px; }
#account-form .linkish { min-height:0; align-self:center; font-weight:400; }
#account-back { min-height:36px; padding:0; }
#account-title:focus { outline:none; }
.foot { display:flex; flex-wrap:wrap; gap:6px 16px; font-size:11.5px; color:var(--text-muted); padding:24px 20px 8px; border-top:1px solid var(--border); margin:24px auto 0; max-width:1240px; }
.foot a { color:var(--text-muted); }
@media (max-width:1000px) { #entry-guest .four { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:860px) {
  :is(#entry-guest, #account-guest) :is(.entry,.login) { grid-template-columns:minmax(0,1fr); }
  #entry-guest .entry .photo { aspect-ratio:4/3; order:-1; }
  #account-guest .login .photo { display:none; }
  #entry-guest .hide-sm { display:none; }
}
@media (max-width:560px) { #entry-guest .four { grid-template-columns:minmax(0,1fr); } }

:is(#entry-guest, #account-guest) :is(h1,h2,h3) { line-height:1.45; letter-spacing:-.03em; text-wrap:balance; }
#entry-guest .entry h1 { line-height:1.35; }

/* Workspace follows the agreed mock's steps, panels, facts and frames. */
.workspace-steps { display:flex; gap:6px; flex-wrap:wrap; margin-top:18px; font-size:12.5px; }
.workspace-steps a { padding:5px 12px; border-radius:30px; background:var(--soft); color:var(--text-muted); font-weight:600; text-decoration:none; }
.workspace-steps button { padding:5px 12px; min-height:0; border:0; border-radius:30px; background:var(--soft); color:var(--text-muted); font-size:inherit; font-weight:600; }
.workspace-steps button[aria-current="step"] { background:var(--accent); color:var(--surface); }
.video-work { display:flex; flex-direction:column; gap:14px; min-width:0; padding-top:14px; }
.video-work .panel { background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:18px; display:flex; flex-direction:column; gap:12px; min-width:0; }
#video-player { display:block; width:100%; max-width:100%; min-width:0; aspect-ratio:16 / 9; object-fit:contain; background:#000; border-radius:20px; }
.video-work :is(h1,h2,p) { margin:0; }
.video-work :is(h1,h2) { font-size:16px; display:flex; align-items:center; gap:8px; }
.video-work h2 small { font-weight:400; color:var(--text-muted); font-size:12px; margin-left:auto; }
.video-work .drop { border:2px dashed var(--border); border-radius:18px; padding:22px; text-align:center; color:var(--text-muted); display:flex; flex-direction:column; gap:8px; align-items:center; }
.video-note { font-size:12px; color:var(--text-muted); }
#video-read-status:empty { display:none; }
.video-file { margin:0; max-width:100%; font-size:13px; }
.video-file input { max-width:100%; font-size:13px; }
.video-work .facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; font-size:13px; }
.video-work .facts div { background:var(--background); border:1px solid var(--border); border-radius:12px; padding:8px 10px; }
.video-work .facts b { display:block; font-size:17px; font-variant-numeric:tabular-nums; }
.video-work .frames { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.video-work .frame { border-radius:12px; overflow:hidden; position:relative; aspect-ratio:16/10; background:var(--soft); border:2px solid transparent; cursor:pointer; padding:0; min-height:0; }
.video-work .frame img { width:100%; height:100%; object-fit:cover; display:block; }
.video-work .frame em { position:absolute; left:6px; bottom:4px; font-style:normal; font-size:11px; color:#fff; background:#0008; border-radius:6px; padding:0 6px; font-variant-numeric:tabular-nums; }
.video-work .frame.pick { border-color:var(--pink); }
#video-to-text { align-self:flex-start; }
@media (max-width:860px) {
  .video-work .frames { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .video-work .facts { grid-template-columns:minmax(0,1fr); }
}

/* Monitor survey uses the application's shared palette and controls. */
.survey-shell { display: block; max-width: 720px; margin: 0 auto; padding-inline: 0; }
.survey-shell > main { width: 100%; margin: 0; padding: 24px 20px max(40px, env(safe-area-inset-bottom)); }
.survey-card { margin-top: 24px; padding: clamp(18px, 4vw, 36px); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 12px 40px #7940cc0a; }
.survey-card h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); }
.survey-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.survey-card legend { font-size: 1.15rem; font-weight: 650; width: 100%; }
.survey-card .survey-section { color: var(--accent); font-size: .85rem; margin-bottom: 12px; }
.survey-card .choice input[type=checkbox] { display: inline-block; width: 20px; height: 20px; margin: 0; padding: 0; flex: 0 0 20px; accent-color: var(--accent); }
.survey-card .choice { overflow-wrap: anywhere; }
.survey-card .navigation { position: sticky; bottom: 0; padding: 12px 0; background: var(--surface); }
#survey-error { color: var(--error-text); }
#survey-access { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
#survey-access[hidden] { display: none; }
.survey-login { color: var(--accent); }
.survey-footer { display: flex; flex-wrap: wrap; gap: 20px; margin: 24px 0; font-size: .85rem; }

/* Mock alignment (docs/design/app-redesign-mock.html; Owner 2026-11-09 「画面操作とはまだ乖離がある。UI/UXをいけてる風に見直して」). */
.brand { border-bottom: 0; padding-bottom: 8px; }
.brand .brand-name { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: -1px; }
.brand .brand-name span { display: inline; font-size: inherit; font-weight: inherit; letter-spacing: inherit; color: var(--pink, #ff94d1); }
.brand nav a { font-size: 13px; }
/* Signed in: the account is one quiet line, not a card. */
.account:has(#account-member:not([hidden])) { margin-top: 0; padding: 0; border: 0; background: none; }
.account-member { justify-content: flex-end; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.account-member .remaining { flex: 0 1 auto; font-weight: 600; color: var(--text-muted); }
.account-member > button { min-height: 0; padding: 4px 12px; font-size: 12.5px; }
.account-member details { font-size: 12.5px; }
.account-member details summary { cursor: pointer; color: var(--text-muted); }
.account-member details[open] { flex-basis: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
.account:has(#account-member:not([hidden])) #account-status:not(.error) { font-size: 12.5px; color: var(--text-muted); text-align: right; margin: 4px 0 0; }
/* Steps as one segmented row. */
.workspace-steps { margin-top: 8px; }
.workspace-steps button[aria-current="step"] { background: var(--accent); color: var(--surface); }
/* ① Editing start */
.edit-card { padding: 28px; }
.edit-card .eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.edit-card h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.02em; }
.edit-card .lead { margin: 0 0 18px; color: var(--text-muted); }
.edit-points { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.edit-points li { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--background); display: grid; gap: 4px; }
.edit-points b { font-size: 14px; }
.edit-points span { font-size: 12.5px; color: var(--text-muted); }
.edit-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.edit-actions .btn.primary { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: var(--radius-button); background: var(--primary-background); color: var(--primary-text); font-weight: 700; text-decoration: none; box-shadow: 0 8px 28px #bd3aab30; }
/* Chat: bubbles, AI on the left and you on the right; one-line input with the send button beside it. */
#conversation-history { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; }
#conversation-history li { margin: 0; padding: 10px 13px; max-width: 92%; align-self: flex-start; border-radius: 14px; font-size: 14px; line-height: 1.6; }
#conversation-history li.me, #intake-chat-history li.me { align-self: flex-end; background: linear-gradient(105deg, #7d2a8f, #5a3aa8); border-color: transparent; color: #fff; }
.chat h2 { font-size: 15px; }
.chat .quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chat .quick button { min-height: 0; padding: 6px 12px; font-size: 12.5px; border-radius: 999px; }
:is(#conversation-form, #intake-chat-form) { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
:is(#conversation-form, #intake-chat-form) > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:is(#conversation-form, #intake-chat-form) textarea { min-height: 46px; margin: 0; resize: vertical; }
:is(#conversation-form, #intake-chat-form) > button[type=submit] { margin: 0; min-height: 46px; padding: 0 18px; }
#conversation-form > :not(label):not(textarea):not(button[type=submit]) { grid-column: 1 / -1; }
#conversation-clear { justify-self: start; min-height: 0; padding: 2px 0; border: 0; background: none; font-size: 12px; color: var(--text-muted); text-decoration: underline; }
.handoff { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: var(--radius-control); background: var(--background); }
.handoff p { margin: 0; display: grid; gap: 2px; }
.handoff span { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }

/* Demo look (Owner 2026-11-09 「全ページデザイン統一してね。操作見本の方が私は好き。」): the work screens use the same
   shell as site/demo.html + site/preview.css — wide work column, white rounded panels, and the dark purple chat. */
:root { --chat:#2a2140; --chat-text:#faf4ff; --chat-muted:#cbbbe0; --chat-bubble:#3a2d55; --chat-me:#5a3a8c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chat:#241b41; --chat-bubble:#3a2b5a; --chat-me:#6b3f86; --chat-muted:#c8bdd9; } }
:root[data-theme="dark"] { --chat:#241b41; --chat-bubble:#3a2b5a; --chat-me:#6b3f86; --chat-muted:#c8bdd9; }
@media (min-width: 861px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); max-width: 1240px; margin: 0 auto; gap: 16px; }
  .chat { margin-top: 98px; }
}
/* Header: the mock's brand row. */
#work-brand { padding: 6px 0 0; }
#work-brand .brand-name img { width: 30px; height: 30px; }
#work-brand nav a { color: var(--text-muted); text-decoration: none; padding: 5px 10px; border-radius: 30px; }
#work-brand nav a[aria-current="page"] { color: var(--text); background: var(--soft); }
.workspace-steps { margin-top: 10px; }
/* Panels on every work screen. */
.edit-card, #intake, #completion, .prepared, .post-export { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: none; }
.screen.edit-start, #intake { margin-top: 14px; padding-top: 0; }
.screen.edit-start { padding: 0; }
.edit-card { padding: 22px; }
#intake { padding: 18px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 18px; align-items: start; }
#intake > h1 { grid-column: 2; font-size: 16px; margin: 0; }
#intake > .intake-photo { grid-column: 1; grid-row: 1 / span 3; width: 220px; height: 220px; max-height: none; margin: 0; border-radius: 14px; }
#intake > #intake-summary, #intake > form { grid-column: 2; }
#intake-form textarea { border: 1px solid var(--border); background: var(--background); border-radius: 14px; padding: 10px 12px; }
#intake-form .hint { font-size: 12px; margin: 6px 0; }
#prepare-first { border-radius: 40px; min-height: 52px; padding: 12px 28px; }
@media (max-width: 700px) { #intake { grid-template-columns: minmax(0, 1fr); } #intake > * { grid-column: 1 !important; grid-row: auto !important; } #intake > .intake-photo { width: 100%; height: 200px; } }
#completion { padding: 18px 20px; }
#completion.done { background: var(--surface); border-color: var(--border); }
#completion.done h1 { color: var(--text); }
#completion h1 { font-size: 20px; margin: 4px 0 6px; }
.prepared { margin-top: 14px; padding: 18px; }
.prepared > h2 { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
#artifacts.panels > details { border-radius: 16px; }
#artifacts.panels > details:first-child .out { padding: 14px 16px; border-radius: 14px; font-weight: 700; font-size: 16px; }
.post-export { margin-top: 14px; padding: 18px; }
/* Chat: dark purple panel, bubbles, pill quick buttons (site/preview.css .chat). */
.chat { background: var(--chat); color: var(--chat-text); border: 0; border-radius: 22px; padding: 16px; }
.chat :is(h2, label, p, summary, span, b) { color: inherit; }
.chat .hint, .chat .chat-head span, #sales-consult-notice { color: var(--chat-muted); }
.chat-head { padding-bottom: 6px; border-bottom: 0; }
.chat > section + section { border-top-color: #ffffff1f; }
:is(#conversation-history, #intake-chat-history, #sales-consult-history) li { background: var(--chat-bubble); color: var(--chat-text); border: 0; border-radius: 14px; font-size: 14px; }
:is(#conversation-history, #intake-chat-history, #sales-consult-history) li.me { background: var(--chat-me); }
.chat .quick button, .chat button.secondary { border: 1px solid #ffffff40; background: transparent; color: var(--chat-text); box-shadow: none; }
.chat .quick button { border-radius: 20px; font-size: 12.5px; padding: 4px 12px; min-height: 0; }
.chat button.secondary:disabled { opacity: .45; }
.chat textarea, .chat input { border: 1px solid #ffffff30; background: #ffffff12; color: var(--chat-text); border-radius: 12px; }
.chat textarea::placeholder { color: var(--chat-muted); }
.chat button.primary { border-radius: 12px; }
#conversation-clear, #sales-consult-clear { color: var(--chat-muted); }

/* ① editing chat: the same bubbles as the screen sample. */
.edit-chat-log { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.edit-chat-log li { padding: 10px 13px; max-width: 92%; border-radius: 14px; font-size: 14px; line-height: 1.6; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.chip-link { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-decoration: none; color: #fff; background: linear-gradient(105deg, #bd237d, #7040d7); }

/* Light / Dark switch (static/theme.js), the same pill as the homepage header (site/styles.css .theme-switch). */
.theme-switch { display: inline-flex; background: var(--soft); border: 1px solid var(--border); border-radius: 40px; padding: 3px; }
.theme-switch button { border: 0; background: transparent; border-radius: 30px; color: var(--text-muted); min-height: 32px; padding: 4px 12px; font-size: 12px; font-weight: 600; }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px #0001; }
#work-brand nav { margin-left: auto; }
:is(#entry-guest, #account-guest) .top .theme-switch button { min-height: 32px; }
