/* The real-app glue for Caro's components (hand-written; design.css next to it is generated).
   Rules: no phone frame, no status bar, no paging chrome. The page is the screen. */
.d-root { height: auto; background: transparent; min-width: 0; }
.d-page { height: var(--vvh, 100dvh); width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; background: var(--d-page); overflow: hidden; padding-top: env(safe-area-inset-top); }
.d-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.d-col { display: flex; flex-direction: column; }
.d-field__box input:not([dir="auto"]) { direction: ltr; }
.d-field__err, .d-auth__formerr, .d-alertline span { overflow-wrap: anywhere; }
.d-auth__formerr { text-align: start; }
.d-auth__content { padding-bottom: 16px; }

/* Welcome: no social block, so the buttons sit on the bottom edge on every height */
.d-onb-welcome__bottom { top: auto; bottom: 34px; }
.d-onb-welcome__brand { top: max(48px, calc(50% - 210px)); }
.d-onb-welcome__line { width: auto; padding: 0 16px; }

/* Connect your AI: Skip at the top, the page scrolls between top and footer */
.d-cai__title { padding-top: 0; }

/* Meet Andy / Make it yours: flow layout instead of the prototype's 393 x 852 absolute positions */
.d-meet__hero img { width: min(240px, 62vw); height: auto; aspect-ratio: 1; }
.d-meet__title { margin-top: max(24px, 8vh); }
.d-meet__hero { margin-top: max(16px, 5vh); }
.d-meet__who { margin-top: max(16px, 3vh); }
.d-meet__line { overflow-wrap: anywhere; }
.d-ac-create { display: flex; flex-direction: column; overflow: hidden; }
.d-ac-create__title { position: static; padding: 56px 16px 0; }
.d-ac-create__preview { position: relative; left: auto; top: auto; align-self: center; width: 160px; height: 160px; margin-top: 12px; flex: none; }
.d-ac-create__preview > .d-av--160 { position: absolute; inset: 0; transition: opacity .28s ease; }
.d-ac-create__caption { position: static; margin-top: 8px; flex: none; }
.d-ac-create__body { position: static; flex: 1; min-height: 0; height: auto; overflow-y: auto; padding-bottom: 8px; }
.d-ac-create__btn { position: static; padding: 8px 16px 34px; flex: none; }
.d-ac-swatches { grid-template-columns: repeat(auto-fill, 40px); }
.d-ac-chars { grid-template-columns: repeat(auto-fill, 56px); }

/* Andy's chat pane (inside the app's two-pane shell on a wide screen, full screen on a phone) */
.d-chatpane { height: var(--vvh, 100dvh); display: flex; flex-direction: column; min-width: 0; background: var(--d-page); }
.d-chatpane .d-chdr__name { overflow: hidden; text-overflow: ellipsis; }
.d-timeline__inner { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; margin-top: auto; }
.d-timeline { scroll-behavior: auto; }
.d-bubble { max-width: min(296px, 86%); }
.d-bubble--wide { width: auto; max-width: min(296px, 86%); }
.d-bubble--wide .d-bubble__text { width: auto; }
.d-bubble--agent, .d-bubble--owner { min-width: 0; }
/* row 008: every bubble has the same 16 px sides; the room for the time is the spacer inside the text (kit.js), not padding, and not a measurement */
.d-bubble, .d-bubble--wide { padding: 12px 16px; }
.d-bubble__time, .d-bubble--wide .d-bubble__time { right: 16px; }
.d-bubble.d-rtl .d-bubble__time { right: auto; left: 16px; }
.d-bubble__spacer { display: inline-block; visibility: hidden; font-size: 12px; line-height: 16px; padding-inline-start: 10px; white-space: nowrap; }
.d-bubble__spacer::after { content: attr(data-t); }
.d-bubble__text { white-space: pre-wrap; }
.d-chip { max-width: 100%; white-space: normal; text-align: start; }
.d-chip.d-is-on { border-color: var(--d-berry); background: var(--d-berry-tint); }
.d-chip:disabled { opacity: var(--d-disabled); }
.d-chip--primary { border-color: var(--d-berry); color: var(--d-berry-text); font-weight: 600; }
.d-ch-row { padding-top: 0; }
.d-ch-row .d-chip { max-width: 100%; }
.d-composer-wrap { flex: none; background: var(--d-page); }
.d-composer-wrap .d-composer { padding-top: 8px; }
.d-composer__input textarea { min-height: 26px; }
.d-composer__input { align-self: flex-end; }
.d-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 0; }
.d-attachments .d-chip button { display: inline-grid; place-items: center; margin-inline-start: 6px; }
.d-composer__icon.d-is-rec { color: var(--d-bad); }
.d-composer__icon:disabled { opacity: var(--d-disabled); }
.d-chat-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--d-grey); font-size: 14px; line-height: 20px; }
.d-chat-state b { color: var(--d-ink); font-size: 16px; line-height: 24px; font-weight: 600; }

