/* Move prompt dialog — native <dialog>, calm design system */

/* Folder/home controls use the same native data and form flow. */
.calm-actions { --calm-menu-hover: #f3efe9; --calm-menu-line: #e8ddd4; --calm-menu-ink: #3a2f26; display: inline-flex; flex: none; }
.calm-actions-trigger { display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; width: 36px; height: 36px; padding: 6px !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: inherit !important; cursor: pointer; }
.calm-actions-trigger:is(:hover,:focus-visible) { background: var(--calm-menu-hover) !important; }
.calm-actions:not(.calm-folder-settings) > .calm-actions-trigger:is(:hover,:focus-visible) { background: radial-gradient(circle at center,var(--calm-menu-hover) 15px,transparent 16px) !important; }
.calm-actions-menu { position: fixed; z-index: 12000; inset: auto; margin: 0; padding: 6px; width: 200px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); box-sizing: border-box; border: 1px solid var(--calm-menu-line); border-radius: 12px; background: #fffefb; color: var(--calm-menu-ink); box-shadow: 0 6px 24px #3a2f2620; overflow: auto; }
.calm-actions-menu:not([hidden]) { display: flex; flex-direction: column; gap: 2px; }
.calm-actions-menu button { display: flex !important; align-items: center; gap: 10px; text-align: start !important; justify-content: flex-start !important; width: 100% !important; min-height: 44px; height: auto !important; padding: 10px 12px !important; border: 0 !important; border-radius: 7px !important; font: inherit; font-size: 14px; background: transparent !important; color: var(--calm-menu-ink) !important; box-shadow: none !important; cursor: pointer; }
.calm-actions-menu button:is(:hover,:focus-visible) { background: var(--calm-menu-hover) !important; }
.calm-actions-menu button:disabled { opacity: .45; cursor: default; }
.calm-actions-menu svg { flex: none; width: 18px; height: 18px; }
#calm-prompt-modal .calm-folder-settings .calm-actions-trigger { width: auto; font-size: 13px; border: 1px solid var(--calm-menu-line) !important; padding: 6px 10px !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-panel-header { gap: 10px !important; flex-wrap: wrap; }
#calm-prompt-modal .calm-folder-list .chat-prompt-panel-title { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#calm-prompt-modal .calm-folder-list .chat-prompt-list { display: flex !important; flex-direction: column !important; gap: 0 !important; padding: 8px 20px !important; margin: 0 !important; max-height: calc(100dvh - 232px) !important; }
dialog#calm-prompt-modal.calm-prompt-modal:has(.calm-folder-list) { max-height: calc(100dvh - 24px); }
#calm-prompt-modal :is(.calm-folder-list,.chat-prompt-panel-inner:has(#cpf-cat-name)) > .chat-prompt-panel-header { background: #faf8f5 !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-item { display: flex !important; align-items: center; gap: 8px; height: auto !important; min-height: 59px !important; box-sizing: border-box; padding: 7px 0 !important; border: 0 !important; border-bottom: 1px solid #ece7df !important; background: transparent !important; border-radius: 0 !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-item[hidden] { display: none !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn::before { display: none !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn > .calm-prompt-row-icon { display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 28px !important; width: 28px !important; min-width: 28px !important; max-width: 28px !important; height: 28px; margin: 0 !important; padding: 0 !important; border-radius: 7px; background: #e8eeea; color: #4a7a68; }
#calm-prompt-modal .calm-folder-list .calm-prompt-row-icon svg { display: block !important; width: 18px !important; height: 18px !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn > span:last-child { margin: 0 !important; padding-inline-end: 0 !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; width: auto !important; flex: 1; min-height: 44px; border: 0 !important; background: transparent !important; padding: 10px 8px !important; border-radius: 8px !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn:is(:hover,:focus-visible) { background: #f3efe9 !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-add-row { padding: 16px 24px !important; margin: 0 !important; }
#calm-prompt-modal .calm-folder-list .chat-prompt-new-prompt-btn { width: 100%; min-height: 44px; border: 1px solid #e8ddd4 !important; background: transparent !important; color: inherit !important; }
#calm-prompt-modal .calm-list-search { flex: none; margin: 16px 24px 4px; width: calc(100% - 48px); box-sizing: border-box; min-height: 44px; border: 1px solid #e8ddd4; border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 14px; color: inherit; background: transparent; }
#calm-prompt-modal .calm-list-search:focus-visible { outline: none; border-color: #4a7a68; }
dialog#calm-prompt-modal:has(#cpf-cat-name) { width: min(520px,calc(100% - 32px)); }
#calm-prompt-modal:has(#cpf-cat-name) .calm-prompt-subtitle { display: none !important; }
#calm-prompt-modal:has(#cpf-cat-name) .chat-prompt-form-label { text-transform: none !important; font-size: 14px !important; font-weight: 600 !important; letter-spacing: normal !important; }
#calm-prompt-modal .calm-search-empty { margin: 16px 24px; color: inherit; }
#calm-prompt-modal [hidden], .calm-actions-menu[hidden] { display: none !important; }
#calm-prompt-modal .calm-category-appearance { margin-top: 12px; }
#calm-prompt-modal .calm-category-appearance > summary { cursor: pointer; min-height: 36px; padding: 6px 0; font-size: 14px; }
#calm-prompt-modal .calm-category-appearance > .chat-prompt-form-label { display: block; margin: 18px 0 10px !important; }
#calm-prompt-modal .calm-category-appearance .chat-prompt-icon-picker { grid-template-columns: repeat(6,minmax(0,1fr)) !important; gap: 10px !important; }
#calm-prompt-modal .calm-category-appearance .chat-prompt-icon-btn { height: 40px !important; max-width: none !important; aspect-ratio: auto !important; }
#calm-prompt-modal .calm-category-appearance .chat-prompt-color-picker { display: flex !important; justify-content: space-between !important; gap: 12px !important; flex-wrap: wrap; }
.chat-prompt-area .calm-standalone { display: inline-flex; align-items: center; padding: 4px 8px 4px 12px !important; gap: 2px; max-width: 100%; }
.chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; border: 0; padding: 0 4px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-prompt-area .chat-prompt-create { background: #fffefb; }
dialog.calm-prompt-confirm { inset: 0; margin: auto !important; width: min(400px,calc(100vw - 32px)); box-sizing: border-box; padding: 28px; border: 0; border-radius: 16px; background: #fffefb; color: #3a2f26; box-shadow: 0 16px 56px #3a2f2630; }
.calm-prompt-confirm::backdrop { background: #302a2455; }
.calm-prompt-confirm h2 { margin: 0 0 12px; font-size: 21px; }
.calm-prompt-confirm p { margin: 0 0 24px; }
.calm-confirm-actions { display: flex; gap: 12px; justify-content: flex-end; }
.calm-confirm-actions button { min-height: 44px; padding: 10px 16px; border: 1px solid #e8ddd4; border-radius: 12px; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.calm-confirm-actions .calm-confirm-accept { background: #a44e40 !important; color: white !important; border-color: #a44e40; }
.calm-form-error { color: #a03728; font-size: 13px; }
[data-theme="dark"] .calm-actions { --calm-menu-hover: #39362f; --calm-menu-line: #575047; --calm-menu-ink: #f0e8df; }
[data-theme="dark"] .calm-actions-menu, [data-theme="dark"] .calm-prompt-confirm { background: #2c2925 !important; color: #f0e8df !important; }
[data-theme="dark"] #calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn:is(:hover,:focus-visible) { background: #39362f !important; }
[data-theme="dark"] #calm-prompt-modal .calm-folder-list .chat-prompt-item { border-bottom-color: #474139 !important; }
[data-theme="dark"] #calm-prompt-modal :is(.calm-folder-list,.chat-prompt-panel-inner:has(#cpf-cat-name)) > .chat-prompt-panel-header { background: #302d28 !important; }
[data-theme="dark"] #calm-prompt-modal .calm-folder-list .calm-prompt-row-icon { background: #34473e; color: #bad3c6; }
[data-theme="dark"] .calm-form-error { color: #f0b3a7; }
@media(max-width:640px) {
  .calm-actions-trigger { min-width: 44px; height: 44px; }
  #calm-prompt-modal .calm-folder-list .chat-prompt-list { padding-inline: 12px !important; }
  #calm-prompt-modal .calm-folder-settings { order: 3; margin-inline-start: auto; }
  #calm-prompt-modal .calm-folder-list .chat-prompt-panel-close { margin-inline-start: auto; }
  .calm-confirm-actions { flex-wrap: wrap; }
}
@media(max-width:480px) {
  #calm-prompt-modal .calm-folder-list .chat-prompt-panel-header { flex-wrap: nowrap; }
  #calm-prompt-modal .calm-folder-list .chat-prompt-panel-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #calm-prompt-modal .calm-folder-settings { order: 1; margin-inline-start: 0; }
  #calm-prompt-modal .calm-folder-settings .calm-actions-trigger { width: 44px; padding: 10px !important; }
  #calm-prompt-modal .calm-folder-settings .calm-actions-trigger > :is(span,svg:last-child) { display: none; }
  #calm-prompt-modal .calm-folder-list .chat-prompt-panel-close { order: 2; flex: none; margin-inline-start: 0; }
}

/* Existing prompt/category forms keep their controls and save flow, in a
   viewport-contained white modal. The current AI dock remains in the panel. */
dialog#calm-prompt-modal.calm-prompt-modal {
  margin: auto !important;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  width: min(640px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  background: #FFFEFB;
  color: #3A2F26;
  box-shadow: 0 16px 56px rgba(58,47,38,.12);
  overflow: visible;
}

dialog#calm-prompt-modal.calm-prompt-modal::backdrop {
  background: rgba(251,249,246,.88);
  backdrop-filter: blur(2px);
}

html body dialog#calm-prompt-modal.calm-prompt-modal > .chat-prompt-panel {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  max-height: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  animation: none !important;
  overflow: visible !important;
}

html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel > .chat-prompt-panel-inner {
  display: flex !important;
  flex-direction: column;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: inherit !important;
  min-height: 0;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  background: #FFFEFB !important;
  box-sizing: border-box;
  overflow: hidden !important;
}

html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner > .chat-prompt-form,
html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner > .chat-prompt-list {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}

html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner > .chat-prompt-panel-header,
html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner > .chat-prompt-form-actions,
html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner > .chat-prompt-add-row {
  flex: none !important;
}

html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel-inner .chat-prompt-panel-close {
  display: flex !important;
}

html body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-form-textarea {
  max-height: min(32dvh, 280px) !important;
  overflow-y: auto !important;
}

dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-form-actions {
  padding: 14px 20px !important;
  margin-top: 0 !important;
  border-top: 1px solid rgba(58,47,38,.08);
}

dialog#calm-prompt-modal.calm-prompt-modal .calm-icon-overflow-popover,
dialog#calm-prompt-modal.calm-prompt-modal .calm-cat-icon-popover {
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

[data-theme="dark"] dialog#calm-prompt-modal.calm-prompt-modal,
[data-theme="dark"] body dialog#calm-prompt-modal.calm-prompt-modal .chat-prompt-panel > .chat-prompt-panel-inner {
  background: #2c2925 !important;
  color: #f0e8df;
}

[data-theme="dark"] dialog#calm-prompt-modal.calm-prompt-modal::backdrop {
  background: rgba(31,29,26,.88);
}

@media (min-width: 769px) {
  dialog#calm-prompt-modal.calm-prompt-modal:has(> .chat-prompt-panel > [data-calm-ai-dock].cvm-is-open) {
    width: min(1040px, calc(100% - 32px));
  }
  html body dialog#calm-prompt-modal.calm-prompt-modal .cvm-dock--inline {
    max-height: calc(100dvh - 32px) !important;
  }
}

@media (max-width: 640px) {
  dialog#calm-prompt-modal.calm-prompt-modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
}

/* The existing prompt form and AI helper share one surface. Category and move
   dialogs retain their own headers, dividers and controls. */
#calm-prompt-modal .calm-prompt-form-mode > .chat-prompt-panel-header {
  border-bottom: 0 !important;
}
#calm-prompt-modal .calm-prompt-form-mode > .chat-prompt-form-actions {
  border-top: 0 !important;
}
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-dock--inline {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-top: 0 !important;
}

/* Keep the mic on the UI edge, even when dir=auto resolves the field text in
   the opposite direction. Both fields reserve the same space for the button. */
#calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap > .cvm-mic {
  top: 8px !important;
  inset-inline-end: 12px !important;
}
#calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap:not(.calm-field-wrap--no-stt) > :is(#cpf-title, #cpf-text) {
  padding: 12px 56px 12px 14px !important;
}
html[dir="rtl"] #calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap:not(.calm-field-wrap--no-stt) > :is(#cpf-title, #cpf-text) {
  padding: 12px 14px 12px 56px !important;
}

