:where(#panel, #launcher, #lightbox) {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", Manrope, system-ui, sans-serif;
  --text: #1d1d1f;
  --soft: #424248;
  --base: rgba(255,255,255,.72);
  --base-solid: #f5f5f7;
  --surface: rgba(255,255,255,.82);
  --menu-surface: #f5f5f7;
  --rim: rgba(255,255,255,.78);
  --edge: rgba(29,29,31,.12);
  --group: #f2f2f7;
  --bubble: #f2f2f7;
  --bubble-ink: #1d1d1f;
  --accent: #005bb7;
  --status-blue: #0071e3;
  --blue: #0071e3;
  --button-hover: #0065ce;
  --accent-soft: #e5f1ff;
  --shadow: rgba(0,0,0,.14);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 24px 64px -18px rgba(0,0,0,.38), 0 0 0 1px var(--edge);
  --ease: cubic-bezier(.16,1,.3,1);
  color: var(--text);
  color-scheme: light;
  font-family: var(--font);
  font-variant-numeric: tabular-nums lining-nums;
}
@media (prefers-color-scheme: dark) {
  :where(#panel, #launcher, #lightbox) {
    --text: #f5f5f7;
    --soft: #d7d7dc;
    --base: rgba(28,28,30,.72);
    --base-solid: #1c1c1e;
    --surface: rgba(34,34,38,.83);
    --menu-surface: #27272a;
    --rim: rgba(255,255,255,.28);
    --edge: rgba(255,255,255,.16);
    --group: #303035;
    --bubble: rgba(255,255,255,.88);
    --accent: #82c2ff;
    --status-blue: #2997ff;
    --accent-soft: #19344f;
    --shadow: rgba(0,0,0,.36);
    --glass-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 28px 68px -18px rgba(0,0,0,.64);
    color-scheme: dark;
  }
}

/* Shared controls */
.panel :where(button, textarea, input),.launcher { font-family: inherit; color: inherit; }
.panel :where(button, a),.launcher,#lightbox button { -webkit-tap-highlight-color: transparent; }
.panel :where(button),.launcher,#lightbox button { appearance: none; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.panel :where(p,figure) { margin: 0; }
.panel :where(a) { text-decoration: none; }
.panel [hidden],#panel[hidden],#launcher[hidden],#sheet-shade[hidden] { display: none !important; }
.panel .sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:where(#panel, #lightbox) :where(i[data-icon]) { display: inline-flex; width: 20px; height: 20px; flex: none; }
:where(#panel, #lightbox) i svg { display: block; width: 100%; height: 100%; }
.panel button,.launcher { min-height: 44px; min-width: 44px; }
.panel .primary,.panel .secondary,.panel .pick,.launcher,.panel .rail-ask {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; border-radius: 100px; padding: 11px 18px; font-size: 15px; font-weight: 600; line-height: 1.3;
}
.panel .primary,.panel .send,.panel .rail-ask { color: #fff; background: var(--blue); }
:where(#panel,#launcher) .agent-avatar {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: linear-gradient(160deg,#3d9bff,#0063d1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
:where(#panel,#launcher) .agent-avatar::before {
  content: ""; box-sizing: border-box; width: 40%; aspect-ratio: 1;
  border: solid #fff; border-width: 2px 0 0 2px; transform: translateY(22%) rotate(45deg);
}
.panel :is(.rich,.quick,.icon-btn,.typing),#composer {
  background: var(--surface);
  border: 1px solid var(--edge);
}
.panel :is(.secondary,.pick) { color: var(--accent); background: var(--surface); border: 1px solid var(--edge); }
.panel .rich .secondary { background: var(--group); }
.panel :is(button,a),#lightbox button { transition: scale .5s var(--ease); }
.panel :is(button:enabled,a):active,#lightbox button:active,.launcher:active {
  scale: .97;
  transition-duration: .12s;
}
@media (hover:hover) {
  .panel :is(.primary,.send,.rail-ask):not(:disabled):hover { background: var(--button-hover); }
  .panel :is(.secondary,.pick,.quick,.icon-btn):not(:disabled):hover,.launcher:hover { border-color: var(--accent); }
  .launcher:hover { scale: 1.025; }
  .launcher:hover .agent-avatar { translate: 0 -1px; }
  .launcher:active { scale: .97; }
}

/* Launcher */
.chat-open { overflow: hidden; }
.launcher {
  position: fixed; z-index: 1000; right: 22px; bottom: max(22px,env(safe-area-inset-bottom));
  padding: 5px 18px 5px 6px; gap: 9px; font-size: 15px; font-weight: 700; color: var(--text);
  transition: scale .5s var(--ease), opacity .3s;
}
.launcher .agent-avatar { transition: translate .5s var(--ease); }
.launcher-label { display: inline-block; max-width: 7.5em; overflow: hidden; white-space: nowrap; }
body:not(.story-on) #launcher:not([hidden]) { animation: launcher-arrive .78s var(--ease) both; }
@keyframes launcher-arrive { from { translate: 0 12px; opacity: 0; } }
#sheet-shade { position: fixed; inset: 0; z-index: 1001; background: rgba(0,0,0,.18); }
#panel,#launcher {
  border: 1px solid var(--rim);
  background: var(--base-solid);
  box-shadow: var(--glass-shadow);
}
@supports (backdrop-filter: blur(28px)) or (-webkit-backdrop-filter: blur(28px)) {
  #panel,#launcher {
    background: var(--base);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    backdrop-filter: blur(28px) saturate(190%);
  }
}