/* secret field card (Andy asks for a key) and the brief: built from the card base */
.d-secret { gap: 8px; }
.d-secret .d-field__box { height: 44px; }
.d-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--d-r-full); background: var(--d-surface-2); font-size: 14px; line-height: 20px; color: var(--d-grey); }
.d-pill.d-ok { color: var(--d-good); }
.d-pill img { width: 16px; height: 16px; }
.d-brief .d-sec h4 { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--d-grey); margin-bottom: 4px; }
.d-brief ul { padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 24px; }
.d-brief .d-sec + .d-sec, .d-brief .d-savings { margin-top: 8px; }
.d-cs-link { align-self: flex-start; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--d-berry-text); }
.d-row-tight { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.d-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Night 3: tab screens (Agents, Routines, Settings), overlays, Create / Edit agent, profile ---- */
.d-tab .d-lhdr { padding-top: 56px; }
.d-tab .d-ac-list, .d-tab .d-rt-list, .d-tab .d-st-root { padding-bottom: 112px; }
.d-tab .d-rt-empty { padding-bottom: 112px; }
.d-ac-list.d-scroll { padding-bottom: 112px; }
.d-grow { flex: 1; min-width: 0; }
.d-arow__text, .d-arow__l1 { min-width: 0; }
.d-arow__l1 > span { overflow: hidden; text-overflow: ellipsis; }
.d-arow__l1 .d-arow__name { flex: none; max-width: 60%; }
.d-ac-row .d-arow__text { text-align: start; }
.d-ac-listcard { display: flex; flex-direction: column; }
.d-ac-arow__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; }
.d-ac-formerr { padding: 0 16px; }
.d-ac-topbar { position: relative; flex: none; height: 56px; margin-top: 8px; display: flex; align-items: center; justify-content: center; }
.d-ac-topbar__cancel { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 16px; line-height: 22px; color: var(--d-ink); }
.d-ac-topbar__title { font-size: 18px; line-height: 26px; font-weight: 600; }
.d-ac-create--edit .d-ac-create__preview { margin-top: 8px; }
.d-is-saving .d-ac-create__body { opacity: .6; pointer-events: none; }
.d-ac-clear { display: grid; place-items: center; }

/* overlays: a fixed layer over the page; the sheet keeps the phone width on a wide screen */
.d-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; height: auto; }
.d-layer .d-overlay { position: absolute; inset: 0; pointer-events: auto; align-items: center; }
.d-layer .d-overlay:not(.d-overlay--center) { justify-content: flex-end; }
.d-layer .d-sheet { max-width: 480px; margin: 0 auto; }
.d-layer .d-cdialog { max-width: 345px; }
.d-layer .d-sheet textarea { width: 100%; font-size: 16px; line-height: 24px; outline: none; resize: none; background: transparent; }
.d-fsheet__field--multi { align-items: flex-start; }
.d-snackhost { position: fixed; top: 0; left: 0; right: 0; z-index: 90; pointer-events: none; display: flex; justify-content: center; height: auto; }
.d-snackhost .d-snackbar { position: static; margin-top: max(16px, env(safe-area-inset-top)); width: min(448px, calc(100% - 32px)); pointer-events: auto; }