@media (min-width: 769px) {
  #calm-prompt-modal > .chat-prompt-panel:has(.calm-prompt-form-mode) {
    column-gap: 0;
  }
  #calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-head {
    padding: 22px 22px 14px;
  }
  #calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-body {
    padding-inline: 22px;
  }
  #calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-foot {
    padding: 14px 22px 22px;
  }
}

@media (max-width: 768px) {
  #calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap > .cvm-mic {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
  }
  #calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap:not(.calm-field-wrap--no-stt) > :is(#cpf-title, #cpf-text) {
    padding: 12px 64px 12px 14px !important;
    min-height: 60px;
  }
  html[dir="rtl"] #calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap:not(.calm-field-wrap--no-stt) > :is(#cpf-title, #cpf-text) {
    padding: 12px 14px 12px 64px !important;
  }
}

@media (max-width: 768px) {
  #calm-prompt-modal .calm-prompt-form-mode .chat-prompt-form > [data-calm-ai-dock] {
    margin: 20px 0 0 !important;
    border-top: 0 !important;
    padding-top: 0 !important;
  }
  #calm-prompt-modal .calm-prompt-form-mode .cvm-dock--inline {
    padding: 0 !important;
    max-height: none !important;
  }
  #calm-prompt-modal .calm-prompt-form-mode .cvm-dock--inline .cvm-body {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
  #calm-prompt-modal .calm-prompt-form-mode .cvm-close {
    display: none !important;
  }
  #calm-prompt-modal .calm-prompt-form-mode .cvm-composer .cvm-mic {
    position: static !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
  }
  #calm-prompt-modal:has(.calm-prompt-form-mode) :is(.cvm-head, .cvm-body, .cvm-foot) {
    padding-inline: 0;
  }
}