/* Panel */
section#panel {
  position: fixed; z-index: 1002; bottom: 18px; right: 22px; display: flex; flex-direction: column; isolation: isolate; overflow: clip;
  width: min(420px,calc(100vw - 40px)); height: min(720px,calc(100dvh - 36px));
  border-radius: 30px; font-size: 17px; line-height: 1.45; transform-origin: right bottom;
}
.panel.moving { will-change: transform; }
.panel:focus { outline: none; }
.panel :focus-visible,#launcher:focus-visible,#lightbox :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(#panel) .chat-head,:where(#panel) .chat-bottom { position: relative; z-index: 1; flex: none; }
:where(#panel) .chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--edge); }
:where(#panel) .chat-head.scrolled { box-shadow: 0 3px 14px var(--shadow); }
:where(#panel) .chat-head strong { display: block; font: 700 16px/1.2 var(--font); letter-spacing: -.02em; }
:where(#panel) .chat-head small { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--soft); font-size: 13px; }
:where(#panel) .chat-head small b { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--status-blue); }
:where(#panel) .icon-btn { display: grid; place-items: center; width: 44px; height: 44px; color: var(--text); border-radius: 50%; }
:where(#panel) .chat-head .close { margin-left: auto; }
:where(#panel) .close i { width: 16px; height: 16px; }
:where(#panel) .grabber { display: none; }
:where(#panel) .thread { position: relative; flex: 1; min-height: 0; padding: 16px; overscroll-behavior: contain; overflow-y: auto; overflow-anchor: none; scrollbar-width: none; }
:where(#panel) .thread::after { display: block; height: var(--reading-space,0px); content: ""; }

/* Welcome */
:where(#panel) .welcome { padding: 3px 2px 6px; }
:where(#panel) .welcome h2 { margin: 0; font: 700 36px/1.02 var(--font); letter-spacing: -.035em; }
:where(#panel) .reveal-mask { overflow: clip; overflow-clip-margin: 2px; }
:where(#panel) .reveal-line { display: block; }
:where(#panel) .welcome > p { margin: 8px 0 15px; max-width: 32ch; color: var(--soft); font-size: 15px; line-height: 1.4; }
:where(#panel) .welcome-project {
  display: flex; flex-direction: column; overflow: hidden; height: clamp(132px,19vh,150px);
  border-radius: 20px; background: var(--surface); border: 1px solid var(--edge);
}
:where(#panel) .welcome-project img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: 50% 56%; }
:where(#panel) .welcome-project figcaption { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; font-size: 14px; }
:where(#panel) .welcome-project figcaption span { border-radius: 99px; padding: 3px 9px; font-size: 12px; font-weight: 650; color: var(--accent); background: var(--accent-soft); }
:where(#panel) .actions,:where(#panel) .action-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
:where(#panel) .actions { margin-top: 12px; }
:where(#panel) .quick { display: grid; align-content: start; justify-items: start; gap: 2px; padding: 12px 14px; text-align: left; color: var(--text); }
:where(#panel) .actions .quick { border-radius: 24px; min-height: 116px; padding: 13px 14px; align-content: end; grid-template-rows: 1fr auto auto; gap: 3px; }
:where(#panel) .actions .quick i,:where(#panel) .action-menu .quick i { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; margin-bottom: 4px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
:where(#panel) .quick span { font: 650 16px/1.15 var(--font); letter-spacing: -.02em; }
:where(#panel) .quick small { color: var(--soft); font-size: 13px; line-height: 1.25; }

/* Composer */
:where(#panel) .chat-bottom { z-index: 3; padding: 9px 14px max(9px,env(safe-area-inset-bottom)); border-top: 1px solid var(--edge); background: var(--surface); }
:where(#panel) .composer-row { display: flex; align-items: flex-end; gap: 8px; }
#menu { margin-bottom: 3px; }
#menu i { transition: transform .5s var(--ease); }
#menu[aria-expanded=true] i { transform: rotate(45deg); }
#composer { display: flex; flex: 1; align-items: flex-end; gap: 6px; min-width: 0; min-height: 50px; padding: 2px 3px 2px 15px; border-radius: 26px; }
#composer:focus-within { border-color: var(--accent); }
#prompt { flex: 1; align-self: center; min-width: 0; max-height: 100px; resize: none; border: 0; outline: none; background: transparent; font-size: 17px; line-height: 22px; padding: 6px 0; }
.panel ::placeholder { color: var(--soft); opacity: 1; }
:where(#panel) .send { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; }
#send:disabled { visibility: hidden; }
:where(#panel) .chat-note { display: flex; justify-content: center; align-items: center; min-height: 28px; text-align: center; margin-top: 4px; color: var(--soft); font-size: 12px; text-decoration: none; }
:where(#panel) .chat-note u { text-decoration-color: var(--accent); text-underline-offset: 3px; margin-left: 4px; color: var(--text); }
#menu-shade { position: absolute; inset: 0; z-index: 2; background: #14141428; }
.panel .action-menu { position: absolute; display: grid; grid-template-columns: 1fr; gap: 0; bottom: calc(100% + 6px); left: 14px; width: min(292px,calc(100% - 28px)); padding: 4px 12px; border-radius: 23px; transform-origin: bottom left; background: var(--menu-surface); border: 1px solid var(--rim); box-shadow: inset 0 1px 0 var(--rim), 0 2px 18px var(--shadow); }
.panel .action-menu .quick { display: flex; align-items: center; gap: 11px; min-height: 51px; padding: 6px 2px; border: 0; border-radius: 0; background: transparent; }
.panel .action-menu .quick + .quick { border-top: 1px solid var(--edge); }
:where(#panel) .action-menu .quick i { margin: 0; width: 29px; height: 29px; padding: 6px; border-radius: 10px; }

/* Messages */
:where(#panel) .msg { display: flow-root; margin: 12px 0 0; overflow-wrap: anywhere; }
:where(#panel) .msg.user { display: flex; justify-content: flex-end; }
:where(#panel) .msg + .msg { margin-top: 12px; }
:where(#panel) .msg.user + .user,:where(#panel) .msg.assistant + .assistant { margin-top: 3px; }
:where(#panel) .bubble,:where(#panel) .typing { position: relative; width: fit-content; max-width: 90%; padding: 11px 15px; border-radius: 21px; color: var(--text); font-size: 17px; line-height: 1.4; white-space: pre-wrap; }
.panel .user .bubble { color: #fff; background: var(--blue); border-bottom-right-radius: 6px; }
.panel .assistant .bubble { color: var(--bubble-ink); background: var(--bubble); border-bottom-left-radius: 6px; }
:where(#panel) .msg:has(+ .msg.user).user .bubble,:where(#panel) .msg:has(+ .msg.assistant).assistant .bubble { border-radius: 21px; }
:where(#panel) .msg .agent-avatar { float: left; margin: 5px 7px 0 0; }
:where(#panel) .msg .agent-avatar { width: 28px; height: 28px; }
:where(#panel) .msg .agent-avatar + .bubble { margin-left: 35px; max-width: calc(100% - 48px); }
:where(#panel) .typing { display: flex; align-items: center; gap: 5px; margin: 8px 0; padding: 14px; animation: typing-arrive .62s var(--ease) both; }
:where(#panel) .typing b { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); animation: typing-dot 1.25s ease-in-out infinite; }
:where(#panel) .typing b:nth-child(2) { animation-delay: .12s; }
:where(#panel) .typing b:nth-child(3) { animation-delay: .24s; }
@keyframes typing-arrive { from { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes typing-dot {
  0%, 60%, 100% { opacity: .48; transform: translateY(0); }
  25% { opacity: 1; transform: translateY(-4px); }
}
:where(#panel) .msg:not(:last-child) > .next-steps { display: none; }
:where(#panel) .next-steps,:where(#panel) .choice-line { display: flex; flex-wrap: wrap; gap: 7px; }
:where(#panel) .next-steps { margin-top: 8px; }
.panel .pick { padding: 9px 14px; font-size: 14px; color: var(--accent); }
.panel :is(.rich,.quick) { color: var(--text); }

/* Rich cards */
:where(#panel) .rich { min-width: 0; margin: 9px 0; overflow: hidden; border-radius: 24px; }
:where(#panel) .rich-inner { padding: 16px; }
:where(#panel) .rich h3 { margin: 4px 0; font: 700 22px/1.12 var(--font); letter-spacing: -.035em; }
:where(#panel) .rich p,:where(#panel) .rich li,:where(#panel) .rich label,:where(#panel) .disclosure-toggle { font-size: 15px; line-height: 1.5; }
:where(#panel) .rich p { margin: 6px 0; }
:where(#panel) .rich-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--accent); font: 650 13px/1.2 var(--font); letter-spacing: .02em; }
:where(#panel) .rich-head i { width: 16px; height: 16px; }
:where(#panel) .rich .primary,:where(#panel) .rich .secondary { margin-top: 8px; }
:where(#panel) .tag,:where(#panel) .budget-badge { display: inline-block; width: fit-content; padding: 2px 9px; border-radius: 100px; font-size: 11px; font-weight: 650; letter-spacing: .02em; border: 1px solid currentColor; }
.panel .tag,:where(#panel) .budget-badge { color: var(--soft); }
:where(#panel) .budget-badge.fits { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
:where(#panel) .source-note { display: block; color: var(--soft); font-size: 12px; }
:where(#panel) .project-spec { margin-top: 4px; color: var(--soft); font-size: 14px; }
:where(#panel) .card-plot h3 { font: 700 clamp(19px,5.2vw,25px)/1.3 var(--font); letter-spacing: -.035em; }
:where(#panel) .card-plot dl,:where(#panel) .stages-list { margin: 14px 0; padding: 2px 10px; border-radius: 15px; background: var(--group); }
:where(#panel) .card-plot dl { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1fr); }
:where(#panel) .card-plot dt,:where(#panel) .card-plot dd,:where(#panel) .row-data { margin: 0; padding: 9px 0; border-top: 1px solid var(--edge); font-size: 13px; line-height: 1.4; }
:where(#panel) .card-plot dt { display: flex; align-items: baseline; gap: 7px; padding-right: 8px; color: var(--text); }
:where(#panel) .card-plot dt i { width: 13px; height: 13px; align-self: flex-start; margin-top: 2px; color: var(--accent); }
:where(#panel) .card-plot dd,:where(#panel) .row-data span:last-child { color: var(--soft); text-align: right; }
:where(#panel) .card-plot :is(dt,dd):nth-child(-n+2),:where(#panel) .row-data:first-child { border: 0; }
:where(#panel) .card-plot .project-spec { margin-block: 12px 2px; }
:where(#panel) .plot-option,:where(#panel) .budget-option { padding: 11px 0; border-top: 1px solid var(--edge); }
:where(#panel) .budget-option strong { display: block; margin-bottom: 3px; }

/* Project rail */
:where(#panel) .project-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 12px)/2); gap: 12px; padding-bottom: 5px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
:where(#panel) .project-rail article { min-width: 0; margin: 0; scroll-snap-align: start; }
:where(#panel) .project-rail .project-frame { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 4/5; background: var(--group); }
:where(#panel) .project-rail .project-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
:where(#panel) .project-rail .project-body { padding: 10px 12px; }
:where(#panel) .project-rail .project-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
:where(#panel) .project-rail .project-title h3 { margin: 0; font-size: 18px; }
:where(#panel) .project-rail .project-spec { margin: 3px 0 0; font-size: 13px; }
.panel .photo-meta { position: absolute; top: 9px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 4px; color: #1d1d1f; font-size: 11px; font-weight: 650; }
.panel .photo-tag,.panel .photo-count { padding: 4px 9px; border-radius: 100px; background: rgba(255,255,255,.9); }
:where(#panel) .rail-ask { position: absolute; left: 10px; right: 10px; bottom: 10px; justify-content: space-between; }
:where(#panel) .rail-ask::after { content: "↗"; font-size: 16px; }

/* Estimate */
:where(#panel) .estimate-cover { overflow: hidden; }
:where(#panel) .estimate-scene .project-photo { width: 100%; aspect-ratio: 2.65; height: auto; object-fit: cover; object-position: 50% 56%; }
:where(#panel) .project-photo { transition: opacity .6s var(--ease); }
:where(#panel) .project-photo:not(.loaded) { opacity: 0; }
:where(#panel) .estimate-caption { padding: 13px 16px 0; }
:where(#panel) .estimate-caption .project-spec { margin: 4px 0 0; }
:where(#panel) .card-estimate .rich-inner { padding-top: 8px; }
:where(#panel) .estimate-value { position: relative; display: block; color: var(--text); font: 700 clamp(29px,8.2vw,38px)/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
:where(#panel) .price-dial { display: inline-flex; align-items: baseline; white-space: nowrap; }
:where(#panel) .digit-slot { display: inline-block; overflow: hidden; width: .6em; height: 1.18em; align-self: flex-end; text-align: center; }
:where(#panel) .digit-strip { display: block; }
:where(#panel) .digit-strip > span { display: block; height: 1.18em; line-height: 1.18; }
:where(#panel) .punctuation { align-self: center; }
:where(#panel) .price-unit { align-self: flex-end; margin: 0 0 .5em .28em; font: 600 .43em/1 var(--font); letter-spacing: -.01em; color: var(--soft); }
:where(#panel) .rich .estimate-note { margin: 6px 0 12px; font-size: 12px; color: var(--soft); }
:where(#panel) .disclosure { border-top: 1px solid var(--edge); }
:where(#panel) .disclosure-toggle { display: flex; align-items: center; justify-content: space-between; gap: 9px; width: 100%; text-align: left; font-weight: 600; }
:where(#panel) .disclosure-toggle::after { content: ""; width: 7px; height: 7px; margin: -3px 5px 0 0; border: solid var(--accent); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .2s var(--ease); }
:where(#panel) .expanded > .disclosure-toggle::after { transform: rotate(225deg); }
:where(#panel) .fold { display: none; }
:where(#panel) .expanded > .fold { display: block; }
:where(#panel) .row-data { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
:where(#panel) .row-data span:last-child { text-align: right; }
:where(#panel) .extras { margin: 6px 0 14px; padding-left: 18px; color: var(--soft); list-style: disc; }
:where(#panel) .extras li::marker { color: var(--accent); }
:where(#panel) .choice-line { border-top: 1px solid var(--edge); }
:where(#panel) .filter .disclosure { border: 0; padding-inline: 14px; }

/* Segments and stepper */
:where(#panel) .segments { display: block; min-width: 0; margin: 8px 0 12px; padding: 0; border: 0; }
:where(#panel) .segments legend,:where(#panel) .control-label { display: block; padding: 0 0 5px; font-size: 13px; color: var(--soft); }
:where(#panel) .segment-track,:where(#panel) .stepper { position: relative; display: flex; gap: 0; padding: 3px; border-radius: 17px; background: var(--group); border: 1px solid var(--edge); }
:where(#panel) .segment-track { border-radius: 99px; }
:where(#panel) .segment,:where(#panel) .segment[aria-pressed=true],:where(#panel) .step { flex: 1; z-index: 1; min-width: 0; padding: 4px; border: none; border-radius: 14px; background: transparent; color: var(--text); font-size: 14px; font-weight: 540; line-height: 1.15; }
:where(#panel) .segment[aria-pressed=true] { font-weight: 700; color: var(--accent); }
:where(#panel) .segment-pill { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc((100% - 6px) / var(--count)); border-radius: 99px; background: var(--accent-soft); box-shadow: 0 1px 4px var(--shadow); pointer-events: none; }
:where(#panel) .stepper { width: fit-content; align-items: center; }
:where(#panel) .step { min-width: 44px; color: var(--accent); font-size: 21px; }
:where(#panel) .rich input:not([type=checkbox]) { width: 100%; min-height: 44px; padding: 9px 12px; font-size: 16px; }
.panel .stepper input { width: 62px; padding-inline: 3px; text-align: center; appearance: textfield; border: solid var(--edge); border-width: 0 1px; border-radius: 0; background: transparent; font-weight: 650; }
:where(#panel) .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
:where(#panel) .edit-status,:where(#panel) .form-error,:where(#panel) .contact-done { color: var(--accent); }
:where(#panel) .edit-status:empty,:where(#panel) .form-error:empty { display: none; }

/* Facade */
:where(#panel) .facade-photo { position: relative; display: block; width: 100%; overflow: hidden; }
:where(#panel) .facade-photo .project-photo { display: block; width: 100%; aspect-ratio: 1.65; height: auto; object-fit: cover; }
:where(#panel) .photo-in-lightbox .project-photo { visibility: hidden; }
.panel .facade-photo i { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; padding: 9px; border-radius: 50%; color: #1d1d1f; background: rgba(255,255,255,.92); border: 1px solid var(--rim); }

/* Contact */
:where(#panel) .card-contact form > label { display: block; }
:where(#panel) .card-contact label input { margin-top: 5px; }
.panel .card-contact input:not([type=checkbox]) { border: 1px solid var(--edge); background: var(--surface); color: var(--text); border-radius: 13px; }
:where(#panel) .card-contact .consent { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; font-size: 13px; color: var(--soft); }
:where(#panel) .card-contact .consent input { appearance: none; position: relative; flex: none; width: 49px; height: 30px; margin: 0; border-radius: 17px; background: #75757b; cursor: pointer; }
:where(#panel) .consent input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0003; transition: transform .22s var(--ease); }
:where(#panel) .consent input:checked { background: var(--blue); }
:where(#panel) .consent input:checked::after { transform: translateX(19px); }
:where(#panel) .card-contact .primary,:where(#panel) .card-ready .primary { width: 100%; }
:where(#panel) .contact-done { display: flex; align-items: center; gap: 8px; }
.panel .card-ready .rich-head { color: var(--text); font: 700 22px/1.2 var(--font); letter-spacing: -.035em; }
:where(#panel) .card-ready .rich-head i { width: 32px; height: 32px; padding: 7px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); }
:where(#panel) .card-ready .secondary { width: 100%; }
.panel button:disabled:not(.send) { opacity: 1; background: var(--group); color: var(--soft); box-shadow: none; }

/* Lightbox */
#lightbox { position: fixed; inset: 0; margin: 0; padding: 0; max-width: none; max-height: none; width: 100%; height: 100dvh; border: 0; background: transparent; overflow: hidden; touch-action: none; }
#lightbox[open] { display: grid; place-items: center; }
#lightbox::backdrop { background: transparent; }
:where(#lightbox) .photo-shade { position: absolute; inset: 0; background: #141414dc; }
:where(#lightbox) .photo-stage { position: relative; width: min(100%,calc(100dvh * var(--photo-ratio,1.5))); aspect-ratio: var(--photo-ratio,1.5); overflow: hidden; transform-origin: top left; }
#lightbox img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
#lightbox .icon-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; z-index: 1; top: max(16px,env(safe-area-inset-top)); right: 16px; color: var(--text); background: var(--base-solid); border: 1px solid var(--rim); }

@media (max-width: 640px) {
  #site-content { transform-origin: 50% var(--site-pivot,0px); }
  body.chat-open:has(.site-head[data-tone=dark]) { background: #000; }
  /* На телефоне капсула при прокрутке вниз сжимается в круглую иконку и раскрывается, когда листают назад.
     Над готовыми вопросами и рядом с главной кнопкой она прячется: там свои входы в чат. */
  .launcher { right: 14px; bottom: max(16px,env(safe-area-inset-bottom)); font-size: 14px;
    transition: padding .5s var(--ease), gap .5s var(--ease), opacity .3s, transform .5s var(--ease), scale .5s var(--ease), visibility 0s; }
  .launcher { transform-origin: 100% 50%; }
  .launcher-label { transition: max-width .5s var(--ease), opacity .3s .1s; }
  .launcher-mini .launcher { padding: 5px; gap: 0; }
  .launcher-mini .launcher-label { max-width: 0; opacity: 0; transition: max-width .5s var(--ease), opacity .2s; }
  :is(.hero-button-visible, .launcher-away) .launcher { opacity: 0; transform: scale(.6); visibility: hidden; pointer-events: none;
    transition: padding .5s var(--ease), gap .5s var(--ease), opacity .25s, transform .4s var(--ease), visibility 0s .4s; }
  body:is(.hero-button-visible,.launcher-away) #launcher:not([hidden]) { animation: none; }
  section#panel { --sheet-gap: max(24px,env(safe-area-inset-top)); width: 100%; left: 0; right: auto; bottom: auto; top: calc(var(--viewport-top,0px) + var(--sheet-gap)); height: calc(var(--viewport-height,100dvh) - var(--sheet-gap)); border-radius: 30px 30px 0 0; border-width: 1px 0 0; }
  #panel.compact { --sheet-gap: 0px; }
  /* Пока открыт чат, страница под шторкой не прокручивается ни пальцем, ни фокусом поля. */
  html.chat-lock,html.chat-lock body { overflow: hidden; overscroll-behavior: none; }
  #sheet-shade { touch-action: none; }
  /* С клавиатурой поле ввода стоит прямо на ней: без нижнего отступа под полоску «домой» и без подписи. */
  .panel.keyboard .chat-bottom { padding-bottom: 9px; }
  .panel.keyboard .chat-note { display: none; }
  :where(#panel) .chat-head { touch-action: none; user-select: none; padding: 22px 17px 11px; }
  .panel.compact .chat-head { padding-top: max(22px,calc(env(safe-area-inset-top) + 9px)); }
  :where(#panel) .grabber { display: block; position: absolute; top: 8px; left: calc(50% - 18px); width: 36px; height: 5px; border-radius: 6px; background: var(--soft); opacity: .45; }
  .panel.compact .grabber { top: max(8px,env(safe-area-inset-top)); }
  :where(#panel) .welcome-project { height: clamp(120px,18vh,150px); }
  :where(#panel) .project-rail { grid-auto-columns: 82%; gap: 10px; }
}
@media (prefers-reduced-motion:reduce) {
  #launcher,#launcher .agent-avatar,#launcher .launcher-label,.panel *,#lightbox * {
    animation: none !important; transition: none !important; scale: none !important; translate: none !important;
  }
  :where(#panel) .project-photo { opacity: 1 !important; }
}
