/*
  Template styles extracted from HTML templates.
  Purpose: keep presentation out of templates and in static CSS.
*/

/* Shared utility classes for former inline style attributes */
.icon-inherit {
  font-size: inherit;
  vertical-align: middle;
}
.toast-container-max {
  max-width: 420px;
}

/* Shared toast theme styles (loaded in both base and auth layouts). */
.app-toast {
  backdrop-filter: blur(2px);
}
.app-toast__content {
  color: inherit;
}
.app-toast__icon {
  color: inherit;
}
.app-toast__close {
  color: inherit;
  opacity: 0.72;
}
.app-toast__close:hover {
  opacity: 1;
}
.app-toast--success {
  background-color: #ecfdf5;
  color: #064e3b;
  border-color: #6ee7b7;
}
.app-toast--error {
  background-color: #fef2f2;
  color: #7f1d1d;
  border-color: #fca5a5;
}
.app-toast--info {
  background-color: #ecfeff;
  color: #164e63;
  border-color: #67e8f9;
}
.dark .app-toast--success {
  background-color: #052e16;
  color: #d1fae5;
  border-color: #047857;
}
.dark .app-toast--error {
  background-color: #450a0a;
  color: #fecaca;
  border-color: #b91c1c;
}
.dark .app-toast--info {
  background-color: #083344;
  color: #cffafe;
  border-color: #0e7490;
}
.hidden-force {
  display: none !important;
}
.draft-address-col {
  min-width: 8rem;
}
.draft-popup-anchor {
  top: 0;
  left: 0;
}
.task-thread-body-frame {
  min-height: 4rem;
  max-height: 70vh;
}
.task-email-body-min {
  min-height: 4rem;
}
.draft-signature-separator {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.draft-swatch-fore-default {
  background-color: #000000;
}
.draft-swatch-back-default {
  background-color: #fef08a;
}

/* Sidebar styles (moved from templates/includes/sidebar.html) */
#app-sidebar .sidebar-theme-icon-light,
#app-sidebar .sidebar-theme-icon-dark { display: none; }
html:not(.dark) #app-sidebar .sidebar-theme-icon-dark { display: inline-flex; }
html.dark #app-sidebar .sidebar-theme-icon-light { display: inline-flex; }

.sidebar-modern .sidebar-nav-link { position: relative; }
.sidebar-modern .sidebar-nav-link:hover span:first-of-type:not(.bg-cyan-500\/20) { background: rgb(226 232 240); color: rgb(71 85 105); }
.dark .sidebar-modern .sidebar-nav-link:hover span:first-of-type:not(.bg-cyan-500\/20) { background: rgba(255,255,255,0.1); color: rgb(226 232 240); }
/* Keep icon hover/active pills visibly rounded in collapsed sidebar state */
#app-sidebar .sidebar-nav-link > span:first-of-type {
  border-radius: 0.625rem !important;
  overflow: hidden;
  background-clip: padding-box;
}
#app-sidebar {
  width: 72px;
  box-sizing: border-box;
  contain: layout style paint;
  isolation: isolate;
}
#app-sidebar .sidebar-text {
  display: none;
}
#app-sidebar .sidebar-brand,
#app-sidebar .sidebar-user-row {
  justify-content: center;
}
#app-sidebar nav {
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#app-sidebar nav ul {
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#app-sidebar nav li {
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}
#app-sidebar nav li.sidebar-nav-item-jobs {
  margin-top: 0.5rem;
}
#app-sidebar .sidebar-nav-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding: 0.5rem 0 !important;
  border-left-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
}
#app-sidebar .sidebar-nav-link > span:first-of-type {
  flex-shrink: 0;
}
#app-sidebar .sidebar-user-card {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
#app-sidebar .sidebar-user-actions {
  margin-left: 0;
}
#app-sidebar .material-icons:not(.sidebar-theme-icon-light):not(.sidebar-theme-icon-dark) {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#app-sidebar nav .sidebar-nav-link > span:first-of-type .material-icons {
  width: 100%;
  height: 100%;
}
#app-sidebar .sidebar-user-actions .material-icons {
  width: 100%;
  height: 100%;
}
#app-mobile-nav .mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#app-mobile-nav .mobile-nav-grid.mobile-nav-grid--admin {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
#app-mobile-nav .mobile-nav-item-link {
  width: 100%;
  min-width: 0;
  max-width: none;
}
@media (max-width: 639px) {
  #app-mobile-nav .mobile-icon-only-text {
    display: none !important;
  }
  #app-mobile-nav .mobile-nav-item-link {
    justify-content: center;
    gap: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* Settings account accordion styles (moved from templates/settings.html) */