/* profile */
.d-profile .d-screen { overflow: hidden; }
.d-p-rule__kind { color: var(--d-grey); font-size: 14px; line-height: 20px; }
.d-p-rule .d-col { flex: 1; min-width: 0; }
.d-chdr__name { align-self: flex-start; }
.d-p-id__role, .d-p-id__name { overflow-wrap: anywhere; }
.d-is-na { opacity: .5; }
.d-is-dim { opacity: .45; }
.d-p-hdr { padding-top: max(16px, env(safe-area-inset-top)); }
.d-p-sub .d-pad textarea { height: 200px; }

/* settings */
.d-settings .d-st-body { padding-bottom: 32px; }
.d-st-row--dim { opacity: .55; }
.d-st-row__value { font-size: 14px; line-height: 20px; color: var(--d-grey); }
.d-st-row { text-align: start; }
.d-st-row > .d-st-row__text > span { overflow-wrap: anywhere; }
.d-settings--sub .d-subhdr { padding-top: 56px; }
.d-p-chev { stroke-width: 1.5; }
.d-ac-create__body { margin-top: 10px; }
.d-search input[type="search"]::-webkit-search-cancel-button, .d-search input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* round 2: an inline text link that is a button ("Send it again"), and its off state */
.d-small .d-link { font: inherit; font-weight: 600; padding: 0; background: none; border: 0; }
.d-link:disabled { opacity: .5; cursor: default; }

/* night 4 review (M1): while a create or a save is in flight, the way out of the screen is dimmed and inert. design.css carries the prototype's selectors
   (.d-is-creating .d-ac-create__back, .d-is-saving .d-ac-edit__cancel), which name classes this app never applies; the app applies d-is-saving to both modes. */
.d-is-saving .d-ac-topbar__cancel, .d-is-saving .d-ac-create__back { opacity: .45; pointer-events: none; }
/* night 4 review (L5): the eye is a real button with a 44px tap area made of negative margin, so the 20px icon keeps its place in the field */
.d-field__eyebtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -12px; cursor: pointer; }
/* round 4 (M-A): the "now signed in as" line sits under the place where the snackbar shows, and stays */
.d-accounthost { top: 64px; z-index: 89; }

/* Customer Service (design/cs.js; the generated design-cs.css has the prototype's own rules for Maya and customers) */
.d-m-tint-0 { background: #E3EEF9; }
.d-m-tint-1 { background: #ECE8F8; }
.d-m-tint-2 { background: #E4F2E6; }
.d-m-ccard.d-m-tint-0, .d-m-ccard.d-m-tint-1, .d-m-ccard.d-m-tint-2 { color: var(--d-ink); }
.d-clist { display: flex; flex-direction: column; }
.d-m1-pad { padding: 16px; }
.d-m1-scroll-inner { display: flex; flex-direction: column; }
.d-m-others { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.d-m-ccard.d-m-plain { background: var(--d-surface); }
.d-m-ccard__who { font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.d-m-ccard__draft p, .d-m-cerr, .d-m-ccard__meta { overflow-wrap: anywhere; }
.d-m-ccard__draft p { white-space: pre-wrap; }
.d-m-ccard.d-is-busy .d-m-ccard__draft { opacity: .8; }
.d-m-crow__l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-m-crow__l1 > span { flex: none; }
.d-m1-skel .d-skel-row { height: 76px; }
.d-m-crow, .d-m-reqblock { text-decoration: none; color: inherit; }
.d-m-esheet__field { box-sizing: border-box; font-family: inherit; }
.d-m-psheet { gap: 16px; }
.d-m-psheet .d-m-esheet__title { margin-bottom: 0; }
.d-m-ownbar span { flex: 1; min-width: 0; }
.d-m-orow .d-bubble { max-width: 100%; }
.d-m-cinit { overflow: hidden; }
.d-m-crow__l1 b { flex: 0 1 auto; }
.d-m-crow__l1 > span { margin-inline-start: auto; }
/* row 021: while a reply to a choice is on its way the chosen chip keeps its full colour (a disabled chip is otherwise dimmed) */
.d-ch-row.d-is-sending .d-chip.d-is-on:disabled { opacity: 1; }
/* row 019: no fade for a reader who asked for less motion */
@media (prefers-reduced-motion: reduce) { .d-fade-in { animation: none; } }