dialog.chat-prompt-move-dialog {
  border: none;
  border-radius: 14px;
  background: var(--card-bg, #FFFEFB);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 0;
  max-width: 380px;
  width: calc(100% - 32px);
  margin: auto;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

dialog.chat-prompt-move-dialog::backdrop {
  background: rgba(0,0,0,0.3);
}

.chat-prompt-move-inner {
  display: flex;
  flex-direction: column;
}

.chat-prompt-move-dialog .chat-prompt-panel-header {
  display: flex;
  align-items: center;
  padding: 16px 20px 0;
  gap: 8px;
}

.chat-prompt-move-dialog .chat-prompt-panel-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary, #1a1a1a);
}

.chat-prompt-move-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary, #888);
  border-radius: 6px;
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}

.chat-prompt-move-close:hover {
  background: rgba(0,0,0,0.06);
}

.chat-prompt-move-body {
  padding: 16px 20px 8px;
}

.chat-prompt-move-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 16px;
  color: var(--text-primary, #1a1a1a);
  word-break: break-word;
}

.chat-prompt-move-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #555);
  margin-bottom: 6px;
}

/* Custom folder picker (replaces native <select>) */
.chat-prompt-move-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
  border: 1.5px solid var(--border-light, #e0ddd8);
  border-radius: 10px;
  padding: 4px;
}