.account-accordion > summary::-webkit-details-marker { display: none; }
.account-accordion[open] .account-chevron { transform: rotate(180deg); }
.account-accordion-content {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 260ms ease, opacity 180ms ease;
}
.account-accordion-content-inner {
  overflow: hidden;
}
.account-accordion[open] .account-accordion-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Action form styles (moved from templates/actions/form_content.html) */
.custom-select-dropdown { position: relative; }
.custom-select-dropdown .custom-select-native {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%;
}
.custom-select-trigger {
  position: relative;
  display: flex; align-items: center; width: 100%; padding: 0.5rem 0.75rem; padding-right: 2.25rem;
  font-size: 0.875rem; line-height: 1.25rem; text-align: left;
  border-radius: 0.5rem; border: 0;
  background: rgb(243 244 246); color: rgb(17 24 32);
}
.dark .custom-select-trigger {
  background: rgba(255,255,255,0.05); color: #fff;
}
.custom-select-trigger .select-arrow { transition: transform 0.2s ease-out; }
.custom-select-dropdown[data-open="true"] .custom-select-trigger .select-arrow { transform: translateY(-50%) rotate(180deg); }
#create-action .custom-select-list {
  position: absolute; top: calc(100% + 0.25rem) !important; left: 0; right: 0;
  max-height: 12rem; overflow-y: auto; z-index: 50;
  border-radius: 0.5rem; border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.custom-select-list--long { max-height: 18rem; }
