/* Shared phone-first controls. Loaded after each surface's existing theme. */
:root {
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --font-input: 16px; --touch-target: 48px; --radius-input: 12px;
  --animation-fast: 160ms; --animation-normal: 220ms;
  --safe-top: max(env(safe-area-inset-top), var(--tg-safe-top, 0px));
  --safe-right: max(env(safe-area-inset-right), var(--tg-safe-right, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left), var(--tg-safe-left, 0px));
  --keyboard-offset: 0px; --keyboard-accessory-height: 0px; --sticky-height: 0px;
}
[hidden] { display: none !important; }
dialog:not([open]) { display: none !important; }
input[type="hidden"] { display: none !important; }
input[type="file"] { display: none !important; }
.native-picker-source { display: none !important; }
html { scroll-padding: 16px 0 calc(16px + var(--keyboard-offset) + var(--keyboard-accessory-height)); }
input, textarea, select, [contenteditable="true"], [role="combobox"], .picker-trigger {
  font-size: var(--font-input) !important;
}
input::placeholder, textarea::placeholder { font-size: inherit; color: #92a1b1; opacity: 1; }
input, textarea, [contenteditable="true"] { scroll-margin: 20px; }
input:focus, textarea:focus { outline: none; }
input:focus-visible, textarea:focus-visible { outline: none; }
textarea { resize: none !important; line-height: 1.5; }
button, [role="button"], .picker-trigger { min-height: var(--touch-target) !important; min-width: var(--touch-target); touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
button:active:not(:disabled) { filter: brightness(1.12); }
button:focus-visible, a:focus-visible { outline-width: 2px; outline-offset: 2px; }
.field-heading label, .field > span, .file-picker-label, .settings-field { font-size: 14px; line-height: 1.45; }
.field-heading { gap: 6px; margin-bottom: 8px; }
.field-help, .field-error, .file-picker-message, .app-switch-description { font-size: 13px; line-height: 1.45; }
.field-help { margin-top: 7px; color: var(--muted, #a4b2c4); }
.field-error { margin-top: 7px; }
.help-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px !important; margin: -8px 0; flex: none; }
.legal-footer a, .billing-legal-links a, .legal-consent-row a, .chart-toggle { display: inline-flex; align-items: center; min-height: 44px; }
.legal-footer { gap: 0 18px; padding-bottom: calc(16px + var(--safe-bottom)); }
/* The label supplies the touch target; the visible checkbox stays compact. */
.consent-checkbox { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 44px; padding: 10px 0; margin: 0; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.5; }
.consent-checkbox input[type="checkbox"] { appearance: none; box-sizing: border-box; width: 22px; height: 22px; min-height: 22px; padding: 0; margin: 0; border: 1.5px solid var(--muted); border-radius: 6px; background: var(--surface-raised); cursor: pointer; }
.consent-checkbox input[type="checkbox"]:checked { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/18px no-repeat; }
.consent-checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.consent-checkbox-copy { min-width: 0; overflow-wrap: anywhere; }
.legal-acceptance-intro.hero { padding: 20px 0 16px; }
.legal-acceptance-intro h1 { font-size: 23px; line-height: 1.25; margin: 6px 0 8px; }
.legal-acceptance-intro .lead { font-size: 14px; line-height: 1.5; margin: 0; }
.legal-acceptance-intro .eyebrow { display: none; }
.legal-acceptance-card.surface-card { padding: 16px; gap: 8px; }
.legal-acceptance-card > .full-button { margin: 0; }
.legal-consent-row { display: block; }
.legal-consent-row .consent-checkbox { padding: 0; font-weight: 500; font-size: 14px; }
.legal-consent-row .consent-checkbox-copy { display: grid; grid-template-columns: minmax(0,1fr); gap: 2px; }
.legal-consent-row .legal-document-link { grid-column: 1; display: inline-flex; align-items: flex-start; justify-self: start; gap: 6px; min-height: 44px; padding: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 18px; text-decoration: none; }
.legal-document-link > .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.legal-document-link > span { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.legal-consent-row .legal-document-link:hover { color: var(--accent); }
.profile-share-actions { display: grid; gap: 12px; margin-top: 16px; }
.profile-share-actions > * { margin: 0; }
.bio-editor-form .consent-checkbox { padding: 8px 0; color: var(--text); }
.bio-editor-submit .consent-checkbox { padding: 0; }
.chart-toggle { padding: 0 5px; }
.icon-button, .support-file-row .icon-button { width: var(--touch-target); height: var(--touch-target); flex: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border-soft, #203348); border-radius: 12px; background: var(--surface-raised, #142538); color: var(--muted, #a4b2c4); }
.icon-button .icon { width: 21px; height: 21px; }
.field input:not([type="hidden"]):not([type="file"]), .field textarea, .picker-trigger { min-height: 50px; border-radius: var(--radius-input); }
.field input::placeholder, .field textarea::placeholder, .form-card > textarea::placeholder { color: #92a1b1; }
.field input:focus, .field textarea:focus, textarea:focus { box-shadow: 0 0 0 2px #2a8cff22; }
.form-card, .support-form { gap: 22px; }
.form-card.panel { gap: 20px; }
.file-picker-control, .file-picker-preview { min-height: 72px; padding: 14px; }
.file-picker-progress.is-indeterminate span { width: 38% !important; animation: progress-slide 1.35s ease-in-out infinite; }
.file-picker-progress[role="progressbar"] { min-width: 0; }
.offer-card .status-chip { font-size: 11px !important; line-height: 1.3; max-width: 125px; min-height: 0; padding: 4px 8px; overflow-wrap: normal; word-break: normal; white-space: normal; }
.offer-card .offer-side { max-width: 130px; }
.media-viewer.bottom-sheet { display: grid; gap: 12px; width: min(680px, 100%); max-height: min(80dvh, calc(var(--visible-height, 100dvh) - 16px)); padding: 10px 16px calc(16px + var(--safe-bottom)); }
.media-viewer .sheet-handle { margin-bottom: 0; }
.media-viewer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.media-viewer-heading strong { min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.media-viewer-heading .icon-button { flex: none; }
.media-stage { display: grid; position: relative; min-width: 0; min-height: 150px; max-height: 52dvh; overflow: auto; border-radius: 12px; background: #080c11; }
.media-player, .media-image { display: block; width: 100%; max-width: 100%; max-height: 52dvh; margin: auto; object-fit: contain; border-radius: 12px; }
.media-player { min-height: 150px; }
.media-loading { display: grid; align-content: center; justify-items: center; gap: 10px; width: 100%; min-height: 150px; padding: 20px 16px; text-align: center; background: #101b27f2; }
.media-stage:has(video) .media-loading { position: absolute; inset: 0 0 auto; z-index: 1; min-height: 116px; pointer-events: none; }
.media-stage:has(video) .media-loading button { pointer-events: auto; }
.media-loading strong { font-size: 15px; }
.media-loading small { font-size: 13px; color: #a4b2c4; }
.media-loading .inline-spinner { width: 26px; height: 26px; color: var(--accent, #328dff); }
.media-progress { height: 5px; width: 100%; min-width: 120px; max-width: 320px; }
.media-progress.is-determinate > span { animation: none; width: 0; transition: width .12s linear; }
.media-viewer-footer { display: flex; align-items: center; gap: 8px; }
.media-viewer-footer .primary { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #328dff; border-radius: 12px; padding: 12px 16px; background: #328dff; color: white; }
.media-viewer > .toast-region:not(.toast-region--top) { position: static; width: 100%; max-width: none; margin: 0; }
.media-viewer > .toast-region:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .media-progress.is-determinate > span { transition: none; } }
.support-file-row { min-width: 0; }
.support-file-row > span:first-child { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.support-upload-feedback { display: grid; gap: 8px; margin: 0; color: var(--muted, #a4b2c4); font-size: 13px; }
.inline-spinner { display: inline-block; flex: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: feedback-spin .75s linear infinite; }
.payment-loading > .inline-spinner, .submit-overlay-content > .inline-spinner { width: 32px; height: 32px; color: var(--accent, #328dff); }
.payment-loading > .inline-spinner { margin-bottom: 20px; }
button.is-loading { position: relative; cursor: progress; opacity: .8; }
button.is-loading > .inline-spinner { flex: none; }
button.is-loading::after { content: ''; display: inline-block; flex: none; width: 18px; height: 18px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: feedback-spin .75s linear infinite; }
.offer-card.is-loading::after, .creator-card.is-loading::after { position: absolute; right: 12px; }
.offer-card.is-loading > .inline-spinner, .creator-card.is-loading > .inline-spinner { position: absolute; right: 12px; background: var(--surface-raised, #111820); }
form[aria-busy="true"] { cursor: progress; }
.skeleton { position: relative; overflow: hidden; background: #151f2a; animation: none; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #24344480, transparent); transform: translateX(-100%); animation: skeleton-slide 1.6s linear infinite; }
.loading-state { display: grid; gap: 14px; padding: 20px 0; }
.skeleton-title { width: 60%; height: 24px; border-radius: 8px; }
.skeleton-card { height: 92px; border-radius: 14px; }
.page-skeleton { animation: screen-in var(--animation-fast) ease-out; }
.indeterminate-progress { position: relative; width: 100%; height: 3px; overflow: hidden; border-radius: 8px; background: var(--border-soft, #203348); }
.indeterminate-progress > span { display: block; width: 38%; height: 100%; background: var(--accent, #328dff); animation: progress-slide 1.35s ease-in-out infinite; }
.background-progress { position: fixed; top: var(--safe-top); left: 0; right: 0; z-index: 120; border-radius: 0; pointer-events: none; }
.ai-loading-state { display: grid; justify-items: center; gap: 12px; padding: 24px 16px; border: 1px solid var(--border-soft, #203348); border-radius: 16px; background: var(--surface, #0d1926); text-align: center; }
.ai-loading-state strong { font-size: 16px; }
.ai-loading-state p { margin: 0; color: var(--muted, #a4b2c4); font-size: 14px; }
.ai-loading-mark { color: var(--accent, #328dff); width: 32px; height: 32px; animation: ai-breathe 1.5s ease-in-out infinite; }
.ai-loading-mark svg { width: 100%; height: 100%; stroke-width: 1.6; }
.ai-loading-state .indeterminate-progress { max-width: 230px; margin-top: 4px; }
.keyboard-accessory { position: fixed; z-index: 100; left: 0; right: 0; display: flex; align-items: center; gap: 4px; height: 56px; transform: translateY(-100%); padding: 4px max(12px, var(--safe-right)) 4px max(12px, var(--safe-left)); border-top: 1px solid var(--border, #294057); background: #121e2b; box-shadow: 0 -3px 14px #0004; }
.keyboard-accessory button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text, #eaf1fb); font: inherit; font-weight: 600; }
.keyboard-accessory button:disabled { opacity: .35; }
.keyboard-accessory .keyboard-field-button { width: 48px; font-size: 22px; }
.keyboard-position { color: var(--muted, #a4b2c4); font-size: 13px; }
.keyboard-accessory .keyboard-done { margin-left: auto; color: var(--accent, #328dff); }
.keyboard-open { --sticky-height: 0px; }
.keyboard-open .sticky-actions { display: none !important; }
.keyboard-open .shell { padding-bottom: calc(24px + var(--keyboard-offset) + var(--keyboard-accessory-height)); }
.toast-region { position: fixed; z-index: 110; left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right)); bottom: calc(12px + var(--safe-bottom) + var(--sticky-height) + var(--keyboard-offset) + var(--keyboard-accessory-height)); max-width: 648px; margin: auto; pointer-events: none; }
.toast-region--top { top: calc(12px + var(--safe-top) + var(--visual-top, 0px)); bottom: auto; }
dialog > .toast-region:not(.toast-region--top) { bottom: calc(76px + var(--safe-bottom)); }
.keyboard-open dialog > .toast-region:not(.toast-region--top) { bottom: 12px; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px 6px 14px; border: 1px solid var(--border, #294057); border-radius: 14px; background: #182635; color: var(--text, #eaf1fb); font-size: 14px; line-height: 1.45; box-shadow: 0 8px 28px #0006; pointer-events: auto; animation: screen-in var(--animation-fast) ease-out; }
.snackbar-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.snackbar-mark { color: var(--success, #38ce96); font-size: 20px; }
.toast--success { border-color: #285749; background: #102a24; }
.toast--error { border-color: #65363c; background: #2c171b; color: #ffc1c5; }
.toast--warning { border-color: #6c522d; background: #292112; color: #f0d5a2; }
.snackbar-close, .snackbar-action { flex: none; min-width: 44px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; }
.snackbar-close { font-size: 23px; color: #bbc9d7; }
.snackbar-action { color: #82bdff; font-weight: 600; }
.toast--leaving { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.bottom-sheet, .admin-dialog { overscroll-behavior: contain; }
.bottom-sheet { position: fixed; inset: auto 0 0; width: min(680px, 100%); max-height: calc(var(--visible-height, 100dvh) - 16px); overflow: auto; margin: 0 auto; padding: 12px max(16px, var(--safe-right)) calc(16px + var(--safe-bottom)) max(16px, var(--safe-left)); border: 1px solid var(--border, #294057); border-radius: 20px 20px 0 0; background: var(--surface-raised, #0d1926); color: var(--text, #eaf1fb); }
.bottom-sheet::backdrop, .admin-dialog::backdrop { background: #0009; }
.bottom-sheet { max-width: min(680px, 100%); }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 5px; background: #526273; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-heading h2 { margin: 0; font-size: 18px; }
.picker-options { overflow: auto; overscroll-behavior: contain; min-height: 0; }
.picker-sheet { display: flex; flex-direction: column; gap: 12px; }
.picker-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 16px; text-align: left; }
.picker-option--selected { border-color: var(--accent, #328dff); background: #102b48; }
.picker-option .icon { width: 20px; height: 20px; }
.sheet-done { width: 100%; margin-top: 12px; }
.picker-search { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--border, #294057); border-radius: 12px; background: var(--surface, #111820); color: inherit; }
.custom-select { min-width: 0; width: 100%; }
div.field, label.field { border: 0; padding: 0; background: transparent; }
.error-retry { display: inline-flex; margin: 0 0 0 8px; }
.error:empty { display: none; }
.custom-select .field-heading { display: none; }
.custom-select .picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 12px 14px; border: 1px solid var(--border, #294057); background: var(--surface, #111820); color: inherit; text-align: left; }
.custom-select .picker-trigger svg { width: 18px; height: 18px; flex: none; }
.custom-select .picker-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select .picker-value { display: none; }
.sheet-form { display: grid; gap: 20px; }
.sheet-form .field-heading label { color: var(--muted, #a4b2c4); }
.sheet-form input:not([type="hidden"]), .sheet-form textarea { display: block; width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--border, #294057); border-radius: 12px; background: var(--surface, #111820); color: inherit; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-form p { margin: 0; font-size: 14px; color: var(--muted, #a4b2c4); line-height: 1.5; }
.modal-open { position: fixed; width: 100%; overflow: hidden; }
.message-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px; }
.message-composer-input, .offer-message-form .message-composer-input, .ai-advice-draft .message-composer-input { min-height: 48px; max-height: 180px; margin: 0; padding: 10px 12px; }
.composer-send { width: 48px; height: 48px; padding: 0; margin: 0; border: 0; border-radius: 10px; background: var(--accent, #328dff); color: #fff; }
.composer-send .icon { width: 20px; height: 20px; }
.composer-send.is-loading .icon { display: none; }
.composer-send.is-loading::after { margin: 0; }
.composer-send:disabled { background: transparent; color: var(--subtle, #8295ac); }
.composer-send > .button-label { display: none; }
.date-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.date-day { min-width: 0; min-height: 44px !important; }
.admin-shell { min-height: var(--app-height, 100dvh); }
.sidebar { height: var(--app-height, 100dvh); }
body.menu-open { overflow: hidden; }
.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 48px; }
.admin-shell .global-search { min-height: 50px; }
.admin-shell .global-search input { min-height: 44px; }
.admin-shell input:focus-visible, .admin-shell textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px #328dff22; }
main > .hero, main > .detail-card, main > .list, .bottom-sheet[open], .admin-dialog[open] { animation: screen-in var(--animation-fast) ease-out; }
@media (max-width: 680px) {
  .shell { padding-top: var(--safe-top); padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); }
  .topbar { min-height: 52px; }
  .page-nested .shell > .topbar, .page-nested .hero > .eyebrow { display: none; }
  .hero { padding: 16px 0 14px; }
  .back { margin-top: 0; font-size: 15px; }
  .profile-hero { padding: 18px 0 14px; }
  .surface-card, .detail-card, .evidence-card, .empty-state { padding: 16px; }
  .detail-grid { gap: 18px 14px; }
  .lead, .detail-hint, .profile-subtitle, .card-copy { font-size: 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 22px; }
  .primary, .secondary, .danger { font-size: 15px; }
  .app-switch-description { font-size: 13px; }
  .summary { margin: 20px 0; }
  .section-head { margin-top: 28px; }
  .payment-loading { min-height: 42dvh; }
  .admin-dialog, .material-viewer { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(var(--visible-height, 100dvh) - 16px); margin: 0 auto; overflow: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + var(--safe-bottom)); }
  .admin-shell .topbar { min-height: calc(60px + var(--safe-top)); height: auto; padding-top: var(--safe-top); padding-left: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
  .admin-shell main { padding-left: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); padding-bottom: calc(40px + var(--safe-bottom)); }
  .admin-shell .sidebar { padding-top: calc(26px + var(--safe-top)); padding-bottom: calc(18px + var(--safe-bottom)); }
  .admin-shell .global-search { flex: 1 1 0; min-width: 0; }
  .admin-shell .global-search input { width: 100%; }
  .admin-shell .topbar-actions { flex: none; }
  .admin-shell .notification-button, .admin-shell .menu-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
.keyboard-open .bottom-sheet, .keyboard-open .admin-dialog { bottom: calc(var(--keyboard-offset) + var(--keyboard-accessory-height)); max-height: calc(var(--visible-height, 100dvh) - var(--keyboard-accessory-height) - 12px); padding-bottom: 16px; }
@keyframes feedback-spin { to { transform: rotate(360deg); } }
@keyframes skeleton-slide { to { transform: translateX(100%); } }
@keyframes progress-slide { from { transform: translateX(-110%); } to { transform: translateX(365%); } }
@keyframes ai-breathe { 50% { opacity: .45; transform: scale(.9); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .skeleton::after { display: none; }
  .inline-spinner, .indeterminate-progress > span, .file-picker-progress span, .ai-loading-mark { animation: none !important; }
  button.is-loading::after { animation: none; border-style: dotted; }
  .indeterminate-progress > span, .file-picker-progress.is-indeterminate span { width: 100% !important; opacity: .55; }
  .toast, .page-skeleton, main > .hero, main > .detail-card, main > .list, .bottom-sheet[open], .admin-dialog[open] { animation: none; }
}
/* Existing Reclorio tokens, made explicit for the new compact creator tools. */
:root { --surface-selected: var(--accent-soft, #102b48); --border-active: var(--accent, #2a8cff); --accent-pressed: #2478dc; --font-page-title: 24px; --font-section-title: 18px; --font-body: 16px; --font-caption: 13px; }
.creator-navigation { display: grid; grid-template-columns: .85fr 1.15fr .85fr 1.3fr; gap: 2px; }
.creator-navigation button { min-width: 0; padding: 8px 3px; font-size: 12px; overflow-wrap: normal; }
.creator-navigation .icon { width: 16px; height: 16px; margin-right: 4px; }
.creator-navigation button:last-child { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px; }
.reach-material { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: grid; gap: 8px; }
.reach-material .file-card { border: 0; padding: 0; }
.reach-freshness { justify-self: start; border-radius: 8px; padding: 4px 8px; color: var(--success); background: var(--surface); font-size: var(--font-caption); }
.reach-freshness--stale { color: var(--warning); }
.reach-material-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.writer-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--font-page-title); line-height: 1.25; overflow-wrap: anywhere; }
.writer-title .icon { width: 24px; height: 24px; color: var(--accent); }
.writer-conversations { display: grid; gap: 10px; margin-top: 20px; }
.writer-chat { display: flex; flex-direction: column; min-height: calc(var(--visible-height, 100dvh) - 130px); gap: 16px; }
.writer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.writer-heading > div { min-width: 0; }
.writer-heading .eyebrow { font-size: 12px; }
.writer-messages { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; padding-bottom: 12px; }
.writer-bubble { max-width: 94%; border-radius: 14px; padding: 12px 14px; overflow-wrap: anywhere; min-width: 0; }
.writer-bubble--user { align-self: flex-end; background: var(--accent-soft); }
.writer-bubble--assistant { align-self: flex-start; background: var(--surface-raised); border: 1px solid var(--border-soft); }
.writer-sender { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.writer-rich p { margin: 0 0 6px; line-height: 1.5; font-size: 16px; white-space: pre-wrap; }
.writer-rich p:empty { height: 4px; margin: 0; }
.writer-rich h2 { font-size: 17px; line-height: 1.4; margin: 12px 0 6px; }
.writer-intro { color: var(--muted); font-size: 16px; line-height: 1.5; }
.writer-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.writer-quick button { padding: 10px 12px; font-size: 13px; }
.writer-compose { position: sticky; bottom: calc(var(--keyboard-offset, 0px) + var(--keyboard-accessory-height, 0px)); z-index: 5; background: var(--bg); padding: 8px 0 calc(8px + var(--safe-bottom)); margin-top: auto; }
.writer-compose .message-composer { grid-template-columns: 48px minmax(0,1fr) 48px; }
.writer-compose .message-composer-input { min-width: 0; width: 100%; }
.writer-compose .icon-button { background: transparent; border: 0; }
.writer-files { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.writer-file { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px; background: var(--surface); border-radius: 10px; }
.writer-file-name { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow-wrap: anywhere; text-align: left; background: transparent; border: 0; color: var(--text); font-size: 13px; }
.writer-file small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.writer-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.writer-attachment-sheet, .writer-menu { display: grid; gap: 16px; }
.writer-typing { min-width: 160px; }
.writer-typing small { color: var(--muted); font-size: 13px; }
.typing-dots { display: flex; gap: 5px; padding: 10px 0 2px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: writer-typing 1.1s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .14s; }.typing-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes writer-typing { 0%,70%,100% { opacity: .35; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .8; } }
.reach-add-channel { margin-top: 24px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 12px; }
.reach-add-channel > summary { display: flex; align-items: center; min-height: var(--touch-target); cursor: pointer; font-size: 16px; color: var(--muted); }
.reach-add-channel .form-card { border: 0; padding: 12px 0 0; margin: 0; }

/* Component correction: theme colours stay unchanged; sizes no longer inherit CTA styles. */
:root { --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px; --action-blue: color-mix(in srgb, var(--accent, var(--blue, #2a8cff)) 83%, black); }
.primary { background: var(--action-blue); color: #fff; }
.primary:hover { background: color-mix(in srgb, var(--accent, var(--blue, #2a8cff)) 78%, black); filter: none; }
.primary:active { filter: brightness(.94); }
.icon { width: var(--icon-md); height: var(--icon-md); }
.icon-button .icon, .composer-send .icon { width: var(--icon-md); height: var(--icon-md); }
.status-chip { min-height: 0; width: fit-content; max-width: 100%; padding: 4px 8px; border: 0; border-radius: 8px; font-size: 12px !important; font-weight: 600; line-height: 1.35; white-space: normal; overflow-wrap: normal; word-break: normal; }
.offer-card .status-chip { font-size: 11px !important; max-width: 130px; padding: 4px 7px; }
.status-chip--danger { white-space: nowrap; }
.bottom-sheet { height: max-content; min-height: 0; align-content: start; align-items: start; grid-auto-rows: max-content; }
.bottom-sheet > button:not(.sheet-handle):not(.icon-button) { align-self: start; }
/* Flex-column sheets: "align-items: start" above would shrink every row to its content and pin it left. */
.picker-sheet { align-items: stretch; }
.picker-sheet > button:not(.sheet-handle):not(.icon-button) { align-self: stretch; }
button.sheet-handle { position: relative; display: block; width: 100%; height: 44px; min-height: 44px !important; min-width: 44px; margin: -12px 0 -4px; padding: 0; border: 0; border-radius: 10px; background: transparent; box-shadow: none; cursor: grab; touch-action: none; flex: none; }
button.sheet-handle::after { content: ''; display: block; position: absolute; left: calc(50% - 18px); top: 20px; width: 36px; height: 4px; border: 0; border-radius: 4px; background: #526273; }
button.sheet-handle:active { cursor: grabbing; transform: none; }
.sheet-dragging { animation: none !important; transition: none !important; user-select: none; }
.sheet-heading h2, .writer-attachment-sheet h2 { font-size: 18px; line-height: 1.35; margin: 0; }
.sheet-heading .icon-button, .writer-heading .icon-button { width: 48px; height: 48px; padding: 0; }
.writer-attachment-sheet, .writer-menu { gap: 12px; }
.writer-attachment-sheet .field { margin: 0; }
.writer-attachment-sheet > .secondary, .writer-attachment-sheet > .primary { width: 100%; min-height: 48px; padding: 12px 16px; }
.writer-attachment-sheet .file-picker-control { min-height: 76px; }
.writer-attachment-sheet .field-help { margin: 0; font-size: 12px; line-height: 1.45; }
.message-composer { gap: 4px; padding: 4px; align-items: end; }
.message-composer-input, .offer-message-form .message-composer-input, .ai-advice-draft .message-composer-input { min-height: 48px; padding: 12px 8px; line-height: 24px; border: 0; background: transparent; box-shadow: none; }
.message-composer-input:focus { box-shadow: none; }
.writer-compose .message-composer { grid-template-columns: 48px minmax(0,1fr) 48px; }
.writer-compose .icon-button { color: var(--muted); }
.writer-compose { padding-top: 8px; }
.writer-chat { gap: 12px; }
.writer-heading .eyebrow { display: none; }
.writer-heading .writer-title { font-size: 22px; line-height: 1.3; }
.writer-intro { font-size: 14px; line-height: 1.5; margin: 4px 0 12px; }
.writer-quick { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.writer-quick button { justify-content: flex-start; text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 500; }
.writer-conversations .file-copy strong { white-space: normal; overflow-wrap: normal; line-height: 1.4; }
@media (min-width: 700px) {
  .bottom-sheet:not(.media-viewer) { width: min(520px, calc(100vw - 48px)); max-width: 520px; bottom: 24px; max-height: min(82dvh,720px); border-radius: 20px; padding: 12px 20px 20px; }
  .writer-chat { min-height: min(780px,calc(var(--visible-height,100dvh) - 120px)); }
}
@media (prefers-reduced-motion: reduce) { .sheet-dragging { transition: none !important; } }
/* One disclosure heading, with a clear hit area and an explicit expansion cue. */
.reach-add-channel { padding: 0; background: var(--surface-raised); }
.reach-add-channel > summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 60px; padding: 16px; color: var(--text); font-size: 16px; font-weight: 600; border-radius: var(--radius-md); }
.reach-add-channel > summary::-webkit-details-marker { display: none; }
.reach-add-channel > summary::marker { content: ''; }
.disclosure-chevron { width: 20px; height: 20px; color: var(--muted); flex: none; transition: transform var(--animation-fast) ease-out; }
.reach-add-channel[open] .disclosure-chevron { transform: rotate(90deg); }
.reach-add-channel > summary:hover { background: var(--surface-hover); }
.reach-add-channel > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reach-add-channel .form-card { background: transparent; border: 0; padding: 0 16px 16px; gap: 20px; }
.reach-add-channel .field { margin: 0; }
@media (prefers-reduced-motion: reduce) { .disclosure-chevron { transition: none; } }
/* Workload is a mode of the existing Reclorio calendar, never a second widget. */
.calendar-title { display: flex; align-items: center; gap: 10px; font-size: 24px; }
.calendar-title .icon { width: 24px; height: 24px; color: var(--accent); }
.creator-calendar { display: grid; gap: 20px; margin-top: 20px; }
.calendar-surface { padding: 8px 0; }
.calendar-view { min-width: 0; display: grid; gap: 8px; }
.calendar-view .date-nav { margin: 0; }
.calendar-view .date-grid { gap: 2px; }
.calendar-view .date-day { position: relative; min-width: 0; min-height: 44px !important; padding: 8px 0; }
.calendar-view .date-day--busy::after { content: ''; position: absolute; bottom: 4px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.calendar-view .date-day--selected.date-day--busy::after { background: var(--text); }
.calendar-view .date-day--today { outline: 1px solid var(--accent); outline-offset: -3px; }
.calendar-view .date-day--unavailable { background: var(--surface-hover); color: var(--muted); cursor: not-allowed; text-decoration: line-through; }
.calendar-view .date-day--unavailable::after { background: var(--muted); }
.calendar-progress { height: 2px; overflow: hidden; border-radius: 2px; }
.calendar-progress.is-loading { background: var(--accent-soft); }
.calendar-progress.is-loading::after { content: ''; display: block; height: 2px; width: 38%; background: var(--accent); animation: progress-slide 1.35s linear infinite; }
.calendar-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend span::before { content: ''; width: 8px; height: 8px; border: 1px solid var(--muted); border-radius: 50%; }
.calendar-legend .calendar-busy::before { border-color: var(--accent); background: var(--accent); }
.calendar-details, .calendar-upcoming { display: grid; gap: 12px; }
.calendar-details h2, .calendar-upcoming h2 { margin: 0 0 4px; font-size: 18px; }
.calendar-task { display: grid; gap: 8px; padding: 16px; }
.calendar-brand { color: var(--text); font-size: 14px; }
.calendar-task h3 { font-size: 17px; line-height: 1.4; margin: 0; }
.calendar-task .field-help { margin: 0; }
.calendar-description { font-size: 14px; line-height: 1.5; white-space: pre-wrap; margin: 0; overflow-wrap: anywhere; }
.calendar-task-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 48px; gap: 8px; margin-top: 8px; }
.calendar-task-actions button { padding: 8px; font-size: 13px; }
.calendar-status { color: var(--success); font-size: 13px; }
.calendar-task--cancelled .calendar-status { color: var(--muted); }
.calendar-entry-sheet { display: grid; gap: 16px; }
.calendar-entry-form { gap: 20px; }
.calendar-entry-form .field { margin: 0; }
.calendar-entry-form > .primary { width: 100%; }
.calendar-entry-form textarea { min-height: 112px; }
.calendar-view .date-help { margin: 4px 0; font-size: 13px; color: var(--muted); }
.snackbar-secondary { display: block; margin-top: 4px; color: inherit; font-size: 13px; font-weight: 400; }
.snackbar-icon { flex: none; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .calendar-progress.is-loading::after { animation: none; width: 100%; opacity: .6; } }
.calendar-surface .date-nav { padding: 0 8px; }
.calendar-surface .calendar-legend { padding: 0 12px 4px; }
.calendar-view .date-day--today.date-day--selected { outline-color: var(--text); }
