/* Creation actions share the Plan reference. Match semantic controls, never
   all secondary buttons: cancellation and destructive actions keep their paint.
   Menu rows, case pickers and home tiles remain navigation surfaces. */
html body :is(#app, #sheetRoot, .tabbar) :is(
  [data-plan-action="add"], [data-timeline-add], [data-add-calendar-event],
  [data-case-task-new], [data-action="new-task"], [data-action="task-added"],
  [data-add-existing-case], [data-home-layout], [data-bulk-add], [data-bulk-start],
  [data-action="upload-next-volume"], [data-case-photo-confirm], #startUpload,
  [data-chat-document-confirm], [data-scanner-add-case],
  .rich-empty [data-route="case-type"], .rich-empty [data-route="document-case"],
  #caseForm button[type="submit"], #noteForm button[type="submit"],
  #filterForm button[type="submit"], #documentBuilderForm button[type="submit"],
  #audioMaterialForm button[type="submit"],
  #calendarEventForm:not([data-edit-event-id]) button[type="submit"],
  .cases-add-button, .case-material-trigger, [data-add-filter],
  [data-new-assistant-chat], .home-attach, .upload-file-picker
):not(.danger):not([data-close-sheet]):not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 44px;
  max-width: 100%;
  padding: var(--space-3) var(--space-6);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--creation-button-fill, linear-gradient(145deg, #836bff, #664be5));
  color: #fff;
  box-shadow: var(--creation-button-shadow, 0 8px 20px rgba(116, 88, 255, .2));
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  text-decoration: none;
  cursor: pointer;
}

/* Icon-only entry points keep their existing footprint and label. */
html body :is(#app, #sheetRoot, .tabbar) :is(
  .cases-add-button, .case-material-trigger, [data-add-filter],
  [data-new-assistant-chat], .home-attach
) {
  padding: 0 !important; /* Preserve the 44px icon footprint against form selector specificity. */
  flex-shrink: 0;
}

/* The calendar used to draw a second coloured tile around the plus. */
html body #app [data-add-calendar-event] > span {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}
html body #app [data-add-calendar-event] > strong {
  color: inherit;
  font: inherit;
}

html body :is(#app, #sheetRoot, .tabbar) :is(
  [data-plan-action="add"], [data-timeline-add], [data-add-calendar-event],
  [data-case-task-new], [data-action="new-task"], [data-action="task-added"],
  [data-add-existing-case], [data-home-layout], [data-bulk-add], [data-bulk-start],
  [data-action="upload-next-volume"], [data-case-photo-confirm], #startUpload,
  [data-chat-document-confirm], [data-scanner-add-case],
  .rich-empty [data-route="case-type"], .rich-empty [data-route="document-case"],
  #caseForm button[type="submit"], #noteForm button[type="submit"],
  #filterForm button[type="submit"], #documentBuilderForm button[type="submit"],
  #audioMaterialForm button[type="submit"],
  #calendarEventForm:not([data-edit-event-id]) button[type="submit"],
  .cases-add-button, .case-material-trigger, [data-add-filter],
  [data-new-assistant-chat], .home-attach, .upload-file-picker
):not(.danger):not([data-close-sheet]):not([hidden]):focus-visible {
  outline: 2px solid var(--creation-button-focus, #b8abff);
  outline-offset: 3px;
}

html body :is(#app, #sheetRoot, .tabbar) :is(
  [data-plan-action="add"], [data-timeline-add], [data-add-calendar-event],
  [data-case-task-new], [data-action="new-task"], [data-action="task-added"],
  [data-add-existing-case], [data-home-layout], [data-bulk-add], [data-bulk-start],
  [data-action="upload-next-volume"], [data-case-photo-confirm], #startUpload,
  [data-chat-document-confirm], [data-scanner-add-case],
  .rich-empty [data-route="case-type"], .rich-empty [data-route="document-case"],
  #caseForm button[type="submit"], #noteForm button[type="submit"],
  #filterForm button[type="submit"], #documentBuilderForm button[type="submit"],
  #audioMaterialForm button[type="submit"],
  #calendarEventForm:not([data-edit-event-id]) button[type="submit"],
  .cases-add-button, .case-material-trigger, [data-add-filter],
  [data-new-assistant-chat], .home-attach, .upload-file-picker
):not(.danger):not([data-close-sheet]):not([hidden]):disabled {
  opacity: .5;
  box-shadow: none;
  cursor: default;
}

/* Light-theme navigation and home composer: paint only, existing geometry stays. */
html[data-theme="light"] body #addMain,
html[data-theme="light"] body.home-route #app #homeAskForm.home-ai-search > button:is(.home-attach, .send-question)[data-open-global-chat] {
  background: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .30), transparent 60%),
    linear-gradient(145deg, #36dfad 0%, #12b98b 35%, #0b8060 68%, #064d3c 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(6, 95, 70, .24);
}
html[data-theme="light"] body #addMain {
  box-shadow: 0 0 14px rgba(16, 185, 129, .50),
    0 0 32px rgba(16, 185, 129, .32), 0 12px 30px rgba(6, 95, 70, .35);
}
html[data-theme="light"] body.home-route #app #homeAskForm.home-ai-search > button:is(.home-attach, .send-question)[data-open-global-chat]:disabled {
  box-shadow: none;
}

/* Match the vertical violet gradient sampled from the dark IQ wordmark.
   Paint only: preserve navigation and composer geometry, state and handlers. */
html:not([data-theme="light"]) {
  --home-iq-button-fill: linear-gradient(180deg, #8a29fa 0%, #6726e1 35%, #471ac0 70%, #330a9e 100%);
}
html:not([data-theme="light"]) body #addMain,
html:not([data-theme="light"]) body.home-route #app .home-ai-search > :is(.home-attach, .send-question) {
  background-image: var(--home-iq-button-fill) !important;
}