.dark #create-action .custom-select-list,
.dark [id^="edit-action-"] .custom-select-list {
  border-color: rgba(255,255,255,0.1); background: rgb(31 41 55); color: #fff;
}
[id^="edit-action-"] .custom-select-list {
  position: absolute; top: calc(100% + 0.25rem) !important; left: 0; right: 0;
  max-height: 12rem; overflow-y: auto; z-index: 50;
  border-radius: 0.5rem; border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.custom-select-option {
  display: block; width: 100%; padding: 0.5rem 0.75rem; font-size: 0.875rem; text-align: left;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.custom-select-option:hover { background: rgb(243 244 246); }
.dark .custom-select-option:hover { background: rgba(255,255,255,0.08); }
.create-action-auto-grow { overflow-y: hidden; resize: none; min-height: 3.75rem; }
#create-action textarea,
[id^="edit-action-"] textarea { border: 0; outline: none; }

/* Task form textarea autosize styles (moved from templates/tasks/form_content.html) */
.task-form textarea[name="details"],
.task-form textarea[name="actions"] {
  overflow-y: hidden;
  resize: none;
  min-height: 3.75rem;
  border: 0;
  outline: none;
}

/* Task filter checkbox styles */
.filter-checkbox-wrapper {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  overflow: hidden;
}
.filter-checkbox-wrapper input[type="checkbox"],
.filter-checkbox-wrapper input[type="radio"] {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  padding: 0;
  min-width: 1rem;
  max-width: 1rem;
  width: 1rem;
  min-height: 1rem;
  max-height: 1rem;
  height: 1rem;
  line-height: 1;
  display: block;
  flex: 0 0 1rem;
  cursor: pointer;
  appearance: none;
  border-radius: 0.25rem;
  border: 1px solid rgb(209 213 219);
  background: #fff;
}
.dark .filter-checkbox-wrapper input[type="checkbox"],
.dark .filter-checkbox-wrapper input[type="radio"] {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgb(31 41 55);
}
.filter-checkbox-wrapper input[type="checkbox"]:checked,
.filter-checkbox-wrapper input[type="radio"]:checked {
  border-color: rgb(8 145 178);
  background: rgb(8 145 178);
}
.filter-checkbox-wrapper input[type="checkbox"]:checked + .filter-checkbox-icon,
.filter-checkbox-wrapper input[type="radio"]:checked + .filter-checkbox-icon {
  opacity: 1;
}

/* Label form styles (moved from templates/labels/form_content.html) */
.dark #create-label .custom-select-trigger {
  color: #fff;
}
#create-label .custom-select-list,
[id^="edit-label-"] .custom-select-list {
  position: absolute; top: calc(100% + 0.25rem) !important; left: 0; right: 0;
  max-height: 12rem; overflow-y: auto; z-index: 50;
  border-radius: 0.5rem; border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.dark #create-label .custom-select-list,
.dark [id^="edit-label-"] .custom-select-list {
  border-color: rgba(255,255,255,0.1); background: rgb(31 41 55); color: #fff;
}
.custom-select-option {
  display: flex; align-items: center; width: 100%; min-height: 2.25rem; padding: 0 0.75rem;
  font-size: 0.875rem; line-height: 1.25rem; text-align: left;
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.accounts-checkbox-dropdown-wrapper { min-width: 0; }
.accounts-checkbox-dropdown-wrapper select {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 0; min-height: 0; overflow: hidden;
}
.accounts-checkbox-dropdown-trigger {
  position: relative;
  display: flex; align-items: center; width: 100%; padding: 0.5rem 0.75rem; padding-right: 2.25rem;
  font-size: 0.875rem; line-height: 1.25rem; text-align: left;
  border-radius: 0.5rem; border: 0;
  background: rgb(243 244 246); color: rgb(17 24 32);
}
.dark .accounts-checkbox-dropdown-trigger {
  background: rgba(255,255,255,0.05); color: #fff;
}
.accounts-checkbox-dropdown-trigger .select-arrow { transition: transform 0.2s ease-out; }
.accounts-checkbox-dropdown-wrapper[data-open="true"] .accounts-checkbox-dropdown-trigger .select-arrow { transform: translateY(-50%) rotate(180deg); }
#create-label .accounts-checkbox-dropdown-panel,
[id^="edit-label-"] .accounts-checkbox-dropdown-panel {
  position: absolute; top: calc(100% + 0.25rem) !important; left: 0; right: 0;
  width: 100%; max-width: 100%; min-width: 0;
  max-height: 12rem; overflow-y: auto; overflow-x: hidden; z-index: 50;
  border-radius: 0.5rem; border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.dark #create-label .accounts-checkbox-dropdown-panel,
.dark [id^="edit-label-"] .accounts-checkbox-dropdown-panel {
  border-color: rgba(255,255,255,0.1); background: rgb(31 41 55); color: #fff;
}
.accounts-checkbox-option {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.75rem; width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  font-size: 0.875rem; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: inherit;
}
.accounts-checkbox-option:hover { background: rgb(243 244 246); }
.dark .accounts-checkbox-option:hover { background: rgba(255,255,255,0.08); }
.accounts-checkbox-option-checkbox { flex: 0 0 5%; min-width: 0; display: flex; align-items: center; }
.accounts-checkbox-option-checkbox input { margin: 0; flex-shrink: 0; }
.accounts-checkbox-option-label { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-checkbox-dropdown-wrapper { min-width: 0; }
.actions-checkbox-dropdown-wrapper select {
  position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 0; min-height: 0; overflow: hidden;
}
.actions-checkbox-dropdown-trigger {
  position: relative;
  display: flex; align-items: center; width: 100%; padding: 0.5rem 0.75rem; padding-right: 2.25rem;
  font-size: 0.875rem; line-height: 1.25rem; text-align: left;
  border-radius: 0.5rem; border: 0;
  background: rgb(243 244 246); color: rgb(17 24 32);
}
.dark .actions-checkbox-dropdown-trigger {
  background: rgba(255,255,255,0.05); color: #fff;
}
.actions-checkbox-dropdown-trigger .select-arrow { transition: transform 0.2s ease-out; }
.actions-checkbox-dropdown-wrapper[data-open="true"] .actions-checkbox-dropdown-trigger .select-arrow { transform: translateY(-50%) rotate(180deg); }
#create-label .actions-checkbox-dropdown-panel,
[id^="edit-label-"] .actions-checkbox-dropdown-panel {
  position: absolute; top: calc(100% + 0.25rem) !important; left: 0; right: 0;
  width: 100%; max-width: 100%; min-width: 0;
  max-height: 12rem; overflow-y: auto; overflow-x: hidden; z-index: 50;
  border-radius: 0.5rem; border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}
.dark #create-label .actions-checkbox-dropdown-panel,
.dark [id^="edit-label-"] .actions-checkbox-dropdown-panel {
  border-color: rgba(255,255,255,0.1); background: rgb(31 41 55); color: #fff;
}
.actions-checkbox-option {
  display: flex; align-items: center; justify-content: flex-start; gap: 0.75rem; width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  font-size: 0.875rem; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: inherit;
}
.actions-checkbox-option:hover { background: rgb(243 244 246); }
.dark .actions-checkbox-option:hover { background: rgba(255,255,255,0.08); }
.actions-checkbox-option-checkbox { flex: 0 0 5%; min-width: 0; display: flex; align-items: center; }
.actions-checkbox-option-checkbox input { margin: 0; flex-shrink: 0; }
.actions-checkbox-option-label { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#create-label input:not([type="checkbox"]):not([type="radio"]), #create-label textarea, #create-label select,
[id^="edit-label-"] input:not([type="checkbox"]):not([type="radio"]), [id^="edit-label-"] textarea, [id^="edit-label-"] select { border: 0; outline: none; }
#create-label input[type="number"]::-webkit-inner-spin-button,
#create-label input[type="number"]::-webkit-outer-spin-button,
[id^="edit-label-"] input[type="number"]::-webkit-inner-spin-button,
[id^="edit-label-"] input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#create-label input[type="number"],
[id^="edit-label-"] input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
#create-label input[type="number"]:focus,
[id^="edit-label-"] input[type="number"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgb(6 182 212);
}

/* Task detail modal styles (moved from templates/tasks/detail_modal.html) */
dialog[id^="task-detail-"]:not([open]) {
  display: none !important;
  visibility: hidden !important;
}
dialog[id^="task-detail-"][open] {
  display: block !important;
  visibility: visible !important;
  position: fixed !important;
  inset: 0 !important;
}
.task-detail-mobile-desc {
  display: block;
  width: 100%;
}
.task-detail-desktop-desc {
  display: none;
  width: 100%;
  min-width: 0;
}
@media (min-width: 1024px) {
  .task-detail-mobile-desc {
    display: none !important;
  }
  .task-detail-desktop-desc {
    display: block !important;
  }
}

.draft-body-editor a[href] {
  color: #2563eb;
  text-decoration: underline;
}
.dark .draft-body-editor a[href] {
  color: #60a5fa;
}
.draft-body-editor a[href]:hover {
  color: #1d4ed8;
  text-decoration: underline;
}
.dark .draft-body-editor a[href]:hover {
  color: #93c5fd;
}
.draft-body-editor ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.draft-body-editor ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin: 0.5em 0;
}
.draft-body-editor li {
  margin: 0.15em 0;
}
.draft-body-editor {
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  /* Keep line boxes proportional when users apply larger inline font sizes. */
  font-size: 0.875rem;
  line-height: 1.5 !important;
}
.draft-body-editor .draft-signature-content,
.draft-body-editor .draft-signature-content * {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
.draft-body-editor .draft-signature-content img,
.draft-body-editor .gmail_signature img,
.draft-body-editor .email-signature img {
  max-width: 100% !important;
  height: auto !important;
}
.draft-body-editor .draft-signature-content table,
.draft-body-editor .gmail_signature table,
.draft-body-editor .email-signature table {
  max-width: 100% !important;
}
@keyframes draft-rewrite-blur-pulse {
  0%, 100% {
    filter: blur(0);
    opacity: 1;
  }
  50% {
    filter: blur(1.8px);
    opacity: 0.72;
  }
}
.draft-body-editor.draft-body-rewrite-processing {
  animation: draft-rewrite-blur-pulse 1.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .draft-body-editor.draft-body-rewrite-processing {
    animation: none;
    opacity: 0.75;
  }
}
.task-original-email-card:has(details[data-task-responsive-accordion]:not([open])) {
  min-height: 0 !important;
  height: auto !important;
}
details[data-task-responsive-accordion]:not([open]) {
  height: auto !important;
  min-height: 0 !important;
  flex-shrink: 1 !important;
}
details[data-task-responsive-accordion]:not([open]) > div {
  display: none !important;
  overflow: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  visibility: hidden !important;
}
.task-thread-message-body .task-thread-message-box,
.task-thread-message-body article {
  display: none !important;
}
.task-detail-email-body-iframe,
.task-thread-message-body {
  background: transparent !important;
}
.raw-email-body {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  overflow-wrap: anywhere;
}
.dark .raw-email-body {
  background: #1F2937 !important;
  color: #ffffff;
}
.dark .raw-email-body,
.dark .raw-email-body * {
  color: #ffffff !important;
}
.raw-email-body td { padding: 0.25em 0.5em 0.25em 0; }
.raw-email-body b,
.raw-email-body strong { font-weight: 700; }
.raw-email-body i,
.raw-email-body em { font-style: italic; }
.raw-email-body a {
  color: #2563eb;
  text-decoration: underline;
}
.raw-email-body a:hover { color: #1d4ed8; }
.dark .raw-email-body a { color: #60a5fa; }
.dark .raw-email-body a:hover { color: #93c5fd; }
.dark .raw-email-body a { color: #60a5fa !important; }
.dark .raw-email-body a:hover { color: #93c5fd !important; }
.raw-email-body ul { list-style-type: disc; padding-left: 1.5em; margin: 0.5em 0; }
.raw-email-body ol { list-style-type: decimal; padding-left: 1.5em; margin: 0.5em 0; }
.raw-email-body img, .raw-email-body table { max-width: 100% !important; height: auto !important; }
.task-actions-list {
  margin: 0;
  padding-left: 1.5rem;
  list-style-type: disc !important;
  list-style-position: outside;
}
.task-action-item {
  display: list-item;
  margin: 0.45rem 0 0;
  line-height: 1.55;
  padding-left: 0.3rem;
}
.task-action-item:first-child {
  margin-top: 0;
}
.task-action-item::marker {
  color: currentColor;
}
#attachment-preview-modal .attachment-preview-panel.attachment-preview-panel--compact {
  height: auto;
  max-height: none;
}
#attachment-preview-modal .attachment-preview-panel.attachment-preview-panel--compact #attachment-preview-content {
  overflow: visible;
}
#attachment-preview-modal .attachment-preview-panel.attachment-preview-panel--image-preview {
  height: auto !important;
  min-height: 200px;
  max-height: 75vh !important;
}
#attachment-preview-modal .attachment-preview-panel.attachment-preview-panel--image-preview #attachment-preview-content {
  flex: none !important;
  height: auto !important;
  max-height: none;
  overflow: auto;
}
#attachment-preview-modal .attachment-preview-panel.attachment-preview-panel--pdf #attachment-preview-content {
  overflow: hidden;
  padding-bottom: 0.5rem;
}
#attachment-preview-modal #attachment-preview-content {
  /* Keep preview scroll area visually merged with panel in both themes. */
  scrollbar-gutter: auto;
  scrollbar-color: auto transparent;
  background-clip: padding-box;
}
#attachment-preview-modal #attachment-preview-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
#attachment-preview-modal #attachment-preview-content::-webkit-scrollbar-track,
#attachment-preview-modal #attachment-preview-content::-webkit-scrollbar-corner {
  background: transparent !important;
}
.dark #attachment-preview-modal #attachment-preview-content {
  color-scheme: dark;
  scrollbar-color: #4b5563 #1f2937;
}
.dark #attachment-preview-modal #attachment-preview-content::-webkit-scrollbar-track,
.dark #attachment-preview-modal #attachment-preview-content::-webkit-scrollbar-corner {
  background: #1f2937 !important;
}
.task-detail-scroll-container {
  /* Reserve only scrollbar side to prevent content shift without creating a left gutter strip. */
  scrollbar-gutter: stable;
  background-color: inherit;
  scrollbar-color: auto transparent;
}
.task-detail-scroll-container::-webkit-scrollbar-track {
  background: transparent !important;
}
.dark .task-detail-scroll-container::-webkit-scrollbar-track {
  background: transparent !important;
}

/* Email detail modal accordion state (no inline styles in template) */
.thread-accordion-icon {
  transform: rotate(0deg);
}
.thread-accordion-icon.thread-accordion-icon-open {
  transform: rotate(180deg);
}
.thread-accordion-content {
  max-height: 0;
}
.thread-accordion-content.thread-accordion-content-open {
  max-height: none;
}

/* Shared detail modal styles (action/label/task-adjacent UX) */
.detail-modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  min-height: 0;
  max-height: calc(100vh - 2rem);
}
@media (min-width: 640px) {
  .detail-modal-panel {
    max-height: 80vh;
  }
}
.detail-modal-scroll-container {
  scrollbar-gutter: stable;
  background-color: inherit;
  scrollbar-color: auto transparent;
  -webkit-overflow-scrolling: touch;
}
.detail-modal-scroll-container::-webkit-scrollbar-track,
.dark .detail-modal-scroll-container::-webkit-scrollbar-track {
  background: transparent !important;
}
.detail-modal-section-card {
  border: 1px solid rgb(229 231 235);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  overflow: hidden;
}
.dark .detail-modal-section-card {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(31 41 55 / 0.75);
}
.detail-modal-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid rgb(229 231 235);
  background: rgb(249 250 251 / 0.9);
}
.dark .detail-modal-section-head {
  border-bottom-color: rgb(255 255 255 / 0.1);
  background: rgb(17 24 39 / 0.55);
}
.detail-modal-section-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(55 65 81);
}
.dark .detail-modal-section-title {
  color: rgb(229 231 235);
}
.detail-modal-section-body {
  padding: 0.9rem;
}
.detail-modal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.detail-modal-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  line-height: 1rem;
  font-weight: 500;
}
.detail-modal-chip-neutral {
  background: rgb(243 244 246);
  color: rgb(55 65 81);
}
.dark .detail-modal-chip-neutral {
  background: rgb(255 255 255 / 0.08);
  color: rgb(209 213 219);
}
.detail-modal-chip-cyan {
  background: rgb(6 182 212 / 0.14);
  color: rgb(14 116 144);
}
.dark .detail-modal-chip-cyan {
  color: rgb(34 211 238);
}
.detail-modal-kv-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .detail-modal-kv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.detail-modal-kv-label {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1rem;
  font-weight: 500;
  color: rgb(107 114 128);
}
.dark .detail-modal-kv-label {
  color: rgb(156 163 175);
}
.detail-modal-kv-value {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgb(31 41 55);
}
.dark .detail-modal-kv-value {
  color: rgb(229 231 235);
}
.detail-modal-kv-value-pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 75ch;
}
.detail-modal-rel-list {
  border: 1px solid rgb(229 231 235);
  border-radius: 0.75rem;
  overflow: hidden;
}
.dark .detail-modal-rel-list {
  border-color: rgb(255 255 255 / 0.1);
}
.detail-modal-rel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid rgb(229 231 235);
  background: rgb(255 255 255 / 0.5);
}
.detail-modal-rel-item:first-child {
  border-top: 0;
}
.detail-modal-rel-item:hover {
  background: rgb(249 250 251);
}
.dark .detail-modal-rel-item {
  border-top-color: rgb(255 255 255 / 0.08);
  background: rgb(31 41 55 / 0.55);
}
.dark .detail-modal-rel-item:hover {
  background: rgb(31 41 55 / 0.9);
}
.detail-modal-rel-badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.detail-modal-rel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  max-width: 100%;
  min-height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid rgb(229 231 235);
  background: rgb(255 255 255 / 0.9);
  padding: 0.5rem 0.55rem 0.5rem 0.9rem;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 500;
  color: rgb(17 24 39);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.detail-modal-rel-badge > span {
  display: inline-flex;
  align-items: center;
}
.detail-modal-rel-badge:hover {
  background: rgb(249 250 251);
  border-color: rgb(209 213 219);
  color: rgb(8 145 178);
}
.dark .detail-modal-rel-badge {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(31 41 55 / 0.85);
  color: rgb(229 231 235);
}
.dark .detail-modal-rel-badge:hover {
  background: rgb(17 24 39 / 0.9);
  border-color: rgb(34 211 238 / 0.4);
  color: rgb(34 211 238);
}