.chat-prompt-move-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: start;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary, #1a1a1a);
  transition: background-color 0.15s ease;
}

.chat-prompt-move-option:hover:not(:disabled) {
  background: rgba(74, 122, 104, 0.08);
}

.chat-prompt-move-option[aria-selected="true"] {
  background: rgba(74, 122, 104, 0.12);
  font-weight: 500;
}

.chat-prompt-move-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-prompt-move-error {
  color: #c0392b;
  font-size: 13px;
  min-height: 20px;
  margin-top: 8px;
}

.chat-prompt-move-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
}

dialog.chat-prompt-move-dialog .chat-prompt-move-done-btn {
  background: #4A7A68 !important;
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

dialog.chat-prompt-move-dialog .chat-prompt-move-done-btn:hover {
  background: #3d6656 !important;
}

.chat-prompt-move-done-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Move button in prompt item actions */
.chat-prompt-item-move {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-secondary, #888);
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}

.chat-prompt-item-move:hover {
  color: var(--sage, #4A7A68);
  background: rgba(74, 122, 104, 0.08);
}

/* Dark mode */
[data-theme="dark"] dialog.chat-prompt-move-dialog {
  background: var(--bg-dark-card, #1e1e1e);
}

[data-theme="dark"] .chat-prompt-move-dialog .chat-prompt-panel-title {
  color: var(--text-dark-primary, #e8e8e8);
}

[data-theme="dark"] .chat-prompt-move-picker {
  border-color: var(--border-dark, #444);
}

[data-theme="dark"] .chat-prompt-move-option {
  color: var(--text-dark-primary, #e8e8e8);
}

[data-theme="dark"] .chat-prompt-move-option:hover:not(:disabled) {
  background: rgba(90, 154, 126, 0.15);
}

[data-theme="dark"] .chat-prompt-move-option[aria-selected="true"] {
  background: rgba(90, 154, 126, 0.2);
}

[data-theme="dark"] .chat-prompt-move-name {
  color: var(--text-dark-primary, #e8e8e8);
}

[data-theme="dark"] .chat-prompt-move-label {
  color: var(--text-dark-secondary, #aaa);
}

[data-theme="dark"] dialog.chat-prompt-move-dialog .chat-prompt-move-done-btn {
  background: #7cb8a4 !important;
  color: #1e2924 !important;
}

[data-theme="dark"] dialog.chat-prompt-move-dialog .chat-prompt-move-done-btn:hover {
  background: #9ac9b8 !important;
}

[data-theme="dark"] dialog.chat-prompt-move-dialog .chat-prompt-move-error {
  color: #f0b3a7 !important;
}

/* Mobile: 44px touch targets */
@media (max-width: 640px) {
  dialog.chat-prompt-move-dialog {
    width: calc(100% - 24px);
  }

  .chat-prompt-item-move {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .chat-prompt-move-option {
    padding: 12px;
    font-size: 16px;
  }

  .chat-prompt-move-done-btn {
    padding: 12px 28px;
    width: 100%;
  }
}

/* Prompt polish: whitespace and tint identify controls without extra surfaces. */
html body #calm-prompt-modal .chat-prompt-panel-inner:is(.calm-folder-list,.calm-prompt-new-category) { padding: 0 !important; }
html body #calm-prompt-modal .calm-folder-list .chat-prompt-item:not([hidden]):not(:has(~ .chat-prompt-item:not([hidden]))) { border-bottom: 0 !important; }
html body #calm-prompt-modal { --prompt-hover-ink: #3d725f; }
html[data-theme="dark"] body #calm-prompt-modal { --prompt-hover-ink: #b1d3c2; }
html body #calm-prompt-modal .calm-folder-list :is(.chat-prompt-suggestion-btn,.chat-prompt-panel-title[role="button"]):is(:hover,:focus-visible),
html body #calm-prompt-modal :is(.calm-actions-trigger,.chat-prompt-panel-close):is(:hover,:focus-visible),
html body #chat-main .chat-prompt-area .calm-actions-trigger:is(:hover,:focus-visible) {
  background: transparent !important; box-shadow: none !important; color: var(--prompt-hover-ink,#3d725f) !important;
}
html body #calm-prompt-modal .calm-folder-list .chat-prompt-suggestion-btn:is(:hover,:focus-visible) .calm-prompt-row-icon { color: var(--prompt-hover-ink) !important; }
html body #calm-prompt-modal :is(.chat-prompt-suggestion-btn,.chat-prompt-panel-title[role="button"]):focus-visible { outline: none !important; text-decoration: underline; text-underline-offset: 3px; }
html body #chat-main .chat-prompt-area :is(.chat-prompt-chip[data-cat-id],.calm-standalone):is(:hover,:focus-within) { transform: none !important; box-shadow: none !important; color: #3d725f !important; }
html body #chat-main .chat-prompt-area :is(.chat-prompt-chip[data-cat-id],.calm-standalone):is(:hover,:focus-within) svg { color: #3d725f !important; }
html[data-theme="dark"] body #chat-main .chat-prompt-area :is(.chat-prompt-chip[data-cat-id],.calm-standalone):is(:hover,:focus-within),
html[data-theme="dark"] body #chat-main .chat-prompt-area :is(.chat-prompt-chip[data-cat-id],.calm-standalone):is(:hover,:focus-within) svg,
html[data-theme="dark"] body #chat-main .chat-prompt-area .calm-actions-trigger:is(:hover,:focus-visible) { color: #b1d3c2 !important; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-close { display: none !important; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-suggestion { background: transparent !important; box-shadow: none !important; border-color: rgba(110,138,126,.18) !important; padding: 10px 12px; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-label { text-transform: none; letter-spacing: normal; font-size: 14px; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-confirm { justify-content: flex-end; }
#calm-prompt-modal:has(.calm-prompt-form-mode) :is(.cvm-yes,.cvm-no) { flex: 0 0 auto; min-width: 64px; min-height: 44px; border-radius: 10px; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-suggestion:has(.cvm-result) { border-color: transparent !important; padding-block: 6px; }
#calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-suggestion:has(.cvm-result) .cvm-new { margin-bottom: 6px; }
@media(min-width:769px) {
  html body #calm-prompt-modal > .chat-prompt-panel:has(.calm-prompt-form-mode) { align-items: stretch !important; }
  html body #calm-prompt-modal .calm-prompt-form-mode { position: static !important; align-self: stretch; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  html body #calm-prompt-modal .calm-prompt-form-mode::before { display: none !important; }
  html body #calm-prompt-modal .calm-prompt-form-mode > .chat-prompt-panel-header { position: static !important; }
  html body #calm-prompt-modal .calm-prompt-form-mode .chat-prompt-panel-close { position: absolute !important; top: 16px; inset-inline-end: 18px; z-index: 5; }
  #calm-prompt-modal:has(.calm-prompt-form-mode) .cvm-head { padding-inline-end: 64px; }
  html body #calm-prompt-modal .calm-prompt-form-mode .chat-prompt-form { flex: 1 1 auto !important; }
  html body #calm-prompt-modal .calm-prompt-form-mode .calm-field-wrap--textarea { display: flex !important; flex: 1 1 auto; min-height: 132px; }
  html body #calm-prompt-modal .calm-prompt-form-mode #cpf-text { flex: 1; height: 100% !important; min-height: 132px !important; max-height: none !important; resize: none !important; }
}

/* Homepage actions appear on keyboard focus; gestures retain the same menu. */
html body #chat-main .chat-prompt-area .calm-standalone { position: relative; }
html body #chat-main .chat-prompt-area .calm-standalone > .calm-actions { position: absolute; inset-inline-end: 0; top: 0; bottom: 0; display: flex; align-items: center; }
html body #chat-main .chat-prompt-area .calm-standalone .calm-home-settings { opacity: 0; pointer-events: none; }
html body #chat-main .chat-prompt-area .calm-standalone:focus-within .calm-home-settings { opacity: 1; pointer-events: auto; background: var(--calm-menu-bg, #fffefa) !important; }
html body #chat-main .chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn { min-height: 32px; }
@media (max-width: 768px) { html body #chat-main .chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn { min-height: 44px; } }
/* Long standalone titles must not widen the narrow Chat empty state. */
@media (max-width: 768px) {
html body #chat-main #chat-empty-voksen.content:has(.calm-standalone),
html body #chat-main .chat-prompt-area:has(.calm-standalone),
html body #chat-main .chat-prompt-chips:has(.calm-standalone) { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
}
html body #chat-main .chat-prompt-area .calm-standalone { min-width: 0; box-sizing: border-box; }
html body #chat-main .chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn { flex: 1 1 auto; min-width: 0; }
html body #chat-main .chat-prompt-area .calm-standalone .chat-prompt-suggestion-btn span { min-width: 0; }
