.ai-page-body { display: grid; gap: 22px; margin-top: 18px; min-width: 0; }
.ai-wallet-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; border-block: 1px solid var(--line); padding: 16px 0; margin-bottom: 18px; font-size: 13px; }
.ai-wallet-strip strong { color: var(--rose-dark); font-size: 20px; font-variant-numeric: tabular-nums; }
.ai-wallet-strip .btn { margin-left: auto; }
.ai-spec-option:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 2px; }
.ai-spec-empty { margin: 0; }
.ai-spec-list { display: grid; gap: 10px; }
.ai-spec-option { display: grid; grid-template-columns: minmax(100px, .8fr) minmax(160px, 1.4fr) auto; gap: 12px; text-align: left; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ai-spec-option span { color: var(--muted); font-size: 12px; }
.ai-spec-option b { color: var(--rose-dark); }
.ai-spec-option.chosen { background: var(--rose-pale); border-color: var(--rose); }
.ai-quantity-row { display: flex; flex-wrap: wrap; align-items: end; gap: 18px 40px; margin: 12px 0; }
.ai-quantity-label, .ai-price-preview span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.ai-quantity-control { display: grid; grid-template-columns: 44px 60px 44px; align-items: center; height: 46px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.ai-quantity-control button { width: 44px; height: 44px; border: 0; background: var(--surface); font-size: 23px; line-height: 1; cursor: pointer; }
.ai-quantity-control button:hover:not(:disabled) { background: var(--rose-pale); }
.ai-quantity-control button:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: -3px; }
.ai-quantity-control button:disabled { opacity: .35; cursor: not-allowed; }
.ai-quantity-control output { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-price-preview strong { display: block; min-height: 46px; align-content: center; color: var(--rose-dark); font-size: 22px; font-variant-numeric: tabular-nums; }
.ai-reference-list figure { padding: 8px; border: 1px solid transparent; border-radius: 8px; }
.ai-daily-plan { padding-top: 16px; border-top: 1px solid var(--line); }
.ai-compose { display: grid; gap: 18px; }
.ai-compose form { min-width: 0; }
.ai-gallery, .ai-reference-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.ai-gallery figure, .ai-reference-list figure { margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: start; }
.ai-gallery img, .ai-gallery video, .ai-reference-list img { width: 100%; max-height: 380px; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.ai-gallery figcaption, .ai-reference-list figcaption { flex-basis: 100%; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ai-reference-list img { height: 160px; aspect-ratio: auto; }
.ai-page-body small.finance-reference { display: block; }
.ai-mobile-quote { display: none; }
.ai-step-head { margin: 4px 0 0; font-size: 15px; }
.ai-daily-details > summary { display: none; }
.ai-schedules-form, .ai-workbench-existing-list { display: grid; gap: 12px; }
.ai-schedule-day { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ai-schedule-day:last-of-type { border-bottom: 0; }
.ai-schedule-day-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ai-schedule-day-editing .ai-schedule-day-head { margin-bottom: 14px; }
.ai-schedule-day-head strong, .ai-schedule-day-head span { display: block; }
.ai-schedule-day-head > div span { margin-top: 3px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ai-schedule-status { color: var(--muted); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.ai-schedule-day-head .btn { min-height: 38px; padding: 7px 10px; white-space: nowrap; }
.ai-schedule-day-actions { display: flex; gap: 8px; }
.ai-schedule-form-actions { margin-top: 18px; }
.ai-schedule-reference-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.ai-schedule-reference-field legend { margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 650; }
.ai-schedule-reference-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; min-width: 0; }
.ai-schedule-reference-option { display: flex; min-width: 0; min-height: 72px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer; }
.ai-schedule-reference-option:has(input:checked) { border-color: var(--rose); background: var(--rose-pale); color: var(--rose-dark); }
.ai-schedule-reference-option input { width: 18px; height: 18px; flex: none; accent-color: var(--rose); }
.ai-schedule-reference-thumb { display: grid; width: 56px; height: 56px; flex: none; place-items: center; overflow: hidden; border-radius: 5px; background: var(--surface-2); }
.ai-schedule-reference-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-schedule-reference-thumb-empty { color: var(--muted); font-size: 11px; }
.ai-schedule-reference-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-schedule-overrides { margin-top: 14px; border-top: 1px solid var(--line); }
.ai-schedule-overrides > summary { padding: 12px 0; color: var(--rose-dark); font-size: 13px; font-weight: 650; cursor: pointer; }
.ai-schedule-override-list { display: grid; gap: 12px; }
.ai-schedule-override { min-width: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-schedule-override > summary { min-height: 44px; align-content: center; cursor: pointer; font-weight: 650; }
.ai-schedule-override > label { display: block; margin: 12px 0; }
.ai-schedule-override .field { margin-bottom: 12px; }
.ai-generation-target-list { display: grid; gap: 14px; }
.ai-generation-target { min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ai-generation-target:last-child { border-bottom: 0; }
.ai-generation-target > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-target-status { flex: none; color: var(--rose-dark); font-size: 12px; font-weight: 650; }
.ai-generation-target h4 { margin: 12px 0 6px; overflow-wrap: anywhere; }
.ai-generation-target p { margin: 0 0 8px; line-height: 1.65; overflow-wrap: anywhere; }
.ai-target-tags { color: var(--rose-dark); font-size: 12px; }
.ai-target-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.ai-target-assets figure { margin: 0; min-width: 0; }
.ai-target-assets img, .ai-target-assets video { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 7px; background: var(--surface-2); }
.ai-workbench { display: grid; gap: 20px; min-width: 0; }
.ai-workbench-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.ai-workbench-intro h2 { margin: 0 0 4px; }
.ai-workbench-intro p { margin: 0; color: var(--muted); }
.ai-workbench-intro > span { color: var(--rose-dark); font-size: 13px; }
.ai-workbench-form { display: grid; gap: 22px; min-width: 0; }
.ai-schedule-day-editor { min-width: 0; margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.ai-schedule-day-editor > h3 { margin: 0 0 18px; font-size: 16px; }
.ai-workbench-form > fieldset { min-width: 0; margin: 0; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); }
.ai-workbench-form > fieldset > legend { margin-bottom: 14px; font-weight: 700; }
.ai-workbench-options { display: flex; flex-wrap: wrap; gap: 9px; }
.ai-workbench-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.ai-workbench-choice:has(input:checked) { background: var(--rose-pale); border-color: var(--rose); }
.ai-workbench-choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.ai-workbench-choice input { accent-color: var(--rose); }
.ai-workbench-form .field { display: block; margin: 16px 0; }
.ai-workbench-form .textarea { display: block; width: 100%; margin-top: 7px; }
.ai-workbench-form .ai-schedule-reference-picker { margin-top: 12px; }
.ai-workbench-mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-workbench-mode { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.ai-workbench-mode:has(input:checked) { border-color: var(--rose); background: var(--rose-pale); }
.ai-workbench-mode input { grid-row: 1 / span 2; margin-top: 3px; accent-color: var(--rose); }
.ai-workbench-mode strong { font-size: 13px; }
.ai-workbench-mode span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ai-workbench-shared-config { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.ai-workbench-shared-config h3, .ai-workbench-account-configs h3 { margin: 0 0 8px; font-size: 15px; }
.ai-workbench-account-configs { min-width: 0; margin-top: 16px; }
.ai-workbench-account-list { display: grid; gap: 10px; }
.ai-workbench-account-config { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.ai-workbench-account-config > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ai-workbench-account-config > header .help { flex: none; }
.ai-workbench-account-mode { max-width: 320px; margin: 12px 0 0 !important; }
.ai-workbench [hidden] { display: none !important; }
.ai-workbench-overrides, .ai-workbench-legacy, .ai-workbench-manual { min-width: 0; }
.ai-workbench-overrides > summary, .ai-workbench-legacy > summary, .ai-workbench-manual > summary { padding: 12px 0; cursor: pointer; font-weight: 650; }
.ai-workbench-override { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.ai-workbench-override label { display: block; min-width: 0; }
.ai-workbench-summary { padding: 12px 16px; background: var(--surface-2); border-radius: 7px; line-height: 1.6; }
.ai-workbench-guide { margin: 0 0 -12px; color: var(--rose-dark); font-weight: 650; line-height: 1.6; }
.ai-workbench-existing { min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.ai-workbench-existing h3 { margin: 0 0 4px; font-size: 16px; }
.ai-workbench-existing > .help { margin: 0 0 10px; }
.ai-workbench-form .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .ai-workbench { gap: 14px; }
  .ai-workbench-intro { align-items: start; }
  .ai-workbench-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-workbench-choice { min-width: 0; overflow-wrap: anywhere; }
  .ai-workbench-form .form-grid { display: grid; grid-template-columns: 1fr; }
  .ai-workbench-form .actions { display: grid; grid-template-columns: 1fr; }
  .ai-workbench-form .actions .btn { width: 100%; min-height: 44px; white-space: normal; }
  .ai-workbench-mode-options { grid-template-columns: 1fr; }
  .ai-workbench-mode { min-height: 58px; }
  .ai-workbench-account-config { padding: 12px; }
  .ai-spec-option { grid-template-columns: 1fr auto; padding: 14px; }
  .ai-spec-option span { grid-row: 2; grid-column: 1 / -1; }
  .ai-spec-option b { grid-column: 2; grid-row: 1; }
  .ai-wallet-strip { gap: 10px 18px; }
  .ai-wallet-strip .btn { margin-left: 0; }
  .shell[data-current-page="ai"][data-role="customer"] .agent-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .shell[data-current-page="ai"][data-role="customer"] .agent-tabs .btn { padding-inline: 4px; }
  .shell[data-current-page="ai"] .ai-wallet-strip { margin-bottom: 10px; padding: 10px 0; }
  .shell[data-current-page="ai"] .ai-wallet-strip .btn { display: none; }
  .ai-mobile-quote { position: sticky; top: 58px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; margin: -16px -15px 16px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; }
  .ai-mobile-quote strong { color: var(--rose-dark); font-size: 18px; font-variant-numeric: tabular-nums; }
  .ai-reference-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ai-reference-list img { width: 100%; height: 124px; }
  .ai-reference-list figure { padding: 6px; }
  .ai-reference-list figcaption { font-size: 11px; overflow-wrap: anywhere; }
  .ai-reference-list .btn, #ai-reference-form .btn, #ai-generate-form .btn, #ai-daily-form .btn { width: 100%; min-height: 44px; white-space: normal; }
  .ai-compose { gap: 14px; }
  .ai-step-head { padding-top: 15px; border-top: 1px solid var(--line); }
  .ai-daily-details { border-top: 1px solid var(--line); }
  .ai-daily-details > summary { display: list-item; padding: 16px 0; color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; }
  .ai-daily-plan { padding-top: 0; border-top: 0; }
  #ai-generate-form .textarea { font-size: 16px; }
  .ai-schedule-day { padding: 12px 0; }
  .ai-schedule-day-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .ai-schedule-status { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .ai-schedule-day-head > .btn, .ai-schedule-day-actions { grid-column: 2; grid-row: 1; }
  .ai-schedule-day-head .btn { min-height: 44px; }
  .ai-schedule-form-actions { display: grid; grid-template-columns: 1fr; }
  .ai-schedule-form-actions .btn { width: 100%; min-height: 44px; }
  .ai-schedule-reference-picker { grid-template-columns: 1fr; }
  .ai-schedule-reference-option { min-height: 72px; padding: 8px; font-size: 13px; }
  .ai-schedule-reference-thumb { width: 56px; height: 56px; }
  .ai-schedule-override { padding: 12px; }
  .ai-generation-target { padding: 14px 0; }
  .ai-generation-target .actions { display: grid; grid-template-columns: 1fr; }
  .ai-generation-target .actions .btn { width: 100%; min-height: 44px; }
  .ai-target-assets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .ai-workbench-options { grid-template-columns: 1fr; }
}

/* Match the saved note's paragraphs without changing its publication text. */
.ai-note-preview { max-width: 680px; margin: 16px 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ai-note-preview h4 { margin: 0 0 14px; font-size: 18px; line-height: 1.5; }
.ai-note-preview .ai-note-description { white-space: pre-wrap; line-height: 1.9; font-size: 15px; margin-bottom: 16px; }
.ai-note-preview .ai-target-tags { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.ai-target-copy-form { max-width: 680px; margin-top: 16px; display: grid; gap: 12px; }
.ai-target-copy-form textarea { resize: vertical; line-height: 1.8; }
.ai-generation-target > .actions[hidden] { display: none; }
@media (max-width: 600px) { .ai-note-preview { padding: 16px; } }