/* Scheduled-send icon button active state in draft composer. */
.draft-schedule-toggle-btn--active {
  background-color: rgb(255 255 255 / 0.22);
  color: rgb(207 250 254);
  box-shadow: inset 0 0 0 1px rgb(186 230 253 / 0.65);
}
.draft-schedule-toggle-btn--active:hover {
  background-color: rgb(255 255 255 / 0.3);
  color: rgb(236 254 255);
}
.dark .draft-schedule-toggle-btn--active {
  background-color: rgb(34 211 238 / 0.22);
  color: rgb(165 243 252);
  box-shadow: inset 0 0 0 1px rgb(103 232 249 / 0.55);
}
.dark .draft-schedule-toggle-btn--active:hover {
  background-color: rgb(34 211 238 / 0.32);
  color: rgb(236 254 255);
}

/* Force dark-mode send-and-done button to cyan in task draft composer. */
.dark button[id^="draft-send-mark-done-btn-"] {
  background-color: rgb(8 145 178) !important; /* cyan-600 */
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
}
.dark button[id^="draft-send-mark-done-btn-"]:hover {
  background-color: rgb(6 182 212) !important; /* cyan-500 */
  color: #ffffff !important;
}
.detail-modal-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px dashed rgb(209 213 219);
  border-radius: 0.75rem;
  padding: 0.8rem;
  font-size: 0.85rem;
  color: rgb(107 114 128);
}
.dark .detail-modal-empty {
  border-color: rgb(255 255 255 / 0.12);
  color: rgb(156 163 175);
}

/* Settings: connect-account picker should be compact on desktop, full-screen on mobile. */
@media (min-width: 640px) {
  dialog#connect-account-provider-modal[open] {
    position: fixed !important;
    inset: auto !important;
    top: 15vh !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    width: min(28rem, calc(100vw - 2rem)) !important;
    height: auto !important;
    max-height: 80vh !important;
    border-radius: 0.75rem !important;
    border-width: 1px !important;
    overflow-y: auto !important;
  }
}
